在sqlplus里执行
create directory backup as '/data/oracle/oradata/mydata'--这里选择一个文件夹存放dmp文件
grant read,write on directory backup to system
退出到linux终端或windos cmd执行
expdp systemtest directory=backup dumpfile=test.dmp logfile=test.log consistent=y exclude=statistics schemas=sunbaby CLUSTER=N
impdp system/test directory=backup dumpfile=test.dmp logfile=test.log CLUSTER=N transform=oid:n
你的意思是要用管理员用户新建普通用户,然后将相应的dmp数据文件导入到这个用户下,是吗?新建脚本语句:
-----------------SYS创建用户
CREATE USER dandeliondshtest PROFILE "DEFAULT" IDENTIFIED BY dandeliondshtest DEFAULT
TABLESPACE "USERS" TEMPORARY
TABLESPACE "TEMP" ACCOUNT UNLOCK
GRANT SELECT ON "SYS"."V_$SESSION" TO dandeliondshtest
GRANT "CONNECT" TO dandeliondshtest
GRANT "DBA" TO dandeliondshtest
GRANT "RESOURCE" TO dandeliondshtest
GRANT CREATE ANY sequence TO dandeliondshtest
CREATE USER dandelionids IDENTIFIED BY dandelionids
grant create session to dandelionids--授予zhangsan用户创建session的权限,即登陆权限
grant unlimited tablespace to dandelionids--授予zhangsan用户使用表空间的权限
grant create table to dandelionids--授予创建表的权限
grant drop table to dandelionids--授予删除表的权限
导入dmp文件是在dos命令窗口中来执行的,impdp 用户名/密码@IP/pdborcl dumpfile=bak_dir:文件名.DMP nologfile=Y (单击回车)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)