SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
. . imported "TEST2"."DEPT" 5.656 KB 4 rows
. . imported "TEST2"."EMP" 7.820 KB 14 rows
. . imported "TEST2"."SALGRADE" 5.585 KB 5 rows
. . imported "TEST2"."BONUS" 0 KB 0 rows
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "SYSTEM"."SYS_IMPORT_FULL_01" successfully completed at 19:10:40
创建之后的用户最好立即修改密码:
SQL> alter user test2 identified by oracle;
User altered.
SQL> alter user test2 account unlock;
User altered.
SQL> grant connect,resource to test2;
Grant succeeded.
SQL> conn test2/oracle
Connected.
SQL> select tname from tab;
TNAME
------------------------------
DEPT
EMP
BONUS
SALGRADE
SQL> select username,default_tablespace from user_users;
USERNAME DEFAULT_TABLESPACE
------------------------------ ------------------------------
TEST2 USERS
DBLINK:
在Data Pump Import中的Impdp:将远端数据库中的数据导入到本地的数据库
SQL> create public database link impdp_link connect to scott identified by oracle using 'orcl_192.168.1.222';
Database link created.
SQL> select username,default_tablespace from user_users;
USERNAME DEFAULT_TABLESPACE
------------------------------ ------------------------------
TEST USERS
SQL> select table_name,tablespace_name from user_tables;
no rows selected
[oracle@localhost ~]$ impdp test/oracle network_link=impdp_link nologfile=y remap_schema=scott:test
Import: Release 10.2.0.1.0 - Production on Saturday, 12 April, 2014 19:42:15
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
Starting "TEST"."SYS_IMPORT_SCHEMA_01": test/******** network_link=impdp_link nologfile=y remap_schema=scott:test
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 192 KB
Processing object type SCHEMA_EXPORT/USER
ORA-31684: Object type USER:"TEST" 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/TABLE/TABLE
. . imported "TEST"."DEPT" 4 rows
. . imported "TEST"."EMP" 14 rows
. . imported "TEST"."SALGRADE" 5 rows
. . imported "TEST"."BONUS" 0 rows
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Job "TEST"."SYS_IMPORT_SCHEMA_01" completed with 1 error(s) at 19:42:58
ORA-31684: Object type USER:"TEST" already exists
这个不用管,提示用户已存在……
SQL> select * from tab;
TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
DEPT TABLE
EMP TABLE
BONUS TABLE
SALGRADE TA