暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Oracle Remp_tablespace在impdp期间不工作

ASKTOM 2019-01-07
927

问题描述

你好,

我有一个可插拔数据库OTB1,具有不同表空间的多个模式。表空间名称为小写。(模式和表空间名称相同,但小写一个,大写另一个)

SQL> select username from dba_users;

TABLESPACE_NAME
------------------------------
X3DPASSADMIN
X3DPASSTOKENS
X3DDASHADMIN

SQL> select tablespace_name from dba_tablespaces;

TABLESPACE_NAME
------------------------------
x3dpassadmin
x3dpasstokens
x3ddashadmin
复制


我已经使用expdp导出了模式

expdp system/xxxxx@OTB1 schemas=x3dpassadmin dumpfile=x3dpassadmin_01072019.dmp logfile=x3dpassadmin_01072019.log
复制


我已经在不同的oracle oracle服务器中创建了一个新的PDB (副本),并试图通过remp_schema和remp_tablespace导入模式。

impdp system/xxxxxx@REPLICA directory=backup dumpfile=x3dpassadmin_01072019.dmp schemas=x3dpassadmin REMAP_TABLESPACE="x3dpassadmin":"repx3dpassadmin" REMAP_SCHEMA=X3DPASSADMIN:REPX3DPASSADMIN
复制


导入失败,出现以下错误:

*

Starting "SYSTEM"."SYS_IMPORT_SCHEMA_01":  system/********@REPLICA directory=backup dumpfile=01072019.dmp schemas=x3dpassadmin REMAP_SCHEMA=x3dpassadmin:repx3dpassadmin REMAP_TABLESPACE=x3dpassadmin:repx3dpassadmin 
Processing object type DATABASE_EXPORT/SCHEMA/USER
ORA-39083: Object type USER:"REPX3DPASSADMIN" failed to create with error:
ORA-00959: tablespace 'x3dpassadmin' does not exist

Failing sql is:
 CREATE USER "REPX3DPASSADMIN" IDENTIFIED BY VALUES 'S:22631040B826012059205A147CE70F13DE963B5DFFAF7534DFE7FB6A9D1A;T:260AF81B044D16D04197CED00B9EE62BFC7A6BF3D8E73762E7695969A3965695830390E3D0D854019B621ADCB6277951971997F4E62F97EA26C3D2E9D551E9832A16E2804FAAA54417B638D650409944' DEFAULT TABLESPACE "x3dpassadmin" TEMPORARY TABLESPACE "TEMP"
复制



*

在创建用户时,默认表空间被分配为旧表空间,所以remp_tablespace不工作?你能帮忙吗?

问候,
纳雷什

专家解答

1.您需要在执行导入之前创建表空间。模式模式导入不会创建它们。

2.您可能会在impdp的命令行上遇到小写名称的问题。从MOS注2464695.1:

The tablespace TEST_TBS exists in the database, but the tablespace name is created with lower case:
SQL> create tablespace "test_tbs" datafile '/test1.dbf' size 10m logging;

Tablespace created.

SQL> select TABLESPACE_NAME from dba_tablespaces;

TABLESPACE_NAME
------------------------------
SYSTEM
SYSAUX
UD1
TEMP
SYSEXT
USER_DATA
test_tbs

DataPump Utility doesn't find the lower case tablespace during its execution and reports ORA-00959:

> impdp DIRECTORY=EXPDP DUMPFILE=test.dmp LOGFILE=test_imp.log REMAP_TABLESPACE=test_tbs:APP_CAS_TBS_01

generates: ORA-00959: tablespace 'test_tbs' does not exist
Changes

NONE
Cause

DataPump Utility translates the tablespace name to upper case when a parameter file is not used to start the job.
Solution

To have a successful execution of DataPump use any of below alternatives:

1/ Use parameter file to pass lower case tablespace names:

REMAP_SCHEMA=PAWANGREPORT:PAWANGREPORTQA
DIRECTORY=EXPDP
DUMPFILE=APP_CAS.dmp
LOGFILE=APP_CASimp.log
REMAP_TABLESPACE=\"test_tbs\":APP_CAS_TBS_01

- OR -

2/ Rename the tablespace:
SQL> alter tablespace "test_tbs" rename to TEST_TBS;
Tablespace altered.

and restart the DataPump job.

文章转载自ASKTOM,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论