Linux 下面如何设置Oracle的自动启动.
1. 先设置 /etc/oratab 文件.
添加一下信息.
$ORACLE_SID:$ORACLE_HOME:Y|N
Y表示在系统启动的时候, 自动启动,
N表示在系统启动的时候不启动.
| ||
|
2. 修改/etc/rc.d/rc.local
添加一下信息.
su - oracle -c 'dbstart'
su - oracle -c 'lsnrctl start'
| ||
|
3. 在命令行测试使用dbstart, dbshut脚本, 看看脚本是不是能够正常启动关闭数据库,
dbshut中默认使用shutdown 命令关闭的. 即使用shutdown normal关闭的.
如果需要可以修改, $ORACLE_HOME/bin/dbshut脚本, 将shutdown 修改为shutdown immediate. 这样关闭数据库的时间会大大加快:)
注:
1、In some cases for 9.2.0 I also had to copy the init file for my SID "test" from /opt/oracle/admin/test/pfile to $ORACLE_HOME/dbs to get dbstart and dbshut working:
cp /opt/oracle/admin/test/pfile/inittest.ora.642002224936 $ORACLE_HOME/dbs/inittest.ora
But first make sure if your init file already exists in $ORACLE_HOME/dbs!
2、some bugs in dbstart when you using spfile in oracle9i
You can do the following step to solve it:
代码:--------------------------------------------------------------------------------
- edit the dbstart script
Linux 下面如何设置Oracle的自动启动.
1. 先设置 /etc/oratab 文件.
添加一下信息.
$ORACLE_SID:$ORACLE_HOME:Y|N
Y表示在系统启动的时候, 自动启动,
N表示在系统启动的时候不启动.
| ||
|
2. 修改/etc/rc.d/rc.local
添加一下信息.
su - oracle -c 'dbstart'
su - oracle -c 'lsnrctl start'
| ||
|
3. 在命令行测试使用dbstart, dbshut脚本, 看看脚本是不是能够正常启动关闭数据库,
dbshut中默认使用shutdown 命令关闭的. 即使用shutdown normal关闭的.
如果需要可以修改, $ORACLE_HOME/bin/dbshut脚本, 将shutdown 修改为shutdown immediate. 这样关闭数据库的时间会大大加快:)
注:
1、In some cases for 9.2.0 I also had to copy the init file for my SID "test" from /opt/oracle/admin/test/pfile to $ORACLE_HOME/dbs to get dbstart and dbshut working:
cp /opt/oracle/admin/test/pfile/inittest.ora.642002224936 $ORACLE_HOME/dbs/inittest.ora
But first make sure if your init file already exists in $ORACLE_HOME/dbs!
2、some bugs in dbstart when you using spfile in oracle9i
You can do the following step to solve it:
代码:--------------------------------------------------------------------------------
- edit the dbstart script