oracle 设置控制文件多路复用

控制文件虽小,但却很重要,如果损坏将不能启动数据库,通过设置控制文件多路复用,可以降低控制文件损坏导致数据库失败的风险性。

步骤:

1查看当前控制文件

SQL> show parameter control_files;


NAME     TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files     string /home/oracle/zydb/control01.ct
l

2 干净关闭数据库

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

3 复制控制文件到其它目录

SQL> host cp /home/oracle/zydb/control01.ctl /u01/flash_recovery_area/control03.ctl


SQL> host cp /home/oracle/zydb/control01.ctl /u01/flash_recovery_area/zydb/control02.ctl


SQL> startup nomount;
ORACLE instance started.


Total System Global Area 1.3429E+10 bytes
Fixed Size    2217992 bytes
Variable Size 7449085944 bytes
Database Buffers 5905580032 bytes
Redo Buffers   71770112 bytes

4 重新设置控制文件参数

SQL> alter system set control_files="/home/oracle/zydb/control01.ctl","/u01/flash_recovery_area/zydb/control02.ctl","/u01/flash_recovery_area/control03.ctl" scope=spfile;


System altered.


SQL> startup force;
ORACLE instance started.


Total System Global Area 1.3429E+10 bytes
Fixed Size    2217992 bytes
Variable Size 7449085944 bytes
Database Buffers 5905580032 bytes
Redo Buffers   71770112 bytes
Database mounted.
Database opened.

5  我之前不在在sqlplus中复制的控制文件,而是直接在操作系统中复制的,结果启动时报错:

ORA-00205: error in identifying control file, check alert log for more info

查看告警日志文件:

ORA-00210: cannot open the specified control file
ORA-00202: control file: '/u01/flash_recovery_area/control03.ctl'
ORA-27041: unable to open file
Linux-x86_64 Error: 13: Permission denied

原来是没有打开control03.ctl的权限:

root@localhost trace]# ll /u01/flash_recovery_area/control03.ctl
-rw-r----- 1 root root 9748480  2月 15 01:31 /u01/flash_recovery_area/control03.ctl

更改文件所属的用户和组,重启数据库即可

chown oracle:dba control03.ctl 



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值