12C新特性:CDB/PDB的维护命令:将non-CDB数据导入PDB

1、创建测试数据

登录non-CDB,创建数据

[oracle@cat1 ~]$ export ORACLE_SID=orcl1
[oracle@cat1 ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Nov 30 14:47:57 2020
Version 19.3.0.0.0

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

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> create user test identified by test;

User created.

SQL> grant dba to test;

Grant succeeded.

SQL> conn test/test
Connected.
SQL> create table test1 as select * from dba_tables;

Table created.

SQL> select count(*) from dba_tables;

  COUNT(*)
----------
      2179

SQL> 

2、导出non-CDB数据

创建路径

SQL> conn system/oracle
Connected.
SQL> create directory for_exp as '/tmp';

Directory created.

修改为只读模式

SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
--------------------------------------------------------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP
USERS
UNDOTBS2

6 rows selected.

SQL> alter tablespace users read only;

Tablespace altered.

SQL> 

导出数据

[oracle@cat1 ~]$ expdp system/oracle directory=for_exp dumpfile=expfull.dmp full=y transportable=always logfile=exp.log

Export: Release 19.0.0.0.0 - Production on Mon Nov 30 14:59:23 2020
Version 19.3.0.0.0

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

UDE-28002: operation generated ORACLE error 28002
ORA-28002: the password will expire within 7 days

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Starting "SYSTEM"."SYS_EXPORT_FULL_02":  system/******** directory=for_exp dumpfile=expfull.dmp full=y transportable=always logfile=exp.log 
Processing object type DATABASE_EXPORT/EARLY_OPTIONS/VIEWS_AS_TABLES/TABLE_DATA
Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/TABLE_DATA
Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/VIEWS_AS_TABLES/TABLE_DATA
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type DATABASE_EXPORT/STATISTICS/MARKER
Processing object type DATABASE_EXPORT/PLUGTS_FULL/FULL/PLUGTS_TABLESPACE
Processing object type DATABASE_EXPORT/PLUGTS_FULL/PLUGTS_BLK
Processing object type DATABASE_EXPORT/END_PLUGTS_BLK
Processing object type DATABASE_EXPORT/PRE_SYSTEM_IMPCALLOUT/MARKER
Processing object type DATABASE_EXPORT/PRE_INSTANCE_IMPCALLOUT/MARKER
Processing object type DATABASE_EXPORT/TABLESPACE
Processing object type DATABASE_EXPORT/PROFILE
Processing object type DATABASE_EXPORT/SCHEMA/USER
Processing object type DATABASE_EXPORT/RADM_FPTM
Processing object type DATABASE_EXPORT/GRANT/SYSTEM_GRANT/PROC_SYSTEM_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/GRANT/SYSTEM_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/ROLE_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/DEFAULT_ROLE
Processing object type DATABASE_EXPORT/SCHEMA/ON_USER_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/TABLESPACE_QUOTA
Processing object type DATABASE_EXPORT/RESOURCE_COST
Processing object type DATABASE_EXPORT/TRUSTED_DB_LINK
Processing object type DATABASE_EXPORT/DIRECTORY/DIRECTORY
Processing object type DATABASE_EXPORT/DIRECTORY/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type DATABASE_EXPORT/SYSTEM_PROCOBJACT/PRE_SYSTEM_ACTIONS/PROCACT_SYSTEM
Processing object type DATABASE_EXPORT/SYSTEM_PROCOBJACT/PROCOBJ
Processing object type DATABASE_EXPORT/SYSTEM_PROCOBJACT/POST_SYSTEM_ACTIONS/PROCACT_SYSTEM
Processing object type DATABASE_EXPORT/SCHEMA/PROCACT_SCHEMA
Processing object type DATABASE_EXPORT/EARLY_OPTIONS/VIEWS_AS_TABLES/TABLE
Processing object type DATABASE_EXPORT/EARLY_POST_INSTANCE_IMPCALLOUT/MARKER
Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/TABLE
Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/VIEWS_AS_TABLES/TABLE
Processing object type DATABASE_EXPORT/NORMAL_POST_INSTANCE_IMPCALLOUT/MARKER
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/COMMENT
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/INDEX/INDEX
Processing object type DATABASE_EXPORT/FINAL_POST_INSTANCE_IMPCALLOUT/MARKER
Processing object type DATABASE_EXPORT/AUDIT_UNIFIED/AUDIT_POLICY_ENABLE
Processing object type DATABASE_EXPORT/POST_SYSTEM_IMPCALLOUT/MARKER
. . exported "SYS"."KU$_USER_MAPPING_VIEW"               6.070 KB      37 rows
. . exported "SYSTEM"."REDO_DB"                          25.59 KB       1 rows
. . exported "WMSYS"."WM$WORKSPACES_TABLE$"              12.10 KB       1 rows
. . exported "WMSYS"."WM$HINT_TABLE$"                    9.984 KB      97 rows
. . exported "LBACSYS"."OLS$INSTALLATIONS"               6.960 KB       2 rows
. . exported "WMSYS"."WM$WORKSPACE_PRIV_TABLE$"          7.078 KB      11 rows
. . exported "SYS"."DAM_CONFIG_PARAM$"                   6.531 KB      14 rows
. . exported "SYS"."TSDP_SUBPOL$"                        6.328 KB       1 rows
. . exported "WMSYS"."WM$NEXTVER_TABLE$"                 6.375 KB       1 rows
. . exported "LBACSYS"."OLS$PROPS"                       6.234 KB       5 rows
. . exported "WMSYS"."WM$ENV_VARS$"                      6.015 KB       3 rows
. . exported "SYS"."TSDP_PARAMETER$"                     5.953 KB       1 rows
. . exported "SYS"."TSDP_POLICY$"                        5.921 KB       1 rows
. . exported "WMSYS"."WM$VERSION_HIERARCHY_TABLE$"       5.984 KB       1 rows
. . exported "WMSYS"."WM$EVENTS_INFO$"                   5.812 KB      12 rows
. . exported "LBACSYS"."OLS$AUDIT_ACTIONS"               5.757 KB       8 rows
. . exported "LBACSYS"."OLS$DIP_EVENTS"                  5.539 KB       2 rows
. . exported "AUDSYS"."AUD$UNIFIED":"AUD_UNIFIED_P0"     122.7 KB     150 rows
. . exported "AUDSYS"."AUD$UNIFIED":"SYS_P201"           51.90 KB       2 rows
. . exported "LBACSYS"."OLS$AUDIT"                           0 KB       0 rows
. . exported "LBACSYS"."OLS$COMPARTMENTS"                    0 KB       0 rows
. . exported "LBACSYS"."OLS$DIP_DEBUG"                       0 KB       0 rows
. . exported "LBACSYS"."OLS$GROUPS"                          0 KB       0 rows
. . exported "LBACSYS"."OLS$LAB"                             0 KB       0 rows
. . exported "LBACSYS"."OLS$LEVELS"                          0 KB       0 rows
. . exported "LBACSYS"."OLS$POL"                             0 KB       0 rows
. . exported "LBACSYS"."OLS$POLICY_ADMIN"                    0 KB       0 rows
. . exported "LBACSYS"."OLS$POLS"                            0 KB       0 rows
. . exported "LBACSYS"."OLS$POLT"                            0 KB       0 rows
. . exported "LBACSYS"."OLS$PROFILE"                         0 KB       0 rows
. . exported "LBACSYS"."OLS$PROFILES"                        0 KB       0 rows
. . exported "LBACSYS"."OLS$PROG"                            0 KB       0 rows
. . exported "LBACSYS"."OLS$SESSINFO"                        0 KB       0 rows
. . exported "LBACSYS"."OLS$USER"                            0 KB       0 rows
. . exported "LBACSYS"."OLS$USER_COMPARTMENTS"               0 KB       0 rows
. . exported "LBACSYS"."OLS$USER_GROUPS"                     0 KB       0 rows
. . exported "LBACSYS"."OLS$USER_LEVELS"                     0 KB       0 rows
. . exported "SYS"."AUD$"                                    0 KB       0 rows
. . exported "SYS"."DAM_CLEANUP_EVENTS$"                     0 KB       0 rows
. . exported "SYS"."DAM_CLEANUP_JOBS$"                       0 KB       0 rows
. . exported "SYS"."TSDP_ASSOCIATION$"                       0 KB       0 rows
. . exported "SYS"."TSDP_CONDITION$"                         0 KB       0 rows
. . exported "SYS"."TSDP_FEATURE_POLICY$"                    0 KB       0 rows
. . exported "SYS"."TSDP_PROTECTION$"                        0 KB       0 rows
. . exported "SYS"."TSDP_SENSITIVE_DATA$"                    0 KB       0 rows
. . exported "SYS"."TSDP_SENSITIVE_TYPE$"                    0 KB       0 rows
. . exported "SYS"."TSDP_SOURCE$"                            0 KB       0 rows
. . exported "SYSTEM"."REDO_LOG"                             0 KB       0 rows
. . exported "WMSYS"."WM$BATCH_COMPRESSIBLE_TABLES$"         0 KB       0 rows
. . exported "WMSYS"."WM$CONSTRAINTS_TABLE$"                 0 KB       0 rows
. . exported "WMSYS"."WM$CONS_COLUMNS$"                      0 KB       0 rows
. . exported "WMSYS"."WM$LOCKROWS_INFO$"                     0 KB       0 rows
. . exported "WMSYS"."WM$MODIFIED_TABLES$"                   0 KB       0 rows
. . exported "WMSYS"."WM$MP_GRAPH_WORKSPACES_TABLE$"         0 KB       0 rows
. . exported "WMSYS"."WM$MP_PARENT_WORKSPACES_TABLE$"        0 KB       0 rows
. . exported "WMSYS"."WM$NESTED_COLUMNS_TABLE$"              0 KB       0 rows
. . exported "WMSYS"."WM$RESOLVE_WORKSPACES_TABLE$"          0 KB       0 rows
. . exported "WMSYS"."WM$RIC_LOCKING_TABLE$"                 0 KB       0 rows
. . exported "WMSYS"."WM$RIC_TABLE$"                         0 KB       0 rows
. . exported "WMSYS"."WM$RIC_TRIGGERS_TABLE$"                0 KB       0 rows
. . exported "WMSYS"."WM$UDTRIG_DISPATCH_PROCS$"             0 KB       0 rows
. . exported "WMSYS"."WM$UDTRIG_INFO$"                       0 KB       0 rows
. . exported "WMSYS"."WM$VERSION_TABLE$"                     0 KB       0 rows
. . exported "WMSYS"."WM$VT_ERRORS_TABLE$"                   0 KB       0 rows
. . exported "WMSYS"."WM$WORKSPACE_SAVEPOINTS_TABLE$"        0 KB       0 rows
. . exported "MDSYS"."RDF_PARAM$"                        6.515 KB       3 rows
. . exported "SYS"."AUDTAB$TBS$FOR_EXPORT"               5.953 KB       2 rows
. . exported "SYS"."DBA_SENSITIVE_DATA"                      0 KB       0 rows
. . exported "SYS"."DBA_TSDP_POLICY_PROTECTION"              0 KB       0 rows
. . exported "SYS"."FGA_LOG$FOR_EXPORT"                      0 KB       0 rows
. . exported "SYS"."NACL$_ACE_EXP"                           0 KB       0 rows
. . exported "SYS"."NACL$_HOST_EXP"                      6.976 KB       2 rows
. . exported "SYS"."NACL$_WALLET_EXP"                        0 KB       0 rows
. . exported "SYS"."SQL$TEXT_DATAPUMP"                       0 KB       0 rows
. . exported "SYS"."SQL$_DATAPUMP"                           0 KB       0 rows
. . exported "SYS"."SQLOBJ$AUXDATA_DATAPUMP"                 0 KB       0 rows
. . exported "SYS"."SQLOBJ$DATA_DATAPUMP"                    0 KB       0 rows
. . exported "SYS"."SQLOBJ$PLAN_DATAPUMP"                    0 KB       0 rows
. . exported "SYS"."SQLOBJ$_DATAPUMP"                        0 KB       0 rows
. . exported "SYSTEM"."SCHEDULER_JOB_ARGS"                   0 KB       0 rows
. . exported "SYSTEM"."SCHEDULER_PROGRAM_ARGS"               0 KB       0 rows
. . exported "WMSYS"."WM$EXP_MAP"                        7.718 KB       3 rows
. . exported "WMSYS"."WM$METADATA_MAP"                       0 KB       0 rows
. . exported "SYSTEM"."SYS_EXPORT_FULL_01"                   0 KB       0 rows
Master table "SYSTEM"."SYS_EXPORT_FULL_02" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_FULL_02 is:
  /tmp/expfull.dmp
******************************************************************************
Datafiles required for transportable tablespace USERS:
  +DATA/ORCL/DATAFILE/users.267.1051309053    《===注意这个地方的数据文件,需要cp到pdb的数据文件路径下
Job "SYSTEM"."SYS_EXPORT_FULL_02" successfully completed at Mon Nov 30 15:01:45 2020 elapsed 0 00:02:20

3、登录PDB,创建路径

[oracle@cat1 admin]$ sqlplus system/oracle@PDB2_WHS

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Nov 30 15:08:59 2020
Version 19.3.0.0.0

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

Last Successful login time: Sun May 01 2005 21:15:47 +08:00

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> create directory for_exp as '/tmp';

Directory created.

查看表空间,已经存在users表空间,将其rename为users02

SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
--------------------------------------------------------------------------------
SYSTEM
SYSAUX
UNDOTBS1
TEMP
UNDO_2
USERS

SQL> alter tablespace users rename to user02;

查看PDB数据文件路径:

SQL> select file_name from dba_data_files;

FILE_NAME
--------------------------------------------------------------------------------
+DATA1/WHS1/B4D6EBAED583686DE0532900A8C0FDBB/DATAFILE/users.280.1057335893
+DATA1/WHS1/B4D6EBAED583686DE0532900A8C0FDBB/DATAFILE/undo_2.279.1057335893
+DATA1/WHS1/B4D6EBAED583686DE0532900A8C0FDBB/DATAFILE/undotbs1.281.1057335893
+DATA1/WHS1/B4D6EBAED583686DE0532900A8C0FDBB/DATAFILE/sysaux.283.1057335893
+DATA1/WHS1/B4D6EBAED583686DE0532900A8C0FDBB/DATAFILE/system.282.1057335893

拷贝数据文件

ASMCMD> cp +DATA/ORCL/DATAFILE/users.267.1051309053 +DATA1/WHS1/B4D6EBAED583686DE0532900A8C0FDBB/DATAFILE/users_1.dbf
copying +DATA/ORCL/DATAFILE/users.267.1051309053 -> +DATA1/WHS1/B4D6EBAED583686DE0532900A8C0FDBB/DATAFILE/users_1.dbf

4、导入数据

[oracle@cat1 tmp]$ impdp system/oracle@PDB2_WHS directory=for_exp full=y dumpfile=expfull.dmp transport_datafiles='+DATA1/WHS1/B4D6EBAED583686DE0532900A8C0FDBB/DATAFILE/users_1.dbf' logfile=imp.log cluster=N

Import: Release 19.0.0.0.0 - Production on Mon Nov 30 15:34:17 2020
Version 19.3.0.0.0

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

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
ORA-39002: invalid operation
ORA-39126: Worker unexpected fatal error in KUPW$WORKER.DISPATCH_WORK_ITEMS [SELECT old_value FROM "SYSTEM"."SYS_IMPORT_FULL_01" WHERE process_order = :1] 
ORA-25153: Temporary Tablespace is Empty

ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPW$WORKER", line 12613
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.DBMS_LOB", line 741
ORA-06512: at "SYS.KUPW$WORKER", line 13683

----- PL/SQL Call Stack -----
  object      line  object
  handle    number  name
0x63dba548     33476  package body SYS.KUPW$WORKER.WRITE_ERROR_INFORMATION
0x63dba548     12641  package body SYS.KUPW$WORKER.DETERMINE_FATAL_ERROR
0x63dba548     13961  package body SYS.KUPW$WORKER.DISPATCH_WORK_ITEMS
0x63dba548      2429  package body SYS.KUPW$WORKER.MAIN
0x63e78870         2  anonymous block

KUPW: In procedure DISPATCH_WORK_ITEMS
KUPW: Open Cursor Check took 0 seconds
KUPW: In procedure SEND_MSG. Fatal=0
KUPC$QUEUE.TRANSCEIVE
KUPC$QUEUE.TRANSCEIVE
KUPW: Saved debug_info: 0
KUPW: Master debug flags: 0
KUPW: Current debug_info: 0
DBMS_LOB.CREATETEMPORARY v_md_xml_clob
KUPW: In procedure DETERMINE_FATAL_ERROR with ORA-25153: Temporary Tablespace is Empty
ORA-06512: at "SYS.DBMS_LOB", line 741

以上报错没有临时表空间,确认查看:

[oracle@cat1 ~]$ sqlplus system/oracle@PDB2_WHS

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Nov 30 15:36:28 2020
Version 19.3.0.0.0

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

Last Successful login time: Mon Nov 30 2020 15:34:17 +08:00

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> select tablespace_name,status from dba_tablespaces where tablespace_name='TEMP';

TABLESPACE_NAME
--------------------------------------------------------------------------------
STATUS
---------------------------
TEMP
ONLINE

SQL>  select file_name,tablespace_name from dba_temp_files;

no rows selected

确实没有数据文件,手动增加数据文件

SQL> alter tablespace temp add tempfile '+DATA1' SIZE 1g AUTOEXTEND OFF;

Tablespace altered.

SQL>  select file_name,tablespace_name from dba_temp_files;

FILE_NAME
--------------------------------------------------------------------------------
TABLESPACE_NAME
--------------------------------------------------------------------------------
+DATA1/WHS1/B4D6EBAED583686DE0532900A8C0FDBB/TEMPFILE/temp.301.1057851553
TEMP

导入数据

[oracle@cat1 tmp]$ impdp system/oracle@PDB2_WHS directory=for_exp full=y dumpfile=expfull.dmp transport_datafiles='+DATA1/WHS1/B4D6EBAED583686DE0532900A8C0FDBB/DATAFILE/users_1.dbf' logfile=imp.log cluster=N

Import: Release 19.0.0.0.0 - Production on Mon Nov 30 15:45:20 2020
Version 19.3.0.0.0

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

Connected to: Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Master table "SYSTEM"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_FULL_01":  system/********@PDB2_WHS directory=for_exp full=y dumpfile=expfull.dmp transport_datafiles=+DATA1/WHS1/B4D6EBAED583686DE0532900A8C0FDBB/DATAFILE/users_1.dbf logfile=imp.log cluster=N 
Processing object type DATABASE_EXPORT/PRE_SYSTEM_IMPCALLOUT/MARKER
Processing object type DATABASE_EXPORT/PRE_INSTANCE_IMPCALLOUT/MARKER
Processing object type DATABASE_EXPORT/PLUGTS_FULL/PLUGTS_BLK
Processing object type DATABASE_EXPORT/TABLESPACE
ORA-31684: Object type TABLESPACE:"UNDOTBS1" already exists

ORA-31684: Object type TABLESPACE:"TEMP" already exists

Processing object type DATABASE_EXPORT/PROFILE
Processing object type DATABASE_EXPORT/SCHEMA/USER
Processing object type DATABASE_EXPORT/RADM_FPTM
Processing object type DATABASE_EXPORT/GRANT/SYSTEM_GRANT/PROC_SYSTEM_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/GRANT/SYSTEM_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/ROLE_GRANT
ORA-39083: Object type ROLE_GRANT failed to create with error:
ORA-01917: user or role 'GSMROOTUSER' does not exist

Failing sql is:
 GRANT "GSMROOTUSER_ROLE" TO "GSMROOTUSER"

Processing object type DATABASE_EXPORT/SCHEMA/DEFAULT_ROLE
ORA-39083: Object type DEFAULT_ROLE:"GSMROOTUSER" failed to create with error:
ORA-01918: user 'GSMROOTUSER' does not exist

Failing sql is:
 ALTER USER "GSMROOTUSER" DEFAULT ROLE ALL

Processing object type DATABASE_EXPORT/SCHEMA/ON_USER_GRANT
ORA-39083: Object type ON_USER_GRANT failed to create with error:
ORA-31625: Schema GSMROOTUSER is needed to import this object, but is unaccessible
ORA-01435: user does not exist

Failing sql is:
 GRANT INHERIT PRIVILEGES ON USER "GSMROOTUSER" TO "PUBLIC"

Processing object type DATABASE_EXPORT/SCHEMA/TABLESPACE_QUOTA
Processing object type DATABASE_EXPORT/RESOURCE_COST
Processing object type DATABASE_EXPORT/TRUSTED_DB_LINK
Processing object type DATABASE_EXPORT/DIRECTORY/DIRECTORY
ORA-31684: Object type DIRECTORY:"FOR_EXP" already exists

Processing object type DATABASE_EXPORT/DIRECTORY/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type DATABASE_EXPORT/SYSTEM_PROCOBJACT/PRE_SYSTEM_ACTIONS/PROCACT_SYSTEM
Processing object type DATABASE_EXPORT/SYSTEM_PROCOBJACT/PROCOBJ
Processing object type DATABASE_EXPORT/SYSTEM_PROCOBJACT/POST_SYSTEM_ACTIONS/PROCACT_SYSTEM
Processing object type DATABASE_EXPORT/SCHEMA/PROCACT_SCHEMA
ORA-39083: Object type PROCACT_SCHEMA failed to create with error:
ORA-31625: Schema GSMROOTUSER is needed to import this object, but is unaccessible
ORA-01435: user does not exist

Failing sql is:
BEGIN 
sys.dbms_logrep_imp.instantiate_schema(schema_name=>SYS_CONTEXT('USERENV','CURRENT_SCHEMA'), export_db_name=>'ORCL', inst_scn=>'2070080');COMMIT; END; 

Processing object type DATABASE_EXPORT/EARLY_OPTIONS/VIEWS_AS_TABLES/TABLE
Processing object type DATABASE_EXPORT/EARLY_OPTIONS/VIEWS_AS_TABLES/TABLE_DATA
. . imported "SYS"."KU$_EXPORT_USER_MAP"                 6.070 KB      37 rows
Processing object type DATABASE_EXPORT/EARLY_POST_INSTANCE_IMPCALLOUT/MARKER
Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/TABLE
Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/TABLE_DATA
. . imported "SYSTEM"."REDO_DB_TMP"                      25.59 KB       1 rows
. . imported "WMSYS"."E$WORKSPACES_TABLE$"               12.10 KB       1 rows
. . imported "WMSYS"."E$HINT_TABLE$"                     9.984 KB      97 rows
. . imported "WMSYS"."E$WORKSPACE_PRIV_TABLE$"           7.078 KB      11 rows
. . imported "SYS"."AMGT$DP$DAM_CONFIG_PARAM$"           6.531 KB      14 rows
. . imported "SYS"."DP$TSDP_SUBPOL$"                     6.328 KB       1 rows
. . imported "WMSYS"."E$NEXTVER_TABLE$"                  6.375 KB       1 rows
. . imported "WMSYS"."E$ENV_VARS$"                       6.015 KB       3 rows
. . imported "SYS"."DP$TSDP_PARAMETER$"                  5.953 KB       1 rows
. . imported "SYS"."DP$TSDP_POLICY$"                     5.921 KB       1 rows
. . imported "WMSYS"."E$VERSION_HIERARCHY_TABLE$"        5.984 KB       1 rows
. . imported "WMSYS"."E$EVENTS_INFO$"                    5.812 KB      12 rows
. . imported "AUDSYS"."AMGT$DP$AUD$UNIFIED":"AUD_UNIFIED_P0"  122.7 KB     150 rows
. . imported "AUDSYS"."AMGT$DP$AUD$UNIFIED":"SYS_P201"   51.90 KB       2 rows
. . imported "LBACSYS"."OLS_DP$OLS$AUDIT"                    0 KB       0 rows
. . imported "LBACSYS"."OLS_DP$OLS$COMPARTMENTS"             0 KB       0 rows
. . imported "LBACSYS"."OLS_DP$OLS$GROUPS"                   0 KB       0 rows
. . imported "LBACSYS"."OLS_DP$OLS$LAB"                      0 KB       0 rows
. . imported "LBACSYS"."OLS_DP$OLS$LEVELS"                   0 KB       0 rows
. . imported "LBACSYS"."OLS_DP$OLS$POL"                      0 KB       0 rows
. . imported "LBACSYS"."OLS_DP$OLS$POLS"                     0 KB       0 rows
. . imported "LBACSYS"."OLS_DP$OLS$POLT"                     0 KB       0 rows
. . imported "LBACSYS"."OLS_DP$OLS$PROFILE"                  0 KB       0 rows
. . imported "LBACSYS"."OLS_DP$OLS$PROG"                     0 KB       0 rows
. . imported "LBACSYS"."OLS_DP$OLS$USER"                     0 KB       0 rows
. . imported "SYS"."AMGT$DP$AUD$"                            0 KB       0 rows
. . imported "SYS"."AMGT$DP$DAM_CLEANUP_EVENTS$"             0 KB       0 rows
. . imported "SYS"."AMGT$DP$DAM_CLEANUP_JOBS$"               0 KB       0 rows
. . imported "SYS"."DP$TSDP_ASSOCIATION$"                    0 KB       0 rows
. . imported "SYS"."DP$TSDP_CONDITION$"                      0 KB       0 rows
. . imported "SYS"."DP$TSDP_FEATURE_POLICY$"                 0 KB       0 rows
. . imported "SYS"."DP$TSDP_PROTECTION$"                     0 KB       0 rows
. . imported "SYS"."DP$TSDP_SENSITIVE_DATA$"                 0 KB       0 rows
. . imported "SYS"."DP$TSDP_SENSITIVE_TYPE$"                 0 KB       0 rows
. . imported "SYS"."DP$TSDP_SOURCE$"                         0 KB       0 rows
. . imported "SYSTEM"."REDO_LOG_TMP"                         0 KB       0 rows
. . imported "WMSYS"."E$BATCH_COMPRESSIBLE_TABLES$"          0 KB       0 rows
. . imported "WMSYS"."E$CONSTRAINTS_TABLE$"                  0 KB       0 rows
. . imported "WMSYS"."E$CONS_COLUMNS$"                       0 KB       0 rows
. . imported "WMSYS"."E$LOCKROWS_INFO$"                      0 KB       0 rows
. . imported "WMSYS"."E$MODIFIED_TABLES$"                    0 KB       0 rows
. . imported "WMSYS"."E$MP_GRAPH_WORKSPACES_TABLE$"          0 KB       0 rows
. . imported "WMSYS"."E$MP_PARENT_WORKSPACES_TABLE$"         0 KB       0 rows
. . imported "WMSYS"."E$NESTED_COLUMNS_TABLE$"               0 KB       0 rows
. . imported "WMSYS"."E$RESOLVE_WORKSPACES_TABLE$"           0 KB       0 rows
. . imported "WMSYS"."E$RIC_LOCKING_TABLE$"                  0 KB       0 rows
. . imported "WMSYS"."E$RIC_TABLE$"                          0 KB       0 rows
. . imported "WMSYS"."E$RIC_TRIGGERS_TABLE$"                 0 KB       0 rows
. . imported "WMSYS"."E$UDTRIG_DISPATCH_PROCS$"              0 KB       0 rows
. . imported "WMSYS"."E$UDTRIG_INFO$"                        0 KB       0 rows
. . imported "WMSYS"."E$VERSION_TABLE$"                      0 KB       0 rows
. . imported "WMSYS"."E$VT_ERRORS_TABLE$"                    0 KB       0 rows
. . imported "WMSYS"."E$WORKSPACE_SAVEPOINTS_TABLE$"         0 KB       0 rows
Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/VIEWS_AS_TABLES/TABLE
Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/VIEWS_AS_TABLES/TABLE_DATA
. . imported "MDSYS"."RDF_PARAM$TBL"                     6.515 KB       3 rows
. . imported "SYS"."AMGT$DP$AUDTAB$TBS$FOR_EXPORT"       5.953 KB       2 rows
. . imported "SYS"."DP$DBA_SENSITIVE_DATA"                   0 KB       0 rows
. . imported "SYS"."DP$DBA_TSDP_POLICY_PROTECTION"           0 KB       0 rows
. . imported "SYS"."AMGT$DP$FGA_LOG$FOR_EXPORT"              0 KB       0 rows
. . imported "SYS"."NACL$_ACE_IMP"                           0 KB       0 rows
. . imported "SYS"."NACL$_HOST_IMP"                      6.976 KB       2 rows
. . imported "SYS"."NACL$_WALLET_IMP"                        0 KB       0 rows
. . imported "SYS"."DATAPUMP$SQL$TEXT"                       0 KB       0 rows
. . imported "SYS"."DATAPUMP$SQL$"                           0 KB       0 rows
. . imported "SYS"."DATAPUMP$SQLOBJ$AUXDATA"                 0 KB       0 rows
. . imported "SYS"."DATAPUMP$SQLOBJ$DATA"                    0 KB       0 rows
. . imported "SYS"."DATAPUMP$SQLOBJ$PLAN"                    0 KB       0 rows
. . imported "SYS"."DATAPUMP$SQLOBJ$"                        0 KB       0 rows
. . imported "SYSTEM"."SCHEDULER_JOB_ARGS_TMP"               0 KB       0 rows
. . imported "SYSTEM"."SCHEDULER_PROGRAM_ARGS_TMP"           0 KB       0 rows
. . imported "WMSYS"."E$EXP_MAP"                         7.718 KB       3 rows
. . imported "WMSYS"."E$METADATA_MAP"                        0 KB       0 rows
Processing object type DATABASE_EXPORT/NORMAL_POST_INSTANCE_IMPCALLOUT/MARKER
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
. . imported "SYSTEM"."SYS_EXPORT_FULL_01"                   0 KB       0 rows
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/COMMENT
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type DATABASE_EXPORT/STATISTICS/MARKER
Processing object type DATABASE_EXPORT/END_PLUGTS_BLK
Processing object type DATABASE_EXPORT/FINAL_POST_INSTANCE_IMPCALLOUT/MARKER
Processing object type DATABASE_EXPORT/AUDIT_UNIFIED/AUDIT_POLICY_ENABLE
Processing object type DATABASE_EXPORT/POST_SYSTEM_IMPCALLOUT/MARKER
Job "SYSTEM"."SYS_IMPORT_FULL_01" completed with 7 error(s) at Mon Nov 30 15:46:56 2020 elapsed 0 00:01:35

5、验证:

[oracle@cat1 ~]$ sqlplus test/test@PDB2_WHS

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Nov 30 15:49:05 2020
Version 19.3.0.0.0

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

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0

SQL> select count(*) from test1;

  COUNT(*)
----------
      2178

SQL> 

Related Posts