Queries information about all oracle tables, tablespaces, and database connections.

Source: Internet
Author: User

-- Query Information about all oracle tables, tablespaces, and database connections -- 1. select table_name, num_rows, avg_row_len, num_rows * avg_row_len --, 'delete from' | table_name | ';' from user_tables t order by num_rows * avg_row_len desc; -- 2. query the table space Path ------- select * from dba_data_files twhere t. tablespace_name = 'users'; -- 3. query the table space capacity --------- select dbf. tablespace_name, dbf. totalspace "Total (M)", dbf. total totalblocks as blocks, dfs. freespace "total remaining amount (M)", dfs. freeblocks "remaining blocks", (dfs. freespace/dbf. totalspace) * 100 "idle ratio" from (select t. tablespace_name, sum (t. bytes)/1024/1024 totalspace, sum (t. blocks) totalblocksfrom dba_data_files tgroup by t. tablespace_name) dbf, (select tt. tablespace_name, sum (tt. bytes)/1024/1024 freespace, sum (tt. blocks) freeblocksfrom dba_free_space ttgroup by tt. tablespace_name) dfswhere trim (dbf. tablespace_name) = trim (dfs. tablespace_name); -- 4 select count (*) from v $ process; select value from v $ parameter where name = 'processs'; SELECT osuser,. username, cpu_time/executions/1000000 |'s, SQL _fulltext, machine from v $ session a, v $ sqlarea B where. SQL _address = B. address order by cpu_time/executions desc; Author: dingshuo168

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.