I get the ORA-00904: "DBMS_METADATA"."GET_DDL": invalid identifier error when I run dbms_metadata.
That error is for having the wrong column name or alias. I am not sure why I am getting it.
Here is some code to show the error: I create a table:
create table test_table (
column1 varchar2(300));
I insert a row of data:
insert into test_table values (55);
I try to get the DDL for it:
SELECT DBMS_METADATA.GET_DDL('TABLE','test_table') FROM dual;
Here is the error:
>> SELECT DBMS_METADATA.GET_DDL('TABLE','test_table') FROM dual
*
Error at line 1
ORA-00904: "DBMS_METADATA"."GET_DDL": invalid identifier
I checked permissions and it appears I have the correct permissions:
select * FROM DBA_ROLE_PRIVS where granted_role = 'SELECT_CATALOG_ROLE';
My user (aka schema) is in that list.
Here are, what I believe, the docs: https://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_metada.htm#i1016867