oracle9204(9i)_dg(data guard)_重命名主库数据文件_指南_转摘官档

Posted tomas20

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了oracle9204(9i)_dg(data guard)_重命名主库数据文件_指南_转摘官档相关的知识,希望对你有一定的参考价值。

原创 Linux操作系统 作者:wisdomone1 时间:2010-02-28 13:27:24 2690 0

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. If you do not want the standby database to have the same physical structure as the primary database, then these steps are not required.

  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 tbs_4.dbf tbs_x.dbf
  3. Rename the datafile in the primary database and bring the tablespace back online:
    SQL> ALTER TABLESPACE tbs_4 RENAME DATAFILE ‘tbs_4.dbf‘ 
    2> TO ‘tbs_x.dbf‘;
    SQL> ALTER TABLESPACE tbs_4 ONLINE;
  4. Connect to the standby database and make sure that all the logs are applied; then stop managed recovery operations:
    SQL> SELECT NAME, SEQUENCE#, ARCHIVED, APPLIED 
    2> FROM V$ARCHIVED_LOG;
    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 tbs_4.dbf tbs_x.dbf
  7. Start and mount the standby database with the new control file:
    SQL> STARTUP NOMOUNT;
    SQL> ALTER DATABASE MOUNT STANDBY DATABASE;
  8. Rename the datafile in the standby controlfile. Note that the STANDBY_FILE_MANAGEMENT initialization parameter must be set to MANUAL.
    SQL> ALTER DATABASE RENAME FILE ‘tbs_4.dbf‘ 
    2> TO ‘tbs_x.dbf‘;
  9. On the standby database, restart managed recovery operations:
    SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
    2> DISCONNECT FROM SESSION;

If you do not rename the corresponding datafile at the standby site, 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 data file 4 - see DBWR trace file
ORA-01110: data file 4: ‘/disk1/oracle/dbs/tbs_x.dbf‘

以上是关于oracle9204(9i)_dg(data guard)_重命名主库数据文件_指南_转摘官档的主要内容,如果未能解决你的问题,请参考以下文章

Oracle Data Guard系列:单机环境基于拷贝文件方式搭建DG

win7 64位的 如何安装 oracle 9i

red hat linux 9下如何安装oracle9

suse 11 怎么安装nginx 求详细步骤

从Oracle9i RMAN全库备份迁移到 Oracle10g

oracle11gRAC+DG主库增加数据文件