Which user does the Oracle query table belong?

Source: Internet
Author: User

Select username, default_tablespace from dba_users order by username

You must have dba permissions.

1. view the user's default tablespace name

You must know your login user name, right,

Log On With sysdba.

Sqlplus/as sysdba

Select username, default_tablespace from dba_users;

2. view the total table space size and the used table space size.

Select a. tablespace_name, a. bytes/1024/1024 "Sum MB", (a. bytes-b.bytes)/1024/1024 "used MB", B. bytes/1024/1024 "free MB ",

Round (a. bytes-b.bytes)/a. bytes) *) "percent_used"

From

(Select tablespace_name, sum (bytes) bytes from dba_data_files group by tablespace_name),

(Select tablespace_name, sum (bytes) bytes, max (bytes) largest from dba_free_space group by tablespace_name) B

Where a. tablespace_name = B. tablespace_name

Order by (a. bytes-b.bytes)/a. bytes) desc;

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.