Home > database >  See a user belongs to which table space
See a user belongs to which table space

Time:10-18

Select the username, default_tablespace from dba_users where username='user name';


Select * from dba_tablespaces; - see table space

- see table space file path
The select tablespace_name file_id, bytes/1024/1024, file_name
The from dba_data_files order by file_id;
- to check the user and the relationship between the default table space
Select the username, default_tablespace from dba_users

CodePudding user response:

Check under the user tablespace statement:

The select a.t ablespace_name,

A. ytes/1024/1024 "sum MB,"

(a. ytes - b.b ytes)/1024/1024 "2 MB,"

B.b ytes/1024/1024 "free MB,"

Round (((a. ytes - b.b ytes)/a. ytes) * 100, 2) "% 2"

The from (select tablespace_name, sum (bytes) bytes

The from dba_data_files

Group by tablespace_name). A,

(select tablespace_name, sum (bytes) bytes, Max (bytes) largest

The from dba_free_space

Group by tablespace_name) b

Where a.t ablespace_name=b.t ablespace_name

The order by ((a. ytes - b.b ytes)/a. ytes) desc;

CodePudding user response:

1, do you understand it might be a little problem here, the user does not belong to any table space, but can use which table space, the authorized user of oracle table space is a public resource, the key to see if the user has the right to use, therefore, you can check to the user which is the default table space, the user has permissions to which table space,
2, query the user the default table Spaces:
Select the username, default_tablespace from dba_users where username="USER1";
3, query the user table space access:
Select * from dba_sys_privs where username="USER1";
Select * from dba_ts_quotas where username="USER1";
  • Related