In the REL5 oracle service shell, create an oracle file in/etc/init. d/. How can I get the Java code www.2cto.com #! /Bin/sh # oracle service start or stop shell ORA_HOME =/home/oracle/db/oracle/product/12.1.0/db_1 ORA_OWNER = oracle if [! -F $ ORA_HOME/bin/dbstart] then echo "Oracle startup: cannot start" exit fi case "$1" in 'start') # start the Oracle databases: echo "Starting Oracle Databases... "echo" --------------------------------------------- ">/var/log/oracle date +" % T % a % D: Starting Oracle Databases as part of system up. ">>>/var/log/oracle echo" --------------------------------------------- ">/var/log/oracle su-$ ORA_OWNER-c" $ ORA_HOME/bin/dbstart ">/var/ log/oracle echo "Done" # Start the Listener: echo "Starting Oracle Listeners... "echo" --------------------------------------------- ">/var/log/oracle date +" % T % a % D: Starting Oracle Listeners as part of system up. ">/var/log/oracle echo" --------------------------------------------- ">/var/log/oracle su-$ ORA_OWNER-c" $ ORA_HOME/bin/lsnrctl start ">/var /log/oracle echo "Done. "echo" ----------------------------------------------- ">/var/log/oracle date +" % T % a % D: Finished. ">>>/var/log/oracle echo" --------------------------------------------- ">/var/log/oracle touch/var/lock/subsys/oracle; 'stop ') # Stop the Oracle Listener: echo "Stoping Oracle Listeners... "echo" --------------------------------------------- ">/var/log/oracle date +" % T % a % D: Stoping Oracle Listener as part of system down. ">/var/log/oracle echo" --------------------------------------------- ">/var/log/oracle su-$ ORA_OWNER-c" $ ORA_HOME/bin/lsnrctl stop ">/var /log/oracle echo "Done. "rm-f/var/lock/subsys/oracle # Stop the Oracle Database: echo" Stoping Oracle Databases... "echo" --------------------------------------------- ">/var/log/oracle date +" % T % a % D: Stoping Oracle Databases as part of system down. ">/var/log/oracle echo" --------------------------------------------- ">/var/log/oracle su-$ ORA_OWNER-c" $ ORA_HOME/bin/dbshut ">/var/ log/oracle echo "Done. "echo" "echo" ----------------------------------------------- ">/var/log/oracle date +" % T % a % D: Finished. ">>>/var/log/oracle echo" --------------------------------------------- ">/var/log/oracle; 'restart') $0 stop $0 start ;; esac add service # chkconfig -- level 35 oracle on shutdown or stop the database before restarting the machine # ln-s/etc/init. d/oracle/etc/rc0.d/K01oracle // shutdown # ln-s/etc/init. d/oracle/etc/rc6.d/K01oracle // restart usage # service oracle start // start oracle # service oracle stop // close oracle # service oracle restart // restart xs @ xs # su-oracle Password: oracle @ xs # sqlplus/nolog SQL * Plus: Release 11.2.0.1.0 Production on Tue Feb 19 07:14:25 2013 Copyright (c) 1982,200 9, Oracle. all rights reserved. SQL> conn/as sysdba Connected. SQL> select sysdate from dual; SYSDATE --------- 19-FEB-13 SQL>