执行DBMS_METADATA.get_ddl报ORA-39212的解决方法

Posted MING93

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了执行DBMS_METADATA.get_ddl报ORA-39212的解决方法相关的知识,希望对你有一定的参考价值。

环境:
    数据库:oracle 10.2.0.4 --64位
    操作系统:红旗dc 5.0  --64位

以sys登陆,执行DBMS_METADATA.get_ddl得到某个表空间的元数据报错
select DBMS_METADATA.get_ddl(‘TABLESPACE‘,‘PDA‘) from dual;
ERROR:
ORA-39212: installation error: XSL stylesheets not loaded correctly
ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
ORA-06512: at "SYS.DBMS_METADATA_INT", line 7428
ORA-06512: at "SYS.DBMS_METADATA_INT", line 7477
ORA-06512: at "SYS.DBMS_METADATA_INT", line 9495
ORA-06512: at "SYS.DBMS_METADATA", line 1920
ORA-06512: at "SYS.DBMS_METADATA", line 2793
ORA-06512: at "SYS.DBMS_METADATA", line 4333
ORA-06512: at line 1

马上查看10g的在线文件:
ORA-39212: installation error: XSL stylesheets not loaded correctly

Cause: The XSL stylesheets used by the Data Pump Metadata API were not loaded correctly into the Oracle dictionary table "sys.metastylesheet." Either the stylesheets were not loaded at all, or they were not converted to the database character set.
Action: Connect AS SYSDBA and execute dbms_metadata_util.load_stylesheets to reload the stylesheets.


解决方法:
以sysdba权限的用户登陆执行以下语句:

SQL> exec dbms_metadata_util.load_stylesheets;

PL/SQL procedure successfully completed.


再次执行成功:

SQL> select DBMS_METADATA.get_ddl(‘TABLESPACE‘,‘PDA‘) from dual;

DBMS_METADATA.GET_DDL(‘TABLESPACE‘,‘PDA‘)
--------------------------------------------------------------------------------

CREATE TABLESPACE "PDA" DATAFILE 
  ‘/db_data/app/oracle/oradata/pda/PDA_01.dbf‘ SIZE 2147483648
  LOGGING ONLINE PERMANENT BLOCKSIZE 8192
  EXTENT MANAGEMENT LOCAL AUTOALLOCATE SEGMENT SPACE MANAGEMENT AUTO


























以上是关于执行DBMS_METADATA.get_ddl报ORA-39212的解决方法的主要内容,如果未能解决你的问题,请参考以下文章

ORA-00904: "DBMS_METADATA"."GET_DDL": 标识符无效

Oracle利用dbms_metadata.get_ddl查看DDL语句

DBMS_METADATA.GET_DDL 失败,即使我有 SELECT_CATALOG_ROLE?

转载oracle dbms_metadata.get_ddl的使用方法总结

Oracle获取数据库中的对象创建语句

如何在 SQL Developer 中显示查询的完整结果?