ZT:Data Guard中rename a datafile的步骤小计

简介: http://grassbell.itpub.net/post/26/18902补充一点:改名之前在standby上先执行 ALTER SYSTEM SET standby_file_management='MANUAL' SCOPE=BOTH;。

http://grassbell.itpub.net/post/26/18902

补充一点:

改名之前在standby上先执行 ALTER SYSTEM SET standby_file_management='MANUAL' SCOPE=BOTH;。

需要注意的是:
如果你想让primary 和standby 上的数据文件结构保持一致的话,在primary 上rename a datafile后,即使STANDBY_FILE_MANAGEMENT = auto,也需要在standby上手工执行相同的操作。当然,如果不想保持一致,standby上可以不作任何动作。

-------------------------修改相应的primary数据文件路径-----------------------
1.Offline 表空间:
Alter tablespace tools offline NORMAL;

2.Mv dbfile:
Mv /data4/oradata/crmtemp/tools02.dbf /disk3/oradata/crmtemp/

3.Rename:
Alter tablespace tools
rename datafile '/data4/oradata/crmtemp/tools02.dbf'
To '/disk3/oradata/crmtemp/tools02.dbf';

4.Online:
Alter tablespace tools online;

-------------------------修改相应的standby 数据文件路径-----------------------
1.Recover
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
2> DISCONNECT FROM SESSION;
确定已经所有的log都已经应用了。
(或用脚本sh /home/oracle/admin/recover_stby.sh)
2.Cancel RECOVER:
SQL> SELECT NAME, SEQUENCE#, ARCHIVED, APPLIED
2> FROM V$ARCHIVED_LOG;
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

3.Shutdown
SQL> SHUTDOWN;

4.Mv dbfile:
Mv /data4/oradata/crmtemp/tools02.dbf /disk3/oradata/crmtemp/

5.mount
SQL> STARTUP NOMOUNT;
SQL> ALTER DATABASE MOUNT STANDBY DATABASE;

6.Rename:
ALTER DATABASE RENAME FILE
'/data4/oradata/crmtemp/tools02.dbf'
To '/disk3/oradata/crmtemp/tools02.dbf';

7.Recover:
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
2> DISCONNECT FROM SESSION;
(或用脚本sh /home/oracle/admin/recover_stby.sh)


目录
相关文章
|
SQL Oracle 关系型数据库
asm normal diskgroup ,strong split test
normal disk strong spilte.
1223 0
|
Oracle 关系型数据库 SQL
【MOS】EVENT: DROP_SEGMENTS - cleanup of TEMPORARY segments (文档 ID 47400.1)
【MOS】EVENT: DROP_SEGMENTS - Forcing cleanup of TEMPORARY segments (文档 ID 47400.1) ***Checked for relevance on 14-Jun-2012*** ...
1201 0
|
测试技术 BI 关系型数据库
[20151105]视图DBA_HIST_SEG_STAT_OBJ.txt
[20151105]视图DBA_HIST_SEG_STAT_OBJ.txt --前一阵子看别人的awr报表.链接http://www.itpub.net/thread-1940496-1-1.
1038 0
|
OLTP
[20131125]Partition, compress and drop column (ORA-39726).txt
[20131125]Partition, compress and drop column (ORA-39726).txt http://www.dbaglobe.
1018 0