Renaming a Datafile in the Primary Database
Renaming a Datafile in the Primary Database
When you rename one or more datafiles in the primary database, the change is not
propagated to the standby database. Therefore, if you want to rename the same
datafiles on the standby database, you must manually make the equivalent
modifications on the standby database because the modifications are not performed
automatically, even if the STANDBY_FILE_MANAGEMENT initialization parameter is set
to AUTO.
The following steps describe how to rename a datafile in the primary database and
manually propagate the changes to the standby database.
1. To rename the datafile in the primary database, take the tablespace offline:
SQL> ALTER TABLESPACE tbs_4 OFFLINE;
2. Exit from the SQL prompt and issue an operating system command, such as the
following UNIX mv command, to rename the datafile on the primary system:
% mv /disk1/oracle/oradata/payroll/tbs_4.dbf
/disk1/oracle/oradata/payroll/tbs_x.dbf
3. Rename the datafile in the primary database and bring the tablespace back online:
SQL> ALTER TABLESPACE tbs_4 RENAME DATAFILE
2> '/disk1/oracle/oradata/payroll/tbs_4.dbf'
3> TO '/disk1/oracle/oradata/payroll/tbs_x.dbf';
SQL> ALTER TABLESPACE tbs_4 ONLINE;
4. Connect to the standby database, query the V$ARCHIVED_LOG view to verify all
of the archived redo log files are applied, and then stop Redo Apply:
SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
SEQUENCE# APP
Primary Database Changes That Require Manual Intervention at a Physical Standby
Managing Physical and Snapshot Standby Databases 9-9
--------- ---
8 YES
9 YES
10 YES
11 YES
4 rows selected.
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
5. Shut down the standby database:
SQL> SHUTDOWN;
6. Rename the datafile at the standby site using an operating system command, such
as the UNIX mv command:
% mv /disk1/oracle/oradata/payroll/tbs_4.dbf /disk1/oracle/oradata/payroll/tbs_
x.dbf
7. Start and mount the standby database:
SQL> STARTUP MOUNT;
8. Rename the datafile in the standby control file. Note that the STANDBY_FILE_
MANAGEMENT initialization parameter must be set to MANUAL.
SQL>alter system set STANDBY_FILE_MANAGEMENT =manual;
SQL> ALTER DATABASE RENAME FILE '/disk1/oracle/oradata/payroll/tbs_4.dbf'
2> TO '/disk1/oracle/oradata/payroll/tbs_x.dbf';
9. On the standby database, restart Redo Apply:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
2> DISCONNECT;
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 4 - see DBWR trace file
ORA-01110: datafile 4: '/Disk1/oracle/oradata/payroll/tbs_x.dbf'
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-413632/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- standby database to primary database.Database
- Create RAC Standby Database for RAC Primary DatabaseDatabase
- alter database create datafileDatabase
- alter database create datafile '' as ''Database
- ALTER DATABASE DATAFILE OFFLINEDatabase
- alter database datafile offline drop 與 alter tablespace drop datafile 區別Database
- alter database datafile offline and alter database tablespace ...offlineDatabase
- alter database ... create datafile的原理及用途Database
- alter database datafile 4 offline drop;Database
- rman restore database(spfile,controlfile, datafile)RESTDatabase
- 恢復一則 alter database create datafile '' as ''Database
- ARCH: Possible network disconnect with primary databaseDatabase
- ORA-600 [krslint.9] in PRIMARY databaseDatabase
- Rename a Datafile in Primary Within in Physical Dataguard Configuration_733796.1
- Alter database datafile resize ORA-03297 原因解析Database
- UNRECOVERABLE DATAFILE clause in the ALTER DATABASE CLEAR LOGFILE statementDatabase
- Case two -- Recover a datafile in primary site from the backup taken in standby site without using c
- “alter database switchover to xx“過程不當導致的primary-primary 雙主問題Database
- alter database datafile .... offline drop的問題Database
- How to release space from database( in other words: resize datafile ) (zt)Database
- How to release space from database( in other words: resize datafile ) 【zt】Database
- Case One -- Recover a datafile in primary site from the backup taken in standby site using catalog d
- Display Storage Map for Database | Tablespace | Datafile Storage_1377458.1Database
- alter database drop datafile 與 drop tablespace file 的區別Database
- alter database datafile offline drop相關問題Database
- 冷備手工完全恢復(recover database,recover tablespace,recover datafile)Database
- Recover a Database Having Added a Datafile Since Last Backup (Doc ID 29430.1)DatabaseAST
- Oracle ASM Renaming Disks GroupsOracleASM
- Renaming the default branch from master to main on GithubASTAIGithub
- rman copy asm datafile(rename asm datafile)ASM
- 【Datafile】Oracle單個datafile大小的限制Oracle
- Oracle datafileOracle
- v$datafile_header 查詢datafile 狀態Header
- sql primary key procedureSQL
- [20111227]Alter database datafile offline drop後的恢復.txtDatabase
- Oracle11g維護分割槽(八)——Renaming PartitionsOracle
- how to remove datafile pathREM
- 收縮datafile for oracle -- 轉Oracle