重庆思庄Oracle、Redhat认证学习论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3798|回复: 7
打印 上一主题 下一主题

oracle 12.2中,国家字符集为utf8导致对某个pdb进行full导出失败

[复制链接]
跳转到指定楼层
楼主
发表于 2018-7-9 11:32:09 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 郑全 于 2018-7-9 11:58 编辑

数据库如下 :

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 ORCLPDB                        READ WRITE NO


对orclpdb进行下面的导出:



[oracle@strong ~]$ expdp \'sys/oracle@orclpdb as sysdba\' directory=exp_dir dumpfile=test.dmp full=y

Export: Release 12.2.0.1.0 - Production on Mon Jul 9 10:51:28 2018

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
Starting "SYS"."SYS_EXPORT_FULL_01":  "sys/********@orclpdb AS SYSDBA" directory=exp_dir dumpfile=test.dmp full=y
Processing object type DATABASE_EXPORT/EARLY_OPTIONS/VIEWS_AS_TABLES/TABLE_DATA
Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/TABLE_DATA
Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/VIEWS_AS_TABLES/TABLE_DATA
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type DATABASE_EXPORT/STATISTICS/MARKER
Processing object type DATABASE_EXPORT/PRE_SYSTEM_IMPCALLOUT/MARKER
Processing object type DATABASE_EXPORT/PRE_INSTANCE_IMPCALLOUT/MARKER
Processing object type DATABASE_EXPORT/TABLESPACE
Processing object type DATABASE_EXPORT/PROFILE
Processing object type DATABASE_EXPORT/SYS_USER/USER
Processing object type DATABASE_EXPORT/SCHEMA/USER
ORA-39126: Worker unexpected fatal error in KUPW$WORKER.FETCH_XML_OBJECTS [ORA-04063: view "SYS.KU$_RADM_FPTM_VIEW" has errors

ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
ORA-06512: at "SYS.KUPW$WORKER", line 12098
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 105
ORA-06512: at "SYS.DBMS_METADATA", line 9039
ORA-06512: at "SYS.DBMS_METADATA", line 2792
ORA-06512: at "SYS.DBMS_METADATA", line 3423
ORA-06512: at "SYS.DBMS_METADATA", line 4760
ORA-06512: at "SYS.DBMS_METADATA", line 5079
ORA-06512: at "SYS.DBMS_METADATA", line 9020
ORA-06512: at "SYS.KUPW$WORKER", line 14367

----- PL/SQL Call Stack -----
  object      line  object
  handle    number  name
0x7beca040     32239  package body SYS.KUPW$WORKER.WRITE_ERROR_INFORMATION
0x7beca040     12119  package body SYS.KUPW$WORKER.DETERMINE_FATAL_ERROR
0x7beca040     14693  package body SYS.KUPW$WORKER.FETCH_XML_OBJECTS
0x7beca040      3689  package body SYS.KUPW$WORKER.UNLOAD_METADATA
0x7beca040     13063  package body SYS.KUPW$WORKER.DISPATCH_WORK_ITEMS
0x7beca040      2311  package body SYS.KUPW$WORKER.MAIN
0x7b538110         2  anonymous block

DBMS_METADATA.SET_FILTER
DBMS_METADATA.SET_FILTER
DBMS_METADATA.SET_FILTER
In FETCH_XML_OBJECTS
End seqno is: 34
KUPF$FILE.OPEN_CONTEXT
KUPF$FILE.OPEN_CONTEXT
DBMS_METADATA.FETCH_XML_CLOB
DBMS_METADATA.FETCH_XML_CLOB
In procedure DETERMINE_FATAL_ERROR with ORA-04063: view "SYS.KU$_RADM_FPTM_VIEW" has errors
ORA-06512: at "SYS.DBMS_METADATA", line 9039
ORA-06512: at "SYS.DBMS_METADATA", line 2792
ORA-06512: at "SYS.DBMS_METADATA", line 3423
ORA-06512: at "SYS.DBMS_METADATA", line 4760
ORA-06512: at "SYS.DBMS_METADATA", line 5079
ORA-06512: at "SYS.DBMS_METADATA", line 9020

Job "SYS"."SYS_EXPORT_FULL_01" stopped due to fatal error at Mon Jul 9 10:52:22 2018 elapsed 0 00:00:51

进行用户及表导出没有问题。


分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 支持支持 反对反对
回复

使用道具 举报

沙发
 楼主| 发表于 2018-7-9 11:39:39 | 只看该作者
字符集情况 :
  cdb:
  1* select * from nls_database_parameters where parameter like '%CHARACT%'

PARAMETER                      VALUE
------------------------------ ------------------------------
NLS_NUMERIC_CHARACTERS         .,
NLS_NCHAR_CHARACTERSET         UTF8
NLS_CHARACTERSET               AL32UTF8

   pdb:

SQL> alter session set container=orclpdb;

Session altered.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         3 ORCLPDB                        READ WRITE NO
SQL> select * from nls_database_parameters where parameter like '%CHARACT%';

PARAMETER                      VALUE
------------------------------ ------------------------------
NLS_NUMERIC_CHARACTERS         .,
NLS_NCHAR_CHARACTERSET         UTF8
NLS_CHARACTERSET               ZHS16GBK

字符集不同,国家字符集为 utf8,不是默认的 AL16UTF16
回复 支持 反对

使用道具 举报

板凳
 楼主| 发表于 2018-7-9 11:47:28 | 只看该作者
发现问题,
  原因是SYS.KU$_RADM_FPTM_VIEW 无效了,cdb可以编译,但 pdb中无法编译导致。
  
set lines 140
col status for a9
col object_type for a20;
col owner.object for a50
select status, object_id, object_type, owner||'.'||object_name "OWNER.OBJECT"
  from dba_objects
where status != 'VALID' and object_name not like 'BIN$%' order by 4,1;

STATUS       OBJECT_ID OBJECT_TYPE          OWNER.OBJECT
--------- ------------ -------------------- --------------------------------------------------
INVALID          12253 VIEW                 SYS.KU$_RADM_FPTM_VIEW

解决办法:
找出 定义,并重新创建并编译即可:

SQL> select dbms_metadata.get_ddl('TYPE','KU$_RADM_FPTM_T','SYS') "DDL" from dual;

DDL
----------------------------------------------------------------------------------------------------

  CREATE OR REPLACE NONEDITIONABLE TYPE "SYS"."KU$_RADM_FPTM_T" as object
(
  vers_major   char(1),                               /* UDT major version # */
  vers_minor   char(1),                               /* UDT minor version # */
  numbercol    number,                                             /* number */
  binfloatcol  binary_float,                                 /* binary float */
  bindoublecol binary_double,                               /* binary double */
  charcol      char(1),                              /* fixed-size character */
  varcharcol   varchar2(1),                       /* variable-size character */
  ncharcol     nchar(1),                    /* fixed-size national character */
  nvarcharcol  nvarchar2(1),             /* variable-size national character */
  datecol      date,                                                 /* date */
  ts_col       timestamp,                                       /* timestamp */
  tswtz_col    timestamp with time zone,         /* timestamp with time zone */
  fpver        number               /* version of default fixed point values */
)


SQL> select dbms_metadata.get_ddl('VIEW','KU$_RADM_FPTM_VIEW','SYS') "DDL" from dual;








DDL
----------------------------------------------------------------------------------------------------

  CREATE OR REPLACE FORCE NONEDITIONABLE VIEW "SYS"."KU$_RADM_FPTM_VIEW" OF "SYS"."KU$_RADM_FPTM_T"
  WITH OBJECT IDENTIFIER (fpver) AS
  select '1','0',
           numbercol, binfloatcol, bindoublecol,
           charcol, varcharcol, ncharcol, nvarcharcol,
           datecol,ts_col,tswtz_col, fpver
    from sys.radm_fptm$
    where fpver=1


@?\rdbms\admin\utlrp.sql


SQL> select con_id, status, object_id, object_type,
  2         owner||'.'||object_name "OWNER.OBJECT"
  3    from cdb_objects where object_name like '%KU$_RADM_FPTM_VIEW%' order by 4,1;

      CON_ID STATUS       OBJECT_ID OBJECT_TYPE          OWNER.OBJECT
------------ --------- ------------ -------------------- --------------------------------------------------
           1 VALID            15648 VIEW                 SYS.KU$_RADM_FPTM_VIEW
           3 VALID            15642 VIEW                 SYS.KU$_RADM_FPTM_VIEW

再去进行数据库导出,就没有问题了。

[oracle@strong ~]$ expdp \'sys/oracle@orclpdb as sysdba\' directory=exp_dir dumpfile=test.dmp full=y reuse_dumpfile=yes
LRM-00101: unknown parameter name 'reuse_dumpfile'

[oracle@strong ~]$ expdp \'sys/oracle@orclpdb as sysdba\' directory=exp_dir dumpfile=test.dmp full=y reuse_dumpfiles=yes

Export: Release 12.2.0.1.0 - Production on Mon Jul 9 11:19:55 2018

Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
Starting "SYS"."SYS_EXPORT_FULL_02":  "sys/********@orclpdb AS SYSDBA" directory=exp_dir dumpfile=test.dmp full=y reuse_dumpfiles=yes
Processing object type DATABASE_EXPORT/EARLY_OPTIONS/VIEWS_AS_TABLES/TABLE_DATA
Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/TABLE_DATA
Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/VIEWS_AS_TABLES/TABLE_DATA
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type DATABASE_EXPORT/STATISTICS/MARKER
Processing object type DATABASE_EXPORT/PRE_SYSTEM_IMPCALLOUT/MARKER
Processing object type DATABASE_EXPORT/PRE_INSTANCE_IMPCALLOUT/MARKER
Processing object type DATABASE_EXPORT/TABLESPACE
Processing object type DATABASE_EXPORT/PROFILE
Processing object type DATABASE_EXPORT/SYS_USER/USER
Processing object type DATABASE_EXPORT/SCHEMA/USER
Processing object type DATABASE_EXPORT/RADM_FPTM
Processing object type DATABASE_EXPORT/GRANT/SYSTEM_GRANT/PROC_SYSTEM_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/GRANT/SYSTEM_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/ROLE_GRANT
Processing object type DATABASE_EXPORT/SCHEMA/DEFAULT_ROLE
Processing object type DATABASE_EXPORT/SCHEMA/ON_USER_GRANT
Processing object type DATABASE_EXPORT/RESOURCE_COST
Processing object type DATABASE_EXPORT/TRUSTED_DB_LINK
Processing object type DATABASE_EXPORT/DIRECTORY/DIRECTORY
Processing object type DATABASE_EXPORT/DIRECTORY/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type DATABASE_EXPORT/SYSTEM_PROCOBJACT/PRE_SYSTEM_ACTIONS/PROCACT_SYSTEM
Processing object type DATABASE_EXPORT/SYSTEM_PROCOBJACT/PROCOBJ
Processing object type DATABASE_EXPORT/SYSTEM_PROCOBJACT/POST_SYSTEM_ACTIONS/PROCACT_SYSTEM
Processing object type DATABASE_EXPORT/SCHEMA/PROCACT_SCHEMA
Processing object type DATABASE_EXPORT/EARLY_OPTIONS/VIEWS_AS_TABLES/TABLE
Processing object type DATABASE_EXPORT/EARLY_POST_INSTANCE_IMPCALLOUT/MARKER
Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/TABLE


Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/VIEWS_AS_TABLES/TABLE
Processing object type DATABASE_EXPORT/NORMAL_POST_INSTANCE_IMPCALLOUT/MARKER
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/COMMENT
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/INDEX/INDEX
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/CONSTRAINT/CONSTRAINT
Processing object type DATABASE_EXPORT/FINAL_POST_INSTANCE_IMPCALLOUT/MARKER
Processing object type DATABASE_EXPORT/SCHEMA/POST_SCHEMA/PROCACT_SCHEMA
Processing object type DATABASE_EXPORT/AUDIT_UNIFIED/AUDIT_POLICY_ENABLE
Processing object type DATABASE_EXPORT/POST_SYSTEM_IMPCALLOUT/MARKER
. . exported "SYS"."KU$_USER_MAPPING_VIEW"               6.093 KB      38 rows
. . exported "SYSTEM"."REDO_DB"                          25.58 KB       1 rows
. . exported "ORDDATA"."ORDDCM_DOCS"                     252.9 KB       9 rows
. . exported "WMSYS"."WM$WORKSPACES_TABLE$"              12.10 KB       1 rows
. . exported "WMSYS"."WM$HINT_TABLE$"                    9.984 KB      97 rows
. . exported "LBACSYS"."OLS$INSTALLATIONS"               6.953 KB       2 rows
. . exported "WMSYS"."WM$WORKSPACE_PRIV_TABLE$"          7.078 KB      11 rows
. . exported "SYS"."DAM_CONFIG_PARAM$"                   6.523 KB      14 rows
. . exported "SYS"."TSDP_SUBPOL$"                        6.320 KB       1 rows
. . exported "WMSYS"."WM$NEXTVER_TABLE$"                 6.367 KB       1 rows
. . exported "LBACSYS"."OLS$PROPS"                       6.234 KB       5 rows
. . exported "WMSYS"."WM$ENV_VARS$"                      6.015 KB       3 rows
. . exported "SYS"."TSDP_PARAMETER$"                     5.945 KB       1 rows
. . exported "SYS"."TSDP_POLICY$"                        5.914 KB       1 rows
. . exported "WMSYS"."WM$VERSION_HIERARCHY_TABLE$"       5.976 KB       1 rows
. . exported "WMSYS"."WM$EVENTS_INFO$"                   5.812 KB      12 rows
. . exported "LBACSYS"."OLS$AUDIT_ACTIONS"                5.75 KB       8 rows
. . exported "LBACSYS"."OLS$DIP_EVENTS"                  5.539 KB       2 rows
. . exported "LBACSYS"."OLS$AUDIT"                           0 KB       0 rows
. . exported "LBACSYS"."OLS$COMPARTMENTS"                    0 KB       0 rows
. . exported "LBACSYS"."OLS$DIP_DEBUG"                       0 KB       0 rows
. . exported "LBACSYS"."OLS$GROUPS"                          0 KB       0 rows
. . exported "LBACSYS"."OLS$LAB"                             0 KB       0 rows
. . exported "LBACSYS"."OLS$LEVELS"                          0 KB       0 rows
. . exported "LBACSYS"."OLS$POL"                             0 KB       0 rows
. . exported "LBACSYS"."OLS$POLICY_ADMIN"                    0 KB       0 rows
. . exported "LBACSYS"."OLS$POLS"                            0 KB       0 rows
. . exported "LBACSYS"."OLS$POLT"                            0 KB       0 rows
. . exported "LBACSYS"."OLS$PROFILE"                         0 KB       0 rows
. . exported "LBACSYS"."OLS$PROFILES"                        0 KB       0 rows
. . exported "LBACSYS"."OLS$PROG"                            0 KB       0 rows
. . exported "LBACSYS"."OLS$SESSINFO"                        0 KB       0 rows
. . exported "LBACSYS"."OLS$USER"                            0 KB       0 rows
. . exported "LBACSYS"."OLS$USER_COMPARTMENTS"               0 KB       0 rows
. . exported "LBACSYS"."OLS$USER_GROUPS"                     0 KB       0 rows
. . exported "LBACSYS"."OLS$USER_LEVELS"                     0 KB       0 rows
. . exported "SYS"."AUD$"                                    0 KB       0 rows
. . exported "SYS"."DAM_CLEANUP_EVENTS$"                     0 KB       0 rows
. . exported "SYS"."DAM_CLEANUP_JOBS$"                       0 KB       0 rows
. . exported "SYS"."TSDP_ASSOCIATION$"                       0 KB       0 rows
. . exported "SYS"."TSDP_CONDITION$"                         0 KB       0 rows
. . exported "SYS"."TSDP_FEATURE_POLICY$"                    0 KB       0 rows
. . exported "SYS"."TSDP_PROTECTION$"                        0 KB       0 rows
. . exported "SYS"."TSDP_SENSITIVE_DATA$"                    0 KB       0 rows
. . exported "SYS"."TSDP_SENSITIVE_TYPE$"                    0 KB       0 rows
. . exported "SYS"."TSDP_SOURCE$"                            0 KB       0 rows
. . exported "SYSTEM"."REDO_LOG"                             0 KB       0 rows
. . exported "WMSYS"."WM$BATCH_COMPRESSIBLE_TABLES$"         0 KB       0 rows
. . exported "WMSYS"."WM$CONSTRAINTS_TABLE$"                 0 KB       0 rows
. . exported "WMSYS"."WM$CONS_COLUMNS$"                      0 KB       0 rows
. . exported "WMSYS"."WM$LOCKROWS_INFO$"                     0 KB       0 rows
. . exported "WMSYS"."WM$MODIFIED_TABLES$"                   0 KB       0 rows
. . exported "WMSYS"."WM$MP_GRAPH_WORKSPACES_TABLE$"         0 KB       0 rows
. . exported "WMSYS"."WM$MP_PARENT_WORKSPACES_TABLE$"        0 KB       0 rows
. . exported "WMSYS"."WM$NESTED_COLUMNS_TABLE$"              0 KB       0 rows
. . exported "WMSYS"."WM$RESOLVE_WORKSPACES_TABLE$"          0 KB       0 rows
. . exported "WMSYS"."WM$RIC_LOCKING_TABLE$"                 0 KB       0 rows
. . exported "WMSYS"."WM$RIC_TABLE$"                         0 KB       0 rows
. . exported "WMSYS"."WM$RIC_TRIGGERS_TABLE$"                0 KB       0 rows
. . exported "WMSYS"."WM$UDTRIG_DISPATCH_PROCS$"             0 KB       0 rows
. . exported "WMSYS"."WM$UDTRIG_INFO$"                       0 KB       0 rows
. . exported "WMSYS"."WM$VERSION_TABLE$"                     0 KB       0 rows
. . exported "WMSYS"."WM$VT_ERRORS_TABLE$"                   0 KB       0 rows
. . exported "WMSYS"."WM$WORKSPACE_SAVEPOINTS_TABLE$"        0 KB       0 rows
. . exported "MDSYS"."RDF_PARAM$"                        6.507 KB       3 rows
. . exported "SYS"."AUDTAB$TBS$FOR_EXPORT"               5.953 KB       2 rows
. . exported "SYS"."DBA_SENSITIVE_DATA"                      0 KB       0 rows
. . exported "SYS"."DBA_TSDP_POLICY_PROTECTION"              0 KB       0 rows
. . exported "SYS"."FGA_LOG$FOR_EXPORT"                      0 KB       0 rows
. . exported "SYS"."NACL$_ACE_EXP"                           0 KB       0 rows
. . exported "SYS"."NACL$_HOST_EXP"                      6.914 KB       1 rows
. . exported "SYS"."NACL$_WALLET_EXP"                        0 KB       0 rows
. . exported "SYS"."SQL$TEXT_DATAPUMP"                       0 KB       0 rows
. . exported "SYS"."SQL$_DATAPUMP"                           0 KB       0 rows
. . exported "SYS"."SQLOBJ$AUXDATA_DATAPUMP"                 0 KB       0 rows
. . exported "SYS"."SQLOBJ$DATA_DATAPUMP"                    0 KB       0 rows
. . exported "SYS"."SQLOBJ$PLAN_DATAPUMP"                    0 KB       0 rows
. . exported "SYS"."SQLOBJ$_DATAPUMP"                        0 KB       0 rows
. . exported "SYSTEM"."SCHEDULER_JOB_ARGS"               8.671 KB       4 rows
. . exported "SYSTEM"."SCHEDULER_PROGRAM_ARGS"           10.29 KB      23 rows
. . exported "WMSYS"."WM$EXP_MAP"                        7.710 KB       3 rows
. . exported "WMSYS"."WM$METADATA_MAP"                       0 KB       0 rows
. . exported "SYSTEM"."SYS_EXPORT_FULL_01"               496.7 KB    2836 rows
. . exported "SYSTEM"."SYS_EXPORT_FULL_02"               500.3 KB    2849 rows
. . exported "SYSTEM"."SYS_EXPORT_FULL_03"               503.4 KB    2859 rows
. . exported "SYSTEM"."SYS_EXPORT_FULL_04"               506.4 KB    2869 rows
. . exported "SYSTEM"."SYS_EXPORT_FULL_05"               509.5 KB    2879 rows
Master table "SYS"."SYS_EXPORT_FULL_02" successfully loaded/unloaded
******************************************************************************
Dump file set for SYS.SYS_EXPORT_FULL_02 is:
  /home/oracle/test.dmp
Job "SYS"."SYS_EXPORT_FULL_02" successfully completed at Mon Jul 9 11:41:55 2018 elapsed 0 00:21:54

回复 支持 反对

使用道具 举报

地板
 楼主| 发表于 2018-7-9 11:49:01 | 只看该作者

metalink上 找到对应的文档 (文档 ID 1903510.1) :

EXPDP/IMPDP - ORA-04063 (view "SYS.KU$_RADM_FPTM_VIEW" Has Errors) on Full Export / Import (文档 ID 1903510.1)

In this Document
        Symptoms
        Changes
        Cause
        Solution
        References


Applies to:
Enterprise Manager for Oracle Database - Version 12.1.0.1.0 to 13.2.2.0.0 [Release 12.1 to 13.2]
Oracle Database - Enterprise Edition - Version 12.1.0.1 and later
Oracle Database - Standard Edition - Version 12.1.0.1 and later
Oracle Database - Personal Edition - Version 12.1.0.1 and later
Information in this document applies to any platform.
Symptoms

1. With the Database Configuration Assistant (dbca) you have created a multitenant configuration with a Container Database (CDB) and one of more Pluggable Databases (PDB):
connect / as sysdba
select dbid,name,cdb,open_mode,con_id from v$database;

        DBID NAME      CDB OPEN_MODE                  CON_ID
------------ --------- --- -------------------- ------------
  3200536659 M12101WU  YES READ WRITE                      0

alter session set container = cdb$root;
show con_name

CON_NAME
------------------------------
CDB$ROOT

col pdb_name for a30
select pdb_id, pdb_name, status from dba_pdbs order by 1;

      PDB_ID PDB_NAME                       STATUS
------------ ------------------------------ ---------
           2 PDB$SEED                       NORMAL
           3 M12101WUPDB1                   NORMAL
           4 M12101WUPDB2                   NORMAL



2. While going through the steps in DBCA, you have specified UTF8 for the national characaterset instead of the default AL16UTF16 national characaterset:
col parameter for a35
col value for a40
select * from nls_database_parameters where parameter like '%SET' order by 1;

PARAMETER                           VALUE
----------------------------------- ----------------------------------------
NLS_CHARACTERSET                    WE8MSWIN1252
NLS_NCHAR_CHARACTERSET              UTF8



3. After installation, you try to run a full database Export Data Pump job, but the expdp job fails with:
expdp system/manager@m12101wupdb1 directory=my_dir dumpfile=expdp_tc.dmp logfile=expdp_tc.log reuse_dumpfiles=y full=y

Export: Release 12.1.0.1.0 - Production on Mon Jun 30 11:46:36 2014
Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
Starting "SYSTEM"."SYS_EXPORT_FULL_01":  system/********@m12101wupdb1 directory=my_dir dumpfile=expdp_tc.dmp logfile=expdp_tc.log reuse_dumpfiles=y full=y
Estimate in progress using BLOCKS method...
Processing object type DATABASE_EXPORT/EARLY_OPTIONS/VIEWS_AS_TABLES/TABLE_DATA
Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/TABLE_DATA
Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/VIEWS_AS_TABLES/TABLE_DATA
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 2.515 MB
Processing object type DATABASE_EXPORT/PRE_SYSTEM_IMPCALLOUT/MARKER
Processing object type DATABASE_EXPORT/PRE_INSTANCE_IMPCALLOUT/MARKER
Processing object type DATABASE_EXPORT/TABLESPACE
Processing object type DATABASE_EXPORT/PROFILE
Processing object type DATABASE_EXPORT/SYS_USER/USER
Processing object type DATABASE_EXPORT/SCHEMA/USER
Processing object type DATABASE_EXPORT/ROLE
ORA-39126: Worker unexpected fatal error in KUPW$WORKER.FETCH_XML_OBJECTS [ROLE:"APEX_GRANTS_FOR_NEW_USERS_ROLE"]
ORA-04063: view "SYS.KU$_RADM_FPTM_VIEW" has errors

ORA-06512: at "SYS.DBMS_SYS_ERROR", line 95
ORA-06512: at "SYS.KUPW$WORKER", line 11014

----- PL/SQL Call Stack -----
  object      line  object
  handle    number  name
000007FF347FE160     26217  package body SYS.KUPW$WORKER
000007FF347FE160     11041  package body SYS.KUPW$WORKER
000007FF347FE160     13189  package body SYS.KUPW$WORKER
000007FF347FE160      3128  package body SYS.KUPW$WORKER
000007FF347FE160     11737  package body SYS.KUPW$WORKER
000007FF347FE160      2059  package body SYS.KUPW$WORKER
000007FF357A4200         2  anonymous block

KUPF$FILE.WRITE_LOB
KUPF$FILE.WRITE_LOB
MD FilePieces Count: 1
FORALL
FORALL
DBMS_LOB.TRIM
DBMS_LOB.TRIM
DBMS_METADATA.FETCH_XML_CLOB
DBMS_METADATA.FETCH_XML_CLOB
In procedure DETERMINE_FATAL_ERROR
Job "SYSTEM"."SYS_EXPORT_FULL_01" stopped due to fatal error at Mon Jun 30 11:47:10 2014 elapsed 0 00:00:29


NOTE:
The same error can be hit during a full DataPump import when the view SYS.KU$_RADM_FPTM_VIEW is in an inconsistent status.


Changes


Cause

1. The view SYS.KU$_RADM_FPTM_VIEW is invalid in the CDB and the PDB's, an it stays invalid even if you run the script utlrp.sql to recompile the invalid objects:
alter session set container = cdb$root;
?\rdbms\admin\utlrp.sql

-- check for invalid objects
set lines 140
col status for a9
col object_type for a20;
col owner.object for a50
select status, object_id, object_type, owner||'.'||object_name "OWNER.OBJECT"
  from dba_objects
where status != 'VALID' and object_name not like 'BIN$%' order by 4,1;

STATUS       OBJECT_ID OBJECT_TYPE          OWNER.OBJECT
--------- ------------ -------------------- --------------------------------------------------
INVALID          12255 VIEW                 SYS.KU$_RADM_FPTM_VIEW

-- check view SYS.KU$_RADM_FPTM_VIEW across the PDB's:
select con_id, status, object_id, object_type,
       owner||'.'||object_name "OWNER.OBJECT"
  from cdb_objects where object_name like '%KU$_RADM_FPTM_VIEW%' order by 4,1;

      CON_ID STATUS       OBJECT_ID OBJECT_TYPE          OWNER.OBJECT
------------ --------- ------------ -------------------- --------------------------------------------------
           1 INVALID          12255 VIEW                 SYS.KU$_RADM_FPTM_VIEW
           2 INVALID          12253 VIEW                 SYS.KU$_RADM_FPTM_VIEW
           3 INVALID          12253 VIEW                 SYS.KU$_RADM_FPTM_VIEW
           4 INVALID          12253 VIEW                 SYS.KU$_RADM_FPTM_VIEW


alter view SYS.KU$_RADM_FPTM_VIEW compile;

Warning: View altered with compilation errors.

show errors view SYS.KU$_RADM_FPTM_VIEW

Errors for VIEW SYS.KU$_RADM_FPTM_VIEW:

LINE/COL ERROR
-------- -----------------------------------------------------------------
0/0      ORA-00932: inconsistent datatypes: expected NCHAR got NCHAR

This is caused by a mismatch between the character set in which the table radm_fptm$ is created and in which the type ku$_radm_fptm$_t is created. This leads to the ORA-932 error when trying to recompile the view SYS.KU$_RADM_FPTM_VIEW.


2. You found the following document:

Note 1641033.1 - Failed To Export MGMTDB Due To Invalid Object KU$_RADM_FPTM_VIEW in 12c

which was based on following defect:

Bug 16498596 - LNX64-12.1-CHM: FAILED TO EXPORT MGMTDB DUE TO INVALID OBJECT KU$_RADM_FPTM_VIEW (not a public bug), fixed in 12.1.0.2 and 12.2.0.1

Based on this document, you tried the workaround to recompile the view. The view became valid in the CDB, but it remains invalid in the PDB's. It also cannot be recompiled in the PDB's (which is actually expected behavior):
alter session set container = cdb$root;
alter type ku$_radm_fptm_t compile reuse settings;
alter view SYS.KU$_RADM_FPTM_VIEW compile;

View altered.

-- check view SYS.KU$_RADM_FPTM_VIEW across the PDB's:
set lines 140
col status for a9
col object_type for a20;
col owner.object for a50
select con_id, status, object_id, object_type,
       owner||'.'||object_name "OWNER.OBJECT"
  from cdb_objects where object_name like '%KU$_RADM_FPTM_VIEW%' order by 4,1;

      CON_ID STATUS       OBJECT_ID OBJECT_TYPE          OWNER.OBJECT
------------ --------- ------------ -------------------- --------------------------------------------------
           1 VALID            12255 VIEW                 SYS.KU$_RADM_FPTM_VIEW
           2 INVALID          12253 VIEW                 SYS.KU$_RADM_FPTM_VIEW
           3 INVALID          12253 VIEW                 SYS.KU$_RADM_FPTM_VIEW
           4 INVALID          12253 VIEW                 SYS.KU$_RADM_FPTM_VIEW

-- try to recompile in the PDB:
alter session set container = m12101wupdb1;

-- recompile invalid objects:
alter session set container = cdb$root;
@?\rdbms\admin\utlrp.sql

-- check for invalid objects:
set lines 140
col status for a9
col object_type for a20;
col owner.object for a50
select status, object_id, object_type, owner||'.'||object_name "OWNER.OBJECT"
  from dba_objects
where status != 'VALID' and object_name not like 'BIN$%' order by 4,1;

STATUS       OBJECT_ID OBJECT_TYPE          OWNER.OBJECT
--------- ------------ -------------------- --------------------------------------------------
INVALID          12253 VIEW                 SYS.KU$_RADM_FPTM_VIEW

alter type ku$_radm_fptm_t compile reuse settings
*
ERROR at line 1:
ORA-65040: operation not allowed from within a pluggable database



3. The problem in this multitenant configuration is related to following unpublished defects:

Bug 14409012 - NLS:DATAPUMP: WHEN NLS_NCHAR_CHARACTERSET IS UTF8 EXPDP FAILS IN FULL MODE (not a public bug), closed as a duplicate of Bug 13995404
Bug 17847697 - 12102_131122: INVALID OBJECT AND COMPONENT IN MANAGEMENT DB (not a public bug), closed as a duplicate of Bug 13995404

The base defect for both is unpublished:
Bug 13995404 - 12.1_120420: INVALID OBJECT 'KU$_RADM_FPTM_VIEW' WITH MGMTDB (not a public bug)
closed as duplicate of:
Unpublished Bug 24719799 : RACOPC: KU$_RADM_FPTM_VIEW INVALID ON NATIONAL CHARACTERSET CONVERSION.


The fix of Bug 24719799 supplies a method to invalidate the types within ADNCS so that utlrp.sql will pick up and recompile the types impacted by character set change.
The fix is to update the national character set id stored in the type images to the new national character set id during the alter database national character set command.
Solution

Re-create the view and its underlying type in the CDB, e.g.:
-- connect to the CDB:

connect / as sysdba
alter session set container = cdb$root;

-- obtain the DDL for the view SYS.KU$_RADM_FPTM_VIEW:
set lines 100 numwidth 12 pages 10000 long 2000000000
col ddl for a100
select dbms_metadata.get_ddl('VIEW','KU$_RADM_FPTM_VIEW','SYS') "DDL" from dual;

DDL
----------------------------------------------------------------------------------------------------
  CREATE OR REPLACE FORCE NONEDITIONABLE VIEW "SYS"."KU$_RADM_FPTM_VIEW" OF "SYS"."KU$_RADM_FPTM_T"
  WITH OBJECT IDENTIFIER (fpver) AS
  select '1','0',
           numbercol, binfloatcol, bindoublecol,
           charcol, varcharcol, ncharcol, nvarcharcol,
           datecol,ts_col,tswtz_col, fpver
    from sys.radm_fptm$
    where fpver=1

-- obtain the DDL for the type SYS.KU$_RADM_FPTM_T:
select dbms_metadata.get_ddl('TYPE','KU$_RADM_FPTM_T','SYS') "DDL" from dual;

DDL
----------------------------------------------------------------------------------------------------
  CREATE OR REPLACE NONEDITIONABLE TYPE "SYS"."KU$_RADM_FPTM_T" as object
(
  vers_major   char(1),                               /* UDT major version # */
  vers_minor   char(1),                               /* UDT minor version # */
  numbercol    number,                                             /* number */
  binfloatcol  binary_float,                                 /* binary float */
  bindoublecol binary_double,                               /* binary double */
  charcol      char(1),                              /* fixed-size character */
  varcharcol   varchar2(1),                       /* variable-size character */
  ncharcol     nchar(1),                    /* fixed-size national character */
  nvarcharcol  nvarchar2(1),             /* variable-size national character */
  datecol      date,                                                 /* date */
  ts_col       timestamp,                                       /* timestamp */
  tswtz_col    timestamp with time zone,         /* timestamp with time zone */
  fpver        number               /* version of default fixed point values */
)


