查看用户和表空间
/*分为四步 */
/*第1步:创建临时表空间 */
create temporary tablespace user_temp
tempfile 'E:\oracle\product\10.2.0\oradata\user_temp.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;
/*第2步:创建数据表空间 */
create tablespace user_data
logging
datafile 'E:\oracle\product\10.2.0\oradata\user_data.dbf'
size 50m
autoextend on
next 50m maxsize 20480m
extent management local;
/*第3步:创建用户并指定表空间 */
create user username identified by password
default tablespace user_data
temporary tablespace user_temp;
/*第4步:给用户授予权限 */
grant connect,resource,dba to username;
--建立directory
create directory dump_dir as "E:\oracle\yinchuan_db";
--授权
grant read,write on dump_dir to 用户名;
create directory dump_dir as "E:\oracle\yinchuan_db";
--授权
grant read,write on dump_dir to 用户名;
查看本机的directory名称和导出文件要存放的位置
impdp'/assysdba'directory=dump_dirschemas=导入库用户remap_schema=导入库用户:本地用户remap_tablespace=导入库命名空间:本地表空间dumpfile=platformcenter_20140507_0001.dmplogfile=platformcenter_20140507_0001.logexclude=STATISTICS
impdp '/ as sysdba ' directory=DATA_PUMP_DIR schemas=yinchuangrid remap_schema=yinchuangrid:yinchuangrid remap_tablespace=yinchuangrid:yinchuangrid_data dumpfile=yinchuangrid_20140629_0001.dmp logfile=yinchuangrid_20140629_0001.log exclude=STATISTICS
impdp'/assysdba'directory=dump_dirschemas=导入库用户remap_schema=导入库用户:本地用户remap_tablespace=导入库命名空间:本地表空间dumpfile=platformcenter_20140507_0001.dmplogfile=platformcenter_20140507_0001.logexclude=STATISTICS
数据泵的导出
数据泵的导入:
如果数据库中已经有这个表空间,可以加
table_exists_action=replace