创建表空间
CREATE TABLESPACE NNC_DATA01 DATAFILE 'D:\NCData\nnc_data01.dbf' SIZE 500M AUTOEXTEND ON NEXT 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 256K ;
CREATE TABLESPACE NNC_INDEX01 DATAFILE 'D:\NCData\nnc_index01.dbf' SIZE 500M AUTOEXTEND ON NEXT 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K ;
CREATE TABLESPACE NNC_DATA02 DATAFILE 'D:\NCData\nnc_data02.dbf' SIZE 500M AUTOEXTEND ON NEXT 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 256K ;
CREATE TABLESPACE NNC_INDEX02 DATAFILE 'D:\NCData\nnc_index02.dbf' SIZE 500M AUTOEXTEND ON NEXT 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K ;
CREATE TABLESPACE NNC_DATA03 DATAFILE 'D:\NCData\nnc_data03.dbf' SIZE 500M AUTOEXTEND ON NEXT 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 256K ;
CREATE TABLESPACE NNC_INDEX03 DATAFILE 'D:\NCData\nnc_index03.dbf' SIZE 500M AUTOEXTEND ON NEXT 50M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 128K ;
创建用户
create user nc57 identified by jxnc57 default tablespace nnc_data01 temporary tablespace temp;
用户授权
grant connect,dba to nc57;
创建虚拟目录
create or replace directory PATH as '/impdp';
在ORACLE_HOME的bin目录下执行导入操作
table_exists_action选项:{skip 是如果已存在表,则跳过并处理下一个对象;append是为表增加数据;truncate是截断表,然后为其增加新数据;replace是删除已存在表,重新建表并追加数据}
impdp nc57/jxnc57 directory=PATH dumpfile=jxkh20191209.dmp logfile=jxkh.log schemas=nc57 table_exists_action=truncate
导出
expdp nc57/jxnc57 schemas=nc57 dumpfile=jxkh.dmp directory=PATH;