Skip to Main Content
  • Questions
  • Sqlloader and passing passwords from scripts

Breadcrumb

Question and Answer

Tom Kyte

Thanks for the question, Todd.

Asked: May 24, 2002 - 12:35 pm UTC

Last updated: June 08, 2003 - 9:43 am UTC

Version: 8.17

Viewed 10K+ times! This question is

You Asked

Hi Tom,

I have several shell scripts that call sql loader to process data from flat files. The general process works like this: The shell script will prompt for a password which will be read into a variable and subsequently passed to the sql loader commands(s) like "sqlldr userid=myuser/$passwd cnt=control.ctl log=logfile.log

My question is, is there a way to hide the password from the ps -ef | grep userid command? Something similar to /nolog?

Thanks a lot,

Todd



and Tom said...

Rating

  (3 ratings)

Is this answer out of date? If it is, please let us know via a Comment

Comments

re- Sqlloader and passing passwords from scripts

Todd Graham, May 30, 2002 - 7:51 pm UTC

Thanks for your answer Tom, It was very helpful to see the "recommended" approach. I've approached it from another angle and used the following and it appears to effectivly hide the password.

sqlldr userid=myuser control=mycontrol.clt log=mylog <<SQLEOF > LOGFILE 2>&1
$PASSWORD
SQLEOF

Can you tell me if there is anything wrong with this method?

Thanks in advance

Tom Kyte
May 30, 2002 - 8:29 pm UTC

Well, on Solaris I just go:

/usr/ucb/ps -auxwwe | grep PASSWORD

and I'll get it ;)

"e" dumps the environment.
"ww" is "weally wide" (to quote elmer fudd)



How to load data from saved in excel

Godwin, May 31, 2002 - 6:26 am UTC

Please Tom i have many records save in excel and i want to use sql loader to insert them into an oracle table.
How do i go about it?
It is difficult these days to post my questions directly because your status is always busy.
Best Regards.

Tom Kyte
May 31, 2002 - 7:20 am UTC

I'll respond to part two of this first.

I'm one person. I have taken an average of 18 questions a day, every day since Jan 1, 2000. Not just business days -- every day. That is well over 15,000 questions so far. I'm just one person -- there are LOTS of resources out there. I might suggest that:

a) the USENET newsgroups, freely available from www.google.com, are a great resource. I can be found there, as well as many other extremely knowledgable people -- all willing to try and help you.

b) </code> http://otn.oracle.com/ <code>has discussion groups where other Oracle developers hang out. Great place to post a question and get an answer (and maybe even answer a question or two yourself)

c) search works really well. A search for excel on this site returned subjects like:

"Automate loading of data from Excel spreadsheets into database"
"Storing & Retrieving Excel Spreadsheet in DB"
"How to import data from more than one (.csv ) [Excel] files into the related tables !"


for example. In your case, I might

1) save the excel data as CSV (comma separated values)
2) use sqlldr to load it (the csv file)



how to convert xls to csv

A reader, June 08, 2003 - 5:19 am UTC

tom,

i tried

$ ls -l
total 28
-rw-r--r-- 1 towercv staff 13824 Jun 8 05:06 book.xls
$ mv * "book.csv"
$ ls -l
total 28
-rw-r--r-- 1 towercv staff 13824 Jun 8 05:06 book.csv
$ head *
&#9576;&#9575;&#945;í&#9618;ß#,##0.00_);[Red]\("$"#,##0.00\)&#9650;&#9830;7$

please let me know how to convert the xls to csv in solaris, i tried in windows i came properly but in unix i dont know how to do it.

thanks





Tom Kyte
June 08, 2003 - 9:43 am UTC

oh, that is funny.

you have to

a) open it in excel, they know how to read their file format.
b) file save as
c) choose file type "csv"


would it not be cool if simply renaming a file changed its format...