-- based on the previous output, re-create the type and the view in the CDB:
alter session set container = cdb$root;
connect / as sysdba

CREATE OR REPLACE NONEDITIONABLE TYPE "SYS"."KU$_RADM_FPTM_T" as object
(
  vers_major   char(1),                               /* UDT major version # */
  vers_minor   char(1),                               /* UDT minor version # */
  numbercol    number,                                             /* number */
  binfloatcol  binary_float,                                 /* binary float */
  bindoublecol binary_double,                               /* binary double */
  charcol      char(1),                              /* fixed-size character */
  varcharcol   varchar2(1),                       /* variable-size character */
  ncharcol     nchar(1),                    /* fixed-size national character */
  nvarcharcol  nvarchar2(1),             /* variable-size national character */
  datecol      date,                                                 /* date */
  ts_col       timestamp,                                       /* timestamp */
  tswtz_col    timestamp with time zone,         /* timestamp with time zone */
  fpver        number               /* version of default fixed point values */
)
/

CREATE OR REPLACE FORCE NONEDITIONABLE VIEW "SYS"."KU$_RADM_FPTM_VIEW" OF "SYS"."KU$_RADM_FPTM_T"
WITH OBJECT IDENTIFIER (fpver) AS
select '1','0',
         numbercol, binfloatcol, bindoublecol,
         charcol, varcharcol, ncharcol, nvarcharcol,
         datecol,ts_col,tswtz_col, fpver
  from sys.radm_fptm$
  where fpver=1
