Home » RDBMS Server » Server Utilities » Ctl file doubts (oracle 10g,HP-UNIX)
Ctl file doubts [message #349139] Fri, 19 September 2008 01:40 Go to next message
swas_fly
Messages: 220
Registered: March 2008
Location: Bhubaneswar
Senior Member
> cat ace2_smerf_sven_kdm.ctl
OPTIONS(SKIP=1)
LOAD DATA
INFILE '/home/x.dat'
BADFILE '/home/x.bad'
DISCARDFILE '/homex.dsc'

INSERT INTO TABLE X
FIELDS TERMINATED BY "~"
TRAILING NULLCOLS
(<column list>)


This is a ctl file in production.Please clarify my doubts
the above ctl file is run as below in production?How correct it is?

sqlldr $leninlogin control=${CTL_DIR}/x.ctl log=${LOGS_DIR}/x.log errors = 200000 direct=true


What will the OPTIONS(SKIP=1) do?

secondly i have one more ctl file below.what exactly is the difference between the two and which one can be prefered for usage?

how to make the first ctl file as a truncate load one?

Please clarify if my understanding right?

LOAD DATA
infile '$HOME/download/y.dat' 
 
TRUNCATE
INTO TABLE Y
FIELDS TERMINATED BY "~"
TRAILING NULLCOLS
(<another column list]
)



[EDITED by MC: changed names as per 'Reported Message' request]
[EDITED by LF: removed column list from the CTL file as per 'Reported Message' request]

[Updated on: Tue, 25 November 2008 02:29] by Moderator

Report message to a moderator

Re: Ctl file doubts [message #349169 is a reply to message #349139] Fri, 19 September 2008 03:09 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
What will the OPTIONS(SKIP=1) do?

I should say: RTFM
It skips one line.

You can't use Unix environment variables in control file.

Regards
Michel
Re: Ctl file doubts [message #349490 is a reply to message #349169] Mon, 22 September 2008 01:28 Go to previous messageGo to next message
swas_fly
Messages: 220
Registered: March 2008
Location: Bhubaneswar
Senior Member
which is the environment variable used here?

whether the first control file is correct?
Re: Ctl file doubts [message #349497 is a reply to message #349490] Mon, 22 September 2008 01:50 Go to previous messageGo to next message
Michel Cadot
Messages: 68648
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Quote:
which is the environment variable used here?

LOAD DATA
infile '$SVEN_HOME/download/CPS/cps_orders.dat' 

Regards
Michel
Re: Ctl file doubts [message #349505 is a reply to message #349497] Mon, 22 September 2008 01:58 Go to previous message
swas_fly
Messages: 220
Registered: March 2008
Location: Bhubaneswar
Senior Member
INSERT INTO TABLE Y
FIELDS TERMINATED BY "~"


ok thanks for the info.

whether this part of the code correct in writing a ctl file?


[EDITED by MC: changed names as per 'Reported Message' request]

[Updated on: Thu, 20 November 2008 01:07] by Moderator

Report message to a moderator

Previous Topic: Export Issue - Takes more than 2 days
Next Topic: Running CATALOG.SQL and Catexp.sql
Goto Forum:
  


Current Time: Thu May 02 20:53:32 CDT 2024