How to change SQLULDR2 session level's parameters?

Links: http://www.dbatools.net/mytools/sqluldr2-alter-session-params.html

    Somebody need to change the date type format (default, "yyyy-mm-dd hh24:mi:ss"), and change the numeric characters. For Oracle, you can run some "alter session set ..." commands to make the changes, so I add a new command line option "alter" for SQLULDR2, which allow you change session level's setting before the data unloading. You can put mulitple alter session lines in a parameter file, such as "testpar.txt".

user=webchart/webchart@localhost:1521/testdb
query=select sysdate from dual
alter=alter session set nls_date_format='yyyy-mon-dd';
      alter session set nls_date_format='yyyy-mm-dd';

    Then run SQLULDR2 with parameter file "testpar.txt".

sqluldr2 parfile=testpar.txt

    Check the data in the out put file, we can see that the data format takes effect. Be attention, the session level's setting will not change the date format of the SQL*Loader control files.

D:\OracleClient>type uldrdata.txt
2009-06-03

    I am not sure how many people really need this feature, as there are already some command line options for session level performance tuning.

Comments (1)

Made some change for security improvement, every line will be prefixed with "alter session", for example :

alter=set nls_date_format='yyyy-mon-dd';

SQLULDR2 will run the following command.

alter session set nls_date_format='yyyy-mon-dd';

Else we can put a alter user command to change the password.

« Previous | Main | Next »

Powered by
Movable Type 5.01