1、备库建相关表空间和用户。
2、配置备库tnsname.ora文件。
vi /app/oracle/product/11.2.0/db_1/network/admin/tnsnames.ora
tlrdb_164.106 =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 172.31.164.106)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = tlrdb)
)
)
[oracle@lzadgtest01 ~]$ tnsping tlrdb_164.106
TNS Ping Utility for Linux: Version 11.2.0.4.0 - Production on 17-NOV-2017 09:29:25
Copyright (c) 1997, 2013, Oracle. All rights reserved.
Used parameter files:
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 172.31.164.106)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = tlrdb)))
OK (0 msec)
测试连接:
sqlplus teller/teller@tlrdb_164.106
3、备库创建dblink。
[oracle@lzadgtest01 ~]$ export ORACLE_SID=tlrdb1
[oracle@lzadgtest01 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Fri Nov 17 09:31:41 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
SQL> create public database link tellerlink using 'tlrdb_164.106';
Database link created.
SQL> connect teller/teller;
Connected.
SQL> create database link tellerlink connect to teller identified by teller;
Database link created.
SQL> select * from dba_db_links;
OWNER DB_LINK USERNAME HOST CREATED
------------------------------ ------------------------------ ---------- ------------------------------ -------------------
PUBLIC TELLERLINK tlrdb_164.106 2017-11-17 09:32:42
TELLER TELLERLINK TELLER 2017-11-17 09:33:44
3、impdp
impdp teller network_link=tellerlink schemas=teller cluster=N parallel=4