Home » RDBMS Server » Server Administration » Error in setting Automatic Oracle Export Backup in Cron of Unix
Error in setting Automatic Oracle Export Backup in Cron of Unix [message #154495] Mon, 09 January 2006 01:09 Go to next message
ekampreet
Messages: 3
Registered: December 2005
Junior Member
We are facing a problem in our Oracle Installation,
actually we want to configure the Oracle Export Backup as CRON entry in our Unix System , but we are getting error in doing so , as export command is not running through root user.

I m copying the content of the script i m using to take the backup which is as follow :-

####################################################################
DISPLAY=hostName:0.0
HOME=/app/oracle
LD_LIBRARY_PATH=/data1/app/oracle/product/920/lib:/lib:/usr/lib
LOGNAME=root
MANPATH=/usr/opt/networker/man:/usr/share/man:/usr/dt/share/man:/usr/local/man

ORACLE_BASE=/data1/app; export ORACLE_BASE
ORACLE_HOME=/data1/app/oracle/product/920 ; export ORACLE_HOME
ORACLE_SID=ora92; export ORACLE_SID
PATH=/app/oracle/bin:/usr/bin:.:/usr/opt/java131/bin:/bin:/data1/app/oracle/product/920/bin:/usr/bin:/etc:/usr/bin/X11:/usr/ccs/bin:/ usr/local:/sbin:/usr/sbin
SHELL=/bin/sh
TEMP=/var/tmp
TERM=dtterm
TNS_ADMIN=/data1/app/oracle/product/920/network/admin; export TNS_ADMIN
USER=oracle; export USER

exp mms/mms123 file=/app/orclbackup/mms.dmp log=/app/orclbackup/mms.log rows=yes indexes=yes
exp common/common123 file=/app/orclbackup/common.dmp log=/app/orclbackup/common.log rows=yes indexes=yes

##########################################################

but when i execute this script as root user , i m getting following error at the promt : -

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Export: Release 9.2.0.1.0 - Production on Thu Dec 8 11:19:14 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

EXP-00056: ORACLE error 12546 encountered
ORA-12546: TNS:permission denied
EXP-00000: Export terminated unsuccessfully

Export: Release 9.2.0.1.0 - Production on Thu Dec 8 11:19:14 2005
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

EXP-00056: ORACLE error 12546 encountered
ORA-12546: TNS:permission denied
EXP-00000: Export terminated unsuccessfully

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

and in the sqlnet.log getting the following error :-

++++++++++++++++++++++++++++++++++++++++++++++++++++++++
***********************************************************************
Fatal NI connect error 12546, connecting to:
(DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=/data1/app/oracle/product/920/bin/oracle)(ARGV0=oracleora92)(ARGS='(DESCRIPTION=(LOCAL=Y ES)(ADDRESS=(PROTOCOL=beq)))')(DETACH=NO))(CONNECT_DATA=(CID=(PROGRAM=)(HOST=TSTPP2)(USER=root))))

VERSION INFORMATION:
TNS for Compaq Tru64 UNIX: Version 9.2.0.1.0 - Production
Oracle Bequeath NT Protocol Adapter for Compaq Tru64 UNIX: Version 9.2.0.1.0 - Production
Time: 10-DEC-2005 12:46:11
Tracing not turned on.
Tns error struct:
nr err code: 0
ns main err code: 12546
TNS-12546: TNS:permission denied
ns secondary err code: 12560
nt main err code: 516
TNS-00516: Permission denied
nt secondary err code: 13
nt OS err code: 0

++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Please help to sort out this problem.

Thank you in advance.

Ekam Preet Singh
Re: Error in setting Automatic Oracle Export Backup in Cron of Unix [message #154548 is a reply to message #154495] Mon, 09 January 2006 06:23 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10680
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
1.) NEVER EVER use ROOT for ORACLE tasks.
Use a Oracle user or a regular user ind DBA group.

Quote:

Fatal NI connect error 12546, connecting to:
(DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=/data1/app/oracle/product/920/bin/oracle)(ARGV0=oracleora92)(ARGS='(DESCRIPTION=(LOCAL=Y ES)(ADDRESS=(PROTOCOL=beq)))')(DETACH=NO))(CONNECT_DATA=(CID=(PROGRAM=)(HOST=TSTPP2)(USER=root))))


Are you sure you need a beq?
your sql*net connectivity is whacky.
check your sqlnet.ora/listener.ora/tnsnames.ora
use tnsservicenames as mentioned in tnsnames.ora.
Re: Error in setting Automatic Oracle Export Backup in Cron of Unix [message #154565 is a reply to message #154548] Mon, 09 January 2006 07:40 Go to previous messageGo to next message
ekampreet
Messages: 3
Registered: December 2005
Junior Member
First of all , we are using the ORACLE users only for DBA activities, we are using the ROOT only for the EXPORT backup to be included in CRON , so that it will automatically be taken up at scheduled time.

The entry in TNSNAMES.ORA at server are following:-

ORA92 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = hostName)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORA92)
)
)


