Visit Our UNIX and Linux User Community

How to get total records loaded from sqlldr log file

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to get total records loaded from sqlldr log file
# 1  
Old 07-26-2009
How to get total records loaded from sqlldr log file


I am loading data in the database table through sqlldr. I have to find total records loaded from sqlldr log file and store it in a variable in my script. How do I get it?

Thank you.
# 2  
Old 07-26-2009
I remember but not sure, in sqlloader log, For successfully loaded, it shows a row something like

 n Rows successfully loaded.

you can grep this row.

RecordsLoaded=$(grep 'Rows successfully loaded' logfile | awk '{print $1}')

I assume you are creating log file each time you load the records.
# 3  
Old 07-26-2009
yes I am creating log file each time I loaded records. In log file we got one line viz.

Table ACCOUNT_DETAILS: 1000 rows successfully loaded.

I will try your code and see if i am getting desired output or no.

In log file the line may be either way. I will double check and try your code. Thanks.
Table ACCOUNT_DETAILS: 1000 rows successfully loaded.
1000 rows successfully loaded.

Last edited by mrpranab; 07-26-2009 at 02:46 AM.. Reason: missed line
# 4  
Old 07-26-2009
If this is your row, then replace "$1" with "$2".

I had thought the log like the below,

1000 rows successfully loaded.

also, Rows --> rows.

so now it will be like this,

RecordsLoaded=$(grep 'rows successfully loaded' logfile | awk '{print $2}')

Last edited by clx; 07-26-2009 at 02:42 AM..

Previous Thread | Next Thread
Test Your Knowledge in Computers #283
Difficulty: Easy
Early computers were built to perform a series of single tasks, like a calculator.
True or False?

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Filter records from a log file based on timestamp

Dear Experts, I have a log file that contains a timestamp, I would like to filter record from that file based on timestamp. For example refer below file - cat sample.txt Jan 19 20:51:48 mukul-Vostro-14-3468 systemd: pam_unix(systemd-user:session): session opened for user root by (uid=0)... (6 Replies)
Discussion started by: mukulverma2408
6 Replies

2. Shell Programming and Scripting

Performance of calculating total number of matching records in multiple files

Hello Friends, I've been trying to calculate total number of a certain match in multiple data records files (DRs). Let say I have a daily created folders for each day since the beginning of july like the following drwxrwxrwx 2 mmsuper med 65536 Jul 1 23:59 20150701 drwxrwxrwx 2 mmsuper... (1 Reply)
Discussion started by: EAGL€
1 Replies

3. Shell Programming and Scripting

Number of rows loaded via sqlldr

Hi all, I'm loading data in database through sqlldr. I want to know the total record count And the number of records inserted in table.. what is the logic to achieve that. Thanks (5 Replies)
Discussion started by: Pratiksha Mehra
5 Replies

4. Shell Programming and Scripting

SQLLDR :Data not loaded completely

Hi , I am using below control file LOAD DATA APPEND INTO TABLE LSHADMIN.EG TRAILING NULLCOLS ( STUDY CHAR ) and the text file to load data is CACZ885M2301 When I run below command: sqlldr userid=apps/apps control=/home/appsuser/dataload/ctl_file.ctl... (3 Replies)
Discussion started by: Pratiksha Mehra
3 Replies

5. Linux

SQLLDR file not able to modify in Linux

Hi All I am trying to modifying SQLLDR file in Linux, I’m getting the below error "counterparty.sqlldr" E506: Can't write to backup file (add ! to override) Press ENTER or type command to continue Can someone help me resove this issue. Thank (1 Reply)
Discussion started by: na.dharma
1 Replies

6. Shell Programming and Scripting

Nawk, creating a variable total from multiple lines(records)

Good Morning/Afternoon All, I am having some trouble creating a variable called "total" to display the sum of the values in a specific field, $6 for example. The data I am working on is in the following form: John Doe:(555) 555-5555:1:2:3 Jane Doe:(544) 444-5556:4:5:6 Moe Doe:(654)... (2 Replies)
Discussion started by: SEinT
2 Replies

7. Shell Programming and Scripting

Total records in table

Hi, I am having two tables. A & B I want to know the total number of records in each table and need to store each value in some variables to process further in the code. How it can be done ? With Regards (2 Replies)
Discussion started by: milink
2 Replies

8. Shell Programming and Scripting

Insert value to ORACLE table from sqlldr log

This is the sample sqlldr log: ------------------------------------------------------------------------------------------------------------ SQL*Loader: Release - Production on Sun Feb 8 23:37:02 2009 Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved. Control... (13 Replies)
Discussion started by: aimy
13 Replies

9. Shell Programming and Scripting

sqlldr end of file

Hi, I've a batch program that load data from a file like: 00000013|FERRAN|JULIAN|GONZALEZ|1| 00000014|FRANCESC|NARVAEZ|PAZOS|1| 00000015|INMACULADA|MAYOL|BELTRAN|2| I used the sqlldr command in this way: sqlldr userid=U/P control=$SCRIPTS/CTRL.WCT data=$DATA/FILE log=$LOGS/FILE.LOG... (2 Replies)
Discussion started by: raippl
2 Replies

10. Shell Programming and Scripting

help getting records loaded from sqlldr log

Does anyone have the code to look in a slqldr log file and get the total amount of records loaded? If so, could you please post. Thanks much. (0 Replies)
Discussion started by: ecupirate1998
0 Replies

Featured Tech Videos