作者:手机用户2502913137 | 来源:互联网 | 2023-09-14 07:13
QL>SELECTobject_name,object_type,ownerfromall_objectswhereobject_nameT_BANKACCOUNTDAYBOO
QL> SELECT object_name ,object_type,owner from all_objects where object_name='T_BANKACCOUNTDAYBOOK';
OBJECT_NAME OBJECT_TYPE OWNER
------------------------------ ------------------- ------------------------------
T_BANKACCOUNTDAYBOOK SYNONYM PUBLIC
T_BANKACCOUNTDAYBOOK TABLE CNTP_CMS
T_BANKACCOUNTDAYBOOK SYNONYM AC_ETL
这个是我查询用户查到的,但是我用get_ddl的时候会报错为什么?
Select dbms_metadata.get_ddl('TABLE','T_BANKACCOUNTDAYBOOK','CNTP_CMS') FROM DUAL;
ERROR:
ORA-31603: object "T_BANKACCOUNTDAYBOOK" of type TABLE not found in schema "CNTP_CMS"
ORA-06512: at "SYS.DBMS_METADATA", line 5805
ORA-06512: at "SYS.DBMS_METADATA", line 8344
ORA-06512: at line 1
3 个解决方案
你现在只有 all_objects 的权限,没有T_bank 这种表的权限。
通过 grant select_catalog_role to xxx, 给当前用户赋权限