Simpler Navigation for Servers and Operating Systems
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
cancel
Showing results for 
Search instead for 
Did you mean: 

exp script

sh5490
Frequent Advisor

exp script

ORACLE_HOME=/u01/app/oracle/OraHome_1
#
# oracle owner at your site.
exp_script

PATH=${PATH}:$ORACLE_HOME/bin
export ORACLE_HOME PATH
su oracle -c "exp system/redhat file='/archivelog/backup/itoslive.dmp' consistent=y owner='itoslive' statistics=none log='/archivelog/backup/itoslive.log'"
echo "connected as `id` user"
$ls -l exp_script.sh

permission
-rwxr-x--- 1 root dba 313 Apr 17 12:49 exp_script.sh

output
$./exp_script.sh

Export: Release 10.2.0.3.0 - Production on Thu Apr 17 12:52:53 2008

Copyright (c) 1982, 2005, Oracle. All rights reserved.
EXP-00056: ORACLE error 12162 encountered
ORA-12162: TNS:net service name is incorrectly specified
EXP-00000: Export terminated unsuccessfully
connected as uid=0(root) gid=3(sys) groups=0(root),1(other),2(bin),4(adm),5(daemon),6(mail),7(lp),20(users) user

this script fails
pls provide inputs

thanks

ahamad



8 REPLIES
Ivan Krastev
Honored Contributor

Re: exp script

Yogeeraj_1
Honored Contributor

Re: exp script

hi Ahamad,

did you try to run the EXP command as the Oracle user"

exp system/redhat file='/archivelog/backup/itoslive.dmp' consistent=y owner='itoslive' statistics=none log='/archivelog/backup/itoslive.log


any errors?

revert!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Yogeeraj_1
Honored Contributor

Re: exp script

hi again

try also:
su - oracle -c "exp system/redhat file='/archivelog/backup/itoslive.dmp' consistent=y owner='itoslive' statistics=none log='/archivelog/backup/itoslive.log'"


NB. not just "su oracle" but "su - oracle"

revert!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
VK2COT
Honored Contributor

Re: exp script

Hello,

From Oracle error codes:

ORA-12162: TNS:net service name is
incorrectly specified

Cause: The connect descriptor corresponding to
the net service name in TNSNAMES.ORA or in the
directory server (Oracle Internet Directory) is
incorrectly specified.

Action: If using local naming make sure there
are no syntax errors in the corresponding
connect descriptor in the TNSNAMES.ORA file. If
using directory naming check the information
provided through the administration used for
directory naming.

Cheers,

VK2COT
VK2COT - Dusan Baljevic
Jeeshan
Honored Contributor

Re: exp script

Hi Ahamad

add this in your script

ORACLE_HOME=/u01/app/oracle/OraHome_1; export ORACLE_HOME

ORACLE_SID=abcd; export ORACLE_SID
a warrior never quits
sh5490
Frequent Advisor

Re: exp script

hi ashan/yoograj

thanks for u inputs
putting ORACLE_SID entry & - switch

the script works

thanks

ahamad
Yogeeraj_1
Honored Contributor

Re: exp script

hi,

Thats good news. Hope you are NOT using this script as your primary backup and that you have RMAN configured for daily backups.

all the best

kind regards
yogeerah
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Jeeshan
Honored Contributor

Re: exp script

Hi ahamad

Good to hear from you.

Ygeeraj

I just skip but thnx for the su - oracle pointing.

BTW, where's the bunny Ahamad?? :)
a warrior never quits