![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| SUN Solaris The Solaris Operating System, usually known simply as Solaris, is a free Unix-based operating system introduced by Sun Microsystems . |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Install Guide: Oracle Database 11g Release 1 on Oracle Enterprise Linux 5 | iBot | Oracle Updates (RSS) | 0 | 04-06-2008 06:10 AM |
| Database can't start automatically on solaris | Sachin Vaidya | SUN Solaris | 2 | 02-27-2008 11:12 PM |
| Howto capture data from rs232port andpull data into oracle database-9i automatically | boss | UNIX for Dummies Questions & Answers | 1 | 09-23-2007 03:35 AM |
| How can I make a program start up automatically after the computer restart/startup? | munna_dude | Shell Programming and Scripting | 1 | 02-07-2007 09:13 AM |
| getting postfix tyo start automatically | kmgrady01 | UNIX for Dummies Questions & Answers | 2 | 05-21-2002 03:18 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
And if you want to start and stop the other services such as the SNMP agent, OEM, and the web services: Code:
# Start the Intelligent Agent
if [ -f $ORA_HOME/bin/agentctl ]; then
su - $ORA_OWNER -c "$ORA_HOME/bin/agentctl start"
else
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl dbsnmp_start"
fi
# Start Management Server
if [ -f $ORA_HOME/bin/oemctl ]; then
su - $ORA_OWNER -c "$ORA_HOME/bin/oemctl start oms"
fi
# Start HTTP Server
if [ -f $ORA_HOME/Apache/Apache/bin/apachectl ]; then
su - $ORA_OWNER -c "$ORA_HOME/Apache/Apache/bin/apachectl start"
fi
# Stop HTTP Server
if [ -f $ORA_HOME/Apache/Apache/bin/apachectl ]; then
su - $ORA_OWNER -c "$ORA_HOME/Apache/Apache/bin/apachectl stop"
fi
# Stop Management Server
if [ -f $ORA_HOME/bin/oemctl ]; then
su - $ORA_OWNER -c "$ORA_HOME/bin/oemctl stop oms sysman/<password>"
fi
# Stop the Intelligent Agent
if [ -f $ORA_HOME/bin/agentctl ]; then
su - $ORA_OWNER -c "$ORA_HOME/bin/agentctl stop"
else
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl dbsnmp_stop"
fi
|
|
|||||
|
Tested on Sun Solaris: Code:
#!/bin/sh
if [ -d /export/home/oracle/OracleStartScripts ] ; then
:
else
mkdir /export/home/oracle/OracleStartScripts
chown oracle:oinstall /export/home/oracle/OracleStartScripts
fi
echo "\
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=\$ORACLE_BASE/product/8.1.7
ORACLE_SID=test
ORA_NLS33=\$ORACLE_HOME/ocommon/nls/admin/data
PATH=.:\$ORACLE_HOME/bin:opt/bin:/bin:/usr/bin:/usr/ccs/bin:/usr/ucb:/etc/usr/sbin
export ORACLE_BASE
export ORACLE_HOME
export ORACLE_SID
export NLS_LANG
export ORA_NLS33
export PATH
svrmgrl /nolog <<EOF
connect internal
startup
EOF
echo starting listner...
lsnrctl start
" > /export/home/oracle/OracleStartScripts/StartOra.sh
#
echo "\
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=\$ORACLE_BASE/product/8.1.7
ORACLE_SID=test
ORA_NLS33=\$ORACLE_HOME/ocommon/nls/admin/data
PATH=.:\$ORACLE_HOME/bin:opt/bin:/bin:/usr/bin:/usr/ccs/bin:/usr/ucb:/etc/usr/sbin
export ORACLE_BASE
export ORACLE_HOME
export ORACLE_SID
export NLS_LANG
export ORA_NLS33
export PATH
svrmgrl /nolog <<EOF
connect internal
shutdown immediate
EOF
echo starting listner...
lsnrctl stop
" > /export/home/oracle/OracleStartScripts/StopOra.sh
chown oracle:oinstall /export/home/oracle/OracleStartScripts/StopOra.sh
chown oracle:oinstall /export/home/oracle/OracleStartScripts/StartOra.sh
chmod +x /export/home/oracle/OracleStartScripts/StopOra.sh
chmod +x /export/home/oracle/OracleStartScripts/StartOra.sh
echo "\
#!/bin/sh
# start/Stop oracle Database
case \"\$1\" in
'start')
# start the database
if [ -f /export/home/oracle/OracleStartScripts/StartOra.sh ] ; then
echo \"Start Oracle database.\"
su -l oracle -c /export/home/oracle/OracleStartScripts/StartOra.sh
else
echo \"Error! Can't find: /export/home/oracle/OracleStartScripts/StartOra.sh\"
echo \" Oracle could not be Started!\"
fi
;;
'stop')
# Stop the database
if [ -f /export/home/oracle/OracleStartScripts/StopOra.sh ] ; then
echo \"stopping oracle Database.\"
su -l oracle -c /export/home/oracle/OracleStartScripts/StopOra.sh
else
echo \"Error! Can't find:/export/home/oracle/OracleStartScripts/StopOra.sh\"
echo \" Oracle could not be Stopped!\"
fi
;;
esac
" > /etc/init.d/MYoracle
chmod +x /etc/init.d/MYoracle
ln -s /etc/init.d/MYoracle /etc/rc3.d/S99oracle
ln -s /etc/init.d/MYoracle /etc/rc2.d/K99oracle
ln -s /etc/init.d/MYoracle /etc/rc1.d/K99oracle
ln -s /etc/init.d/MYoracle /etc/rc0.d/K99oracle
ln -s /etc/init.d/MYoracle /etc/rcS.d/K99oracle
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|