Oracle database, Summary of common SQL statements

Source: Internet
Author: User

--View tablespace names, path, size, and usage of data files
Select B.tablespace_name "tablespace name",
B.file_name "Data file path",
b.bytes/1024/1024 "Size (M)",
SUBSTR ((B.bytes-sum (NVL (a.bytes,0))/(b.bytes) *100,1,5) "Utilization"
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.bytes
Order by 1, 2;

--Increase table space size

--First you need to query the table space name and the path to the data file, and then execute the following command

Alter Tablespace "USERS" Add datafile ' D:\APP\ADMINISTRATOR\ORADATA\ORCL\USERS02. DBF ' size 10240M;

Alter temporary tablespace "TEMP" add tempfile ' D:\APP\ADMINISTRATOR\ORADATA\ORCL\TEMP02. DBF ' size 1024M;

Oracle database, Summary of common SQL statements

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.