sudo/Oracle9i

 
Mehmood Ansari
Frequent Advisor

sudo/Oracle9i

Hi

I am trying to shutdown/startup Oracle database with sudo command, I am getting the following massage:

[cmsprod,cmsoper,ORCL,/home/cmsoper]>/usr/local/bin/sudo shutdown.sql

SQL*Plus: Release 9.2.0.4.0 - Production on Wed Jun 23 13:17:28 2004

Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.

SQL> SQL> ERROR:
ORA-01031: insufficient privileges


SQL> SQL> ORA-01012: not logged on
SQL> SQL> [cmsprod,cmsoper,ORCL,/home/cmsoper]>

The script is :
ORACLE_SID=T002

sqlplus /nolog <
connect /as sysdba

shutdown

EOF

What parameters I ahould defined in [sudoers]

Thanks
3 REPLIES 3
Sanjay Kumar Suri
Honored Contributor

Re: sudo/Oracle9i

Check if the following links helps:
http://www.hmug.org/man/5/sudoers.html
sks
A rigid mind is very sure, but often wrong. A flexible mind is generally unsure, but often right.
Volker Borowski
Honored Contributor

Re: sudo/Oracle9i

Hi,

you might need to set some additional environment.

If you have a script that sets the environment, you should source it in the beginning of your script.

If not, you might need to set:

LIBPATH
ORACLE_HOME
ORA_NLS33
NLS_*
...

As this one is executed as root, root needs to be member of you dba-group, the one you specified upon installation (usually "dba").
Or execute this script as the oracle user (which makes more sense to me) and not as root:

sudo -u oracle ......

Hope this helps
Volker
Mehmood Ansari
Frequent Advisor

Re: sudo/Oracle9i

Hi Volker

Thanks it is working sudo -u oracle9

Thanks and regards