CREATE bigfile TABLESPACE zwj
LOGGING
DATAFILE 'F:\oracle\zwj.ORA' SIZE 1000M
AUTOEXTEND
ON NEXT 1000M MAXSIZE UNLIMITED EXTENT MANAGEMENT LOCAL
SEGMENT SPACE MANAGEMENT AUTO;
2、创建用户,并给用户指定默认表空间
CREATE USER kanguhong PROFILE DEFAULT
IDENTIFIED BY kanguhongDEFAULT TABLESPACE zwj
TEMPORARY TABLESPACE TEMP
ACCOUNT UNLOCK;
3、给用户用赋权限
GRANT UNLIMITED TABLESPACE TO kanguhong;
GRANT CONNECT TO kanguhong;
GRANT DBA TO kanguhong;
GRANT RESOURCE TO kanguhong;
4、准备工作:创建directory对象(以dmpdir为例),并赋予用户权限(以trunkgas为例) --这是用数据泵导入数据
create directory dmpdir as 'F:\temp';
grant read,write on directory dmpdir to kanguhong;
执行完成后,如果下一步是导入,先将要导入的文件放到对应路径下
5、导入
impdp kanguhong/kanguhong directory=dmpdir dumpfile=zwj_1112.DMP LOGFILE=zwjI_imp.log TABLE_EXISTS_ACTION=REPLACE
----- TABLE_EXISTS_ACTION=REPLACE 表对象存在时,替换
6、扩展表空间(如果以前表空间不够用,可以给表空间扩展文件个数)
alter tablespace zwj add datafile 'D:\oracle\product\10.2.0\db_1\database\zwj2.ORA' SIZE 2000M AUTOEXTEND ON NEXT 1000M MAXSIZE UNLIMITED
7.备注:以下这条命令是 当导入文件中有表KNOWLEDGEITEM不是在DALIANRANQI表空间时,而是在XINJIANGGAS表空间,这时不用建XINJIANGGAS空间,就可以导入表KNOWLEDGEITEM了。remap_schema当你从A用户导出的数据,想要导入到B用户中去,就使用这个:remap_schema=A:B impdp kanguhong/kanguhong directory=dmpdir dumpfile=zwj_1112.dmp tables=KNOWLEDGEITEM REMAP_SCHEMA=XINJIANGGAS:kanguhong REMAP_TABLESPACE=XINJIANGGAS:zwj LOGFILE=zwjTEST_1112_IMP.log (在第五步的基础上再执行此句即可)
原文链接:https://www.f2er.com/oracle/212776.html