光谷网站建设制作,自己搭建公网ip服务器,怎样做pdf电子书下载网站,wordpress 统计分析Oracle在$ORACLE_HOME/bin下提供许多对数据库进行操作的脚本#xff0c;其中dbstart和dbshut可分别用来启动和关闭数据库。注意#xff0c;这两个脚本已包含监听器的启动或关闭#xff0c;但并未对EM进行相关的操作。使用如下命令#xff1a;
/oracle/product/11.2.0/db_1…Oracle在$ORACLE_HOME/bin下提供许多对数据库进行操作的脚本其中dbstart和dbshut可分别用来启动和关闭数据库。注意这两个脚本已包含监听器的启动或关闭但并未对EM进行相关的操作。使用如下命令
/oracle/product/11.2.0/db_1/bin/dbstart /oracle/product/11.2.0/db_1 #启动数据库实例(包含监听器)
/oracle/product/11.2.0/db_1/bin/dbshut /oracle/product/11.2.0/db_1 #关闭数据库实例(包括监听器)以上命令要成功启动数据库实例还得打开Oracle设置的一个关卡vi /etc/oratab修改行
orcl:/oracle/product/11.2.0/db_1:Y #默认为orcl:/oracle/product/11.2.0/db_1:N这时候用命令启动会报ORACLE_HOME_LISTNER没有设置
[oracleprimary bin]$ /oracle/product/11.2.0/db_1/bin/dbstart /oracle/product/11.2.0/db_1
ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listener修改dbstart和dbshut dbstart修改前
# First argument is used to bring up Oracle Net Listener
ORACLE_HOME_LISTNER$1
if [ ! $ORACLE_HOME_LISTNER ] ; thenecho ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listenerecho Usage: $0 ORACLE_HOME
elseLOG$ORACLE_HOME_LISTNER/listener.logdbstart修改后
# First argument is used to bring up Oracle Net Listener
ORACLE_HOME_LISTNER/u01/app/oracle/product/11.2.0/db_1 // --/u01/app/oracle/product/11.2.0/db_1为$ORACLE_HOME
if [ ! $ORACLE_HOME_LISTNER ] ; thenecho ORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listenerecho Usage: $0 ORACLE_HOME
elseLOG$ORACLE_HOME_LISTNER/listener.log同理dbshut也做相应修改
在启动了Linux系统之后转到 /etc/init.d 目录下
[rootoracle ~]# cd /etc/init.d使用 vi 命令新建一个以 oracle 命名的文件并将以下代码复制至文件中[rootoracle init.d]# vi oracle#!/bin/sh
# chkconfig: 345 61 61
# description: Oracle 11g AutoRun Services
# /etc/init.d/oracle
#
# Run-level Startup script for the Oracle Instance, Listener, and
# Web Interfaceexport ORACLE_BASE/u01/app/oracle
export ORACLE_HOME$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SIDddhldata
export PATH$ORACLE_HOME/bin:$PATHORA_OWNRoracle# if the executables do not exist -- display errorif [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
thenecho Oracle startup: cannot startexit 1
fi# depending on parameter -- startup, shutdown, restart
# of the instance and listener or usage displaycase $1 instart)# Oracle listener and instance startupsu $ORA_OWNR -lc $ORACLE_HOME/bin/dbstartecho Oracle Start Succesful!OK.;;stop)# Oracle listener and instance shutdownsu $ORA_OWNR -lc $ORACLE_HOME/bin/dbshutecho Oracle Stop Succesful!OK.;;reload|restart)$0 stop$0 start;;*)echo $Usage: basename $0 {start|stop|reload|reload}exit 1
esac
exit 0在编辑完成之后使用 :x 命令保存此文件。
赋予执行权限
[rootoracle init.d]# chmod 750 /etc/init.d/oracle做一个链接:
[rootoracle init.d]# ln -s /etc/init.d/oracle /etc/rc1.d/K61oracle[rootoracle init.d]# ln -s /etc/init.d/oracle /etc/rc3.d/S61oracle执行以下命令:
[rootoracle init.d]# chkconfig --level 345 oracle on[rootoracle init.d]# chkconfig --add oracle //添加到服务里