1.vi /etc/rc.local

 
su - oracle -c "/bin/sh /opt/dbstart.sh"
 
2. dbstart.sh的内容
 
export ORACLE_BASE=/opt/oracle
export ORACLE_SID=orcl
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
 
sqlplus '/as sysdba'<
 
startup;
 
exit
 
eof
 
/opt/oracle/product/10.2.0/db_1/bin/lsnrctl start
 
3.修改/etc/oratab内容
 
ORACLE_SID:/u01/app/oracle/product/10.2.0/db_1:N改为如下内容
 
ORACLE_SID:/u01/app/oracle/product/10.2.0/db_1:Y