Dba _ view of Oracle Data Dictionary

Source: Internet
Author: User


DBA _ view returns information about all objects in the database, regardless of the object owner. Only the database administrator can access this view. For example, a query of DBA_TABLES returns a list of tables related to the database. Sometimes the database administrator can authorize developers to access the DBA view. Synonyms are not created for these views, because only Administrators can query the DBA view. Therefore, to query the DBA view, the Administrator must first name the view with the owner name SYS. The query below www.2cto.com lists information about all tables in the database. [SQL] SQL> SELECT username, user_id, account_status from dba_users where user_id> 5 and user_id <20; DBA _ View tables are as follows: table description DBA_TABLES contains tables of all users in the database. DBA_CATALOG contains tables, views, and synonyms defined in the database. DBA_OBJECTS contains all user objects. Www.2cto.com DBA_DATAFILES contains information about data files. DBA_TABLESPACES provides information about each tablespace in the database. DBA_TAB_COLUMNS provides detailed information about each column in the table. DBA_SOURCE displays the source code of stored functions, triggers, and Java objects. Table 9 in the DBA _ view demonstrates the usage of the DBA_CATALOG view. [SQL] SQL> SELECT owner, table_name, table_type from dba_catalog where table_type = 'table' and table_name like 'd % 'and owner like' % m '; this example shows the table owner, table name, and table type. For a table or view, the table type is table. The owner name ends with "M" and the table name starts with the letter "D. Example 10 shows how to use the DBA_TAB_COLUMNS view. [SQL] SQL> SELECT owner, table_name, column_name from dba_tab_columns where owner = 'system' and table_name like 'B % '; www.2cto.com This example shows the table space name, block size, and status in the DBA_TABLESPACES view. Example 11 shows how to use the DBA_TABLESPACES view. [SQL] SQL> SELECT TABLESPACE_NAME, BLOCK_SIZE, STATUS FROM DBA_TABLESPACES; this example shows the table space name, block size, and STATUS in the DBA_TABLESPACES view. Example 12 shows how to use the DBA_SOURCE view. [SQL] SQL> SELECT owner, name, type from dba_source where type = 'package body' and owner = 'system'; this example shows the owner, name, and type of the DBA_SOURCE view, the type here is "package body" and the owner is "SYSTEM ". Author jason5186

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.