当前位置: 移动技术网 > IT编程>数据库>Oracle > CMD操作oracle数据导库过程图解

CMD操作oracle数据导库过程图解

2020年08月17日  | 移动技术网IT编程  | 我要评论
1.cmd窗口下,登陆管理员用户:sqlplus sys/1 as sysdba2.创建新用户并为用户授权:  (1)创建用户---create the usercreate user helq3_p

1.cmd窗口下,登陆管理员用户:sqlplus sys/1 as sysdba

2.创建新用户并为用户授权:

  (1)创建用户

---create the user
create user helq3_pro
identified by "1"
default tablespace mof
temporary tablespace temp
profile default;

  (2)为用户授权

sql> grant dba to helq3_cpbgt_20200714 with admin option;
sql> grant unlimited tablespace to helq3_cpbgt_20200714 with admin option;
sql> grant imp_full_database to helq3_cpbgt_20200714;

3.数据导入

  (1)imp导入:

imp userid=helq3_cpbgt_20200714/1@orcl file=e:\cpcz.dmp full=yignore=y 

  (2)数据泵导入impdp

    首先,创建,并为用户授权此文件夹

    数据泵导入:

impdp helq3_cpbgt_20200714/1 dumpfile=cpcz.dmp directory=expdp_dir remap_schema=helq3_cpbgt_20200714(导出时的用户名):helq3_cpbgt_20200714

4.数据导出

  (1)exp导出:

exp helq3_cpbgt_20200714/1@orcl file=e:\cpcz.dmp log=cpcz.log

    导出带空表的数据库->先做查询,再正常导出:

select 'alter table '||table_name||' allocate extent;' from user_tables where num_rows=0;

  (2)expdp 数据泵导出:

expdp helq3_cpbgt_20200714/1@orclschemas=helq3_cpbgt_20200714 dumpfile=cpcz.dmp directory=expdp_dir logfile=cpcz.log

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持移动技术网。

如您对本文有疑问或者有任何想说的,请 点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网