Oracle 11gR2 Active Data Guard调整案例[1](2)


        执行上面的步骤后数据库存在两个问题,由于在主库为SYSTEM表空间添加的数据文件RAC其他实例无法访问导致实例无法正常的工作。在备用库上,由于/u01文件系统空间较小,所以必须将system02.dbf移动到其他目录下。下面讨论这两个问题的处理过程。
 
主库操作:
1).停止RAC所有的数据库实例。
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
 
2).将system02.dbf数据文件拷贝到ASM磁盘组中。
[root@rhel1 bin]# su - grid
[grid@rhel1 ~]$ asmcmd -p
 
ASMCMD [+] > cp /u01/app/oracle/product/11.2.0/db_1/dbs/system02.dbf +DBFILE1/ractest/datafile/
copying /u01/app/oracle/product/11.2.0/db_1/dbs/system02.dbf -> +DBFILE1/ractest/datafile/system02.dbf
ASMCMD [+] > cd +DBFILE1/ractest/datafile/
ASMCMD [+DBFILE1/ractest/datafile] > ls
LIUBINGLIN.268.805074155
LIUBINGLIN.276.786500233
SOE.274.686330585
SYSAUX.257.754173057
SYSTEM.256.754173057
UNDOTBS1.258.754173059
UNDOTBS2.264.754173315
USERS.259.754173059
XIAOYANG.275.786499073
system02.dbf
 
3).重命名system02.dbf的位置。
ASMCMD [+DBFILE1/ractest/datafile] > exit
[grid@rhel1 ~]$ exit
logout
[root@rhel1 bin]# su - oracle
[oracle@rhel1 ~]$ sql
 
SQL*Plus: Release 11.2.0.2.0 Production on Thu May 2 09:18:12 2013
 
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
 
Connected to an idle instance.
 
SQL> startup mount 
ORACLE instance started.
 
Total System Global Area  784998400 bytes
Fixed Size                  2230600 bytes
Variable Size            486540984 bytes
Database Buffers          289406976 bytes
Redo Buffers                6819840 bytes
Database mounted.
SQL> select name from v$datafile;
 
NAME
--------------------------------------------------------------------------------
+DBFILE1/ractest/datafile/system.256.754173057
+DBFILE1/ractest/datafile/sysaux.257.754173057
+DBFILE1/ractest/datafile/undotbs1.258.754173059
+DBFILE1/ractest/datafile/users.259.754173059
+DBFILE1/ractest/datafile/undotbs2.264.754173315
+DBFILE1/ractest/datafile/soe.274.686330585
+DBFILE1/ractest/datafile/liubinglin.276.786500233
+DBFILE1/ractest/datafile/liubinglin.268.805074155
/u01/app/oracle/product/11.2.0/db_1/dbs/system02.dbf
 
9 rows selected.
 
SQL> alter database rename file '/u01/app/oracle/product/11.2.0/db_1/dbs/system02.dbf' to '+DBFILE1/ractest/datafile/system02.dbf';
 
Database altered.
 
SQL> alter database open;
 
Database altered.
 
SQL> select file_name from dba_data_files;
 
FILE_NAME
--------------------------------------------------------------------------------
+DBFILE1/ractest/datafile/users.259.754173059
+DBFILE1/ractest/datafile/undotbs1.258.754173059
+DBFILE1/ractest/datafile/sysaux.257.754173057
+DBFILE1/ractest/datafile/system.256.754173057
+DBFILE1/ractest/datafile/undotbs2.264.754173315
+DBFILE1/ractest/datafile/soe.274.686330585
+DBFILE1/ractest/datafile/liubinglin.276.786500233
+DBFILE1/ractest/datafile/liubinglin.268.805074155
+DBFILE1/ractest/datafile/system02.dbf
 
9 rows selected.
 
完成之后,将RAC其他实例启动起来。
 
备用库操作:
1).停止备库数据库实例。
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
 
2).移动数据文件位置。
[oracle@RedHat5 ~]$ mv /u01/app/oracle/product/11.2.0/db_1/dbs/system02.dbf /u01/app/oracle/oradata/system02.dbf
 