/

-- now recompile the invalid objects in the PDB:
alter session set container = m12101wupdb1;
@?\rdbms\admin\utlrp.sql

set lines 140
col status for a9
col object_type for a20;
col owner.object for a50
select status, object_id, object_type, owner||'.'||object_name "OWNER.OBJECT"
  from dba_objects
where status != 'VALID' and object_name not like 'BIN$%' order by 4,1;

no rows selected

-- check view SYS.KU$_RADM_FPTM_VIEW across the PDB's:
alter session set container = cdb$root;
select con_id, status, object_id, object_type,
       owner||'.'||object_name "OWNER.OBJECT"
  from cdb_objects where object_name like '%KU$_RADM_FPTM_VIEW%' order by 4,1;

      CON_ID STATUS       OBJECT_ID OBJECT_TYPE          OWNER.OBJECT
------------ --------- ------------ -------------------- --------------------------------------------------
           1 VALID            12255 VIEW                 SYS.KU$_RADM_FPTM_VIEW
           2 INVALID          12253 VIEW                 SYS.KU$_RADM_FPTM_VIEW
           3 VALID            12253 VIEW                 SYS.KU$_RADM_FPTM_VIEW
           4 INVALID          12253 VIEW                 SYS.KU$_RADM_FPTM_VIEW

