ORACLE11gR2RAC添加控制⽂件
版本
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release11.2.0.4.0 - 64bit Production
PL/SQL Release11.2.0.4.0 - Production
CORE    11.2.0.4.0  Production
TNS for Linux: Version 11.2.0.4.0 - Production
NLSRTL Version 11.2.0.4.0 - Production
SQL> show parameter cluster;
NAME                    TYPE    VALUE
------------------------------------ ----------- ------------------------------
cluster_database            boolean    TRUE
cluster_database_instances      integer    2
cluster_interconnects            string
11.2.0.4部署在centos6.5的2节点oracle rac。默认情况下,数据库仅有⼀组control file⽂件,需要添加⼀组,保证⼀组⽂件损坏或者丢失导致数据库宕机。
SQL> show parameter control;
NAME                    TYPE    VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer    30
control_files                string  +CRS/orcl/controlfile/current.
260.931276463
control_management_pack_access      string  DIAGNOSTIC+TUNING
操作
1、关闭两个节点
[grid@db-foc-node01 oracle]$ srvctl stop database -d orcl
2、在其中⼀个节点上启动rman
[oracle@db-foc-node01 ~]$ rman target /
Recovery Manager: Release11.2.0.4.0 - Production on Tue Dec 2716:59:102016
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database (not started)
3、将数据库启动到nomount状态下
RMAN> startup nomount;
Oracle instance started
Total System Global Area    4275781632 bytes
Fixed Size                    2260088 bytes
Variable Size                989856648 bytes
Database Buffers            3271557120 bytes
Redo Buffers                  12107776 bytes
4、采⽤restore拷贝⼀份controlfile到新路径
RMAN> restore controlfile to'+DATA/ORCL/CONTROLFILE/Current.261.931276464'from'+CRS/ORCL/CONTROLFILE/Current.260.931276463';
Starting restore at 27-DEC-16
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=50 instance=orcl1 device type=DISK
channel ORA_DISK_1: copied control file copy
Finished restore at 27-DEC-16
注:’+DATA/ORCL/CONTROLFILE/Current.261.931276464’是拷贝的新的控制⽂件,如果asm⾃动管理的,可能名字不会按照你的命名,需要确定下新的⽂件名字。
ASMCMD> pwd
+DATA/ORCL/CONTROLFILE
ASMCMD> ls
current.299.931771447
果然不⼀样。
5、修改spfile⽂件
SQL> show parameter spfile;
NAME TYPE VALUE
-----------------------------------------------------------------------------
spfile string+CRS/a
SQL> shutdown immediate;
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> create pfile='/a'from spfile='+CRS/a';
File created.
vi /a
linux系统安装oracle11g--修改
*.control_files='+CRS/orcl/controlfile/current.260.931276463','+DATA/ORCL/CONTROLFILE/current.299.931771447'
SQL> create spfile='+CRS/a'from pfile='/a';
File created.
6、启动数据库
[grid@db-foc-node01 oracle]$ srvctl start database -d orcl
7、验证
SQL> show parameter control;
NAME                    TYPE    VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer    30
control_files                string  +CRS/orcl/controlfile/current.
260.931276463, +DATA/orcl/cont
rolfile/current.299.931771447
control_management_pack_access      string  DIAGNOSTIC+TUNING

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。