Home » Infrastructure » Unix » Unix Script to load data into the Oracle server from Oracle client (UNIX)
icon5.gif  Unix Script to load data into the Oracle server from Oracle client [message #578699] Mon, 04 March 2013 05:14 Go to next message
ravi23071988
Messages: 5
Registered: March 2013
Location: BBS
Junior Member
Sad Sad
Re: Unix Script to load data into the Oracle server from Oracle client [message #578700 is a reply to message #578699] Mon, 04 March 2013 05:24 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Research use of SQL*Loader. It allows you to load data stored in a file on a client computer into an Oracle database.

Your Unix script would simply call SQLLDR executable.
Re: Unix Script to load data into the Oracle server from Oracle client [message #578703 is a reply to message #578699] Mon, 04 March 2013 05:25 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Question

icon9.gif  Re: Unix Script to load data into the Oracle server from Oracle client [message #578704 is a reply to message #578700] Mon, 04 March 2013 05:30 Go to previous messageGo to next message
ravi23071988
Messages: 5
Registered: March 2013
Location: BBS
Junior Member
I my machine SQLLDR is not there.
And the use of sqlldr is prohibited.

I am in great trouble..
Tomorrow i have to submit the procedure or script which loads the data into the Oracle server via Oracle client without using sqlldr command.

Sad
Re: Unix Script to load data into the Oracle server from Oracle client [message #578705 is a reply to message #578704] Mon, 04 March 2013 05:35 Go to previous messageGo to next message
Littlefoot
Messages: 21806
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Do you have access to database server (a computer)? If so, you could utilize external tables feature.
Re: Unix Script to load data into the Oracle server from Oracle client [message #578706 is a reply to message #578705] Mon, 04 March 2013 05:38 Go to previous messageGo to next message
ravi23071988
Messages: 5
Registered: March 2013
Location: BBS
Junior Member
No sever access is restricted.

Only sql connection is provided.
And we have to use only scripts to pass data(.csv file) from my PC to the oracle database via terminal!!

[Updated on: Mon, 04 March 2013 05:40]

Report message to a moderator

Re: Unix Script to load data into the Oracle server from Oracle client [message #578707 is a reply to message #578706] Mon, 04 March 2013 05:45 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Convert your CSV file into INSERT statement using the standard Unix program (grep, sed, awk...). It is not so difficult.

Regards
Michel
Re: Unix Script to load data into the Oracle server from Oracle client [message #578708 is a reply to message #578707] Mon, 04 March 2013 05:53 Go to previous messageGo to next message
ravi23071988
Messages: 5
Registered: March 2013
Location: BBS
Junior Member
Thank you!
I m working on the script...

can you have the standard unix format using grep, sed.
Please....
Re: Unix Script to load data into the Oracle server from Oracle client [message #578710 is a reply to message #578708] Mon, 04 March 2013 06:00 Go to previous messageGo to next message
ravi23071988
Messages: 5
Registered: March 2013
Location: BBS
Junior Member
Like I have

Dept_Id and Dept_Name as the columns in the csv file.

AND
I have created a table Departments in the Oracle Database.

How do i load data?
Re: Unix Script to load data into the Oracle server from Oracle client [message #578721 is a reply to message #578710] Mon, 04 March 2013 07:27 Go to previous message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
$ cat dept.txt
10;MyDept

$ sed -e 's/^/insert into dept values (/' -e "s/;/,'/" -e "s/$/');/" dept.txt
insert into dept values (10,'MyDept');

Regards
Michel
Previous Topic: cron job
Next Topic: Privilege Delegation problem
Goto Forum:
  


Current Time: Thu Mar 28 14:07:13 CDT 2024