使用数据impdb、expdb导入导出数据
expdp主要通过network_link参数,实现异地备份;
一:环境说明
备份服务器:
DB:oracle 11.2.0.4.0
OS: Microsoft Windows 7
数据库服务器:
DB:11.2.0.1.0
OS: Red Hat Enterprise Linux Server release 6.4 (Santiago)
需要备份的用户:test/a
二:备份服务器,创建连接数据库服务器的tnsname.ora
D:appAdministratorproduct11.2.0dbhome_1NETWORKADMIN nsnames.ora
test =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 20.10.81.3)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
)
)
三:备份服务器,创建dblink连接正式数据库用户test
SQL> create public database link test connect to test identified by a using 'test';
四:备份服务器,创建执行备份操作的用户
SQL> create user backup identified by backup;
SQL> grant connect,resource,dba to backup;
五:备份服务器,创建备份目录及授权
---D:BACKUPexpdp
SQL> create or replace directory zs_dir as ' D:BACKUPexpdp';
SQL> grant read,write on directory zs_dir to backup;
SQL> grant exp_full_database to backup;
六:备份服务器,执行备份操作
expdp backup/backup directory=zs_dir schemas=test dumpfile=zsbackup.dmp logfile=test.log network_link='test'
备份文件自动生成在备份服务器上,而不是数据库服务器本地;
终止imp/exp和expdp/impdp进程运行的方法https://www.2cto.com/database/201308/238174.html