-- do the same for the other PDB's: recompile the invalid objects


Then re-run the Export Data Pump job, e.g.:
expdp system/manager@m12101wupdb1 directory=my_dir dumpfile=expdp_tc.dmp logfile=expdp_tc.log reuse_dumpfiles=y full=y

Export: Release 12.1.0.1.0 - Production on Mon Jun 30 11:53:46 2014
Copyright (c) 1982, 2013, Oracle and/or its affiliates.  All rights reserved.

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
Starting "SYSTEM"."SYS_EXPORT_FULL_02":  system/********@m12101wupdb1 directory=my_dir dumpfile=expdp_tc.dmp logfile=expdp_tc.log reuse_dumpfiles=y full=y
Estimate in progress using BLOCKS method...
Processing object type DATABASE_EXPORT/EARLY_OPTIONS/VIEWS_AS_TABLES/TABLE_DATA
Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/TABLE_DATA
Processing object type DATABASE_EXPORT/NORMAL_OPTIONS/VIEWS_AS_TABLES/TABLE_DATA
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
...
Master table "SYSTEM"."SYS_EXPORT_FULL_02" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_FULL_02 is:
  D:\WORK\EXPDP_TC.DMP
Job "SYSTEM"."SYS_EXPORT_FULL_02" successfully completed at Mon Jun 30 11:56:34 2014 elapsed 0 00:02:44



NOTE:
The issue and the associated solution are not multitenant specific. Hence the same solution works in a non-multitenant environment as well.


References



NOTE:1641033.1 - Failed To Export MGMTDB Due To Invalid Object KU$_RADM_FPTM_VIEW in 12c
回复 支持 反对

使用道具 举报

5#
 楼主| 发表于 2018-7-9 11:51:30 | 只看该作者
根源,就是 选择了 utf8国家字符集,这个是一个 bug.

关键点:
ORA-04063: view "SYS.KU$_RADM_FPTM_VIEW" has errors
回复 支持 反对

使用道具 举报

6#
 楼主| 发表于 2018-7-9 11:55:00 | 只看该作者

Bug 24719799 - KU$_RADM_FPTM_VIEW Invalid On National Characterset Conversion (文档 ID 24719799.8)        转到底部转到底部       

Bug 24719799  KU$_RADM_FPTM_VIEW Invalid On National Characterset Conversion
This note gives a brief overview of bug 24719799.
The content was last updated on: 17-APR-2018
Click here for details of each of the sections below.
Affects:

    Product (Component)        Oracle Server (Rdbms)
    Range of versions believed to be affected         (Not specified)
    Versions confirmed as being affected        

        12.1.0.2.160719 (Jul 2016) Database Proactive Bundle Patch
        12.1.0.2 (Server Patch Set)

    Platforms affected        Generic (all / most platforms affected)

Fixed:

    The fix for 24719799 is first included in        

        18.1.0
        12.2.0.1.180417 (Apr 2018) Database Release Update (DB RU)
        12.2.0.1 (Base Release)
        12.1.0.2.180417 (Apr 2018) Database Proactive Bundle Patch
        12.2.0.1.180417 (Apr 2018) Bundle Patch for Windows Platforms


    Interim patches may be available for earlier versions - click here to check.

Symptoms:
       
Related To:

    (None Specified)

       

    Datapump Export/Import

Description

    After altering database national character set from AL16UTF16 to UTF8 (ex.
     installing pre-built database with selecting UTF8 for national character
     set), expdp fails with ORA-04063: view "SYS.KU$_RADM_FPTM_VIEW" has
     errors.
      
    Rediscovery Notes
    After database installation, you encounter this bug if the following query
    returns ORA-04063:
     
    select * from SYS.KU$_RADM_FPTM_VIEW
                      *
    ERROR at line 1:
    ORA-04063: view "SYS.KU$_RADM_FPTM_VIEW" has errors
     
    Workaround
    Recompiling the types containing NCHAR or NVARCHAR2 attribute will fix the
    problem.
    Execute the utlrp.sql.
     

Please note: The above is a summary description only. Actual symptoms can vary. Matching to any symptoms here does not confirm that you are encountering this problem. For questions about this bug please consult Oracle Support.

References

    Bug:24719799 (This link will only work for PUBLISHED bugs)
    Note:245840.1 Information on the sections in this article
回复 支持 反对

使用道具 举报

7#
 楼主| 发表于 2018-7-9 11:56:41 | 只看该作者

12.2.0.1,看来要打最新的 db ru 12.2.0.1.180417 ,才可以 。
回复 支持 反对

使用道具 举报

8#
 楼主| 发表于 2018-7-9 12:08:43 | 只看该作者
本帖最后由 郑全 于 2018-7-9 12:15 编辑

不打上面的补丁,再增加新的 pdb,又会让这个 SYS.KU$_RADM_FPTM_VIEW 失效。但进行数据导出时,就自动编译正确。

SQL> r
  1  select con_id, status, object_id, object_type,
  2             owner||'.'||object_name "OWNER.OBJECT"
  3*       from cdb_objects where object_name like '%KU$_RADM_FPTM_VIEW%' order by 4,1

    CON_ID STATUS   OBJECT_ID OBJECT_TYPE             OWNER.OBJECT
---------- ------- ---------- ----------------------- ------------------------------
         1 VALID        15648 VIEW                    SYS.KU$_RADM_FPTM_VIEW
         3 VALID        15642 VIEW                    SYS.KU$_RADM_FPTM_VIEW
         4 INVALID      15642 VIEW                    SYS.KU$_RADM_FPTM_VIEW


expdp ... full=y

SQL> r
  1  select con_id, status, object_id, object_type,
  2             owner||'.'||object_name "OWNER.OBJECT"
  3*       from cdb_objects where object_name like '%KU$_RADM_FPTM_VIEW%' order by 4,1

    CON_ID STATUS   OBJECT_ID OBJECT_TYPE             OWNER.OBJECT
---------- ------- ---------- ----------------------- ------------------------------
         1 VALID        15648 VIEW                    SYS.KU$_RADM_FPTM_VIEW
         3 VALID        15642 VIEW                    SYS.KU$_RADM_FPTM_VIEW
         4 VALID        15642 VIEW                    SYS.KU$_RADM_FPTM_VIEW

SQL>

回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|手机版|小黑屋|重庆思庄Oracle、Redhat认证学习论坛 ( 渝ICP备12004239号-4 )

GMT+8, 2024-11-25 00:38 , Processed in 0.103357 second(s), 19 queries .

重庆思庄学习中心论坛-重庆思庄科技有限公司论坛

© 2001-2020

快速回复 返回顶部 返回列表