SQL> select username,default_tablespace,temporary_tablespace from dba_users where username='TSPITR';
USERNAME DEFAULT_TABLESPACE TEMPORARY_TABLESPACE
------------------------------ ------------------------------ ------------------------------
TSPITR USERS TEMP
[oracle@sjjh transport]$ impdp \'sys/xxzx7817600@SJJH as sysdba\' directory=test_dump dumpfile=tspitr.dmp transport_datafiles=/home/transport/data_D-RLZY_I-
1589671076_TS-TSPITR_FNO-21_orrj67ic
Import: Release 11.2.0.4.0 - Production on Mon Oct 24 17:22:29 2016
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 "SYS"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
Starting "SYS"."SYS_IMPORT_TRANSPORTABLE_01": "sys/********@SJJH AS SYSDBA" directory=test_dump dumpfile=tspitr.dmp transport_datafiles=/home/transport/data_D-
RLZY_I-1589671076_TS-TSPITR_FNO-21_orrj67ic
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Job "SYS"."SYS_IMPORT_TRANSPORTABLE_01" successfully completed at Mon Oct 24 17:22:37 2016 elapsed 0 00:00:04
导入用户tspitr下其它对象的元数据:
SQL> select tablespace_name,status from dba_tablespaces where tablespace_name='TSPITR';
TABLESPACE_NAME STATUS
------------------------------ ---------
TSPITR READ ONLY
SQL> alter tablespace tspitr read write;
Tablespace altered.
[oracle@sjjh transport]$ impdp tspitr/tspitr directory=test_dump dumpfile=tspitr_metadata_only.dmp
Import: Release 11.2.0.4.0 - Production on Mon Oct 24 17:47:38 2016
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 "TSPITR"."SYS_IMPORT_FULL_01" successfully loaded/unloaded
Starting "TSPITR"."SYS_IMPORT_FULL_01": tspitr/******** directory=test_dump dumpfile=tspitr_metadata_only.dmp
Processing object type SCHEMA_EXPORT/USER
ORA-31684: Object type USER:"TSPITR" already exists
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/VIEW/VIEW
Job "TSPITR"."SYS_IMPORT_FULL_01" completed with 1 error(s) at Mon Oct 24 17:47:40 2016 elapsed 0 00:00:01
SQL> select owner,view_name,text from dba_views where owner='TSPITR';
OWNER VIEW_NAME TEXT
------------------------------ ------------------------------ --------------------------------------------------------------------------------
TSPITR TSPITR_VIEW select "OWNER","OBJECT_NAME","SUBOBJECT_NAME","OBJECT_ID","DATA_OBJECT_ID","OBJE
查询tspitr表中的记录,与源数据库中的记录数一致。
SQL> select count(*) from tspitr.tspitr;
COUNT(*)
----------
50315
现在用户tspitr的缺省表空间不是tspitr
SQL> select username,default_tablespace,temporary_tablespace from dba_users where username='TSPITR';
USERNAME DEFAULT_TABLESPACE TEMPORARY_TABLESPACE
------------------------------ ------------------------------ ------------------------------
TSPITR USERS TEMP
将用户tspitr的缺省表空间修改为tspitr
SQL> alter user tspitr default tablespace tspitr;
User altered