APPLIES TO:

Oracle Database - Enterprise Edition - Version 10.2.0.1 to 10.2.0.4 [Release 10.2]
Oracle Database - Enterprise Edition - Version 10.2.0.5 to 10.2.0.5 [Release 10.2]
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Information in this document applies to any platform.
Oracle Server Enterprise Edition - Version: 10.2.0.1 to 10.2.0.4
***Checked for relevance on 31-MAY-2013***

GOAL

This note is applicable when the customers do not want to touch the primary for transportable tablespace and they want to move the tablespace from standby to some other database. It is recommended to do when there is a less activity on primary.

当客户不想在主数据库上执行传输表空间,并且客户希望将表空间从备用数据库移动到其他数据库时,本文适用。建议在主数据库上的活动较少时执行此操作。

SOLUTION

NOTE: In the images and/or the document content below, the user information and environment data used represents fictitious data from the Oracle sample schema(s), Public Documentation delivered with an Oracle database product or other training material. Any similarity to actual environments, actual persons, living or dead, is purely coincidental and not intended in any manner.

1. Check if the standby is in SYNC with primary 检查备用数据库是否与主数据库同步

SQL> select ads.dest_id,max(sequence#) "Current Sequence",max(log_sequence) "Last Archived" from v$archived_log al, v$archive_dest ad, v$archive_dest_status ads where ad.dest_id=al.dest_id and al.dest_id=ads.dest_id group by ads.dest_id;

DEST_ID Current Sequence Last Archived
---------- ---------------- -------------
1 31 31
2 31 32 at standby, SQL> select max(al.sequence#) "Last Seq Recieved", max(lh.sequence#) "Last Seq Applied" from v$archived_log al, v$log_history lh; Last Seq Recieved Last Seq Applied
----------------- ----------------
31 31

2. Check the value of db_recovery_file_dest_size and alter it based on the transactions on standby after opening the standby database in read_write mode,
   在以read_write模式打开备用数据库后,检查db_recovery_file_dest_size的值并根据备用数据库上的事务进行更改

SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=20G;

System altered.

SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='/u02/<db_recovery_file_dest>';

System altered.

3. Cancel the MRP (Managed recover process)  取消MRP(恢复管理进程)

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

Database altered.

4. Create guaranteed restore points(GRP) on standby   在备用数据库上创建保证的还原点(GRP)

SQL> CREATE RESTORE POINT before_application_patch GUARANTEE FLASHBACK DATABASE;

Restore point created.

5. On primary defer the log_archive_dest_2, which is sending logs to standby

在主数据库上,将 log_archive_dest_2(将日志发送到备用数据库)设置defer

SQL> ALTER SYSTEM ARCHIVE LOG CURRENT;

System altered.

SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=DEFER;

System altered.

6. Activate and open the standby database  激活并打开备用数据库

SQL> ALTER DATABASE ACTIVATE STANDBY DATABASE;

Database altered.

SQL> STARTUP MOUNT FORCE;
ORACLE instance started. Total System Global Area 612368384 bytes
Fixed Size 1220844 bytes
Variable Size 167776020 bytes
Database Buffers 436207616 bytes
Redo Buffers 7163904 bytes
Database mounted.
NOTE: Check the protection mode if it is MAX_AVAILABILITY AND MAX_PROTECTION then downgrade it to MAX_PERFORMANCE BY

注意:检查保护模式是否为 MAX_AVAILABILITY 和 MAX_PROTECTION,然后将其降级为 MAX_PERFORMANCE BY

SQL> ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE;

Database altered.

SQL> ALTER DATABASE OPEN;

Database altered.

7. Place the tablespace in read only mode   将表空间置于只读模式

SQL> alter tablespace stdby read only;

Tablespace altered.

8. Do the Metadata export 执行元数据导出

$ exp userid=\'/ as sysdba\' transport_tablespace=y tablespaces=stdby file=tts.dmp log=exp_tts.log statistics=none

Export: Release - Production on Fri Mar 6 18:14:39 2009

Copyright (c) 1982, 2005, Oracle. All rights reserved.

Connected to: Oracle Database 10g Enterprise Edition Release - Production
With the Partitioning, OLAP and Data Mining options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
Note: table data (rows) will not be exported
About to export transportable tablespace metadata...
For tablespace STDBY ...
. exporting cluster definitions
. exporting table definitions
. exporting referential integrity constraints
. exporting triggers
. end transportable tablespace metadata export
Export terminated successfully without warnings.
[oracle@core1 db_recovery_file_dest]$ cat exp_tts.log Connected to: Oracle Database 10g Enterprise Edition Release
- Production
With the Partitioning, OLAP and Data Mining options
Export done in US7ASCII character set and AL16UTF16 NCHAR character set
Note: table data (rows) will not be exported
About to export transportable tablespace metadata...
For tablespace STDBY ...
. exporting cluster definitions
. exporting table definitions
. exporting referential integrity constraints
. exporting triggers
. end transportable tablespace metadata export
Export terminated successfully without warnings.
NOTE: For remaining steps about transportable tablespaces refer,
注意:有关可移动表空间的其余步骤,请参见
Article-ID : Note 243304.1
Title: 10g : Transportable Tablespaces Across Different Platforms

9. Place the standby database in mount mode again  再次将备用数据库置于mount模式

SQL> STARTUP MOUNT FORCE;
ORACLE instance started. Total System Global Area 612368384 bytes
Fixed Size 1250428 bytes
Variable Size 247466884 bytes
Database Buffers 356515840 bytes
Redo Buffers 7135232 bytes
Database mounted.

10. Flashback to GRP and again shutdown and startup the standby database  闪回GRP,然后再次关闭并启动备用数据库

SQL> FLASHBACK DATABASE TO RESTORE POINT <RESTORE_POINT_NAME>;
Flashback completed. SQL> ALTER DATABASE CONVERT TO PHYSICAL STANDBY; Database altered. SQL> STARTUP MOUNT FORCE;
ORACLE instance started. Total System Global Area 612368384 bytes
Fixed Size 1250428 bytes
Variable Size 247466884 bytes
Database Buffers 356515840 bytes
Redo Buffers 7135232 bytes
Database mounted.

11. Start the MRP again  再次启动MRP

SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT;

Database altered.
NOTE: If the transactions on primary is more i.e standby is lagging with more logs then we have to, take an incremental backup on the primary and apply it to the standby.
注意:如果主数据库上的事务较多,即备用数据库滞后于更多日志,那么我们必须在主数据库上进行增量备份并将其应用于备用数据库。

12. Enable the log_archive_dest_2 on primary  在主数据库上启用log_archive_dest_2

SQL>ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE;

System altered.
NOTE: Check the standby SYNC by using queries mentioned in first step 1.

注意:通过使用第一步中提到的查询来检查备用SYNC。

NOTE :  truncate (or drop) sys.transport_set_violations and run dbms_tts.transport_set_check from the standby once the logical standby is opened read/write. This is because if they have run this check on the primary, it was propagated to the standby. If they have not cleared this on the standby, and run the check there, it will cause these errors when they try to do the export. Please include the errors when implementing the comment.

注意:一旦逻辑备用数据库以读写方式打开,则截断(或删除)sys.transport_set_violations并从备用数据库运行dbms_tts.transport_set_check。这是因为如果他们在主数据库上运行了此检查,则该检查将传播到备用数据库。如果他们没有在备用数据库上清除此错误,并在那里进行检查,则当他们尝试执行导出操作时,将导致这些错误。实施评论时,请包含错误。

ORA-39123: Data Pump transportable tablespace job aborted
ORA-01001: invalid cursor
ORA-06512: at "SYS.DBMS_SYS_SQL", line 902
ORA-06512: at "SYS.DBMS_SQL", line 19
ORA-06512: at "SYS.DBMS_TTS", line 838
ORA-00955: name is already used by an existing object

Reference is 3-10275730211 for which this was the solution.

参考是3-10275730211,这是解决方案。

Transportable tablespace on standby (Doc ID 788176.1)的更多相关文章

  1. 如何为 Automatic Undo Management 调整 UNDO Tablespace 的大小 (Doc ID 262066.1)

    How To Size UNDO Tablespace For Automatic Undo Management (Doc ID 262066.1) APPLIES TO: Oracle Datab ...

  2. Master Note for Transportable Tablespaces (TTS) -- Common Questions and Issues (Doc ID 1166564.1)

    APPLIES TO: Oracle Database Cloud Exadata Service - Version N/A and laterOracle Database Cloud Servi ...

  3. Troubleshooting ORA-30036 - Unable To Extend Undo Tablespace (Doc ID 460481.1)

    Troubleshooting ORA-30036 - Unable To Extend Undo Tablespace (Doc ID 460481.1) APPLIES TO: Oracle Da ...

  4. 如何通过RMAN使用传输表空间迁移到不同的Endian平台 (Doc ID 371556.1)

    How to Migrate to different Endian Platform Using Transportable Tablespaces With RMAN (Doc ID 371556 ...

  5. 使用 TSPITR 恢复删除的表空间的步骤 (Doc ID 1277795.1)

    Steps To Recover A Dropped Tablespace Using TSPITR (Doc ID 1277795.1) APPLIES TO: Oracle Database - ...

  6. V4 Reduce Transportable Tablespace Downtime using Cross Platform Incremental Backup (Doc ID 2471245.1)

    V4 Reduce Transportable Tablespace Downtime using Cross Platform Incremental Backup (Doc ID 2471245. ...

  7. 18c & 19c Physical Standby Switchover Best Practices using SQL*Plus (Doc ID 2485237.1)

    18c & 19c Physical Standby Switchover Best Practices using SQL*Plus (Doc ID 2485237.1) APPLIES T ...

  8. 11.2 Data Guard Physical Standby Switchover Best Practices using SQL*Plus (Doc ID 1304939.1)

    11.2 Data Guard Physical Standby Switchover Best Practices using SQL*Plus (Doc ID 1304939.1) APPLIES ...

  9. How to Create Transportable Tablespaces Where the Source and Destination are ASM-Based (Doc ID 394798.1)

    How to Create Transportable Tablespaces Where the Source and Destination are ASM-Based (Doc ID 39479 ...

随机推荐

  1. [小技巧]你真的了解C#中的Math.Round么?

    今天在某.NET Core 群中看到有人在问Math.Round的问题.其实这个问题之前有很多人遇到了,在此总结一下. 开发者为了实现小数点后 2 位的四舍五入,编写了如下代码, var num = ...

  2. flyway 非常坑爹的中文乱码问题

    flyway 也真是够了, 动不动乱码,烦死了! 我的 命令是这样的: flyway  -driver=com.mysql.jdbc.Driver -user=root -password=12345 ...

  3. weed3-2.1.开始纯java使用

    Weed3 一个微型ORM框架(只有0.1Mb哦) 源码:https://github.com/noear/weed3 源码:https://gitee.com/noear/weed3 纯java使用 ...

  4. Spring基础——AOP通知

    spring(AOP通知) 切面 切面是封装通用业务逻辑的组件,可以作用到其他组件上.是spring组件中的某个方法.无返回类型.参数类型与通知类型有关.一个切面 开启数据库 关闭数据库 开启事务 检 ...

  5. Laravel实现大型商城网站之用户注册短信发送项目实战功能开发

    确定短信运营商 我这里采用的云片,不过大家使用其它的也可以. 首先自己注册一个帐号,然后找到这个 点击开始接入,完成新手引导过程. 第二部的签名和模板必须填写,类似我下面填写的这样 值得注意的是这个模 ...

  6. 构建Electron的常见问题(Mac)

    背景 起因是产品的需求,需要更换Electron为底层平台,但因为会有不少定制化的功能要实现,必须自己实现此类内容,所以也就导致必须自己编译Electron的源代码. 整个构建过程,看Electron ...

  7. CSS入门(定位的简单总结)

    一.定位 普通流定位 浮动定位 相对定位 绝对定位 固定定位 二.position定位 1.static(默认值) 2.relative 相对定位 3.absolute 绝对定位 4.fixed 固定 ...

  8. EXCEPTION_ACCESS_VIOLATION(0xc0000005)

    EXCEPTION_ACCESS_VIOLATION(0xc0000005)eclipse.ini中添加:-XX:CompileCommand=exclude,org.eclipse.jdt.inte ...

  9. linux 执行 javac 报错 javac: command not found

    bash: javac: command not found java 版本 1.8 [root@localhost home]# java -version openjdk version &quo ...

  10. linux中的交换分区(swap)及优化

    SWAP(交换内存) 1.什么是交换内存? 在硬盘上创建一块区域,当你的物理内存快要被用光的时候,内核临时的 物理内存上的文件数据交换到硬盘上的这段区域上面,当物理内存有闲置的时候 在把交换内存上的数 ...