Created
December 28, 2019 22:21
-
-
Save brianduff/f6718c3d02dbaf4534a3ec7c5a2ae435 to your computer and use it in GitHub Desktop.
Ancient script to start / stop oracle on gentoo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/sbin/runscript | |
# | |
# name: /etc/init.d/oracle | |
# description: starts and stops Oracle on Gentoo Linux | |
# author: Brian.Duff@oracle.com | |
# | |
# Change this to your Oracle user | |
oracle_user=ora92 | |
depend() { | |
need net | |
use cupsd | |
} | |
start() { | |
ebegin "Starting oracle" | |
echo 1073741824 > /proc/sys/kernel/shmmax | |
result=$? | |
su - "$oracle_user" > /dev/null <<EOO | |
# | |
# If you have not defined ORACLE_HOME, ORACLE_BASE, ORACLE_SID and | |
# updated the PATH in the oracle user's .profile, you will need to | |
# uncomment the following lines and fill in the correct | |
# values for ORACLE_BASE, ORACLE_HOME and ORACLE_SID | |
# | |
# export ORACLE_BASE=/u01/app/oracle | |
# export ORACLE_HOME=$ORACLE_BASE/product/9.2.0.1.0 | |
# export ORACLE_SID=yoursid | |
# export PATH=$PATH:$ORACLE_HOME/bin | |
# | |
lsnrctl start | |
sqlplus /nolog<<EOS | |
connect / as sysdba | |
startup | |
EOS | |
EOO | |
result=$(( $result + $? )) | |
eend $result | |
} | |
stop() { | |
ebegin "Stopping oracle" | |
su - "$oracle_user" > /dev/null <<EOO | |
# | |
# If you have not defined ORACLE_HOME, ORACLE_BASE, ORACLE_SID and | |
# updated the PATH in the oracle user's .profile, you will need to | |
# uncomment the following lines and fill in the correct | |
# values for ORACLE_BASE, ORACLE_HOME and ORACLE_SID | |
# | |
# export ORACLE_BASE=/u01/app/oracle | |
# export ORACLE_HOME=$ORACLE_BASE/product/9.2.0.1.0 | |
# export ORACLE_SID=yoursid | |
# export PATH=$PATH:$ORACLE_HOME/bin | |
# | |
lsnrctl stop | |
sqlplus /nolog<<EOS | |
connect / as sysdba | |
shutdown immediate | |
EOS | |
EOO | |
eend $? | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment