1. 准备工作
1.1. 查看当前控制文件数量及位置、名称
1) 方法一:
[oracle@node2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Oct 27 07:53:57 2016
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SYS@PROD1>show parameter control_files
NAME TYPE VALUE
------------------------------------ -----------
control_files string +DATA/prod/controlfile/current
.256.926241707, +FRA/prod/cont rolfile/current.256.926241707
2)方法二:
[grid@node2 ~]$ asmcmd
ASMCMD>
ASMCMD> cd data/prod/controlfile
ASMCMD> ls
Current.256.926241707
1.2. 关闭数据库并将一个节点启动到 nomount
[grid@node2 ~]$ srvctl stop database -d prod -o immediate;
[grid@node2 ~]$
[oracle@node2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Oct 27 08:09:57 2016
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SYS@PROD1>startup nomount;
ORACLE instance started.
Total System Global Area 849530880 bytes
Fixed Size 1339824 bytes
Variable Size 562040400 bytes
Database Buffers 281018368 bytes
Redo Buffers 5132288 bytes
SYS@PROD1>
1.3. 备份参数文件( 可选)
在做参数调整的时候,最好备份一下参数文件,如果出现问题便于回退。在其中一个节点做备份即可。
[oracle@node2 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Oct 27 08:13:51 2016
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to an idle instance.
SYS@PROD1>create pfile='/home/oracle/initPROD1.ora' from spfile;
File created.
2. 创建控制文件
2.1. 利用 RMAN 完成创建
在一个节点完成操作即可。 另:控制文件的名称要以实验环境实际的名称为准
[oracle@node2 dbs]$ rman target /
Recovery Manager: Release 11.2.0.1.0 - Production on Thu Oct 27 08:16:33 2016
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
connected to target database: PROD (not mounted)
RMAN> restore controlfile to '+DATA' from '+DATA/PROD/controlfile/current.256.926241707';
Starting restore at 27-OCT-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=33 instance=PROD1 device type=DISK
channel ORA_DISK_1: copied control file copy
Finished restore at 27-OCT-16
2.2. 确认已生成的控制文件
[grid@node2 ~]$ asmcmd
ASMCMD> cd data/prod/controlfile
ASMCMD> pwd
+data/prod/controlfile
ASMCMD> ls
Current.256.926241707
current.268.926324431
ASMCMD>
3. 修改参数文件
3.1. 修改参数文件, 使其新增控制文件生效
此时 1 节点应该在 nomout 状态下, 在此节点完成修改即可。
[oracle@node2 dbs]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Oct 27 08:29:33 2016
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SYS@PROD1>select inst_id,host_name,status from gv$instance;
INST_ID HOST_NAME STATUS
-----------------------------------------------------------------------
1 node2 STARTED
SYS@PROD1> alter system set control_files='+DATA/prod/controlfile/current.256.926241707','+FRA/prod/controlfile/current.256.926241707','+DATA/prod/controlfile/current.268.926324431' scope=spfile;
System altered.
SYS@PROD1>shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@PROD1>
3.2. 启动数据库
[oracle@node2 ~]$ srvctl start database -d prod
[oracle@node2 ~]$
3.3. 验证
一节点:
[oracle@node2 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Oct 27 09:50:19 2016
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SYS@PROD1>show parameter control_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string +DATA/prod/controlfile/current
.256.926241707, +FRA/prod/cont
rolfile/current.256.926241707,
+DATA/prod/controlfile/curren
t.268.926324431
SYS@PROD1>
二节点:
[oracle@node1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.1.0 Production on Thu Oct 27 09:51:16 2016
Copyright (c) 1982, 2009, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SYS@PROD2>show parameter control_files
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
control_files string +DATA/prod/controlfile/current
.256.926241707, +FRA/prod/cont
rolfile/current.256.926241707,
+DATA/prod/controlfile/curren
t.268.926324431
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31397003/viewspace-2128192/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/31397003/viewspace-2128192/