Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use dba_ View in Oracle

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

How to use dba_view in Oracle, many novices are not very clear about this, in order to help you solve this problem, the following small series will explain in detail for everyone, there are people who need this can learn, I hope you can gain something.

Data Dictionary Related Links:

Oracle Data Dictionary: Common Dictionary

Oracle Data Dictionary: user_view

Oracle Data Dictionary: all_views

DBA_view returns information about all objects in the database, regardless of the object's owner. Only database administrators can access this view. For example, a query to DBA_TABLES returns a list of all relational tables in the database.

Sometimes a database administrator can grant developers access to DBA views. Synonyms are not created for these views because only administrators can query DBA views. Therefore, to query a DBA view, the administrator must precede the view name with the owner name SYS.

The following query lists information about all tables in the database.

SQL> SELECT username,user_id,account_status from dba_users where user_id > 5 and user_id

< 20; DBA_ 视图的各种表如下: 表 说明 DBA_TABLES 包含数据库中所有用户的表。 DBA_CATALOG 包含数据库中定义的表、视图和同义词。 DBA_OBJECTS 包含所有用户的对象。 DBA_DATAFILES 包含有关数据文件的信息。 DBA_TABLESPACES 提供有关数据库中每个表空间的信息。 DBA_TAB_COLUMNS 提供有关表中每个列的详细信息。 DBA_SOURCE 显示存储函数、触发器和 Java 对象的源代码。 DBA_ 视图中的表 示例 9 演示 DBA_CATALOG 视图的用法。 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 owner, table name, and table type of a table, whether it is a table or a view, with the table type being table, the owner name ending in "M," and the table name beginning with the letter "D."

Example 10 demonstrates the use of the DBA_TAB_COLUMNS view.

SQL> SELECT owner, table_name,column_name from dba_tab_columns where owner='SYSTEM' and table_name like 'B%';

This example shows the table space name, block size, and state of the DBA_TABLESPACES view.

Example 11 demonstrates the use of the DBA_TABLESPACES view.

SQL> SELECT TABLESPACE_NAME, BLOCK_SIZE, STATUS FROM DBA_TABLESPACES;

This example shows the table space name, block size, and state of the DBA_TABLESPACES view.

Example 12 demonstrates the use of the DBA_SOURCE view.

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, where the type is PACKAGE BODY and the owner is SYSTEM.

Did reading the above help you? If you still want to have further understanding of related knowledge or read more related articles, please pay attention to the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report