oracle数据泵单独导出建用户语句

测试用户创建
SQL> create user milk identified by milk;

User created.

SQL> grant dba to milk;

Grant succeeded.

SQL> create user milk1 identified by milk;

User created.

SQL> grant connect,resource to milk1;

Grant succeeded.


导出的目录创建


SQL> create directory dir_aq as '/home/oracle/';

Directory created.

SQL> exit

编辑导出脚本
[oracle@g1 ~]$ cat exp.par 
userid='/ as sysdba'
logfile=123.log
include=user
schemas=milk,milk1
directory=dir_aq
dumpfile=123.dmp


编辑导入txt的脚本
[oracle@g1 ~]$ cat expdp.par 
userid='/ as sysdba'
sqlfile=123.sql
logfile=123.log
include=user
schemas=milk,milk1
directory=dir_aq
dumpfile=123.dmp


开始导出用户
[oracle@g1 ~]$expdp parfile=exp.par
开始导入成sql语句
[oracle@g1 ~]$impdp parfile=expdp.par

本地有123.sql就是建用户语句
[oracle@g1 ~]$ cat 123.sql 
-- CONNECT SYS
ALTER SESSION SET EVENTS '10150 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '10904 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '25475 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '10407 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '10851 TRACE NAME CONTEXT FOREVER, LEVEL 1';
ALTER SESSION SET EVENTS '22830 TRACE NAME CONTEXT FOREVER, LEVEL 192 ';
-- new object type path: SCHEMA_EXPORT/USER
-- CONNECT SYSTEM
 CREATE USER "MILK" IDENTIFIED BY VALUES 'S:C345EB607A7EC1D7EE6D4F56F4311327BF2189552D6B0822
B4E1BB42C42E;FFE1199AE956431E'      DEFAULT TABLESPACE "USERS"
      TEMPORARY TABLESPACE "TEMP";
 CREATE USER "MILK1" IDENTIFIED BY VALUES 'S:87F32830A175754038DAD04746B502493F6B37CAA692F1F
8A5A169EF8612;548D1A7D4F5CE4AC'      DEFAULT TABLESPACE "USERS"
      TEMPORARY TABLESPACE "TEMP";

将这个123.sql拿到新库去跑,就创建用户了。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值