Export Script [message #196601] |
Fri, 06 October 2006 02:40 |
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 |
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
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 #196906 is a reply to message #196601] |
Mon, 09 October 2006 02:06 |
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 #196924 is a reply to message #196922] |
Mon, 09 October 2006 03:34 |
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 |
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 |
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 |
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 |
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
|
|
|