oracle sql导入导出笔记

  • 本地删除、创建用户

  drop user test cascade;

  • 删除tablespace(表空间位置 表空间名称test)

  drop tablespace test including contents and datafiles;

  • 查看文件路径

  select * from dba_directories;

  • 创建表空间

  create tablespace 表名 datafile 路径'E:\OracleData\xxxxx.dbf' size 100m autoextend on next 50m;

例:create tablespace test datafile 'D:\OracleData\test.dbf' size 100m autoextend on next 50m;

  • 创建用户密码

  create user 用户名 identified by 密码 default tablespace test account unlock;
例:create user test identified by test default tablespace jrjssfw account unlock;

  • 赋权限

  grant dba to test; --尽量不要赋予dba权限
例:GRANT CONNECT TO test;
  GRANT RESOURCE TO test;

  • CMD中运行  此时导入导出!

  impdp system/密码 schemas=test directory=DATA_PUMP_DIR dumpfile=导出文件名称例:TEST.DMP exclude=statistics

  导入,导入报ORA-39126,添加导入参数:exclude=statistics     create directory dp_data_dir(更改这个) as 'E:\Oracle\admin\orcl\dpdump'; 

  • 导出

  expdp system/数据库密码 schemas=test directory=文件夹 dumpfile=test.dmp version=11.2.0.1.0 logfile=expdp_test.log

posted @ 2018-07-19 15:42  UpYounger  阅读(144)  评论(0)    收藏  举报