测试11G Oracle Restart能否自动启动被杀掉的组件
测试11G Oracle Restart能否自动启动被杀掉的组件
故事主人公:oralce 11g 之 restart
Oracle Restartis another component of Oracle Grid Infrastructure for a Standalone Server that will be used in this guide.
Starting with Oracle Database 11g Release 2, thedbstart anddbshut scripts that were used to automate database startup and shutdown in previous Oracle versions are deprecated. Oracle now recommends to configure Oracle Database with the OracleRestart feature to automatically restart the database, the listener, Oracle Automatic Storage Management (Oracle ASM), and other Oracle components after a hardware or software failure or when the database host computer restarts.
查看环境:
[html] [oracle@oracle11g ~]$ . oraenv ORACLE_SID = [orcl] ? orcl The Oracle base remains unchanged with value /u01/app/oracle [oracle@oracle11g ~]$ srvctl config database -d orcl Database unique name: orcl Database name: orcl Oracle home: /u01/app/oracle/acfsmounts/acfs_db1/dbhome_1 Oracle user: oracle Spfile: +DATA/orcl/spfileorcl.ora Domain: Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Database instance: orcl Disk Groups: DATA,FRA Services: [oracle@oracle11g ~]$ ps -ef |grep ora_lgwr_orcl oracle 5836 1 0 10:08 ? 00:00:00 ora_lgwr_orcl oracle 9087 8813 0 10:26 pts/1 00:00:00 grep ora_lgwr_orcl oracle@oracle11g ~]$ kill -9 5836 [oracle@oracle11g ~]$ ps -ef |grep ora_lgwr_orcl oracle 9116 8813 0 10:26 pts/1 00:00:00 grep ora_lgwr_orcl [oracle@oracle11g ~]$ ps -ef |grep ora_lgwr_orcl oracle 9281 1 0 10:27 ? 00:00:00 ora_lgwr_orcl oracle 9337 8813 0 10:27 pts/1 00:00:00 grep ora_lgwr_orcl
=从Oracle Restart配置里移除orcl数据库实例= [html] [oracle@oracle11g ~]$ srvctl status database -d orcl Database is running. [oracle@oracle11g ~]$ srvctl config database -d orcl Database unique name: orcl Database name: orcl Oracle home: /u01/app/oracle/acfsmounts/acfs_db1/dbhome_1 Oracle user: oracle Spfile: +DATA/orcl/spfileorcl.ora Domain: Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Database instance: orcl Disk Groups: DATA,FRA Services: [oracle@oracle11g ~]$ srvctl remove database -d orcl PRKO-3141 : Database orcl could not be removed because it was running [oracle@oracle11g ~]$ srvctl stop database -d orcl [oracle@oracle11g ~]$ srvctl status database -d orcl Database is not running. [oracle@oracle11g ~]$ srvctl remove database -d orcl Remove the database orcl? (y/[n]) y [oracle@oracle11g ~]$ srvctl remove database -d orcl PRCD-1120 : The resource for database orcl could not be found. PRCR-1001 : Resource ora.orcl.db does not exist
=重启orcl数据库实例= [html] [oracle@oracle11g ~]$ srvctl start database -d orcl PRCD-1120 : The resource for database orcl could not be found. PRCR-1001 : Resource ora.orcl.db does not exist [oracle@oracle11g ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.3.0 Production on Thu Apr 19 10:42:00 2012 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to an idle instance. SQL> startup ORACLE instance started. Total System Global Area 521936896 bytes Fixed Size 2229944 bytes Variable Size 352323912 bytes Database Buffers 163577856 bytes Redo Buffers 3805184 bytes Database mounted. Database opened. SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options
=再次测试Oracle Restart能否自动启动被杀掉的组件= [html] [oracle@oracle11g ~]$ ps -ef |grep ora_lgwr_orcl oracle 11287 1 0 10:42 ? 00:00:00 ora_lgwr_orcl oracle 11696 8813 0 10:44 pts/1 00:00:00 grep ora_lgwr_orcl [oracle@oracle11g ~]$ kill -9 11287 [oracle@oracle11g ~]$ ps -ef |grep ora_lgwr_orcl oracle 11700 8813 0 10:45 pts/1 00:00:00 grep ora_lgwr_orcl
=发现不会再次重启,手工重启数据库= [html] oracle@oracle11g ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.3.0 Production on Thu Apr 19 10:46:04 2012Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to an idle instance. SQL> startup [html] ORACLE instance started. Total System Global Area 521936896 bytes Fixed Size 2229944 bytes Variable Size 352323912 bytes Database Buffers 163577856 bytes Redo Buffers 3805184 bytes Database mounted. Database opened. SQL> exit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit ProductionWith the Partitioning, Automatic Storage Management, OLAP, Data Miningand Real Application Testing options
=使用EM将orcl数据库实例加回到Oracle Restart配置里,如果发现页面上仍旧是Enabled则只能手工添加= [html] [oracle@oracle11g ~]$ srvctl add database -d orcl -o /u01/app/oracle/acfsmounts/acfs_db1/dbhome_1 [oracle@oracle11g ~]$ srvctl config database -d orcl Database unique name: orcl Database name: Oracle home: /u01/app/oracle/acfsmounts/acfs_db1/dbhome_1 Oracle user: oracle Spfile: Domain: Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Database instance: orcl Disk Groups: Services: [oracle@oracle11g ~]$ srvctl status database -d orcl Database is not running. [oracle@oracle11g ~]$ srvctl start database -d orcl [oracle@oracle11g ~]$ srvctl status database -d orcl Database is running. [oracle@oracle11g ~]$ srvctl config database -d orcl Database unique name: orcl Database name: Oracle home: /u01/app/oracle/acfsmounts/acfs_db1/dbhome_1 Oracle user: oracle Spfile: Domain: Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Database instance: orcl Disk Groups: Services: [oracle@oracle11g ~]$ srvctl modify database -d orcl -n orcl -p +DATA/orcl/spfileorcl.ora -a DATA,FRA [oracle@oracle11g ~]$ srvctl config database -d orcl Database unique name: orcl Database name: orcl Oracle home: /u01/app/oracle/acfsmounts/acfs_db1/dbhome_1 Oracle user: oracle Spfile: +DATA/orcl/spfileorcl.ora Domain: Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Database instance: orcl Disk Groups: DATA,FRA Services:
=确认orcl数据库实例是否添加到Oracle Restart成功= [html] [oracle@oracle11g ~]$ ps -ef |grep ora_lgwr_orcl oracle 17276 1 0 11:05 ? 00:00:00 ora_lgwr_orcl oracle 25574 8813 0 11:14 pts/1 00:00:00 grep ora_lgwr_orcl [oracle@oracle11g ~]$ kill -9 17276 [oracle@oracle11g ~]$ ps -ef |grep ora_lgwr_orcl oracle 26107 8813 0 11:14 pts/1 00:00:00 grep ora_lgwr_orcl [oracle@oracle11g ~]$ ps -ef |grep ora_lgwr_orcl oracle 26952 1 0 11:15 ? 00:00:00 ora_lgwr_orcl oracle 27282 8813 0 11:15 pts/1 00:00:00 grep ora_lgwr_orcl
=关闭orcl数据库实例上的Oracle Restart= [html] [oracle@oracle11g ~]$ srvctl status database -d orcl -f Database is disabled Database is running.
- 更多Oracle疑问解答:
- 运行exp备份oracle数据库提示oracle-12154错误
- 有没有,生产Oracle Rman 备份脚本的工具啊!
- 初学orcle,希望有大大帮忙解说一下详细步骤,从登录oracle到创建表的过程
- oracle语句问题:一张user表,三个字段,id,name,time,插入记录比如:张三2007,李四2008,张三2011
- 如何写一个ORACLE触发器同步两个表中的数据?
- oracle 如何查看一个服务器上有多少个数据库.
- oracle 创建包的时候错误 求解
- oracle 重复列的问题
- oracle 中如何查处2星期前的数据
- 请教oracle数据库安装中的问题
- 请问谁能提供给我标准的oracle ERP的数据库表结构并详细说明各表主要的作用?
- 安装oracle遇到的问题 invalid entry CRC (expected 0x3e12e795 but got 0x9db0e9fd)
- 我的是ORACLE 10G,在RMAN中如何按指定的时间恢复数据文件啊?
- oracle为什么没有自动增长列
- oracle快捷键都有哪些啊?