solaris中oracle10g自起動

 

Root用户登录

/etc/init.d下面新建一个文件dbora,内容:

#!/bin/bash

# Copyright .  All rights reserved.

ORACLE_BASE=/oracle/oracle

ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1

ORACLE_OWNER=oracle

su - $ORACLE_OWNER -c "lsnrctl start>>/oracle/log"

su - $ORACLE_OWNER -c "sqlplus /nolog @/oracle/oracle/product/10.2.0/db_1/dbstart.sql>>/oracle/log"

su - $ORACLE_OWNER -c "emctl start dbconsole>>/oracle/log"

-----------------------------------------------------------------------------------------------------------------------

dbstart.sql内容如下

conn / as sysdba

startup

exit

------------------------------------------------------------------------------------------------------------------------

dbora改成可执行

chmod 755 dbora

dbstart.sql改成oracle所有

chown oracle:oinstall /oracle/oracle/product/10.2.0/db_1/dbstart.sql

chmod 755 /oracle/oracle/product/10.2.0/db_1/dbstart.sql

然后作一个连接

ln -s /etc/init.d/dbora /etc/rc2.d/S99dbora

ln -s /etc/init.d/dbora /etc/rc0.d/K10dbora

ln -s /etc/init.d/dbora /etc/rc3.d/S99dborasolaris10是默认在level 3

你可能感兴趣的:(Solaris,开机启动,oracle10g)