ORACLE 11g在ASM磁盘组上添加控制文件

ORACLE使用ASM存储,建库时默认只有一个控制文件,如果想多加几个控制文件,需要通过手工来添加,以下是具体步骤:

1.  查看现在的控制文件

[oracle@Oracle-LAB dbs]$sqlplus /nolog

SQL> conn /assystem

SQL> conn /assysdba

SQL> set line 200

SQL> column nameformat a50

SQL> select * from v$controlfile;

STATUS  NAME                                          IS_  BLOCK_SIZE   FILE_SIZE_BLKS

----------  ------------------------------------------------ ---------- ----

               +DATA/orcl/controlfile/current.259.833372337         NO              16384             594

 

2.  修改spfile中的控制文件参数

SQL> alter system setcontrol_files='+DATA/orcl/controlfile/current.259.833372337','+DATA','+FRA'scope=spfile sid='*';

System altered.

 

3.  将数据库实例启动到nomount状态

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLEinstance shut down.

[oracle@Oracle-LAB/]$ rman target/

Recovery Manager:Release 11.2.0.3.0 - Production on Thu Dec 5 11:49:47 2013

Copyright (c)1982, 2011, Oracle and/or its affiliates. All rights reserved.

connected to target database (not started)

RMAN> startup nomount

Oracle instancestarted

Total SystemGlobal Area    1653518336 bytes

Fixed Size                     2228904 bytes

VariableSize                973081944 bytes

DatabaseBuffers             671088640 bytes

Redo Buffers                  7118848 bytes

RMAN> restore controlfile from '+DATA/orcl/controlfile/current.259.833372337';

Starting restore at 05-DEC-13

using target database control fileinstead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=14 devicetype=DISK

 

channel ORA_DISK_1: copied controlfile copy

output filename=+DATA/orcl/controlfile/current.259.833372337

output filename=+DATA/orcl/controlfile/current.261.833376309

output filename=+FRA/orcl/controlfile/current.256.833376309

Finishedrestore at 05-DEC-13

 

4.  打开数据库

RMAN> sql ' alter database mount';

sqlstatement:  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

--------------------------------------------------------------------------------

+DATA/orcl/controlfile/current.259.833372337

+DATA/orcl/controlfile/current.261.833376309

+FRA/orcl/controlfile/current.256.833376309

 

6.  修改spfile中的新添加的控制文件参数

SQL> alter system set control_files='+DATA/orcl/controlfile/current.261.833376309','+DATA/orcl/controlfile/current.259.833372337','+FRA/orcl/controlfile/current.256.833376309' scope=spfile sid='*';

System altered.

 

7.  使用新的spfile启动数据库

SQL> shutdown immediate

SQL> startup

SQL> select name, value fromV$PARAMETER where name like '%control%';

SQL> select * fromv$controlfile;

 

参考文档:metalink文档:How to duplicate a controlfilewhen ASM is involved [ID 345180.1]


阅读更多
个人分类: Oracle
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