3).重命名system02.dbf位置。
[oracle@redhat5 ~]$ sqlplus / as sysdba
 
SQL*Plus: Release 11.2.0.2.0 Production on Thu May 2 01:28:22 2013
 
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
 
Connected to an idle instance.
 
SQL> startup mount
ORACLE instance started.
 
Total System Global Area  313159680 bytes
Fixed Size                  2226072 bytes
Variable Size            251660392 bytes
Database Buffers          54525952 bytes
Redo Buffers                4747264 bytes
Database mounted.
SQL> select name from v$datafile;
 
NAME
--------------------------------------------------------------------------------
/u01/app/oracle/oradata/ractestsystem.256.754173057
/u01/app/oracle/oradata/ractestsysaux.257.754173057
/u01/app/oracle/oradata/ractestundotbs1.258.754173059
/u01/app/oracle/oradata/ractestusers.259.754173059
/u01/app/oracle/oradata/ractestundotbs2.264.754173315
/u01/app/oracle/oradata/ractestsoe.274.686330585
/u01/app/oracle/oradata/ractestliubinglin.276.786500233
/u01/app/oracle/oradata/ractestliubinglin.268.805074155
/u01/app/oracle/product/11.2.0/db_1/dbs/system02.dbf
 
9 rows selected.
 
SQL> alter database rename file '/u01/app/oracle/product/11.2.0/db_1/dbs/system02.dbf' to '/u01/app/oracle/oradata/system02.dbf';
alter database rename file '/u01/app/oracle/product/11.2.0/db_1/dbs/system02.dbf' to '/u01/app/oracle/oradata/system02.dbf'
*
ERROR at line 1:
ORA-01511: error in renaming log/data files
ORA-01275: Operation RENAME is not allowed if standby file management is
automatic.
        上面提示很明确,在standby_file_management等于AUTO的情况下无法执行该操作。
 
SQL> show parameter standby
 
NAME                                TYPE        VALUE
------------------------------------ ----------- ------------------------------
standby_archive_dest                string      ?/dbs/arch
standby_file_management              string      AUTO
 
修改standby_file_management=manual:
SQL> alter system set standby_file_management=manual;
 
System altered.
 
SQL> alter database rename file '/u01/app/oracle/product/11.2.0/db_1/dbs/system02.dbf' to '/u01/app/oracle/oradata/system02.dbf';
 
Database altered.
 
重命名成功。
 
SQL> alter database open;
 
Database altered.
 
SQL> alter database recover managed standby database using current logfile disconnect;
 
Database altered.
 
恢复standby_file_management的值:
SQL> alter system set standby_file_management=auto;
 
System altered.
 
主库操作:
执行下面的步骤验证日志传输服务是否恢复正常。
SQL> alter system switch logfile;
 
System altered.
 
切换RAC所有实例的logfile。
 
SQL> select dest_id,thread#,max(sequence#) from v$archived_log where resetlogs_change#=5069294 group by dest_id,thread#
 
  DEST_ID    THREAD# MAX(SEQUENCE#)
---------- ---------- --------------
        2          1            17
        1          2            11
        1          1            19
        2          2              9
 
等待数秒后,
SQL> select dest_id,thread#,max(sequence#) from v$archived_log where resetlogs_change#=5069294 group by dest_id,thread#;
 
  DEST_ID    THREAD# MAX(SEQUENCE#)
---------- ---------- --------------
        2          1            20
        1          2            12
        1          1            20
        2          2            12
 
日志传输服务恢复正常。

--end--

基于同一主机配置 Oracle 11g Data Guard

探索Oracle之11g DataGuard

Oracle Data Guard (RAC+DG) 归档删除策略及脚本

Oracle Data Guard 的角色转换

Oracle Data Guard的日志FAL gap问题

Oracle 11g Data Guard Error 16143 Heartbeat failed to connect to standby 处理方法

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/185356b58f85bb40f53f4812cb8aac28.html