Introduction to Oracle's basic operations-data dictionary and dynamic performance view

Source: Internet
Author: User


Iii. Introduction to data dictionaries and dynamic performance views

1. Data Dictionary of the database

(1) Dba_ data dictionary for all objects of a whole library
Only system users have permission queries
(2) All_ object created by current user + other user granted to current user
Current user
(3) User_ objects created by the current 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 the Scott user, view the table under the 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, table or views do 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 statement is equivalent:
SELECT * from user_objects where object_type= ' TABLE ';

=select * from User_tables;

2. Dynamic Performance View

SELECT * from V$session;
SELECT * from V$process;


Exercise: Querying dba_objects under the SYS user, but not under the Scott user, authorizing the query to Scott so that Scott can query the 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.


This article is from the "Feng Songlin blog" blog, make sure to keep this source http://fengsonglin.blog.51cto.com/9860507/1615230

Introduction to Oracle's basic operations-data dictionary and dynamic performance view

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.