您的位置:首页 > 数据库 > Oracle

oracle 设置控制文件多路复用

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

步骤:

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 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: