start oracle with the linux opening
2009-11-20 12:09
246 查看
1.修改/etc/oratab ,添加$ORACLE_SID:$ORACLE_HOME:Y --
Y代表OS启动则DB启动必须设置为Y,否则dbstart和dbstop不可用,N为不启动,$ORACLE_SID是DB
SID,$ORACLE_HOME是DB 绝对路径
2.修改/etc/rc.d/rc.loacl,加入以下:
#listener command
COMM_LISTENER=/opt/oracle/product/10.2.0/db_1/bin/lsnrctl
LISTENER_NAME=orctest
su - oracle -c "$COMM_LISTENER start $LISTENER_NAME"
COMM_START=/opt/oracle/product/10.2.0/db_1/bin/dbstart
su - oracle -c "$COMM_START"
echo $COMM_START
重启即可看到数据库和监听已经启动。
##################################################
1. 创建文件/etc/oratab
#添加如下内容到/etc/oratab文件中,
#$ORACLE_SID是你的Oracle数据库的sid
#$ORACLE_HOME是你的Oracle数据库的Oracle_home
#Y表示要求在系统启动的时候启动Oracle数据库.N表示不要在系统启动的时候启动Oracle
改以下为
# *:/data/opt/app/oracle/app:N# db1:/data/opt/app/oracle/app:N
*:/data/opt/app/oracle/app:Ydb1:/data/opt/app/oracle/app:Y
2. 修改文件/etc/rc.local添加一下两行
su - oracle -c 'dbstart'
su - oracle -c 'lsnrctl start '
3.修改dbstart这个启动文件的oratab的目录为/etc/oratab,默认的文件目录是不对的。一定要改。
#ORATAB=/var/opt/oracle/oratab
ORATAB=/etc/oratab
只需修改以上就可以成功了。很EASY!
#######################################################
=== 5. 设置数据库自动启动 ===
-- 5.1 --
编辑文件 /etc/oratab,将“N”修改为“Y”
oradb1:/oracle/product/10.2.0:Y
-- 5.2 --
确认oracle用户能否用系统自带的Shell程序dbstart, dbshut正常启动和关闭数据库,以oracle
身份执行 dbstart dbshut
-- 5.3 建立启动Shell --
以root身份,在 /etc/rc.d/init.d 目录下建立文件 oracle,内容为:
#!/bin/sh
OPT_=$1
case "$OPT_" in
start)
/bin/echo "$0 : (start)"
#
# Your service startup command goes here.
#
su - oracle -c "/oracle/product/10.2.0/bin/lsnrctl start"
su - oracle -c "/oracle/product/10.2.0/bin/dbstart"
# NOTE: Must exit with zero unless error is severe.
chmod 1777 /tmp
chown root:root /tmp
exit 0
;;
stop)
/bin/echo "$0 : (stop)"
#
# Your service shutdown command goes here.
#
su - oracle -c "/oracle/product/10.2.0/bin/lsnrctl stop"
su - oracle -c "/oracle/product/10.2.0/bin/dbshut"
# NOTE: Must exit with zero unless error is severe.
exit 0
;;
*)
/bin/echo ''
/bin/echo "Usage: $0 [start|stop]"
/bin/echo " Invalid argument ==> "${OPT_}""
/bin/echo ''
exit 0
;;
esac
然后改变它的属性成755, 可以执行
-- 5.4 建立启动、关闭连接 --
在目录 /etc/rc.d/rc3.d 中建立文件链接 S99oracle -> /etc/rc.d/init.d/oracle
在目录 /etc/rc.d/rc0.d 中建立文件链接 K01oracle -> /etc/rc.d/init.d/oracle
重启动...
Y代表OS启动则DB启动必须设置为Y,否则dbstart和dbstop不可用,N为不启动,$ORACLE_SID是DB
SID,$ORACLE_HOME是DB 绝对路径
2.修改/etc/rc.d/rc.loacl,加入以下:
#listener command
COMM_LISTENER=/opt/oracle/product/10.2.0/db_1/bin/lsnrctl
LISTENER_NAME=orctest
su - oracle -c "$COMM_LISTENER start $LISTENER_NAME"
COMM_START=/opt/oracle/product/10.2.0/db_1/bin/dbstart
su - oracle -c "$COMM_START"
echo $COMM_START
重启即可看到数据库和监听已经启动。
##################################################
1. 创建文件/etc/oratab
#添加如下内容到/etc/oratab文件中,
#$ORACLE_SID是你的Oracle数据库的sid
#$ORACLE_HOME是你的Oracle数据库的Oracle_home
#Y表示要求在系统启动的时候启动Oracle数据库.N表示不要在系统启动的时候启动Oracle
改以下为
# *:/data/opt/app/oracle/app:N# db1:/data/opt/app/oracle/app:N
*:/data/opt/app/oracle/app:Ydb1:/data/opt/app/oracle/app:Y
2. 修改文件/etc/rc.local添加一下两行
su - oracle -c 'dbstart'
su - oracle -c 'lsnrctl start '
3.修改dbstart这个启动文件的oratab的目录为/etc/oratab,默认的文件目录是不对的。一定要改。
#ORATAB=/var/opt/oracle/oratab
ORATAB=/etc/oratab
只需修改以上就可以成功了。很EASY!
#######################################################
=== 5. 设置数据库自动启动 ===
-- 5.1 --
编辑文件 /etc/oratab,将“N”修改为“Y”
oradb1:/oracle/product/10.2.0:Y
-- 5.2 --
确认oracle用户能否用系统自带的Shell程序dbstart, dbshut正常启动和关闭数据库,以oracle
身份执行 dbstart dbshut
-- 5.3 建立启动Shell --
以root身份,在 /etc/rc.d/init.d 目录下建立文件 oracle,内容为:
#!/bin/sh
OPT_=$1
case "$OPT_" in
start)
/bin/echo "$0 : (start)"
#
# Your service startup command goes here.
#
su - oracle -c "/oracle/product/10.2.0/bin/lsnrctl start"
su - oracle -c "/oracle/product/10.2.0/bin/dbstart"
# NOTE: Must exit with zero unless error is severe.
chmod 1777 /tmp
chown root:root /tmp
exit 0
;;
stop)
/bin/echo "$0 : (stop)"
#
# Your service shutdown command goes here.
#
su - oracle -c "/oracle/product/10.2.0/bin/lsnrctl stop"
su - oracle -c "/oracle/product/10.2.0/bin/dbshut"
# NOTE: Must exit with zero unless error is severe.
exit 0
;;
*)
/bin/echo ''
/bin/echo "Usage: $0 [start|stop]"
/bin/echo " Invalid argument ==> "${OPT_}""
/bin/echo ''
exit 0
;;
esac
然后改变它的属性成755, 可以执行
-- 5.4 建立启动、关闭连接 --
在目录 /etc/rc.d/rc3.d 中建立文件链接 S99oracle -> /etc/rc.d/init.d/oracle
在目录 /etc/rc.d/rc0.d 中建立文件链接 K01oracle -> /etc/rc.d/init.d/oracle
重启动...
相关文章推荐
- 数据库、用户-第二章Getting Start with the Oracle Server(oracle入门)-by小雨
- Testing C-State Settings and Performance with the Oracle Database on Linux
- oracle中用START WITH...CONNECT BY PRIOR子句实现递归查询
- Trace the process of the start of Linux
- Boot The Cortex-A9 MPCORE With Linux+uC/OS-II AMP
- Browse the Linux Kernel Source with LXR
- Oracle 树操作(select…start with…connect by…prior)
- Oracle START WITH...CONNECT BY PRIOR的用法
- sqlserver下用函数实现 oracle 的树查询( start with connect by ) 功能
- Linux 下Oracle 开机自启动 与 oratab, dbstart 脚本 说明
- Oracle 树操作(select…start with…connect by…prior)
- oracle 中的select ...connect by prior ...start with 及(+)的用法
- linux 下oracle提示:the account is locked
- oracle 中的select ...connect by prior ...start with 及(+)的用法
- Error while performing database login with the oracle 解决方案
- mysql的逆袭:如何做oracle的start with connect by prior递归层次查询
- 令人迷糊的Oracle递归查询(start with)
- Oracle sql中start with,connect by伪语句用法
- Oracle 树操作(select…start with…connect by…prior)
- error while performing database login with the oracle driver