oracle--viewing tablespace size and modifying table space size

Source: Internet
Author: User

I. Modifying table space size

Solution to the above problem: by increasing the table space can be resolved as follows:

SQL code
  1. log in with a DBA user
  2. Sqlplus/ as SYSDBA;
  3.   
  4. execute the following command:
  5. SQL > ALTER tablespace SYSTEM ADD datafile '/u01/app/oracle/oradata/test/system02.dbf '   SIZE 20480M autoextend OFF;
  6.   
  7. Note: where '/u01/app/oracle/oradata/test/system02.dbf ' is the path to your database.  Here I set the size to: 20G.

two. View the table space size and related SQL

In solving the above problems encountered at the same time, through the collation, the following SQL, as a management staff, should also be necessary.

SQL code
  1. 1. View the name and size of the table space
  2. SQl > SELECT t.tablespace_name, round (SUM(Bytes/(1024x768)), 0) ts_size from Dba_ta Blespaces T, dba_data_files D WHERE t.tablespace_name = d.tablespace_name GROUP by T.tablespa   Ce_name;
  3.   
  4. 2. View the table space physical file name and size
  5. SQl > SELECT tablespace_name, file_id, file_name, round (Bytes/(1024x768), 0) total_space from Dba_data_files ORDER by Tablespace_name;
  6.   
  7. 3. Check the rollback segment name and size
  8. SQl > SELECT segment_name, Tablespace_name, R.status, (initial_extent/1024) initialextent, (next_ extent/1024) nextextent, max_extents, V.curext curextent from Dba_rollback_segs R, V$rollstat v WHERE   r.segment_id = V.usn (+) ORDER by Segment_name;
  9.   
  10. 4. View Control Files
  11. SQl > SELECT NAME from V$controlfile;
  12.   
  13. 5. Viewing log files
  14. SELECT MEMBER from V$logfile;
  15.   
  16. 6. View the usage of table space
  17. SQl > SELECT SUM(bytes)/(1024x768 * 1024x768) as Free_space, Tablespace_name from DB   A_free_space GROUP by Tablespace_name;
  18.   
  19. SQl > SELECT a.tablespace_name, a.bytes total, b.bytes used, c.bytes free, (b.bytes * +)/A.byt Es "% used", (c.bytes * +)/a.bytes "% free" from Sys.sm$ts_avail A, sys.sm$ts_used B, sys   . sm$ts_free C WHERE a.tablespace_name = b.tablespace_name and a.tablespace_name = C.tablespace_name;
  20.   
  21. 7. View Database Library Objects
  22. SQl > SELECT owner, object_type, status, Count(*) Count# from All_objects GROUP    by Owner, object_type, status;
  23.   
  24. 8. View the version of the database
  25. SQl > SELECT version from product_component_version WHERE substr (product, 1, 6) = '   Oracle ';
  26.   
  27. 9. View the date the database was created and how it was archived
  28. SQl > SELECT created, Log_mode, Log_mode from v$database;

oracle--viewing tablespace size and modifying table space size

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.