手机版
你好,游客 登录 注册 搜索
背景:
阅读新闻

Oracle控制文件多路复用时要注意的问题

[日期:2014-11-21] 来源:Linux社区  作者:aaron8219 [字体:大 中 小]
--删除文件后重新用备份创建控制文件镜像
SQL> !rm /u01/control04.ctl
 
SQL> alter database backup controlfile to '/u01/control04.ctl';
 
Database altered.
 
--关闭数据库后用spfile启动(原来是pfile启动的)
SQL> shutdown immediate
Database closed.
Database dismounted.
Oracle instance shut down.
SQL> startup
ORACLE instance started.
 
Total System Global Area  835104768 bytes
Fixed Size                  2232960 bytes
Variable Size             507514240 bytes
Database Buffers          322961408 bytes
Redo Buffers                2396160 bytes
ORA-00214: control file '/u01/app/oracle/oradata/zlm11g/control01.ctl' version 9338 inconsistent with file '/u01/control04.ctl'
version 9332
 
仍然报新增的控制文件版本号与系统原有的不一致。
此时猜想可能需要在spfile中先设置好参数后,再生成控制文件备份作为镜像
 
--先恢复正确的spfile
SQL> shutdown immediate
ORA-01507: database not mounted
 
 
ORACLE instance shut down.
SQL> startup pfile=$ORACLE_HOME/dbs/initzlm11g.ora
ORACLE instance started.
 
Total System Global Area  835104768 bytes
Fixed Size                  2232960 bytes
Variable Size             507514240 bytes
Database Buffers          322961408 bytes
Redo Buffers                2396160 bytes
Database mounted.
Database opened.
SQL> create spfile from pfile;
 
File created.
 
SQL> shutdown immedaite
SP2-0717: illegal SHUTDOWN option
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
 
Total System Global Area  835104768 bytes
Fixed Size                  2232960 bytes
Variable Size             507514240 bytes
Database Buffers          322961408 bytes
Redo Buffers                2396160 bytes
Database mounted.
Database opened.
 
--设置control_files参数
SQL> alter system set control_files='/u01/app/oracle/oradata/zlm11g/control01.ctl','/u01/app/oracle/fast_recovery_area/zlm11g/control02.ctl','/u01/control03.ctl','/u01/control04.ctl' scope=spfile;
 
System altered.
 
--备份控制文件作为镜像
SQL> !rm /u01/control04.ctl
SQL> alter database backup controlfile to '/u01/control04.ctl';
 
Database altered.
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
 
Total System Global Area  835104768 bytes
Fixed Size                  2232960 bytes
Variable Size             507514240 bytes
Database Buffers          322961408 bytes
Redo Buffers                2396160 bytes
ORA-00214: control file '/u01/app/oracle/oradata/zlm11g/control01.ctl' version 9373 inconsistent with file '/u01/control04.ctl'
version 9367
 
仍然是不一致的状态,看来之前的假设都被推翻了,用backup controlfile方式备份出的控制文件,与系统原有的控制文件,是不同的,无法做到像OS那样直接复制来得直接
 
总结:
 
1.修改静态参数需要重启数据库,然后通过pfile来指定新增的控制文件镜像,最后用pfile启动,并生成spfile
2.复制控制文件镜像文件时,停库后尽量用OS级copy方式,如果选择使用备份当前控制文件生成控制文件镜像的话,新生成的备份控制文件与数据库原有控制文件是不一致的

更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12

本文永久更新链接地址:http://www.linuxidc.com/Linux/2014-11/109687.htm

linux
相关资讯       Oracle控制文件  多路复用 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款