oracle数据导出导入

导出:

expdp b2-8/xxxxxx@ora12cr2 schemas=b2-8 DIRECTORY=dmp_dir DUMPFILE=b2-8.dmp logfile=temp.log  tables="table1,table2" query="where condition"

 impdp b4r3/aaaaaa@orcl  DUMPFILE=EXPDAT01.DMP tablespaces=b4r3  table_exists_action=replace

 

创建表空间和用户

create tablespace GSGS datafile 'F:\DB\Oracle\oradata\orcl\GSGS.DBF' size 500M AUTOEXTEND on;
create user GSGS identified by aaaaaa default tablespace GSGS;

设置表空间自动增长

ALTER DATABASE DATAFILE 'F:\DB\ORACLE\ORADATA\ORCL\GSGS.DBF' AUTOEXTEND ON;

查看表空间信息

SELECT  FILE_NAME,TABLESPACE_NAME,AUTOEXTENSIBLE FROM dba_data_files;

 

 

 授权

GRANT connect, resource to gsgs;  --授权连接给gsgs
grant create session to gsgs;  
grant dba to gsgs;

 

导入

impdp 2-8/xxxxxx@ora12cr2 DIRECTORY=dmp_dir  DUMPFILE=b2-8.dmp full=yes tablespaces=b2-8 schemas=b2-8 table_exists_action=replace 

导入的时候三种模式选一种 DIRECTORY参数不加默认是

posted @ 2020-03-23 17:34  wolbo  阅读(127)  评论(0编辑  收藏  举报