For a table statement DLL that exports Oracle multiple tables, generates an. SQL statement.

Source: Internet
Author: User

--(' table ', ' line ', ' ods_xx ') all the tables and users in this case need to be capitalized.
If the table name user name is not written, the error is reported: the object "EMP" is of type table, not found in the scheme "Scott"
Pro-Test code:
Set long 90000;
Set Linesize 4000;
Set pagesize 4000;
Spool Table.sql
Select Dbms_metadata.get_ddl (' TABLE ', ' line ', ' ods_xx ') from dual;
Spool off

1, once want to query the table additional log: dbms_metadata.get_ddl (' table ', ' name ', ' User name ') from dual; 2, the error is as follows: ora-31603: Object "table name" belongs to type table, not found in scenario "user name" 3, Reason: The user is missing the query permission of the related data dictionary view. 4, the solution: Grant Select_catalog_role to the user name; Note: Authorization of Select any dictionary permission is still error. 5. Summary: Select any dictionary and select_catalog_role In the same place: With one of these two, you can basically query the data dictionary the Difference: 1) Select any dictionary is a system privilege, and Select_catalog_role is a role. 2) The role needs to be re-logged or explicit set role to take effect, and the system permission is immediately effective. (P.S. The same revoke permission is immediately effective) 3) Select_catalog_role can view some data dictionary views · (You can see the definition of role), such as Dba_, and select any dictionary can view the SYS table, select_catalog_role not see.

For a table statement DLL that exports Oracle multiple tables, generates an. SQL statement.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.