How to deal with oracle tablespace Insufficiency

Source: Internet
Author: User

How to deal with oracle tablespace insufficiency -- 1. view the table's select tablespace_name, table_name from user_talbes where table_name = 'test'; -- 2. Obtain the user's default tablespace select username, DEFAULT_TABLESPACE from dba_users where username = 'mxh'; -- 3. View All tablespace files select * from dba_data_files where tablespace_name = 'users'; -- 4. View tablespace usage: SELECT tbs tablespace name, sum (totalM) total size M, sum (usedM) used space M, sum (remainedM) remaining space M, sum (usedM)/sum (totalM) * 100 percentage used, sum (remainedM)/sum (totalM) * 100 percentage remaining FROM (SELECT B. file_id ID, B. tablespace_name tbs, B. file_name name, B. bytes/1024/1024 totalM, (B. bytes-sum (nvl (. bytes, 0)/1024/1024 usedM, sum (nvl (. bytes, 0)/1024/1024) remainedM, sum (nvl (. bytes, 0)/(B. bytes) * 100), (100-(sum (nvl (. bytes, 0)/(B. bytes) * 100) FROM dba_free_space a, dba_data_files B WHERE. 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 -- 5. Extended tablespace alterdatabase datafile 'd: \ ORACLE \ PRODUCT \ ORADATA \ TEST \ users01.dbf' resize 50 m; -- auto-increment alterdatabase datafile 'd: \ ORACLE \ PRODUCT \ ORADATA \ TEST \ USERS01.DBF 'autoextend onnext 50 m maxsize 500 m; -- add the data file alter tablespace USERS add datafile 'd: \ users02.dbf 'size 5 m;

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.