Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung Nächste Überarbeitung Beide Seiten der Revision | ||
computer:linux:oracle_database_11g_auf_centos [2011/03/17 13:35] christian |
computer:linux:oracle_database_11g_auf_centos [2011/03/17 14:38] christian |
||
---|---|---|---|
Zeile 143: | Zeile 143: | ||
... | ... | ||
</code> | </code> | ||
+ | |||
+ | Initskript: | ||
+ | <code> | ||
+ | # nano /etc/init.d/dbora | ||
+ | ... | ||
+ | #!/bin/sh | ||
+ | # chkconfig: 345 99 10 | ||
+ | # description: Oracle auto start-stop script. | ||
+ | # | ||
+ | # Set ORA_HOME to be equivalent to the $ORACLE_HOME | ||
+ | # from which you wish to execute dbstart and dbshut; | ||
+ | # | ||
+ | # Set ORA_OWNER to the user id of the owner of the | ||
+ | # Oracle database in ORA_HOME. | ||
+ | |||
+ | ORA_HOME=/u01/app/oracle/product/11.2.0 | ||
+ | ORA_OWNER=oracle | ||
+ | |||
+ | if [ ! -f $ORA_HOME/db_1/bin/dbstart ] | ||
+ | then | ||
+ | echo "Oracle startup: cannot start" | ||
+ | exit | ||
+ | fi | ||
+ | |||
+ | case "$1" in | ||
+ | 'start') | ||
+ | # Start the Oracle databases: | ||
+ | # The following command assumes that the oracle login | ||
+ | # will not prompt the user for any values | ||
+ | su - $ORA_OWNER -c "$ORA_HOME/db_1/bin/lsnrctl start" | ||
+ | su - $ORA_OWNER -c "$ORA_HOME/db_1/bin/dbstart" | ||
+ | su - $ORA_OWNER -c "$ORA_HOME/db_1/bin/emctl start dbconsole" | ||
+ | touch /var/lock/subsys/dbora | ||
+ | ;; | ||
+ | 'stop') | ||
+ | # Stop the Oracle databases: | ||
+ | # The following command assumes that the oracle login | ||
+ | # will not prompt the user for any values | ||
+ | su - $ORA_OWNER -c "$ORA_HOME/db_1/bin/emctl stop dbconsole" | ||
+ | su - $ORA_OWNER -c "$ORA_HOME/db_1/bin/dbshut" | ||
+ | su - $ORA_OWNER -c "$ORA_HOME/db_1/bin/lsnrctl stop" | ||
+ | rm -f /var/lock/subsys/dbora | ||
+ | ;; | ||
+ | esac | ||
+ | |||
+ | ... | ||
+ | # chmod 750 /etc/init.d/dbora | ||
+ | # chkconfig --add dbora | ||
+ | # chkconfig --list dbora | ||
+ | dbora 0:off 1:off 2:off 3:on 4:on 5:on 6:off | ||
+ | </code> | ||
+ |