rac创建dblink并使用impdp抽取源库数据 赋权并创建dblink [plain] view plaincopyprint?[oracle@zhongwc1 ~]$ sqlplus / as sysd
rac创建dblink并使用impdp抽取源库数据
赋权并创建dblink
[plain] view plaincopyprint?
[oracle@zhongwc1 ~]$ sqlplus / as sysdba
sql*plus: release 11.2.0.3.0 production on mon feb 4 10:26:45 2013
copyright (c) 1982, 2011, oracle.  all rights reserved.
connected to:  
oracle database 11g enterprise edition release 11.2.0.3.0 - 64bit production  
with the partitioning, real application clusters, automatic storage management, olap,  
data mining and real application testing options
sql> grant create database link to zwc;
grant succeeded.
sql> conn zwc/  
enter password:   
connected.  
sql> show user  
user is zwc  
sql> select tname from tab;
no rows selected 
[oracle@zhongwc1 ~]$ sqlplus / as sysdba
sql*plus: release 11.2.0.3.0 production on mon feb 4 10:26:45 2013
copyright (c) 1982, 2011, oracle.  all rights reserved.
connected to:
oracle database 11g enterprise edition release 11.2.0.3.0 - 64bit production
with the partitioning, real application clusters, automatic storage management, olap,
data mining and real application testing options
sql> grant create database link to zwc;
grant succeeded.
sql> conn zwc/
enter password: 
connected.
sql> show user
user is zwc
sql> select tname from tab;
no rows selected[plain] view plaincopyprint?
create public database link zwc  
  connect to zhongwc identified by zhongwc  
  using '(description =  
    (address = (protocol = tcp)(host = 192.168.1.201)(port = 1521))  
    (connect_data =  
      (server = dedicated)  
      (service_name = zwc)  
    )  
  9    )';
database link created.
sql> select * from dual@zwc;
d  
-  
x
sql> show user  
user is zwc  
sql> select tname from tab;
no rows selected 
--------------------------------------------------------------------------------------
sql> select tname from tab@zwc;
tname  
------------------------------  
t_zhongwc
sql> select count(*) from t_zhongwc;  
select count(*) from t_zhongwc  
                     *  
error at line 1:  
ora-00942: table or view does not exist
sql> select count(*) from t_zhongwc@zwc;
count(*)  
----------  
     75453
sql> exit  
disconnected from oracle database 11g enterprise edition release 11.2.0.3.0 - 64bit production  
with the partitioning, real application clusters, automatic storage management, olap,  
data mining and real application testing options  
[oracle@zhongwc1 ~]$ impdp system/oracle network_link=zwc schemas=zhongwc remap_schema=zhongwc:zwc
import: release 11.2.0.3.0 - production on mon feb 4 10:47:45 2013
copyright (c) 1982, 2011, oracle and/or its affiliates.  all rights reserved.
connected to: oracle database 11g enterprise edition release 11.2.0.3.0 - 64bit production  
with the partitioning, real application clusters, automatic storage management, olap,  
data mining and real application testing options  
starting system.sys_import_schema_01:  system/******** network_link=zwc schemas=zhongwc remap_schema=zhongwc:zwc   
estimate in progress using blocks method...  
processing object type schema_export/table/table_data  
total estimation using blocks method: 9 mb  
processing object type schema_export/user  
ora-31684: object type user:zwc 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 zwc.t_zhongwc                            75453 rows  
job system.sys_import_schema_01 completed with 1 error(s) at 10:48:32 
create public database link zwc
  connect to zhongwc identified by zhongwc
  using '(description =
    (address = (protocol = tcp)(host = 192.168.1.201)(port = 1521))
    (connect_data =
      (server = dedicated)
      (service_name = zwc)
    )
  9    )';
database link created.
sql> select * from dual@zwc;
d
-
x
sql> show user
user is zwc
sql> select tname from tab;
no rows selected
sql> select tname from tab@zwc;
tname
------------------------------
t_zhongwc
   
 
   