How to view permissions and default tablespace of the current user role in Oracle Database

Source: Internet
Author: User

InOracle DatabaseOperation, sometimes we need to view some information about the current user, including the information owned by the userRole PermissionsInformation, user tablespace, and user andDefault tablespaceThis article introduces the implementation methods of these operations. Next we will introduce them one by one.

-- View the role permissions of a user

1. view the role permissions of the current user: select * from role_sys_privs;

2. View All users: select * from all_users;

3. view the details of the current user: select * from user_users;

4. view all roles: select * from dba_roles;

5. view the role information of the current user: select * from user_role_privs;

Summary: Data Dictionary views in ORACLE are divided into three categories, with different prefixes: USER, ALL, and DBA. Many data dictionary views contain similar information.

USER _ *: information about the object owned by the USER, that is, information about the object created by the USER.

ALL _ *: Information about objects that users can access, that is, information about the objects created by users plus the objects created by other users, which the user has the right to access.

DBA _ *: Information about objects in the entire database.

-- View the relationship between the user and the default tablespace

Select username, default_tablespace from dba_users; select * from user_tables;

-- Oracle queries user tablespaces

 
 
  1. select * from user_all_tables; select * from user_source; select * from all_users;  
  2.  
  3. select * from dba_users select * from v$Session; SELECT * FROM USER_ROLE_PRIVS; select * from session_privs; SELECT * FROM DBA_ROLE_PRIVS; select * from dba_roles;   
  4.  
  5. SELECT NAME FROM V$DATABASE; select a.file_id "FileNo",  
  6.  
  7. a.tablespace_name "Tablespace_name",  
  8.  
  9. a.bytes "Bytes",  
  10.  
  11. a.bytes - sum(nvl(b.bytes, 0)) "Used",  
  12.  
  13. sum(nvl(b.bytes, 0)) "Free",  
  14.  
  15. sum(nvl(b.bytes, 0)) / a.bytes * 100 "%free"  
  16.  
  17. from dba_data_files a, dba_free_space b  
  18.  
  19. where a.file_id = b.file_id(+)  
  20.  
  21. group by a.tablespace_name, a.file_id, a.bytes  
  22.  
  23. order by a.tablespace_name; 

This section describes how to view role permissions and relationships between users and default tables in Oracle databases. If you want to learn more about Oracle databases, let's take a look at this article: http://database.51cto.com/oracle/. I believe that we can bring you the opportunity.

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.