导入数据库到本地
1.第一步创建表空间:
sqlplus /nolog//win+R+CMD 进入oralce控制台
conn /as sysdba //以管理员权限登录
create tablespace TABLESPACE
datafile 'E:/11g/oracledata/IMP.DBF' size 500M
autoextend on next 100M maxsize unlimited logging
extent management local autoallocate
segment space management auto;
2.第二步创建用户:
create user USER --创建用户名
identified by "USER" --创建密码
default tablespace TABLESSPACE--默认表空间
temporary tablespace TEMP
3.赋予管理员权限:
grant dba to USER;
4.导入数据库数据
IMPDP USER/USER@ORCL DUMPFILE=USER_199707010000.DMP schemas=USER logfile=localhost_import.log
备注:本次导出语句为expdp方式导出,TABLES为导出的表,默认所有表
expdp USER/USER@ORCL file=USER_199707010000.dmp logfile=USER.log TABLES=(TABLE1,TABLE2,TABLE3)
注意事项:
1.忘记本地Oracle 用户名和密码:
https://www.cnblogs.com/mzlb520/p/9435452.html
2.导入语句运行报错:
3.导入语句需要在CMD命令栏运行;
需要导入的数据库数据存在目类为11g安装时设定目录,例如: USER_199707010000.DMP