oarcle数据库导入导出,创建表空间

oracle导入导出(前提,本机已经安装oracle和oracle客户端)
导出命令:
  exp username/password@192.168.1.138/ORCL file=c: est.dmp
导入本地数据库命令:
  imp username/password@127.0.0.1/ORCL file=c: est.dmp full=y

导入时,遇到错误:
  

IMP-00017: 由于 ORACLE 错误 959, 以下语句失败:.........................
IMP-00003: 遇到 ORACLE 错误 959
ORA-00959: 表空间 'TBS_GCWGGL' 不存在

解决方法:
1.在本地创建一个'TBS_GCWGGL'表空间

/*分为四步 */

/*第1步:创建临时表空间  */
create temporary tablespace user_temp
tempfile 'C:appzyloradataGCWGGLuser_temp.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;

/*第2步:创建数据表空间  */
create tablespace TBS_GCWGGL  
logging  
datafile 'C:appzyloradataGCWGGLuser_data.dbf' 
size 50m  
autoextend on  
next 50m maxsize 20480m  
extent management local;  

/*第3步:创建用户并指定表空间  */
create user GCWGGL identified by GCWGGL
default tablespace TBS_GCWGGL  
temporary tablespace user_temp;  

/*第4步:给用户授予权限  */
grant connect,resource,dba to GCWGGL;

导入数据时,使用GCWGGL用户导入

2.在导出数据库之前把数据使用remap_tablespace参数移动到新的表空间之后,再导出

原文地址:https://www.cnblogs.com/zhouyalei/p/3187716.html