Home » RDBMS Server » Server Utilities » sqlloader log file
sqlloader log file [message #74238] Fri, 15 October 2004 06:04 Go to next message
Jolanda
Messages: 68
Registered: September 2004
Member
Hi you all,

I am invoking sqlldr within an unix shell script. Is it possible to define a location for the logfile?

SQL_LOG=/directory/where/I/want/the/logfile/

sqlldr user/passwor@SID control=/control/bir.ctl
log=$SQL_LOG/bir.log

When I do this, the logfile is still put in the home directory from where shell script is executed.

or is it only possible to give a filename as a paramater?

like:

sqlldr user/passwor@SID control=/control/bir.ctl
log=bir.log

any ideas??

thanks!
Re: sqlloader log file [message #74240 is a reply to message #74238] Fri, 15 October 2004 07:15 Go to previous message
Mahesh Rajendran
Messages: 10708
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Ofcourse it is possible.
---
-- sample is the shell script that takes an input ( name of logfile).
-- lets execute it

bash-2.03$ sample mylogfile.txt

SQL*Loader: Release 9.2.0.4.0 - Production on Fri Oct 15 11:17:27 2004

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

Commit point reached - logical record count 2

--
-- This is the script
-- 
bash-2.03$ cat sample
#!/usr/bin/bash
export ORACLE_HOME=/u01/app/oracle/product/9.2.0
export PATH=$PATH:$ORACLE_HOME/bin
log_dir=/tmp
sqlldr userid=mag/mag control=sample.ctl log=$log_dir/$1

--
-- This the logfile created at my destination.
--
bash-2.03$ cat /tmp/mylogfile.txt

SQL*Loader: Release 9.2.0.4.0 - Production on Fri Oct 15 11:17:27 2004

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.

Control File:   sample.ctl
Data File:      sample.ctl
  Bad File:     sample.bad
  Discard File:  none specified

 (Allow all discards)

Number to load: ALL
Number to skip: 0
Errors allowed: 50
Bind array:     64 rows, maximum of 256000 bytes
Continuation:    none specified
Path used:      Conventional

Table SAMPLE, loaded from every logical record.
Insert option in effect for this table: INSERT
TRAILING NULLCOLS option in effect

   Column Name                  Position   Len  Term Encl Datatype
------------------------------ ---------- ----- ---- ---- ---------------------
SOURCE                              FIRST     *   ,       CHARACTER
SPLIT                                NEXT     *   ,       CHARACTER
    SQL string for column : "substr(source,1,9)||chr(10)||substr(source,10,20))"

Record 2: Discarded - all columns null.
Record 1: Rejected - Error on table SAMPLE, column SPLIT.
ORA-00933: SQL command not properly ended

Table SAMPLE:
  0 Rows successfully loaded.
  1 Row not loaded due to data errors.
  0 Rows not loaded because all WHEN clauses were failed.
  1 Row not loaded because all fields were null.

Space allocated for bind array:                  33024 bytes(64 rows)
Read   buffer bytes: 1048576

Total logical records skipped:          0
Total logical records read:             2
Total logical records rejected:         1
Total logical records discarded:        1

Run began on Fri Oct 15 11:17:27 2004
Run ended on Fri Oct 15 11:17:28 2004

Elapsed time was:     00:00:00.25
CPU time was:         00:00:00.05
bash-2.03$

Previous Topic: SQL*Loader related question.
Next Topic: How to compile an OCI aplication on (sunOS) UNIX ?
Goto Forum:
  


Current Time: Wed Dec 25 08:17:32 CST 2024