8.3.4 Renaming a Datafile in the Primary Database
8.3.4 在主庫中重命令數(shù)據(jù)文件(即手動在備庫修改相等的變化)
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.
當(dāng)你在主庫中重命名一個或多個數(shù)據(jù)文件時,備庫是不會發(fā)生相應(yīng)的變化的。因此,如果你想在備庫重命名相同的數(shù)據(jù)文件,你必須手動在備庫中做相等的修改。因為這些改變不是自動的,甚至STANDBY_FILE_MANAGEMENT設(shè)置為AUTO也不會發(fā)生改變的。
The following
按照以下描述來在主庫重命名數(shù)據(jù)文件,而手動將這些改變傳播到備庫中去。
To rename the datafile in the primary database, take the tablespace offline:
1.在主庫中重命名數(shù)據(jù)文件,先將表空間脫機:
SQL> ALTER TABLESPACE tbs_4 OFFLINE;
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:
退出SQL提示符,使用操作系統(tǒng)命令,像unix的mv命令,在主庫操作系統(tǒng)上重命名數(shù)據(jù)文件:
% 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:
在主庫上發(fā)出以下命令來重命名數(shù)據(jù)文件,然后將表空間聯(lián)機:
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;
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:
連接備庫,查詢V$ARCHIVED_LOG 視圖來驗證所有的歸檔日志已經(jīng)應(yīng)用,然后停止重做應(yīng)用:
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.關(guān)閉備庫
SQL> SHUTDOWN;
Rename the datafile at the standby site using an operating system command, such as the UNIX mv command:
6.在備庫的操作環(huán)境使用操作系統(tǒng)命令,如UNIX的mv命令,來重命名數(shù)據(jù)文件:
% 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 the STANDBY_FILE_MANAGEMENT initialization parameter must be set to MANUAL.
新聞熱點
疑難解答
圖片精選