Oracle XTTS数据迁移

一、环境介绍

由于这里只是简单测试XTTS迁移过程,所以使用了VMWare 创建了两台Redhat 6.10+Oracle 11.2.0.4。

二、实施前环境检查

2.1、检查数据库时区

SQL> select dbtimezone from dual;

DBTIME
------
+00:00

SQL>

检查结果两边都一致

2.2、检查数据库时间

SQL> select to_char(sysdate, 'yyyy-mm-dd hh24:mi:ss') from dual;

TO_CHAR(SYSDATE,'YY
-------------------
2019-04-04 09:26:02

SQL>

检查结果两边都一致

2.3、检查两边字符集

SQL> set linesize 120
SQL> select * from nls_database_parameters where parameter like '%CHARACTERSET%';

PARAMETER		       VALUE
------------------------------ --------------------------------------------------------------------------------
NLS_CHARACTERSET	       ZHS16GBK
NLS_NCHAR_CHARACTERSET	       AL16UTF16

SQL> 

检查结果,两边都一致

2.4、检查目标端补丁情况

SQL> select 'opatch',comments from dba_registry_history;

'OPATC
------
COMMENTS
--------------------------------------------------------------------------------
opatch
Patchset 11.2.0.2.0

opatch
Patchset 11.2.0.2.0


SQL> 

如果使用 DBMS_FILE_TRANSFER方法进行数据传输,目标端建议安装的补丁如下:

Patch 19023822,修复目标端使用 DBMS_FILE_TRANSFER.GET_FILE包获取源端数据文件出现 ORA-03106 的情况。

Patch 22171097: MERGE REQUEST ON TOP OF DATABASE PSU11.2.0.4.6 FOR BUGS 17534365 19023822

 如果准备阶段使用 RMAN 方法,目标端没有小补丁安装需求。

2.5、检查两边组件安装情况

SQL> Select comp_name from dba_registry;

COMP_NAME
--------------------------------------------------------------------------------
OWB
Oracle Application Express
Oracle Enterprise Manager
OLAP Catalog
Spatial
Oracle Multimedia
Oracle XML Database
Oracle Text
Oracle Expression Filter
Oracle Rules Manager
Oracle Workspace Manager

COMP_NAME
--------------------------------------------------------------------------------
Oracle Database Catalog Views
Oracle Database Packages and Types
JServer JAVA Virtual Machine
Oracle XDK
Oracle Database Java Packages
OLAP Analytic Workspace
Oracle OLAP API

18 rows selected.

SQL> 

如果两边安装了不一样的组件,请注意。

2.6、检查是否使用了 Key Compression 的索引组织表

SQL> Select index_name,table_name from dba_indexes where compression='ENABLED';

INDEX_NAME		       TABLE_NAME
------------------------------ ------------------------------
DR_UNIQ_THS_PHRASE	       DR$THS_PHRASE
XDBACL_PATH_TAB_VALUE_IDX      XDBACL_PATH_TAB
SYS70277_XDB$ACL_XI_PIKEY_IX   XDBACL_PATH_TAB
MGMT_DB_INVOBJS_ECM_PK	       MGMT_DB_INVOBJS_ECM
MGMT_DB_RECSEGMENTSETTINGS_PK  MGMT_DB_RECSEGMENTSETTINGS_ECM
MGMT_DB_RECUSERSETTINGS_ECM_PK MGMT_DB_RECUSERSETTINGS_ECM
MGMT_SQL_PLAN_PK	       MGMT_SQL_PLAN
MGMT_SQL_SUMMARY_PK	       MGMT_SQL_SUMMARY
MGMT_DB_DATAFILES_ECM_PK       MGMT_DB_DATAFILES_ECM
MGMT_DB_TABLESPACES_ECM_PK     MGMT_DB_TABLESPACES_ECM
MGMT_DB_SGA_ECM_PK	       MGMT_DB_SGA_ECM

INDEX_NAME		       TABLE_NAME
------------------------------ ------------------------------
MGMT_DB_ROLLBACK_SEGS_ECM_PK   MGMT_DB_ROLLBACK_SEGS_ECM
MGMT_DB_CONTROLFILES_ECM_PK    MGMT_DB_CONTROLFILES_ECM
MGMT_DB_INIT_PARAMS_ECM_PK     MGMT_DB_INIT_PARAMS_ECM
MGMT_FLAT_TARGET_ASSOC_IDX04   MGMT_FLAT_TARGET_ASSOC
MGMT_FLAT_TARGET_ASSOC_IDX01   MGMT_FLAT_TARGET_ASSOC
MGMT_PURGE_POLICY_TGT_STATE_PK MGMT_PURGE_POLICY_TARGET_STATE
MGMT_EMD_PING_IDX_01	       MGMT_EMD_PING
MGMT_SYSTEM_PERF_LOG_IDX_01    MGMT_SYSTEM_PERFORMANCE_LOG
MGMT_JOB_PARAMETER_IDX01       MGMT_JOB_PARAMETER
MGMT_JOB_EXEC_SUMM_IDX05       MGMT_JOB_EXEC_SUMMARY
MGMT_JOB_IDX03		       MGMT_JOB

INDEX_NAME		       TABLE_NAME
------------------------------ ------------------------------
MGMT_DELTA_SNAP_IDX2	       MGMT_DELTA_SNAP
MGMT_DELTA_ENTRY_TIME_IDX      MGMT_DELTA_ENTRY
MGMT_DELTA_ENTRY_SHOULD_BE_UK  MGMT_DELTA_ENTRY
MGMT_INV_DEP_ER_IDX	       MGMT_INV_DEPENDENCY_RULE
MGMT_INV_COMPONENT_IDX_1       MGMT_INV_COMPONENT
MGMT_INV_COM_CONT_IDX	       MGMT_INV_COMPONENT
MGMT_INV_SUMMARY_IDX	       MGMT_INV_SUMMARY
MGMT_ECM_SNAP_IDX2	       MGMT_ECM_SNAPSHOT
MGMT_ECM_SNAP_IDX	       MGMT_ECM_SNAPSHOT
MGMT_TARGET_PROPERTIES_PK      MGMT_TARGET_PROPERTIES
MGMT_METRICS_IDX_03	       MGMT_METRICS

INDEX_NAME		       TABLE_NAME
------------------------------ ------------------------------
MGMT_METRICS_PK 	       MGMT_METRICS
BSLN_RAWDATA_PK 	       MGMT_BSLN_RAWDATA
MGMT_FLAT_TARGET_ASSOC_IDX03   MGMT_FLAT_TARGET_ASSOC
MGMT_FLAT_TARGET_ASSOC_IDX02   MGMT_FLAT_TARGET_ASSOC
MGMT_USER_CONTEXT_PK	       MGMT_USER_CONTEXT
MGMT_USER_CAS_PK	       MGMT_USER_CAS
MGMT_USER_REPORT_DEFS_PK       MGMT_USER_REPORT_DEFS
MGMT_USER_TEMPLATES_PK	       MGMT_USER_TEMPLATES
MGMT_PRIV_GRANTS_IDX01	       MGMT_PRIV_GRANTS
EMDW_TRACE_DATA_IDX_01	       EMDW_TRACE_DATA
MGMT_USER_JOBS_PK	       MGMT_USER_JOBS

INDEX_NAME		       TABLE_NAME
------------------------------ ------------------------------
MGMT_USER_TARGETS_PK	       MGMT_USER_TARGETS
MGMT_PRIV_GRANTS_PK	       MGMT_PRIV_GRANTS
MGMT_FLAT_ROLE_GRANTS_PK       MGMT_FLAT_ROLE_GRANTS
MGMT_ROLE_GRANTS_PK	       MGMT_ROLE_GRANTS
MGMT_LAST_VIOLATION_PK	       MGMT_LAST_VIOLATION
MGMT_POLICY_ASSOC_IDX2	       MGMT_POLICY_ASSOC
MGMT_POLICY_ASSOC_IDX1	       MGMT_POLICY_ASSOC
MGMT_SYSTEM_ERROR_LOG_01       MGMT_SYSTEM_ERROR_LOG
PK_MGMT_JOB_PARAM	       MGMT_JOB_PARAMETER
MGMT_HC_VENDOR_SW_COMPS_IDX    MGMT_HC_VENDOR_SW_COMPONENTS
MGMT_HC_VENDOR_SW_SUMMARY_IDX  MGMT_HC_VENDOR_SW_SUMMARY

INDEX_NAME		       TABLE_NAME
------------------------------ ------------------------------
MGMT_HC_OS_COMPONENTS_IDX1     MGMT_HC_OS_COMPONENTS
MGMT_HC_NIC_DETAILS_IDX        MGMT_HC_NIC_DETAILS
MGMT_HC_IOCARD_DETAILS_IDX     MGMT_HC_IOCARD_DETAILS
MGMT_HC_CPU_DETAILS_IDX        MGMT_HC_CPU_DETAILS
OSP_SNP_PK		       MGMT_HC_OS_PROPERTIES
MGMT_DELTA_ENTRY_ROWGUID_IDX   MGMT_DELTA_ENTRY
MGMT_DELTA_IDS_IDX	       MGMT_DELTA_IDS
MDIV_PK 		       MGMT_DELTA_ID_VALUES
MGMT_ARU_PRD_RLS_PK	       MGMT_ARU_PRODUCT_RELEASE_MAP
MGMT_INV_VERSIONED_PATCH_PIDX  MGMT_INV_VERSIONED_PATCH
ENT_PK			       MGMT_INV_COMPONENT

INDEX_NAME		       TABLE_NAME
------------------------------ ------------------------------
CON_UK			       MGMT_INV_CONTAINER
MGMT_ESCI_PK		       MGMT_ECM_SNAP_COMPONENT_INFO
MGMT_METRIC_ERRORS_PK	       MGMT_METRIC_ERRORS
MGMT_TARGET_ROLLUP_TIMES_PK    MGMT_TARGET_ROLLUP_TIMES
MGMT_METRICS_1DAY_PK	       MGMT_METRICS_1DAY
MGMT_METRICS_1HOUR_PK	       MGMT_METRICS_1HOUR
MGMT_METRICS_COMP_KEYS_PK      MGMT_METRICS_COMPOSITE_KEYS
MGMT_STRING_METRIC_HISTORY_PK  MGMT_STRING_METRIC_HISTORY
MGMT_CURRENT_METRICS_IDX_01    MGMT_CURRENT_METRICS
MGMT_CURRENT_METRICS_PK        MGMT_CURRENT_METRICS
MGMT_METRICS_RAW_PK	       MGMT_METRICS_RAW

INDEX_NAME		       TABLE_NAME
------------------------------ ------------------------------
INDEX_SIZES_PRIMARY_KEY        MGMT_INDEX_SIZES
AVAILABILITY_PRIMARY_KEY       MGMT_AVAILABILITY
TABLE_SIZES_PRIMARY_KEY        MGMT_TABLE_SIZES
WWV_FLOW_SW_STMTS_IDX3	       WWV_FLOW_SW_STMTS
WWV_FLOW_SW_D_RESULT_IDX3      WWV_FLOW_SW_DETAIL_RESULTS
WWV_FLOW_SW_RESULT_IDX3        WWV_FLOW_SW_RESULTS
DR$SUP_TEXT_IDX$X	       DR$SUP_TEXT_IDX$I

84 rows selected.

SQL> Select owner,table_name from dba_tables where iot_type is not null;

OWNER			       TABLE_NAME
------------------------------ ------------------------------
SYS			       SYS_IOT_OVER_5329
SYS			       SYS_IOT_OVER_5335
SYS			       SYS_IOT_OVER_5339
SYS			       SYS_IOT_OVER_5584
SYS			       SYS_IOT_OVER_5619
SYS			       SYS_IOT_OVER_5889
SYS			       SYS_IOT_OVER_12940
SYS			       SYS_IOT_OVER_12974
SYS			       SYS_IOT_OVER_13004
SYS			       SYS_IOT_OVER_13060
SYS			       SYS_IOT_OVER_13263

OWNER			       TABLE_NAME
------------------------------ ------------------------------
SYS			       SYS_IOT_OVER_13299
SYS			       SYS_IOT_OVER_13480
SYS			       SYS_IOT_OVER_13605
WMSYS			       SYS_IOT_OVER_14138
EXFSYS			       SYS_IOT_OVER_68446
EXFSYS			       SYS_IOT_OVER_68456
CTXSYS			       SYS_IOT_OVER_68611
CTXSYS			       SYS_IOT_OVER_68661
EXFSYS			       SYS_IOT_OVER_70447
EXFSYS			       SYS_IOT_OVER_70455
EXFSYS			       SYS_IOT_OVER_70462

OWNER			       TABLE_NAME
------------------------------ ------------------------------
EXFSYS			       SYS_IOT_OVER_70465
EXFSYS			       SYS_IOT_OVER_70468
EXFSYS			       SYS_IOT_OVER_70488
EXFSYS			       SYS_IOT_OVER_70491
EXFSYS			       SYS_IOT_OVER_70494
EXFSYS			       SYS_IOT_OVER_70497
SYSMAN			       SYS_IOT_OVER_81043
SYSMAN			       SYS_IOT_OVER_81046
SYSMAN			       SYS_IOT_OVER_81144
SYSMAN			       SYS_IOT_OVER_81157
SYSMAN			       SYS_IOT_OVER_81160

OWNER			       TABLE_NAME
------------------------------ ------------------------------
SYSMAN			       SYS_IOT_OVER_81214
SYSMAN			       SYS_IOT_OVER_81217
SYSMAN			       SYS_IOT_OVER_81220
SYSMAN			       SYS_IOT_OVER_81225
SYSMAN			       SYS_IOT_OVER_80806
SYSMAN			       SYS_IOT_OVER_81789
SYSMAN			       SYS_IOT_OVER_81661
SYSMAN			       SYS_IOT_OVER_81667
SYSMAN			       SYS_IOT_OVER_81671
SYSMAN			       SYS_IOT_OVER_81676
SYSMAN			       SYS_IOT_OVER_83559

OWNER			       TABLE_NAME
------------------------------ ------------------------------
SYSMAN			       SYS_IOT_OVER_83961
APEX_030200		       SYS_IOT_OVER_84700
SYS			       SYS_IOT_OVER_87376
SYS			       SYS_IOT_OVER_87421
SH			       DR$SUP_TEXT_IDX$N
SH			       DR$SUP_TEXT_IDX$K
IX			       AQ$_STREAMS_QUEUE_TABLE_T
IX			       AQ$_ORDERS_QUEUETABLE_T
IX			       AQ$_ORDERS_QUEUETABLE_I
IX			       AQ$_STREAMS_QUEUE_TABLE_H
IX			       AQ$_STREAMS_QUEUE_TABLE_G

OWNER			       TABLE_NAME
------------------------------ ------------------------------
HR			       COUNTRIES
IX			       AQ$_ORDERS_QUEUETABLE_H
IX			       AQ$_STREAMS_QUEUE_TABLE_C
IX			       AQ$_STREAMS_QUEUE_TABLE_I
IX			       AQ$_ORDERS_QUEUETABLE_G
SYS			       AQ$_KUPC$DATAPUMP_QUETAB_1_D
APEX_030200		       WWV_FLOW_JOB_BIND_VALUES
SYSMAN			       AQ$_MGMT_LOADER_QTABLE_I
SYSMAN			       AQ$_MGMT_LOADER_QTABLE_G
SYSMAN			       AQ$_MGMT_LOADER_QTABLE_H
SYSMAN			       AQ$_MGMT_LOADER_QTABLE_T

OWNER			       TABLE_NAME
------------------------------ ------------------------------
SYSMAN			       MGMT_DIROBJ_USERS_HOTLIST
SYSMAN			       MGMT_DB_INIT_PARAMS_ECM
SYSMAN			       MGMT_BSLN_RAWDATA
SYSMAN			       MGMT_LICENSE_CONFIRMATION
SYSMAN			       MGMT_LICENSED_TARGETS
SYSMAN			       MGMT_LICENSABLE_TARGET_TYPES
SYSMAN			       MGMT_USER_CALLBACKS
SYSMAN			       MGMT_USER_CONTEXT
SYSMAN			       MGMT_USER_CAS
SYSMAN			       MGMT_USER_REPORT_DEFS
SYSMAN			       MGMT_USER_TEMPLATES

OWNER			       TABLE_NAME
------------------------------ ------------------------------
SYSMAN			       MGMT_USER_JOBS
SYSMAN			       MGMT_USER_TARGETS
SYSMAN			       MGMT_PRIV_GRANTS
SYSMAN			       MGMT_FLAT_ROLE_GRANTS
SYSMAN			       MGMT_ROLE_GRANTS
SYSMAN			       MGMT_PRIV_INCLUDES
SYSMAN			       MGMT_LAST_VIOLATION
SYSMAN			       MGMT_SNAPSHOT_METRIC_MAP
SYSMAN			       MGMT_POLICY_ASSOC_CFG_PARAMS
SYSMAN			       MGMT_POLICY_ASSOC
SYSMAN			       MGMT_POLICY_TYPE_VERSIONS

OWNER			       TABLE_NAME
------------------------------ ------------------------------
SYSMAN			       MGMT_POLICY_BIND_VARS
SYSMAN			       MGMT_EMD_PING_CHECK
SYSMAN			       MGMT_NOTIFY_NOTIFYEES
SYSMAN			       MGMT_COLLECTION_TEMPLATE_CREDS
SYSMAN			       MGMT_COLLECTION_CREDENTIALS
SYSMAN			       MGMT_JOB_CREDENTIALS
SYSMAN			       MGMT_ENTERPRISE_CREDENTIALS
SYSMAN			       MGMT_HOST_CREDENTIALS
SYSMAN			       MGMT_TARGET_CREDENTIALS
SYSMAN			       MGMT_CREDENTIAL_TYPE_REF
SYSMAN			       MGMT_COLLECTION_WORKERS

OWNER			       TABLE_NAME
------------------------------ ------------------------------
SYSMAN			       MGMT_COLLECTION_METRIC_TASKS
SYSMAN			       MGMT_TASK_WORKER_COUNTS
SYSMAN			       MGMT_COLLECTION_TASK_CONTEXT
SYSMAN			       MGMT_COLL_ITEM_PROPERTIES
SYSMAN			       MGMT_COLL_ITEM_METRICS
SYSMAN			       MGMT_COLL_ITEMS
SYSMAN			       MGMT_BLACKOUT_WINDOWS
SYSMAN			       MGMT_METRICS_1DAY
SYSMAN			       MGMT_METRICS_1HOUR
SYSMAN			       MGMT_CURRENT_METRICS
SYSMAN			       MGMT_METRICS_RAW

OWNER			       TABLE_NAME
------------------------------ ------------------------------
SYSMAN			       MGMT_BAM_OSESSION_STATUS
SYSMAN			       MGMT_BAM_OSESSION_METRICS
SYSMAN			       MGMT_BAM_OSESSION_ALERTS
SYSMAN			       MGMT_AVAILABILITY_MARKER
SYSMAN			       MGMT_CURRENT_AVAILABILITY
SYSMAN			       MGMT_AVAILABILITY
SYSMAN			       AQ$_MGMT_NOTIFY_QTABLE_I
SYSMAN			       AQ$_MGMT_NOTIFY_QTABLE_G
SYSMAN			       AQ$_MGMT_NOTIFY_QTABLE_H
SYSMAN			       AQ$_MGMT_NOTIFY_QTABLE_T
EXFSYS			       RLM4J$ATTRALIASES

OWNER			       TABLE_NAME
------------------------------ ------------------------------
EXFSYS			       RLM4J$RULESET
EXFSYS			       RLM4J$EVTSTRUCTS
EXFSYS			       RLM$JOBQUEUE
EXFSYS			       RLM$SCHACTERRS
EXFSYS			       RLM$INCRRRSCHACT
EXFSYS			       RLM$DMLEVTTRIGS
EXFSYS			       RLM$ORDERCLSALS
EXFSYS			       RLM$COLLGRPBYSPEC
EXFSYS			       RLM$EQUALSPEC
EXFSYS			       RLM$PRIMEVTTYPEMAP
EXFSYS			       RLM$RSPRIMEVENTS

OWNER			       TABLE_NAME
------------------------------ ------------------------------
EXFSYS			       RLM$RULESETPRIVS
EXFSYS			       RLM$RULESET
EXFSYS			       RLM$EVENTSTRUCT
CTXSYS			       DR$TREE
CTXSYS			       DR$SDATA_UPDATE
CTXSYS			       DR$INDEX_CDI_COLUMN
CTXSYS			       DR$PARALLEL
CTXSYS			       DR$UNINDEXED
CTXSYS			       DR$DELETE
CTXSYS			       DR$ONLINE_PENDING
CTXSYS			       DR$WAITING

OWNER			       TABLE_NAME
------------------------------ ------------------------------
CTXSYS			       DR$PENDING
CTXSYS			       DR$STOPWORD
CTXSYS			       DR$SECTION_ATTRIBUTE
CTXSYS			       DR$THS_FPHRASE
CTXSYS			       DR$SQE
CTXSYS			       DR$INDEX_OBJECT
CTXSYS			       DR$PARAMETER
EXFSYS			       EXF$EXPSETSTATS
EXFSYS			       EXF$IDXSECOBJ
EXFSYS			       EXF$ASUDFLIST
EXFSYS			       EXF$ATTRLIST

OWNER			       TABLE_NAME
------------------------------ ------------------------------
EXFSYS			       EXF$EXPSETPRIVS
EXFSYS			       EXF$EXPRSET
EXFSYS			       EXF$ATTRSET
WMSYS			       AQ$_WM$EVENT_QUEUE_TABLE_I
WMSYS			       AQ$_WM$EVENT_QUEUE_TABLE_G
WMSYS			       AQ$_WM$EVENT_QUEUE_TABLE_H
WMSYS			       AQ$_WM$EVENT_QUEUE_TABLE_T
DBSNMP			       BSLN_TIMEGROUPS
SYS			       AQ$_SYS$SERVICE_METRICS_TAB_I
SYS			       AQ$_SYS$SERVICE_METRICS_TAB_G
SYS			       AQ$_SYS$SERVICE_METRICS_TAB_H

OWNER			       TABLE_NAME
------------------------------ ------------------------------
SYS			       AQ$_SYS$SERVICE_METRICS_TAB_T
SYS			       AQ$_KUPC$DATAPUMP_QUETAB_I
SYS			       AQ$_KUPC$DATAPUMP_QUETAB_G
SYS			       AQ$_KUPC$DATAPUMP_QUETAB_H
SYS			       AQ$_KUPC$DATAPUMP_QUETAB_T
SYS			       AQ$_KUPC$DATAPUMP_QUETAB_1_I
SYS			       AQ$_KUPC$DATAPUMP_QUETAB_1_G
SYS			       AQ$_KUPC$DATAPUMP_QUETAB_1_H
SYS			       AQ$_KUPC$DATAPUMP_QUETAB_1_T
SYS			       AQ$_AQ_PROP_TABLE_I
SYS			       AQ$_AQ_PROP_TABLE_G

OWNER			       TABLE_NAME
------------------------------ ------------------------------
SYS			       AQ$_AQ_PROP_TABLE_H
SYS			       AQ$_AQ_PROP_TABLE_T
SYS			       AQ$_AQ$_MEM_MC_I
SYS			       AQ$_AQ$_MEM_MC_G
SYS			       AQ$_AQ$_MEM_MC_H
SYS			       AQ$_AQ$_MEM_MC_T
SYS			       AQ$_ALERT_QT_I
SYS			       AQ$_ALERT_QT_G
SYS			       AQ$_ALERT_QT_H
SYS			       AQ$_ALERT_QT_T
SYS			       AQ$_SCHEDULER_FILEWATCHER_QT_I

OWNER			       TABLE_NAME
------------------------------ ------------------------------
SYS			       AQ$_SCHEDULER_FILEWATCHER_QT_G
SYS			       AQ$_SCHEDULER_FILEWATCHER_QT_H
SYS			       AQ$_SCHEDULER_FILEWATCHER_QT_T
SYS			       AQ$_SCHEDULER$_REMDB_JOBQTAB_I
SYS			       AQ$_SCHEDULER$_REMDB_JOBQTAB_G
SYS			       AQ$_SCHEDULER$_REMDB_JOBQTAB_H
SYS			       AQ$_SCHEDULER$_REMDB_JOBQTAB_T
SYS			       AQ$_SCHEDULER$_EVENT_QTAB_I
SYS			       AQ$_SCHEDULER$_EVENT_QTAB_G
SYS			       AQ$_SCHEDULER$_EVENT_QTAB_H
SYS			       AQ$_SCHEDULER$_EVENT_QTAB_T

OWNER			       TABLE_NAME
------------------------------ ------------------------------
SYS			       WRR$_WORKLOAD_ATTRIBUTES
SYS			       WRR$_REPLAY_DATA
SYS			       WRR$_REPLAY_SEQ_DATA
SYS			       WRR$_REPLAY_SCN_ORDER
SYS			       RECENT_RESOURCE_INCARNATIONS$
SYS			       CHNF$_GROUP_FILTER_IOT
SYS			       CHNF$_CLAUSES
SYS			       RULE_SET_ROP$
SYS			       RULE_SET_IOT$
SYS			       RULE_SET_PR$
SYS			       SQLOBJ$DATA

OWNER			       TABLE_NAME
------------------------------ ------------------------------
SYS			       SQLOBJ$
SYS			       SQLLOG$
IX			       SYS_IOT_OVER_88024
IX			       SYS_IOT_OVER_88035
EXFSYS			       RLM$VALIDPRIVS
EXFSYS			       RLM$RULESETSTCODE
EXFSYS			       RLM$ERRCODE
CTXSYS			       DR$DBO

217 rows selected.

SQL> 

如果存在,目标端需要安装 Patch 14835322,否则索引组织表的对象无法导入到目标端。

2.7、检查sys和system用户在业务表空间上是否创建对象

SQL> select table_name, owner, tablespace_name from dba_tables where tablespace_name not in('SYSTEM','SYSAUX') and owner in ('SYS','SYSTEM');

no rows selected

SQL> 

如果数据库用户 SYS、SYSTEM 在业务表空间上创建有对象,则这些对象不能通过 XTTS 迁移,需要在目标库手工创建。

2.8、检查源端 Compatible 参数

SQL> show parameter compatible;

NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
compatible			     string	 11.2.0.4.0
SQL> 

如果目标端数据库版本是 11.2.0.3 或更低。那么需要在目标端装 11.2.0.4 并创建实例,然后用来进行备份集转换。如果 11.2.0.4 中转实例使用 ASM。那么 ASM 版本也必须是 11.2.0.4,否则报错 ORA-15295

2.9、确认生产库的 recycle in 功能是关闭,并手工清空回收站

SQL> show parameter recyclebin;

NAME				     TYPE	 VALUE
------------------------------------ ----------- ------------------------------
recyclebin			     string	 on
SQL> 
SQL> alter system set recyclebin='off' scope=spfile;

System altered.

SQL>

2.10、数据文件状态检查

SQL> Select distinct status from v$datafile;

STATUS
-------
ONLINE
SYSTEM

SQL>

正常返回应为:ONLINE、SYSTEM

2.11、查看v$transportable_platform检查平台信息

SQL> col PLATFORM_NAME format a50
SQL> select * from v$transportable_platform;

PLATFORM_ID PLATFORM_NAME				       ENDIAN_FORMAT
----------- -------------------------------------------------- --------------
	  1 Solaris[tm] OE (32-bit)			       Big
	  2 Solaris[tm] OE (64-bit)			       Big
	  7 Microsoft Windows IA (32-bit)		       Little
	 10 Linux IA (32-bit)				       Little
	  6 AIX-Based Systems (64-bit)			       Big
	  3 HP-UX (64-bit)				       Big
	  5 HP Tru64 UNIX				       Little
	  4 HP-UX IA (64-bit)				       Big
	 11 Linux IA (64-bit)				       Little
	 15 HP Open VMS 				       Little
	  8 Microsoft Windows IA (64-bit)		       Little

PLATFORM_ID PLATFORM_NAME				       ENDIAN_FORMAT
----------- -------------------------------------------------- --------------
	  9 IBM zSeries Based Linux			       Big
	 13 Linux x86 64-bit				       Little
	 16 Apple Mac OS				       Big
	 12 Microsoft Windows x86 64-bit		       Little
	 17 Solaris Operating System (x86)		       Little
	 18 IBM Power Based Linux			       Big
	 19 HP IA Open VMS				       Little
	 20 Solaris Operating System (x86-64)		       Little
	 21 Apple Mac OS (x86-64)			       Little

20 rows selected.

SQL>

三、源端创建测试用数据

3.1、创建表空间和用户

SQL> create tablespace test02 datafile '/u01/app/oracle/oradata/or11g/test02.dbf' size 10m autoextend on next 1m;

Tablespace created.

SQL> create user test02 identified by test02 default tablespace test02;

User created.

SQL> grant resource,connect,dba to test02;

Grant succeeded.

SQL>

3.2、添加测试用数据

SQL> create table test02.tab1(marchantid number(10) primary key,marchantname varchar2(20) not null,email varchar2(30));

Table created.

SQL> insert into test02.tab1 values(0000000001,'Java','[email protected]');

1 row created.

SQL> insert into test02.tab1 values(0000000002,'Oracle','[email protected]');

1 row created.

SQL> insert into test02.tab1 values(0000000003,'C++','[email protected]');

1 row created.

SQL> insert into test02.tab1 values(0000000004,'Python','[email protected]');

1 row created.

SQL> insert into test02.tab1 values(0000000005,'PHP','[email protected]');

1 row created.

SQL> insert into test02.tab1 values(0000000006,'IOS','[email protected]');

1 row created.

SQL> insert into test02.tab1 values(0000000007,'Sun','[email protected]');

1 row created.

SQL> commit;

Commit complete.

SQL> 
SQL> select * from test02.tab1;

MARCHANTID MARCHANTNAME 	EMAIL
---------- -------------------- ------------------------------
	 1 Java 		[email protected]
	 2 Oracle		[email protected]
	 3 C++			[email protected]
	 4 Python		[email protected]
	 5 PHP			[email protected]
	 6 IOS			[email protected]
	 7 Sun			[email protected]

7 rows selected.

SQL>

SQL> set linesize 120
SQL> create table test02.tab2 as select * from scott.emp;

Table created.

SQL> select * from test02.tab2;

     EMPNO ENAME      JOB	       MGR HIREDATE	    SAL       COMM     DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
      7369 SMITH      CLERK	      7902 17-DEC-80	    800 		   20
      7499 ALLEN      SALESMAN	      7698 20-FEB-81	   1600        300	   30
      7521 WARD       SALESMAN	      7698 22-FEB-81	   1250        500	   30
      7566 JONES      MANAGER	      7839 02-APR-81	   2975 		   20
      7654 MARTIN     SALESMAN	      7698 28-SEP-81	   1250       1400	   30
      7698 BLAKE      MANAGER	      7839 01-MAY-81	   2850 		   30
      7782 CLARK      MANAGER	      7839 09-JUN-81	   2450 		   10
      7788 SCOTT      ANALYST	      7566 19-APR-87	   3000 		   20
      7839 KING       PRESIDENT 	   17-NOV-81	   5000 		   10
      7844 TURNER     SALESMAN	      7698 08-SEP-81	   1500 	 0	   30
      7876 ADAMS      CLERK	      7788 23-MAY-87	   1100 		   20

     EMPNO ENAME      JOB	       MGR HIREDATE	    SAL       COMM     DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
      7900 JAMES      CLERK	      7698 03-DEC-81	    950 		   30
      7902 FORD       ANALYST	      7566 03-DEC-81	   3000 		   20
      7934 MILLER     CLERK	      7782 23-JAN-82	   1300 		   10

14 rows selected.

SQL> 

四、实施步骤

4.1、创建源端和目标端用于存放备份数据文件夹

[oracle@source ~]$ pwd
/home/oracle
[oracle@source ~]$ mkdir xtts
[oracle@source ~]$ ls
01     1.sh  3.sh  initor11g.ora  insert.log          oradiag_oracle          sql1.log  test.log  xtts
1.ora  2.sh  data  init.ora       me201110162330.dmp  rman_xttconvert_v3.zip  sql.log   test.sql
[oracle@source ~]$ mv rman_xttconvert_v3.zip xtts/
[oracle@source ~]$ 
[oracle@source ~]$ cd xtts/
[oracle@source xtts]$ ls
rman_xttconvert_v3.zip
[oracle@source xtts]$ pwd
/home/oracle/xtts
[oracle@source xtts]$ 
[oracle@source xtts]$ mkdir source_back
[oracle@source xtts]$ mkdir source_incr_back
[oracle@source xtts]$ mkdir target_data
[oracle@source xtts]$ mkdir target_back
[oracle@source xtts]$ mkdir target_incr_back
[oracle@source xtts]$ 

4.2、下载并解压rman_xttconvert_v3工具

[oracle@source xtts]$ pwd
/home/oracle/xtts
[oracle@source xtts]$ 
[oracle@source xtts]$ 
[oracle@source xtts]$ ls
rman_xttconvert_v3.zip  source_back  source_incr_back  target_back  target_data  target_incr_back
[oracle@source xtts]$ 
[oracle@source xtts]$ unzip rman_xttconvert_v3.zip 
Archive:  rman_xttconvert_v3.zip
  inflating: xtt.properties          
  inflating: xttcnvrtbkupdest.sql    
  inflating: xttdbopen.sql           
  inflating: xttdriver.pl            
  inflating: xttprep.tmpl            
 extracting: xttstartupnomount.sql   
[oracle@source xtts]$ ls
rman_xttconvert_v3.zip  source_incr_back  target_data       xttcnvrtbkupdest.sql  xttdriver.pl  xtt.properties
source_back             target_back       target_incr_back  xttdbopen.sql         xttprep.tmpl  xttstartupnomount.sql
[oracle@source xtts]$ 

[root@source oracle]# chmod -R 775 xtts/

4.3、编辑和配置xtt.properties文件

## Specify tablespace names in CAPITAL letters.
tablespaces=TEST02      # 表示需要迁移的表空间


## Source database platform ID
## ===========================
##
## platformid
## ----------
## Source database platform id, obtained from V$DATABASE.PLATFORM_ID
platformid=13    # 表示源OS平台ID

......

## dbms_file_transfer.
#srclink=TTSLINK   #表示从目标库指向源库的db_link,由于这里采用的是rman方式,所以不需要db_link

......


## as the stageondest property for the destination system.
dfcopydir=/home/oracle/xtts/source_back #表示源库备份文件存放目录

## backupformat
## ------------
## Location where incremental backups are created.
##
## This location may be an NFS-mounted filesystem that is shared with the
## destination system, in which case it should reference the same NFS location
## as the stageondest property for the destination system.
backupformat=/home/oracle/xtts/source_incr_back #表示源库增备文件存放目录

......

## as the dfcopydir and backupformat properties for the source system.
stageondest=/home/oracle/xtts/target_back #表示目标库备份文件存放目录

## storageondest
## -------------
## This parameter is used only when Prepare phase method is RMAN backup.
##
## Location where the converted datafile copies will be written during the
## "-c conversion of datafiles" step.  This is the final location of the
## datafiles where they will be used by the destination database.
storageondest=/home/oracle/xtts/target_data  #表示目标库正式文件存放目录
 
## backupondest
## ------------
## Location where converted incremental backups on the destination system
## will be written during the "-r roll forward datafiles" step.
##
## NOTE: If this is set to an ASM location then define properties
##       asm_home and asm_sid below.  If this is set to a file system
##       location, then comment out asm_home and asm_sid below
backupondest=/home/oracle/xtts/target_incr_back #表示目标库增备文件存放目录

......

## If undefined, default value is 8.
parallel=3  #表示备份转化并行度

## rollparallel
## ------------
## Defines the level of parallelism for the -r roll forward operation.
##
## If undefined, default value is 0 (serial roll forward).
rollparallel=2 #表示增备的并行度

## getfileparallel
## ---------------
## Defines the level of parallelism for the -G operation
##
## If undefined, default value is 1. Max value supported is 8.
## This will be enhanced in the future to support more than 8
## depending on the destination system resources.
getfileparallel=4  #表示使用 dbms_file_transfer 方式的并行度

4.4、将源端xtts目录拷贝到目标端

[oracle@source ~]$ scp -rp /home/oracle/xtts/ 192.168.127.71:/home/oracle/
[email protected]'s password: 
xttcnvrtbkupdest.sql                                                                              100% 1390     1.4KB/s   00:00    
xtt.properties                                                                                    100% 8077     7.9KB/s   00:00    
xttdbopen.sql                                                                                     100%   71     0.1KB/s   00:00    
xttdriver.pl                                                                                      100%  139KB 138.7KB/s   00:00    
xttprep.tmpl                                                                                      100%   11KB  11.4KB/s   00:00    
xttstartupnomount.sql                                                                             100%   52     0.1KB/s   00:00    
rman_xttconvert_v3.zip                                                                            100%   34KB  33.9KB/s   00:00    
[oracle@source ~]$

4.5、设置源端和目标端的TMPDIR环境变量

export TMPDIR=/home/oracle/xtts

4.6、源端和目标端开启归档模式并且换日志

SQL> archive log list
Database log mode	       Archive Mode
Automatic archival	       Enabled
Archive destination	       USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     5
Next log sequence to archive   7
Current log sequence	       7
SQL> 
SQL> alter system switch logfile;

System altered.

SQL> archive log list;
Database log mode	       Archive Mode
Automatic archival	       Enabled
Archive destination	       USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence     6
Next log sequence to archive   8
Current log sequence	       8
SQL>

4.7、源端执行如下命令开始初始备份

[oracle@source xtts]$ $ORACLE_HOME/perl/bin/perl /home/oracle/xtts/xttdriver.pl -p
============================================================
trace file is /home/oracle/xtts/prepare_Apr4_Thu_10_32_07_477//Apr4_Thu_10_32_07_477_.log
=============================================================

--------------------------------------------------------------------
Parsing properties
--------------------------------------------------------------------


--------------------------------------------------------------------
Done parsing properties
--------------------------------------------------------------------


--------------------------------------------------------------------
Checking properties
--------------------------------------------------------------------


--------------------------------------------------------------------
Done checking properties
--------------------------------------------------------------------


--------------------------------------------------------------------
Starting prepare phase
--------------------------------------------------------------------

Prepare source for Tablespaces:
                  'TEST02'  /home/oracle/xtts/target_back
xttpreparesrc.sql for 'TEST02' started at Thu Apr  4 10:32:07 2019
xttpreparesrc.sql for  ended at Thu Apr  4 10:32:07 2019
Prepare source for Tablespaces:
                  ''''  /home/oracle/xtts/target_back
xttpreparesrc.sql for '''' started at Thu Apr  4 10:32:11 2019
xttpreparesrc.sql for  ended at Thu Apr  4 10:32:11 2019

--------------------------------------------------------------------
Done with prepare phase
--------------------------------------------------------------------


--------------------------------------------------------------------
Find list of datafiles in system
--------------------------------------------------------------------


--------------------------------------------------------------------
Done finding list of datafiles in system
--------------------------------------------------------------------

[oracle@source xtts]$

4.8、源端查看备份文件,并将备份文件传到目标端

[oracle@source source_back]$ scp -p /home/oracle/xtts/source_back/TEST02_7.tf [email protected]:/home/oracle/xtts/target_back
[email protected]'s password: 
TEST02_7.tf                                                                                       100%   10MB  10.0MB/s   00:00    
[oracle@source source_back]$

4.9、将源端生成的rmanconvert.cmd文件传到目标端,并执行文件转换命令

[oracle@source xtts]$ pwd
/home/oracle/xtts
[oracle@source xtts]$ scp -p rmanconvert.cmd [email protected]:/home/oracle/xtts/
[email protected]'s password: 
rmanconvert.cmd                                                                                   100%  198     0.2KB/s   00:00    
[oracle@source xtts]$

目标端执行如下命令:

[oracle@target xtts]$ $ORACLE_HOME/perl/bin/perl /home/oracle/xtts/xttdriver.pl -c
============================================================
trace file is /home/oracle/xtts/convert_Apr4_Thu_10_42_27_594//Apr4_Thu_10_42_27_594_.log
=============================================================

--------------------------------------------------------------------
Parsing properties
--------------------------------------------------------------------


--------------------------------------------------------------------
Done parsing properties
--------------------------------------------------------------------


--------------------------------------------------------------------
Checking properties
--------------------------------------------------------------------


--------------------------------------------------------------------
Done checking properties
--------------------------------------------------------------------


--------------------------------------------------------------------
Performing convert
--------------------------------------------------------------------


--------------------------------------------------------------------
Converted datafiles listed in: /home/oracle/xtts/xttnewdatafiles.txt
--------------------------------------------------------------------

[oracle@target xtts]$

转换成功之后会生成 xttnewdatafiles.txt文件。

4.10、开始增量同步(由于这里只是测试,所以直接将源库表空间离线然后做最后一次增量同步)

SQL> alter tablespace test02 read only;

Tablespace altered.

SQL> 

接着,源端开始做最后一次增量备份

[oracle@source xtts]$ $ORACLE_HOME/perl/bin/perl /home/oracle/xtts/xttdriver.pl -i
============================================================
trace file is /home/oracle/xtts/incremental_Apr4_Thu_10_49_39_666//Apr4_Thu_10_49_39_666_.log
=============================================================

--------------------------------------------------------------------
Parsing properties
--------------------------------------------------------------------


--------------------------------------------------------------------
Done parsing properties
--------------------------------------------------------------------


--------------------------------------------------------------------
Checking properties
--------------------------------------------------------------------


--------------------------------------------------------------------
Done checking properties
--------------------------------------------------------------------


--------------------------------------------------------------------
Backup incremental
--------------------------------------------------------------------

============================================================
No new datafiles added
=============================================================
Prepare newscn for Tablespaces: 'TEST02'
Prepare newscn for Tablespaces: ''''

--------------------------------------------------------------------
Starting incremental backup
--------------------------------------------------------------------


--------------------------------------------------------------------
Done backing up incrementals
--------------------------------------------------------------------

[oracle@source xtts]$

4.11、将最后的增备文件传到目标端

[oracle@source source_incr_back]$ scp -p /home/oracle/xtts/source_incr_back/02tu4ui5_1_1 [email protected]:/home/oracle/xtts/target_back
[email protected]'s password: 
02tu4ui5_1_1                                                                                     100% 1176KB   1.2MB/s   00:00    
[oracle@source source_incr_back]$ 

将xttplan.txt tsbkupmap.txt文件传到目标端

[oracle@source xtts]$ scp -p xttplan.txt tsbkupmap.txt 192.168.127.71:/home/oracle/xtts
[email protected]'s password: 
xttplan.txt                                                                                      100%   20     0.0KB/s   00:00    
tsbkupmap.txt                                                                                    100%   27     0.0KB/s   00:00    
[oracle@source xtts]$

4.12、目标端应用增备

[oracle@target xtts]$ $ORACLE_HOME/perl/bin/perl /home/oracle/xtts/xttdriver.pl -r
============================================================
trace file is /home/oracle/xtts/rollforward_Apr4_Thu_11_19_26_330//Apr4_Thu_11_19_26_330_.log
=============================================================

--------------------------------------------------------------------
Parsing properties
--------------------------------------------------------------------


--------------------------------------------------------------------
Done parsing properties
--------------------------------------------------------------------


--------------------------------------------------------------------
Checking properties
--------------------------------------------------------------------


--------------------------------------------------------------------
Done checking properties
--------------------------------------------------------------------


--------------------------------------------------------------------
Start rollforward
--------------------------------------------------------------------


--------------------------------------------------------------------
End of rollforward phase
--------------------------------------------------------------------

[oracle@target xtts]$

4.12、源端导出元数据

源端和目标端创建相关的目录并授权

mkdir -p /home/oracle/data
SQL> create directory source_dbdata as '/home/oracle/data';
SQL> grant read,write on directory source_dbdata to system;
SQL> create directory source_dbdata as '/home/oracle/data';

Directory created.

SQL> grant read,write on directory source_dbdata to system;

Grant succeeded.

SQL> select * from dba_directories;

OWNER		   DIRECTORY_NAME			  DIRECTORY_PATH
------------------ -------------------------------------- --------------------------------------------------------------------------------
SYS		   SUBDIR				  /u01/app/oracle/product/11.2.0/db_4/demo/schema/order_entry//2002/Sep
SYS		   SS_OE_XMLDIR 			  /u01/app/oracle/product/11.2.0/db_4/demo/schema/order_entry/
SYS		   SOURCE_DBDATA			  /home/oracle/data
SYS		   LOG_FILE_DIR 			  /u01/app/oracle/product/11.2.0/db_4/demo/schema/log/
SYS		   MEDIA_DIR				  /u01/app/oracle/product/11.2.0/db_4/demo/schema/product_media/
SYS		   DATA_FILE_DIR			  /u01/app/oracle/product/11.2.0/db_4/demo/schema/sales_history/
SYS		   XMLDIR				  /u01/app/oracle/product/11.2.0/db_4/rdbms/xml
SYS		   ORACLE_OCM_CONFIG_DIR		  /u01/app/oracle/product/11.2.0/db_4/ccr/hosts/source/state
SYS		   DATA_PUMP_DIR			  /u01/app/oracle/admin/or11g/dpdump/
SYS		   ORACLE_OCM_CONFIG_DIR2		  /u01/app/oracle/product/11.2.0/db_4/ccr/state

10 rows selected.

SQL>

4.13、源端检查表空间的自包含性

SQL> EXECUTE DBMS_TTS.TRANSPORT_SET_CHECK('TEST02', TRUE);

PL/SQL procedure successfully completed.

SQL> SELECT * FROM TRANSPORT_SET_VIOLATIONS;

no rows selected

SQL> 

4.14、源端导出元数据

[oracle@source ~]$ expdp system/oracle directory=source_dbdata dumpfile=test02.dmp transport_tablespaces=test02 transport_full_check=y

Export: Release 11.2.0.4.0 - Production on Thu Apr 4 11:29:49 2019

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Starting "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01":  system/******** directory=source_dbdata dumpfile=test02.dmp transport_tablespaces=test02 transport_full_check=y 
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Master table "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_TRANSPORTABLE_01 is:
  /home/oracle/data/test02.dmp
******************************************************************************
Datafiles required for transportable tablespace TEST02:
  /u01/app/oracle/oradata/or11g/test02.dbf
Job "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" successfully completed at Thu Apr 4 11:30:34 2019 elapsed 0 00:00:43

[oracle@source ~]$ ls
01     1.sh  3.sh  initor11g.ora  insert.log          oradiag_oracle  sql.log   test.sql
1.ora  2.sh  data  init.ora       me201110162330.dmp  sql1.log        test.log  xtts
[oracle@source ~]$ cd data
[oracle@source data]$ 
[oracle@source data]$ 
[oracle@source data]$ ls
export.log  test02.dmp
[oracle@source data]$

4.14、将导出的数据拷贝到目标端

[oracle@source data]$ scp -p /home/oracle/data/test02.dmp [email protected]:/home/oracle/data
[email protected]'s password: 
test02.dmp                                                                                           100%  112KB 112.0KB/s   00:00    
[oracle@source data]$

4.15、目标端导入元数据

4.15.1、创建test02用户,但是不要创建表空间

SQL> create user test02 identified by test02;

User created.

SQL> grant dba to test02;

Grant succeeded.

SQL> 

4.15.2、目标端导入元数据

[oracle@target ~]$ impdp test02/test02 DUMPFILE=test02.dmp DIRECTORY=source_dbdata TRANSPORT_DATAFILES=/home/oracle/xtts/target_data/TEST02_7.dbf

Import: Release 11.2.0.4.0 - Production on Thu Apr 4 11:38:14 2019

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
Master table "TEST02"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
Starting "TEST02"."SYS_IMPORT_TRANSPORTABLE_01":  test02/******** DUMPFILE=test02.dmp DIRECTORY=source_dbdata TRANSPORT_DATAFILES=/home/oracle/xtts/target_data/TEST02_7.dbf 
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Job "TEST02"."SYS_IMPORT_TRANSPORTABLE_01" successfully completed at Thu Apr 4 11:38:26 2019 elapsed 0 00:00:05

[oracle@target ~]$

4.16、目标端更改test02默认表空间

SQL> alter user test02 default tablespace TEST02;

User altered.

SQL> 

更改表空间test02状态为读写

SQL> ALTER TABLESPACE test02 read write;

Tablespace altered.

SQL> 

4.17、检查目标库test02.tab1的数据

SQL> select * from test02.tab1;

MARCHANTID MARCHANTNAME 	EMAIL
---------- -------------------- ------------------------------
	 1 Java 		[email protected]
	 2 Oracle		[email protected]
	 3 C++			[email protected]
	 4 Python		[email protected]
	 5 PHP			[email protected]
	 6 IOS			[email protected]
	 7 Sun			[email protected]

7 rows selected.

SQL> select * from test02.tab2;

     EMPNO ENAME      JOB	       MGR HIREDATE	    SAL       COMM
---------- ---------- --------- ---------- --------- ---------- ----------
    DEPTNO
----------
      7369 SMITH      CLERK	      7902 17-DEC-80	    800
	20

      7499 ALLEN      SALESMAN	      7698 20-FEB-81	   1600        300
	30

      7521 WARD       SALESMAN	      7698 22-FEB-81	   1250        500
	30


     EMPNO ENAME      JOB	       MGR HIREDATE	    SAL       COMM
---------- ---------- --------- ---------- --------- ---------- ----------
    DEPTNO
----------
      7566 JONES      MANAGER	      7839 02-APR-81	   2975
	20

      7654 MARTIN     SALESMAN	      7698 28-SEP-81	   1250       1400
	30

      7698 BLAKE      MANAGER	      7839 01-MAY-81	   2850
	30


     EMPNO ENAME      JOB	       MGR HIREDATE	    SAL       COMM
---------- ---------- --------- ---------- --------- ---------- ----------
    DEPTNO
----------
      7782 CLARK      MANAGER	      7839 09-JUN-81	   2450
	10

      7788 SCOTT      ANALYST	      7566 19-APR-87	   3000
	20

      7839 KING       PRESIDENT 	   17-NOV-81	   5000
	10


     EMPNO ENAME      JOB	       MGR HIREDATE	    SAL       COMM
---------- ---------- --------- ---------- --------- ---------- ----------
    DEPTNO
----------
      7844 TURNER     SALESMAN	      7698 08-SEP-81	   1500 	 0
	30

      7876 ADAMS      CLERK	      7788 23-MAY-87	   1100
	20

      7900 JAMES      CLERK	      7698 03-DEC-81	    950
	30


     EMPNO ENAME      JOB	       MGR HIREDATE	    SAL       COMM
---------- ---------- --------- ---------- --------- ---------- ----------
    DEPTNO
----------
      7902 FORD       ANALYST	      7566 03-DEC-81	   3000
	20

      7934 MILLER     CLERK	      7782 23-JAN-82	   1300
	10


14 rows selected.

SQL> 
SQL> set linesize 120
SQL> /

     EMPNO ENAME      JOB	       MGR HIREDATE	    SAL       COMM     DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
      7369 SMITH      CLERK	      7902 17-DEC-80	    800 		   20
      7499 ALLEN      SALESMAN	      7698 20-FEB-81	   1600        300	   30
      7521 WARD       SALESMAN	      7698 22-FEB-81	   1250        500	   30
      7566 JONES      MANAGER	      7839 02-APR-81	   2975 		   20
      7654 MARTIN     SALESMAN	      7698 28-SEP-81	   1250       1400	   30
      7698 BLAKE      MANAGER	      7839 01-MAY-81	   2850 		   30
      7782 CLARK      MANAGER	      7839 09-JUN-81	   2450 		   10
      7788 SCOTT      ANALYST	      7566 19-APR-87	   3000 		   20
      7839 KING       PRESIDENT 	   17-NOV-81	   5000 		   10
      7844 TURNER     SALESMAN	      7698 08-SEP-81	   1500 	 0	   30
      7876 ADAMS      CLERK	      7788 23-MAY-87	   1100 		   20

     EMPNO ENAME      JOB	       MGR HIREDATE	    SAL       COMM     DEPTNO
---------- ---------- --------- ---------- --------- ---------- ---------- ----------
      7900 JAMES      CLERK	      7698 03-DEC-81	    950 		   30
      7902 FORD       ANALYST	      7566 03-DEC-81	   3000 		   20
      7934 MILLER     CLERK	      7782 23-JAN-82	   1300 		   10

14 rows selected.

SQL> 

数据已恢复。测试结束!

你可能感兴趣的:(数据库)