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

Basic operation of Oracle-introduction of data dictionary and dynamic performance view

2025-04-13 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Introduction of data dictionary and dynamic performance view

1. Data dictionary of database

(1) the data dictionary of certain objects owned by DBA_.

Only the system user has the right to query

(2) objects created by current users of ALL_ + objects granted to current users by other users

Current user

(3) objects created by the current user of USER_

Current user

Operation example:

Unlock a user hr and change the password

SQL > alter user hr account unlock

User altered.

SQL > alter user hr identified by hr

User altered.

Under scott user, view the table under hr user

SQL > conn scott/scott

Connected.

SQL > select * from hr.jobs

Select * from hr.jobs

*

ERROR at line 1:

ORA-00942: table or view does not exist-error is reported, table or view does not exist

SQL > conn hr/hr

Connected.

SQL > grant select on jobs to scott;-Grant select permission

Grant succeeded.

SQL > insert into hr.jobs values ('HR_REP','asdfasd',1232,5545)

Insert into hr.jobs values ('HR_REP','asdfasd',1232,5545)

*

ERROR at line 1:

ORA-01031: insufficient privileges

Under a user: the following statements are equivalent:

Select * from user_objects where object_type='TABLE'

= select * from user_tables

two。 Dynamic performance View

Select * from v$session

Select * from v$process

Exercise: query DBA_OBJECTS under SYS, but cannot be found under scott, authorize the query to scott, so that scott can query this data dictionary

SQL > conn scott/scott

Connected.

SQL > select * from dba_objects

Select * from dba_objects

*

ERROR at line 1:

ORA-00942: table or view does not exist

SQL > conn / as sysdba

Connected.

SQL > grant select on dba_objects to scott

Grant succeeded.

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