增加控制文件副本

在ASM和本地磁盘的2种情况下控制文件配置多个副本。
归档模式下的情况:
SQL> archive log list;
Database log mode           Archive Mode
Automatic archival           Enabled
Archive destination           /u01/oracle/10g/arch
Oldest online log sequence     22
Next log sequence to archive   24
Current log sequence           24
本地磁盘方式:
SQL>  show parameter control_files;

NAME                     TYPE     VALUE
------------------------------------ ----------- ------------------------------
control_files                 string     /u01/oracle/10g/oradata/gt10g/
                         control1.ctl
SQL> alter system set control_files='/u01/oracle/10g/oradata/gt10g/control1.ctl','/u01/oracle/10g/oradata/gt10g/control2.ctl' scope=spfile;

System altered.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
接下来我们可以使用RMAN方式来恢复控制文件
RMAN> startup nomount;

Oracle instance started

Total System Global Area     520093696 bytes

Fixed Size                     2097496 bytes
Variable Size                138415784 bytes
Database Buffers             373293056 bytes
Redo Buffers                   6287360 bytes

RMAN> restore controlfile from '/u01/oracle/10g/oradata/gt10g/control1.ctl';

Starting restore at 25-FEB-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK

channel ORA_DISK_1: copied control file copy
output filename=/u01/oracle/10g/oradata/gt10g/control1.ctl
output filename=/u01/oracle/10g/oradata/gt10g/control2.ctl
Finished restore at 25-FEB-13

RMAN> sql 'alter database mount';

sql statement: alter database mount
released channel: ORA_DISK_1

RMAN> sql 'alter database open';

sql statement: alter database open

SQL>  show parameter control_files;

NAME                     TYPE     VALUE
------------------------------------ ----------- ------------------------------
control_files                 string     /u01/oracle/10g/oradata/gt10g/
                         control1.ctl, /u01/oracle/10g/
                         oradata/gt10g/control2.ctl

也可以使用pfile的方式修改参数文件指向新的控制文件的OS cp副本,这里就不做演示。
                        
ASM方式:
SQL> show parameter control_files;

NAME                     TYPE     VALUE
------------------------------------ ----------- ------------------------------
control_files                 string     +DATA01/gt10g/controlfile/curr
                         ent.257.808238085
SQL> alter system set control_files='+DATA01/gt10g/controlfile/current.257.808238085','+DATA01','+DATA01' scope=spfile;

System altered.

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

RMAN> startup nomount;

Oracle instance started

Total System Global Area     520093696 bytes

Fixed Size                     2097496 bytes
Variable Size                138415784 bytes
Database Buffers             373293056 bytes
Redo Buffers                   6287360 bytes

RMAN> restore controlfile from '+DATA01/gt10g/controlfile/current.257.808238085';

Starting restore at 25-FEB-13
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK

channel ORA_DISK_1: copied control file copy
output filename=+DATA01/gt10g/controlfile/current.257.808238085
output filename=+DATA01/gt10g/controlfile/current.268.808304299
output filename=+DATA01/gt10g/controlfile/current.267.808304301
Finished restore at 25-FEB-13

RMAN> sql 'alter database mount';

sql statement: alter database mount
released channel: ORA_DISK_1

RMAN> sql 'alter database open';

sql statement: alter database open

SQL> show parameter control_files;

NAME                     TYPE     VALUE
------------------------------------ ----------- ------------------------------
control_files                 string     +DATA01/gt10g/controlfile/curr
                         ent.257.808238085, +DATA01/gt1
                         0g/controlfile/current.268.808
                         304299, +DATA01/gt10g/controlf
                         ile/current.267.808304301
                        
非归档模式下的配置方式也是一样,就不在演示。
-The End-
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值