ORACLE使用ASM存储,建库时默认只有一个控制文件,如果想多加几个控制文件,需要通过手工来添加,以下是我测试文档,贴出来分享下。
1.查看当前数据库的控制文件
SQL> select name from v$controlfile;
NAME
------------------------------------------------
+DATA01/orcl/controlfile/current.274.743672963
2.修改spfile中的控制文件参数
SQL> alter system set control_files='+DATA01/orcl/controlfile/current.274.743672963','+DATA01','+DATA01' scope=spfile sid='*';
System altered.
3.将数据库实例启动到nomount状态
SQL> shutdown immediate
[oracle@node1 ~]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Wed Jul 20 11:27:44 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database (not started)
RMAN> startup nomount
Oracle instance started
Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 88082676 bytes
Database Buffers 75497472 bytes
Redo Buffers 2973696 bytes
RMAN> restore controlfile from '+DATA01/orcl/controlfile/current.274.743672963';
Starting restore at 20-JUL-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=147 instance=orcl1 devtype=DISK
channel ORA_DISK_1: copied control file copy
output filename=+DATA01/orcl/controlfile/current.274.743672963
output filename=+DATA01/orcl/controlfile/backup.285.756991697
output filename=+DATA01/orcl/controlfile/backup.286.756991699
Finished restore at 20-JUL-11
4.打开数据库
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
5.验证控制文件是否添加成功
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
+DATA01/orcl/controlfile/current.274.743672963
+DATA01/orcl/controlfile/backup.285.756991697
+DATA01/orcl/controlfile/backup.286.756991699;
6.修改spfile中的新添加的控制文件参数
SQL> alter system set
control_files='+DATA01/orcl/controlfile/current.274.743672963','+DATA01/orcl/controlfile/backup.285.756991697','+DATA01/orcl/controlfile/backup.286.756991699'
scope=spfile sid='*';
System altered.
7.使用新的spfile启动数据库
SQL> shutdown immediate
SQL> startup
1.查看当前数据库的控制文件
SQL> select name from v$controlfile;
NAME
------------------------------------------------
+DATA01/orcl/controlfile/current.274.743672963
2.修改spfile中的控制文件参数
SQL> alter system set control_files='+DATA01/orcl/controlfile/current.274.743672963','+DATA01','+DATA01' scope=spfile sid='*';
System altered.
3.将数据库实例启动到nomount状态
SQL> shutdown immediate
[oracle@node1 ~]$ rman target /
Recovery Manager: Release 10.2.0.1.0 - Production on Wed Jul 20 11:27:44 2011
Copyright (c) 1982, 2005, Oracle. All rights reserved.
connected to target database (not started)
RMAN> startup nomount
Oracle instance started
Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 88082676 bytes
Database Buffers 75497472 bytes
Redo Buffers 2973696 bytes
RMAN> restore controlfile from '+DATA01/orcl/controlfile/current.274.743672963';
Starting restore at 20-JUL-11
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=147 instance=orcl1 devtype=DISK
channel ORA_DISK_1: copied control file copy
output filename=+DATA01/orcl/controlfile/current.274.743672963
output filename=+DATA01/orcl/controlfile/backup.285.756991697
output filename=+DATA01/orcl/controlfile/backup.286.756991699
Finished restore at 20-JUL-11
4.打开数据库
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
5.验证控制文件是否添加成功
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
+DATA01/orcl/controlfile/current.274.743672963
+DATA01/orcl/controlfile/backup.285.756991697
+DATA01/orcl/controlfile/backup.286.756991699;
6.修改spfile中的新添加的控制文件参数
SQL> alter system set
control_files='+DATA01/orcl/controlfile/current.274.743672963','+DATA01/orcl/controlfile/backup.285.756991697','+DATA01/orcl/controlfile/backup.286.756991699'
scope=spfile sid='*';
System altered.
7.使用新的spfile启动数据库
SQL> shutdown immediate
SQL> startup
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26478664/viewspace-712013/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/26478664/viewspace-712013/