Oracle startup script: differenze tra le versioni

Da Emigar.
Jump to navigation Jump to search
 
(Una versione intermedia di uno stesso utente non è mostrata)
Riga 14: Riga 14:
case "$1" in
case "$1" in
start)
start)
ORACLE_SID=
su - oracle -c "
ORACLE_SID=ORCL
ORAENV_ASK=NO
ORAENV_ASK=NO
export ORACLE_SID ORAENV_ASK
export ORACLE_SID ORAENV_ASK
Riga 20: Riga 21:
lsnrctl start LISTENER
lsnrctl start LISTENER
echo startup | sqlplus '/ as sysdba'
echo startup | sqlplus '/ as sysdba'
"
;;
;;
stop)
stop)

Versione attuale delle 16:07, 20 mag 2026

/etc/init.d/oracle

#! /bin/sh
#
# chkconfig: 2345 29 20
# description: start Oracle RDBMS at system boot
#
### BEGIN INIT INFO
# Provides: oracle
# Required-Stop:
# Default-Start: 2 3 5
# Default-Stop:
### END INIT INFO
case "$1" in
    start)
        su - oracle -c "
        ORACLE_SID=ORCL
        ORAENV_ASK=NO
        export ORACLE_SID ORAENV_ASK
        . oraenv
        lsnrctl start LISTENER
        echo startup | sqlplus '/ as sysdba'
        "
	;;
    stop)
    ;;
	*)
	    echo "Usage: $0 {start|stop|restart|status}"
        exit 1
esac
exit 0


Upstart

# description "start and stop oracle instance"

start on runlevel [3]
stop on runlevel [!3]

console log
chdir /home/oracle
setuid oracle
setgid oinstall
expect fork

env ORACLE_BASE=/u01/app/oracle
env ORACLE_SID=ORCL
env ORAENV_ASK=NO

script
 . oraenv
 echo startup | sqlplus '/ as sysdba'
 lsnrctl start LISTENER
 echo 'ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;' | sqlplus '/ as sysdba'

end script

pre-stop script
 . oraenv
 echo 'ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;' | sqlplus '/ as sysdba'
 echo 'shutdown immediate' | sqlplus '/ as sysdba'
 lsnrctl stop LISTENER

end script



systemd