當你在主庫中重命名一個或多個數據文件時,備庫是不會發生相應的變化的。因此,如果你想在備庫重命名相同的數據文件,你必須手動
8.3.4Renaming a Datafile in the Primary Database
8.3.4 在主庫中重命令數據文件(即手動在備庫修改相等的變化)
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 theSTANDBY_FILE_MANAGEMENTinitialization parameter is set toAUTO.
當你在主庫中重命名一個或多個數據文件時,備庫是不會發生相應的變化的。因此,如果你想在備庫重命名相同的數據文件,你必須手動在備庫中做相等的修改。因為這些改變不是自動的,甚至STANDBY_FILE_MANAGEMENT設置為AUTO也不會發生改變的。
The following steps describe how to rename a datafile in the primary database and manually propagate the changes to the standby database.
按照以下描述來在主庫重命名數據文件,而手動將這些改變傳播到備庫中去。
Torename the datafile in the primary database, take the tablespace offline:
1.在主庫中重命名數據文件,先將表空間脫機:
SQL> ALTER TABLESPACE tbs_4 OFFLINE;
Exit from the SQL prompt and issue an operating system command, such as the following UNIXmvcommand, to rename the datafile on the primary system:
退出SQL提示符,使用操作系統命令,像unix的mv命令,在主庫操作系統上重命名數據文件:
% mv /disk1/Oracle/oradata/payroll/tbs_4.dbf
/disk1/oracle/oradata/payroll/tbs_x.dbf
Rename the datafile in the primary database and bring the tablespace back online:
在主庫上發出以下命令來重命名數據文件,然后將表空間聯機:
SQL> ALTER TABLESPACE tbs_4RENAMEDATAFILE 2> '/disk1/oracle/oradata/payroll/tbs_4.dbf'
3> TO'/disk1/oracle/oradata/payroll/tbs_x.dbf';
SQL> ALTER TABLESPACE tbs_4 ONLINE;
Connect to the standby database, query theV$ARCHIVED_LOGview to verify all of the archived redo log files are applied, and then stop Redo Apply:
連接備庫,,查詢V$ARCHIVED_LOG 視圖來驗證所有的歸檔日志已經應用,然后停止重做應用:
SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
SEQUENCE# APP
--------- ---
8 YES
9 YES
10 YES
11 YES
4 rows selected.
SQL>ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
Shut down the standby database:
5.關閉備庫
SQL> SHUTDOWN;
Rename the datafile at the standby site using an operating system command, such as the UNIXmvcommand:
6.在備庫的操作環境使用操作系統命令,如UNIX的mv命令,來重命名數據文件:
% mv /disk1/oracle/oradata/payroll/tbs_4.dbf /disk1/oracle/oradata/payroll/tbs_x.dbf
Start and mount the standby database:
7.啟動并裝載備庫:
SQL> STARTUP MOUNT;
Rename the datafile in the standby control file. Note that theSTANDBY_FILE_MANAGEMENTinitialization parameter must be set toMANUAL.
在備庫上重命名數據文件到控制文件里,注意: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';
On the standby database, restart Redo Apply:
9.在備庫重新啟動重做應用:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
2> DISCONNECT FROM SESSION;
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'
相關參考:
Oracle Data Guard 重要配置參數
基于同一主機配置 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 處理方法
聲明:本網頁內容旨在傳播知識,若有侵權等問題請及時與本網聯系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com