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
- select * from user_all_tables; select * from user_source; select * from all_users;
-
- 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;
-
- SELECT NAME FROM V$DATABASE; select a.file_id "FileNo",
-
- a.tablespace_name "Tablespace_name",
-
- a.bytes "Bytes",
-
- a.bytes - sum(nvl(b.bytes, 0)) "Used",
-
- sum(nvl(b.bytes, 0)) "Free",
-
- sum(nvl(b.bytes, 0)) / a.bytes * 100 "%free"
-
- from dba_data_files a, dba_free_space b
-
- where a.file_id = b.file_id(+)
-
- group by a.tablespace_name, a.file_id, a.bytes
-
- 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.