We dont require beq, actually i m also surprised how these are coming, as we dont have any user named "oracleora92" not any directory named "oracle" in /data1/app/oracle/product/920/bin/ path, how the system is assuming these values.

Re: Error in setting Automatic Oracle Export Backup in Cron of Unix [message #154569 is a reply to message #154565] Mon, 09 January 2006 08:01 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10680
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
>>we are using the ROOT only for the EXPORT backup to be included in CRON
That is what i am talking about.
I wonder how your Sysadmins allow that.
Root user is not supposed to be used for any oracle job.Whatever it is. Period.
Try to run the same script logged in as a oracle user and schedule it in Oracle users's cronjob.

>>Fatal NI connect error
is an indication that tnsames.ora is having issue.
If you still intend to run the job as root, include root in dba group and first make sure the sql*net works ( do an sql*plus connection)
Log in as root
set ORACLE_SID=yoursid
sqlplus user/password.
If that does not work, use the connect string (copy the tnsames.ora entry from some-other working installation. Spaces around = **equal sign** are important her).
sqlplus user/password@connectstring

Re: Error in setting Automatic Oracle Export Backup in Cron of Unix [message #154571 is a reply to message #154569] Mon, 09 January 2006 08:07 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10680
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
Does that also mean you are using ROOT to take backups / any cronjob.?
Again, do not use ROOT for any regular system administration tasks.
create a seperate user for that.
Talk to your sysadmin.
Re: Error in setting Automatic Oracle Export Backup in Cron of Unix [message #154642 is a reply to message #154571] Mon, 09 January 2006 22:31 Go to previous messageGo to next message
ekampreet
Messages: 3
Registered: December 2005
Junior Member
hi ,

Root is included in DBA Group, and when i tried to run sql plus after setting
ORACLE_SID=ora92

and using
sqlplus user/password

but it gives me following error message,
***********************************************************************
Fatal NI connect error 12546, connecting to:
(DESCRIPTION=(ADDRESS=(PROTOCOL=beq)(PROGRAM=/data1/app/oracle/product/920/bin/
oracle)(ARGV0=oracleora92)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)
))')(DETACH=NO))(CONNECT_DATA=(CID=(PROGRAM=)(HOST=TSTPP2)(USER=root))))

VERSION INFORMATION:
TNS for Compaq Tru64 UNIX: Version 9.2.0.1.0 - Production
Oracle Bequeath NT Protocol Adapter for Compaq Tru64 UNIX: Version 9.2.0
.1.0 - Production
Time: 10-JAN-2006 09:48:08
Tracing not turned on.
Tns error struct:
nr err code: 0
ns main err code: 12546
TNS-12546: TNS:permission denied
ns secondary err code: 12560
nt main err code: 516
TNS-00516: Permission denied
nt secondary err code: 13
nt OS err code: 0


Then i tried to connect as

sqlplus user/password@ora92 ( here ora92) is connection string, IT Logs into the system.


>>Try to run the same script logged in as a oracle user and schedule it in Oracle users's cronjob.
I didnt get the meaning of this, as cron is run from the ROOT users shell not from any other user. Please explain.

Re: Error in setting Automatic Oracle Export Backup in Cron of Unix [message #154716 is a reply to message #154642] Tue, 10 January 2006 05:09 Go to previous messageGo to next message
Mahesh Rajendran
Messages: 10680
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
all you need is something like this.
bash-2.03# crontab -l | grep expjob
57 5 * * * /root/expjob > /dev/null 2>&1
bash-2.03# cat /root/expjob
#!/usr/bin/bash
export ORACLE_HOME=/u01/app/oracle/product/9.2.0
export ORACLE_SID=mutation
export PATH=$ORACLE_HOME/bin:$PATH
exp scott/tiger owner=scott file=scott.dmp
exit;
EOF


The above script was executed in roots cronjob successfully.
Re: Error in setting Automatic Oracle Export Backup in Cron of Unix [message #154718 is a reply to message #154716] Tue, 10 January 2006 05:13 Go to previous message
Mahesh Rajendran
Messages: 10680
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
But as stated above,
DO NOT RUN Oralce jobs logged in as ROOT.
Previous Topic: ora-01927 cannot revoke privilege you did not grant
Next Topic: Multiple Oracle executables and dlls
Goto Forum:
  


Current Time: Sat Jan 20 10:00:21 CST 2018

Total time taken to generate the page: 0.02270 seconds