dbms-metadata

Get complete ddl for index in oracle

丶灬走出姿态 提交于 2020-01-05 06:44:47
问题 I am using oracle 11g/12c. I want to get ddl of indexes in my database. For this I used the query - SELECT DBMS_METADATA.GET_DDL('INDEX','SYS_IL0000091971C00001$$','CCEEXPERTS') FROM dual Here 'SYS_IL0000091971C00001$$' is my index name and 'CCEEXPERTS' is my owner name. From this I get the ddl - CREATE UNIQUE INDEX "CCEEXPERTS"."SYS_IL0000091971C00001$$" ON "CCEEXPERTS"."DATABLOB" ( And my actual ddl is - CREATE UNIQUE INDEX "CCEEXPERTS"."SYS_IL0000091971C00001$$" ON "CCEEXPERTS"."DATABLOB"

Get complete ddl for index in oracle

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-05 06:43:49
问题 I am using oracle 11g/12c. I want to get ddl of indexes in my database. For this I used the query - SELECT DBMS_METADATA.GET_DDL('INDEX','SYS_IL0000091971C00001$$','CCEEXPERTS') FROM dual Here 'SYS_IL0000091971C00001$$' is my index name and 'CCEEXPERTS' is my owner name. From this I get the ddl - CREATE UNIQUE INDEX "CCEEXPERTS"."SYS_IL0000091971C00001$$" ON "CCEEXPERTS"."DATABLOB" ( And my actual ddl is - CREATE UNIQUE INDEX "CCEEXPERTS"."SYS_IL0000091971C00001$$" ON "CCEEXPERTS"."DATABLOB"

Get VIEW ddl using query

∥☆過路亽.° 提交于 2020-01-02 02:41:07
问题 For database re-architecture I need to get DDL of each table and view in the database(Oracle). I don't want to go to property of each table/view and get SQL out of it in SQL Developer. I successfully got DDL for table using- select dbms_metadata.get_ddl('TABLE','Table_name','Schema_Name') from dual; But facing problem with VIEW and MVIEW. Could anyone provide commands/keywords for elements other than table. Also, I want to export the result in an excel file with first column as TableName and

Generating DDL script for object without schema name baked in using DBMS_METADATA.GET_DDL?

走远了吗. 提交于 2019-12-22 04:36:19
问题 How can I generate the DDL script for my object with DBMS_METADATA.GET_DDL without the schema name baked in? With DBMS_METADATA.GET_DDL : CREATE TABLE "MYSCHEMA"."MYTABLE" ( "COL1" NUMBER(10,0) ) SQL Developer can do that, and I think it's also uses the DBMS_METADATA to achive this goal and generale DDL scripts. With SQL Developer: CREATE TABLE "MYTABLE" ( "COL1" NUMBER(10,0) ) 回答1: Use SET_REMAP_PARAM with the REMAP_SCHEMA option: DBMS_METADATA.SET_REMAP_PARAM(th,'REMAP_SCHEMA','HR',NULL);

Which Oracle view contains all constraints together?

*爱你&永不变心* 提交于 2019-12-11 01:14:38
问题 I'm trying to get CONSTRAINTS from user_objects table like this: select CASE object_type WHEN 'DATABASE LINK' then 'dblinks' WHEN 'FUNCTION' then 'functions' WHEN 'INDEX' then 'indexes' WHEN 'PACKAGE' then 'packages' WHEN 'PROCEDURE' then 'procedures' WHEN 'SEQUENCE' then 'sequences' WHEN 'TABLE' then 'tables' WHEN 'TRIGGER' then 'triggers' WHEN 'VIEW' then 'views' WHEN 'SYNONYM' then 'synonyms' WHEN 'GRANT' then 'grants' WHEN 'CONSTRAINT' then 'constraints' ELSE object_type END||'|'|| CASE

Generating DDL script for object without schema name baked in using DBMS_METADATA.GET_DDL?

喜欢而已 提交于 2019-12-05 03:32:06
How can I generate the DDL script for my object with DBMS_METADATA.GET_DDL without the schema name baked in? With DBMS_METADATA.GET_DDL : CREATE TABLE "MYSCHEMA"."MYTABLE" ( "COL1" NUMBER(10,0) ) SQL Developer can do that, and I think it's also uses the DBMS_METADATA to achive this goal and generale DDL scripts. With SQL Developer: CREATE TABLE "MYTABLE" ( "COL1" NUMBER(10,0) ) Use SET_REMAP_PARAM with the REMAP_SCHEMA option: DBMS_METADATA.SET_REMAP_PARAM(th,'REMAP_SCHEMA','HR',NULL); This will map the HR schema to NULL (you'll need a job handle, though); for a full example, see metadata_api