Solaris 10中Oracle 10gR2开机自启动 1.修改/var/opt/oracle/oratab文件,后面的dbstart和dbshut依据这个文件启动数据库: orcl:
Solaris 10中Oracle 10gR2开机自启动
1.修改/var/opt/oracle/oratab文件,后面的dbstart和dbshut依据这个文件启动数据库:
orcl:/opt/oracle/product/10.2:Y
2.修改$ORACLE_HOME/bin/dbstart和$ORACLE_HOME/bin/dbshut文件:
vi dbstart
#ORACLE_HOME_LISTNER=$1
ORACLE_HOME_LISTNER=/opt/oracle/product/10.2
export ORACLE_HOME_LISTNER
vi dbshut
#ORACLE_HOME_LISTNER=$1
ORACLE_HOME_LISTNER=/opt/oracle/product/10.2
export ORACLE_HOME_LISTNER
3.修改完毕后用看看oracle用户能否执行这两个文件,我的dbshut没问题,但是执行dbstart不行:
查看/opt/oracle/product/10.2/listener.log的权限:
原来是oracle用户没有写入listener的权限,赋予相应权限即可:
chown oracle:dba /opt/oracle/product/10.2/listener.log
执行后成功。
4.接下来在/etc/init.d下建立系统自动启动和关机前自动关闭Oracle的脚本文件,分别如下:
vi start_oracle.sh(开机后启动oracle数据库脚本):
#!/usr/bin/bash
#this script is used to start the oracle
su - oracle -c " /opt/oracle/product/10.2/bin/dbstart"
chmod a+x /etc/init.d/start_oracle.sh
vi stop_oracle.sh(关机前停止oracle数据库脚本):
#!/usr/bin/bash
#this script is used to stop the oracle
su - oracle -c " /opt/oracle/product/10.2/bin/dbshut"
chmod a+x /etc/init.d/stop_oracle.sh
,
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn