Re: Auto-starting Oracle?
Date: 1996/07/10
Message-ID: <31E40DD7.13F2_at_hal.com>
David C Winters wrote:
>
> I've been asked to help get Oracle 7.3.2 start up whenever the Un*x box
> starts up. It's a SPARCstation 5 running Solaris 2.4.
>
> The person who's been working on this has put the startup script into
> /etc/rcS.d but he's said it won't work. He's able to source the script
> as anyone who's a member of the group "dba", but root can't successfully
> run the script. He's made root a member of the dba group as root's
> secondary group, but that doesn't seem to be enough.
>
> A secondary problem, when attempting to run svrmgrl as root, is it saying
> that root has insufficient priviliges. And when trying to connect to
> svrmgrl as internal, it asks for a password even though internal's
> password has been disabled.
>
> If anyone can give me advice on any of these problems, I'll forward them
> along. Thanks.
>
> --
> David winters+_at_pitt.edu
Here's the way I do it to cover all the bases:
Script: S99dbora_start
I keep this in /etc/rc2.d
#!/bin/ksh
# $Header: /oracle/backup/RCS/S99dbora_start,v 1.4 1996/03/31 00:46:53 oracle Exp $
### ## Oracle startup file ## To release to production ## su root ## cp S99dbora_start /etc/rc2.d ## chown root /etc/rc2.d/S99dbora_start ## chgrp sys /etc/rc2.d/S99dbora_start ## chmod 544 /etc/rc2.d/S99dbora_start ###
#start the oracle databases:
su - oracle -c "/oracle/oracle.startup"
Comment: "su - oracle" means that root will logon as oracle to oracle's home
directory. Root has no priveledges within Oracle unless s/he is explicitely added as a OS_authenticated user but having root as an oracle user is somewhat rare. I like to keep the root startup scripts simple and indirect so that someone else logged on as oracle can make changes without the need be root. BTW The release instructions at the beginning of the file make it mindless. simple and painless to install the script by cutting and pasting to the command line. (You can also use make to automate your release process.
Script: oracle.startup
#!/bin/ksh
# $Header: /oracle/backup/RCS/oracle.startup,v 1.1 1996/03/31 00:30:15 oracle Exp oracle $
### ## Oracle startup file ## To release to production ## cp oracle.startup /oracle; chmod 544 /oracle/oracle.startup ###
. oracle714.env
dbstart
tcpctl start
Comment: You could use Oracle's dbstart here or reference your own script that
invokes svrmrgl or sqldba I "dot" a script called oracle714.env that contains a standard set of environment variables for oracle. I maintain about 10 instances of oracle on 4 machines I've created a standard file convention or oracleXXX.env on the ORACLE_BASE directory to manage the environment for scripts.
Script oracle714.env
# $Header: /oracle/backup/RCS/oracle714.env,v 1.4 1996/04/05 17:42:48 oracle Exp $ ### ## This sets up the proper environment for oracle 714 applications ## To release to production: ## ## ls -l /oracle/oracle714.env ## chmod u+w /oracle/oracle714.env ## cp oracle714.env /oracle ## chmod 444 /oracle/oracle714.env ## ls -l /oracle/oracle714.env ## cat /oracle/oracle714.env ## ### ORACLE_BASE=/oracle ; export ORACLE_BASE ORACLE_HOME=/oracle/714 ; export ORACLE_HOME LD_LIBRARY_PATH=${ORACLE_HOME}/lib ; export LD_LIBRARY_PATHTNS_ADMIN=${ORACLE_HOME}/network/admin ; export TNS_ADMIN
ORACLE_TERM=xsun5 ; export ORACLE_TERM ENV_ASK=NO ; export ENV_ASK PATH=/usr/ccs/bin:/opt/SUNWspro/bin:/usr/bin::.:/bin:/usr/sbin:/usr/ucbPATH=${PATH}:/oracle/714/bin:/oracle/local/bin PATH=${PATH}:/usr/tools/qa/current/bin:/usr/tools/bin:/usr/local/bin export PATH
Comment: I've found it easier to set the variables from a single script rather than
try to maintain them in individual profiles or logon scripts.
I hope that this helps.
- Ed Kulis 408-341-5561 Hal Computer Systems
- Sr. Oracle DBA ekulis_at_hal.com Campbell, CA 95008
- I would like it to be known that all opinions that are shown
- are exclusively my own, on my own, all my own.