Oracle startup script: differenze tra le versioni
Jump to navigation
Jump to search
Nessun oggetto della modifica |
|||
| Riga 1: | Riga 1: | ||
==/etc/init.d/oracle== |
==/etc/init.d/oracle== |
||
<pre> |
|||
#! /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) |
|||
ORACLE_SID= |
|||
ORAENV_ASK=NO |
|||
export ORACLE_SID ORAENV_ASK |
|||
. oraenv |
|||
lsnrctl start LISTENER |
|||
echo startup | |
|||
;; |
|||
stop) |
|||
;; |
|||
*) |
|||
echo "Usage: $0 {start|stop|restart|status}" |
|||
exit 1 |
|||
esac |
|||
exit 0 |
|||
</pre> |
|||
==Upstart== |
==Upstart== |
||
Versione delle 16:04, 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)
ORACLE_SID=
ORAENV_ASK=NO
export ORACLE_SID ORAENV_ASK
. oraenv
lsnrctl start LISTENER
echo startup |
;;
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