Oracle: view the table space where the user is located; oracle: view the user's location

Source: Internet
Author: User

Oracle: view the table space where the user is located; oracle: view the user's location

View the tablespace of the current user

select username,default_tablespace from user_users;

Modify the user's default tablespace

Alter user Username default new table space;

View roles owned by a user

select * from user_role_privs;

Queries the number of tables in the database.

select * from user_tables;



In oracle, how does one view the tablespace in which a table of the current user is stored?

SELECT
TABLE_NAME,
TABLESPACE_NAME
FROM
USER_TABLES

How to check the tablespace size occupied by a user in oracle

(1) log on to the database with the DBA permission to query the usage of all tablespaces.
SELECT c. tablespace_name, a. bytes/1048576 Megs_Total, (a. bytes-b.bytes)/1048576 Megs_Used,
B. bytes/1048576 Megs_Free, (a. bytes-b.bytes)/a. bytes * 100 Pct_Used, B. bytes/a. bytes * 100 Pct_Free
FROM (SELECT tablespace_name, SUM (a. bytes) bytes, MIN (a. bytes) minbytes, MAX (a. bytes) maxbytes
FROM sys. DBA_DATA_FILES
Group by tablespace_name) a, (SELECT a. tablespace_name, NVL (SUM (B. bytes), 0) bytes
FROM sys. DBA_DATA_FILES a, sys. DBA_FREE_SPACE B
WHERE a. tablespace_name = B. tablespace_name (+)
AND a. file_id = B. file_id (+)
Group by a. tablespace_name) B, sys. DBA_TABLESPACES c
WHERE a. tablespace_name = B. tablespace_name (+)
AND a. tablespace_name = c. tablespace_name
Order by 6;
(2) check whether the table space of the user you are interested in is compared with the usage of all the preceding table spaces to know the result.
(3) The DMP file itself is compressed, and the used space capacity can be considered in a ratio of 4 times, that is, 179 MB * 4.

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.