Home » RDBMS Server » Server Utilities » Export Script
Export Script [message #196601] Fri, 06 October 2006 02:40 Go to next message
marlon_loyolite
Messages: 66
Registered: July 2006
Member
Hi Friends,
Can anyone explain me or give an example of exporting two tables from a database through Shell Scripts.
It could of great help.

Regards,
Marlon.
Re: Export Script [message #196606 is a reply to message #196601] Fri, 06 October 2006 03:11 Go to previous messageGo to next message
bwetkstr
Messages: 114
Registered: August 2005
Senior Member
In Linux


. /etc/profile.d/oracle.sh
export ORACLE_HOME=<oracle home dir>
export ORACLE_SID=<sid>
MYDATE=`date +%H%M`
THETNS=<tns entry>
THEFOLD=<name folder>
THESID=<name sid>


echo `date` >>/orabackup/oratmp/$THEFOLD/log1
$ORACLE_HOME/bin/exp username/password@$THETNS tables=(table1,table2) consistent=yes file=(/orabackup/oratmp/$THEFOLD/$THESID$MYDATE.F1.DMP,/orabackup/oratmp/$THEFOLD/$THESID$MYDATE.F2.DMP,/orabackup/oratmp/$THEFOLD/$T HESID$MYDATE.F3.DMP,/orabackup/oratmp/$THEFOLD/$THESID$MYDATE.F4.DMP) filesize=1g log=/orabackup/oratmp/$THEFOLD/$THESID$MYDATE.LOG


SOmething like this Wink

More info => http://orafaq.com/faqiexp.htm

Kr
Karel.

[Updated on: Fri, 06 October 2006 03:12]

Report message to a moderator

Re: Export Script [message #196607 is a reply to message #196606] Fri, 06 October 2006 03:16 Go to previous messageGo to next message
marlon_loyolite
Messages: 66
Registered: July 2006
Member
Hi Friends,
I should do through shell scripts from UNIX environment.
Regards
Marlon.
Re: Export Script [message #196906 is a reply to message #196601] Mon, 09 October 2006 02:06 Go to previous messageGo to next message
marlon_loyolite
Messages: 66
Registered: July 2006
Member
Hi Friends

I have given the below statements ,But I am getting the error as

the particular schema_base.dmp file is unable to open to write.


list=`grep "^$i" ${File_name} | cut -d' ' -f2 | tr '\n' ','`
if [ ${i} = "BASE" ]; then
if [ "${list}" != "" ]; then
exp ${Connectstring} tables=${list} file=${Schema}_base.dmp
fi
fi

Is it we have set any path or I don't know what to for this error.
Please help me for the same.

Regards
MArlon.
Re: Export Script [message #196912 is a reply to message #196906] Mon, 09 October 2006 02:23 Go to previous messageGo to next message
Littlefoot
Messages: 20901
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Do you have WRITE privileges for the specified directory?
Re: Export Script [message #196915 is a reply to message #196906] Mon, 09 October 2006 02:25 Go to previous messageGo to next message
bwetkstr
Messages: 114
Registered: August 2005
Senior Member
Could it be that the file is/was already open?

Kr
Karel.
Re: Export Script [message #196922 is a reply to message #196912] Mon, 09 October 2006 03:28 Go to previous messageGo to next message
marlon_loyolite
Messages: 66
Registered: July 2006
Member
Hi ,
If I give write permission for that file by giving
chmod 755 APS_base.dmp its giving
Operation not permitted.

Marlon.
Re: Export Script [message #196924 is a reply to message #196922] Mon, 09 October 2006 03:34 Go to previous messageGo to next message
bwetkstr
Messages: 114
Registered: August 2005
Senior Member
marlon_loyolite wrote on Mon, 09 October 2006 10:28

Hi ,
If I give write permission for that file by giving
chmod 755 APS_base.dmp its giving
Operation not permitted.

Marlon.


What are the permissions now, who is the owner of the file, and as with user are you logged in?
Re: Export Script [message #196925 is a reply to message #196922] Mon, 09 October 2006 03:35 Go to previous messageGo to next message
marlon_loyolite
Messages: 66
Registered: July 2006
Member

Hi ,

I have created a separate folder/directory for me in my account and placed the shell files there and executing.
After creating that directory I didn't give any permissions for that .Is it necessary to give because it exists in my own account.



If I give write permission for that file by giving
chmod 755 APS_base.dmp its giving
Operation not permitted.

I am new to shell scripting and unix can anyone give me the correct flow of executing my shell scripts.

Regards,
Marlon.
Re: Export Script [message #196930 is a reply to message #196925] Mon, 09 October 2006 03:52 Go to previous messageGo to next message
bwetkstr
Messages: 114
Registered: August 2005
Senior Member
marlon_loyolite wrote on Mon, 09 October 2006 10:35


Hi ,

I have created a separate folder/directory for me in my account and placed the shell files there and executing.
After creating that directory I didn't give any permissions for that .Is it necessary to give because it exists in my own account.



If I give write permission for that file by giving
chmod 755 APS_base.dmp its giving
Operation not permitted.

I am new to shell scripting and unix can anyone give me the correct flow of executing my shell scripts.

Regards,
Marlon.



No, if you create a dir , then you have controle of that dir.
Do you use in your script the full path
e.g : /opt/appl/myscripts/blabla.dmp
of just myscripts/blabla.dmp ???

Maybe you are trying to save your file in a different dir, then in the one you've created?
Re: Export Script [message #196937 is a reply to message #196930] Mon, 09 October 2006 04:52 Go to previous messageGo to next message
marlon_loyolite
Messages: 66
Registered: July 2006
Member
Hi
Now I have created a new directory in my account but I am unable to transfer the Shell files to that directory.
Is anything I need to do. Help Me.

Regards,
Marlon.
Re: Export Script [message #196959 is a reply to message #196937] Mon, 09 October 2006 06:11 Go to previous message
bwetkstr
Messages: 114
Registered: August 2005
Senior Member
marlon_loyolite wrote on Mon, 09 October 2006 11:52

Hi
Now I have created a new directory in my account but I am unable to transfer the Shell files to that directory.
Is anything I need to do. Help Me.

Regards,
Marlon.




let's try a few things.

1. Go 1 folder above your new directory. And perform ll or ls -l command on it. So I can see what the security is.

2. Tell we what's your username and to witch group you belong.

3. go to your new directory and create a file.
e.g: touch filename.test

4. You say you're unable to transfer your files, what's the error you recieve?

Kr
Karel
Previous Topic: SQL*loader adds .dat to the default filename
Next Topic: Impdp parallel worker status
Goto Forum:
  


Current Time: Fri Dec 09 06:10:45 CST 2016

Total time taken to generate the page: 0.05088 seconds