Chinaunix首页 | 论坛 | 博客
  • 博客访问: 107599
  • 博文数量: 38
  • 博客积分: 506
  • 博客等级: 下士
  • 技术积分: 405
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-03 10:46
文章分类
文章存档

2014年(6)

2013年(10)

2012年(22)

我的朋友

分类: Oracle

2013-10-25 17:04:09

一 startup.sh

oradata-->$ sh   /u01/startup.sh

#!/bin/sh
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin
export PATH=$PATH:$HOME/bin
$ORACLE_HOME/bin/sqlplus /nolog < connect / as sysdba;
startup;
exit;
EOF


$ORACLE_HOME/bin/lsnrctl < start
exit
EOF


二 shutdown.sh

#!/bin/sh


export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin
export PATH=$PATH:$HOME/bin


$ORACLE_HOME/bin/lsnrctl < stop
exit
EOF

$ORACLE_HOME/bin/sqlplus /nolog < connect / as sysdba;
alter system checkpoint;
shutdown immediate;
exit;
EOF

三 編輯 /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.


touch /var/lock/subsys/local


#oracle auto startup


export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export PATH=$ORACLE_HOME/bin:$ORA_CRS_HOME/bin:/bin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin
export PATH=$PATH:$HOME/bin


su - oracle -c "/u01/app/oracle/product/10.2.0/db_1/bin/sqlplus /nolog < connect / as sysdba
startup;
exit
EOF"


su - oracle -c "/u01/app/oracle/product/10.2.0/db_1/bin/lsnrctl < start
exit
EOF"

=========================================================================

#set oracle environment

ORACLE_HOME=/u01/product/oracle;export ORACLE_HOME
ORACLE_SID=wind;export ORACLE_SID

su oracle -c "/u01/product/oracle/bin/sqlplus /nolog < connect / as sysdba
startup nomount;
alter database mount standby database;
alter database recover managed standby database disconnect from session;
exit
EOF"

ORACLE_HOME=/u01/product/oracle;export ORACLE_HOME
ORACLE_SID=qis;export ORACLE_SID

su oracle -c "/u01/product/oracle/bin/sqlplus /nolog < connect / as sysdba
startup nomount;
alter database mount standby database;
alter database recover managed standby database disconnect from session;
exit
EOF"

su oracle -c "/u01/product/oracle/bin/lsnrctl < start
exit
EOF"


阅读(1042) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~