数据泵导出远程服务器数据库到本地

 

--oracle创建本地用户 whnurse 密码 1
-- Create the user
create user whnurse
  identified by "1"
  default tablespace USERS
  temporary tablespace TEMP
  profile DEFAULT;
-- Grant/Revoke role privileges
grant connect to whnurse;
grant dba to whnurse;
grant resource to whnurse;
-- Grant/Revoke system privileges
grant create procedure to whnurse with admin option;
grant create table to whnurse with admin option;
grant create tablespace to whnurse with admin option;
grant create user to whnurse;
grant create view to whnurse with admin option;
grant debug connect session to whnurse with admin option;
grant unlimited tablespace to whnurse with admin option;

 赋予用户权限

grant connect,resource to whnurse;
grant create table,create database link to whnurse;
--dump_dir为oracle识别名字(名字指向路径),'E:\emp'需要自己在本地创建
--也就是oracle通过dump_dir这个名字来识别 'E:\emp'这个路径
create or replace directory dump_dir as 'E:\emp';
select * from dba_directories;
--给用户授予目录读写权限,dump_dir为刚才的虚拟路径名字
grant read,write on directory dump_dir to whnurse;

以whnurse用户登陆  whnurse/1

--创建网络数据库链接,whnurseLink为link名字,随意起,whnurse为远程数据库名字,"1"为远程数据库密码,
--'10.0.0.7:1521/ORCL';为远程端口号
create public database link whnurseLink connect to whnurse identified by "1" using '10.0.0.7:1521/ORCL';

--查询创建的网络链接
select * from global_name@whnurseLink;
--显示结果为GLOBAL_NAME

cmd下导出

--whnurse/1 远程数据库账号密码
--dump_dir 文件导出的虚拟路径 导出后存放在 E:\emp中
--whnurse.dmp 导出文件名称
--whnurseLink 远程连接
expdp whnurse/1@orcl directory=dump_dir dumpfile=whnurse.dmp logfile=whnurse.log network_link=whnurseLink


 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值