监听程序配置完成。
14、数据库初始化设置
(1)、修改vi /etc/oratab,把最后一行ss7:/opt/oracle/oracle/product/10g:N那一行最后的 N改成Y。
(2)、复制初始化文件:
cp /opt/oracle/admin/ss7/pfile/init.ora.* /opt/oracle/product/10g/dbs/ss7.ora (3)、修改dbstart脚本:
修改/opt/oracle/product/10g/bin目录下的dbstart文件,将第78行修改为: ORACLE_HOME_LISTNER=/opt/oracle/product/10g/ (4)、使用命令dbstart启动oracle数据库。
15、配置数据库开机自启动
为了方便管理,可以编写一个脚本oracle10G 以root身份进入系统,进入/etc/rc.d/init.d目录 执行#touch oracle10G
在该文件中加入如下内容:
#!/bin/bash
#
#chkconfig: 2345 91 19
# description: starts the oracle listener and instance status() {
pid=`ps -ef | grep ora_pmon | grep -v grep | awk '{print $8}'` if [ \ then
echo \ exit 1 else
echo \ exit 0 fi }
case \ start)
#startup the listener and instance echo -n \ su - oracle -c \ su - oracle -c dbstart echo \
;; stop)
# stop listener, apache and database echo -n \ su - oracle -c \ su - oracle -c dbshut
echo \ ;;
reload|restart) $0 stop $0 start ;; 'status') status ;; *)
echo \ exit 1 esac exit 0
存为oracle10G后,然后执行chmod a+x oracle10G
即可在以后以root身份运行/etc/rc.d/init.d/ora10g start |stop 来管oracle的启动和停止了。
将这个脚本加入到系统中使其可开机运行,需要运行以下命令: chkconfig --level 345 oracle10G on
重新启动服务器后可以验证一下配置是否生效。
相关推荐: