Expansion of Oracle Tablespace

Source: Internet
Author: User

--Table Space usage Query
SELECT TBS table space name,
SUM (totalm) total size M,
SUM (USEDM) has used space m,
SUM (REMAINEDM) remaining space m,
SUM (USEDM)/sum (Totalm) *100 percent used,
SUM (REMAINEDM)/sum (totalm) *100 remaining percentage
From (
SELECT b.file_id ID,
B.tablespace_name TBS,
B.file_name name,
b.bytes/1024/1024 Totalm,
(B.bytes-sum (NVL (a.bytes,0)))/1024/1024 usedm,
Sum (NVL (a.bytes,0)/1024/1024) remainedm,
Sum (NVL (a.bytes,0)/(b.bytes) *100),
(+-(SUM (NVL (a.bytes,0))/(b.bytes) *100))
From Dba_free_space A,dba_data_files b
WHERE a.file_id = b.file_id
GROUP by B.tablespace_name,b.file_name,b.file_id,b.bytes
ORDER by B.tablespace_name
)
GROUP by TBS

--Querying the Tablespace file path
SELECT T.tablespace_name,d.file_name,d.autoextensible,round (D.bytes/(1024x768), 2) Bytes_mb,round (d.maxbytes/( * 1024x768), 2) Maxbytes_mb,d.status
From Dba_tablespaces t,dba_data_files D
WHERE T.tablespace_name =d.tablespace_name
ORDER by Tablespace_name,file_name;


--Extended size
ALTER DATABASE datafile ' C:\APP\ADMINISTRATOR\PRODUCT\11.2.0\DBHOME_1\DATABASE\SDE ' autoextend on next 50M MAXSIZE UNLIMITED;

Expansion of Oracle Tablespace

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.