数据库导入导出数据解释
--新建用户(sibpm_hc:用户名,sibpm_osa_f_hc:密码)
create user sibpm_hc identified by sibpm_osa_f_hc
--授权
grant dba,connect to sibpm_hc
--cmd 运行,不用登陆
--导出所有sibpm_osa_f_copy用户下的所有表
exp sibpm_osa_f_copy/sibpm_osa_f_copy@xx.xx.xx/orcl file=E:\biao.dmp owner=sibpm_osa_f_copy
--导入所有表到新建用户sibpm_hc中
imp sibpm_hc/sibpm_osa_f_hc@xx.xx:xx/orcl file=E:\biao.dmp full=y
--导出某张表
exp sibpm_osa_f_copy/sibpm_osa_f_copy@xx.xx:xx/orcl tables=(sibpm_card_network_0408) file=E:\sibpm_card_network_0408.dmp
--导入某张表
imp sibpm_hc/sibpm_osa_f_hc@xx.xx:xx/orcl file=E:\sibpm_card_network_0408.dmp ignore=y full=y
存在两个文件.dmp和.log
导入数据,对没有某些权限的数据库,需要进行导入,再导出导入中介操作
--导入表
--创建目录
create directory data_dir as ‘E:\ora\data‘;
--查看所有目录
select * from dba_directories;
--导入表
impdp sibpm_osa_f_copy/sibpm_osa_f_copy@xx.xx:xx/orcl REMAP_SCHEMA=BJCKK:sibpm_osa_f_copy table_exists_action=replace directory=data_dir dumpfile=aaz508_61.dmp logfile=aaz508_61.log
注:
impdp [用户名]/[密码]@[服务名]
REMAP_SCHEMA=[源用户名1]:[目标用户名2]
table_exists_action=replace /*存在的表动作(覆盖)*/
directory=[目录名]
dumpfile=[.dmp文件名]
logfile=[.log文件名]