Search This Blog

Friday, April 13, 2007

Hiding sys password when you use sql loader and export utility

WINDOWS
=======

country.ctl
============
LOAD DATA
INFILE 'C:\sql_loader\country.data' "Str '#\r\n'"
INTO TABLE michael.country
fields terminated by ','
(countryName,countryCode)

country.data
==============
CYPRUS,CY,#
AFGHANISTAN,AF,#
ALBANIA,AL,#
ALGERIA,DZ,#

sqlldr '/ AS SYSDBA' control=product.ctl

UNIX
====

country.ctl
============
LOAD DATA
INFILE '/devvol/oracle9i/michaelg/SQL_LOADER/country.data' "Str '#'"
INTO TABLE michael.country
fields terminated by ','
(countryName,countryCode)

country.data
==============
CYPRUS,CY,#
AFGHANISTAN,AF,#
ALBANIA,AL,#
ALGERIA,DZ,#

sqlldr \'/ AS SYSDBA\' control=/devvol/oracle9i/michaelg/SQL_LOADER/country.ctl

Run the script as root user as follows:
# su - oracle9i -c "sqlldr \'/ AS SYSDBA\' control=/devvol/oracle9i/michaelg/SQL_LOADER/country.ctl"

Sun Microsystems Inc. SunOS 5.9 Generic May 2002
bash-2.05$ exit
exit

SQL*Loader: Release 9.2.0.6.0 - Production on Tue Jul 4 11:26:05 2006

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

Commit point reached - logical record count 4


Hiding sys password when you use exp utility


bash-2.05$ exp "'/ as sysdba'" tables=michael.country file=test.dmp

Export: Release 9.2.0.6.0 - Production on Tue Jul 4 11:36:42 2006

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


Connected to: Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production
Export done in EL8ISO8859P7 character set and AL16UTF16 NCHAR character set

About to export specified tables via Conventional Path ...
Current user changed to MICHAEL
. . exporting table COUNTRY 4 rows exported
Export terminated successfully without warnings.
bash-2.05$


Run the script as root user as follows:

# su - oracle9i -c /devvol/oracle9i/michaelg/EXP/testEXP.sh
Sun Microsystems Inc. SunOS 5.9 Generic May 2002
bash-2.05$ exit
exit
/devvol/oracle9i/michaelg/EXP/testEXP.sh:

Export: Release 9.2.0.6.0 - Production on Tue Jul 4 11:58:39 2006

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


Connected to: Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production
Export done in EL8ISO8859P7 character set and AL16UTF16 NCHAR character set

About to export specified tables via Conventional Path ...
Current user changed to MICHAEL
. . exporting table COUNTRY 4 rows exported
Export terminated successfully without warnings.
#