Rename a Datafile in Primary Within in Physical Dataguard Configuration_733796.1

rongshiyuan發表於2014-12-10

How to Rename a Datafile in Primary Database Within in Physical Dataguard Configuration (Doc ID 733796.1)


In this Document

Goal
Solution

Applies to:

Oracle Database - Enterprise Edition - Version 9.2.0.1 to 11.2.0.2 [Release 9.2 to 11.2]
Information in this document applies to any platform.
***Checked for relevance on 28-Sep-2012***

***Checked for relevance on 5-Aug-2014***


Goal

How to rename a datafile in the primary database and manually propagate the changes to the standby database.

When you rename one or more datafiles in the primary database, the change is not propagated to the standby database, even if the STANDBY_FILE_MANAGEMENT initialization parameter is set to AUTO.

If you do not rename the corresponding datafile at the standby system, and then try to refresh the standby database control file, the standby database will attempt to use the renamed datafile, but it will not find it. Consequently, you will see error messages similar to the following in the alert log:

ORA-00283: recovery session canceled due to errors
ORA-01157: cannot identify/lock datafile 14 - see DBWR trace file
ORA-01110: datafile 14: '/Disk1/oracle/oradata/mum/payroll_01.dbf'

Solution

The following steps describe how to rename a datafile in the primary database and manually propagate the changes to the standby database.

1. Set STANDBY_FILE_MANAGEMENT=MANUAL on both Primary and Standby Database.

SQL>ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=MANUAL;


2. Take the Tablespace offline on the Primary Database:

SQL> ALTER TABLESPACE tbs_4 OFFLINE;


3. Rename Datafile on Primary Site:

% mv /Disk1/oracle/oradata/mum/payroll_1.dbf /Disk1/oracle/oradata/mum/payroll_01.dbf


4. Rename the Datafile in the Primary Database and bring the Tablespace back online:

SQL> ALTER TABLESPACE tbs_4 RENAME DATAFILE '/Disk1/oracle/oradata/mum/payroll_1.dbf' TO '/Disk1/oracle/oradata/mum/payroll_01.dbf';
SQL> ALTER TABLESPACE tbs_4 ONLINE;


5. Stop Redo Apply on Standby Database:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;


6. Shutdown the Standby Database:

SQL> SHUTDOWN;


7. Rename the Datafile at the Standby site :

% mv /Disk1/oracle/oradata/mum/payroll_1.dbf /Disk1/oracle/oradata/mum/payroll_01.dbf


8. Start and mount the Standby Database:

SQL> STARTUP MOUNT;


9. Rename the Datafile in the Standby Database control file.

SQL> ALTER DATABASE RENAME FILE '/Disk1/oracle/oradata/mum/payroll_1.dbf' TO '/Disk1/oracle/oradata/mum/payroll_01.dbf';


Note : STANDBY_FILE_MANAGEMENT initialization parameter must be set to MANUAL.

10. On the Standby Database, restart Redo Apply:

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;


11. Set STANDBY_FILE_MANAGEMENT=AUTO on both Primary and Standby Database.

SQL>ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO;


Please check for more details the Oracle Documentation, eg:


Oracle?? Data Guard Concepts and Administration
11g Release 2 (11.2)
9.3.4 Renaming a Datafile in the Primary Database

For more information about transportable tablespaces, see Oracle Database Administrator's Guide.


 

Document Details

 
Rate this document Email link to this documentOpen document in new windowPrintable Page
Type:
Status:
Last Major Update:
Last Update:
HOWTO
PUBLISHED
Aug 6, 2014
Aug 6, 2014
     
 

Related Products

 
Oracle Database - Enterprise Edition
     
 

Document References

 
No References available for this document.
     
 

Recently Viewed

 
     




來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17252115/viewspace-1363612/,如需轉載,請註明出處,否則將追究法律責任。

相關文章