View the creation statements of Oracle tablespace and tablespace

Source: Internet
Author: User

Table space name and status information:

Select * From dba_tablespaces;

Table space creation statement:

Select dbms_metadata.get_ddl ('tablespace', ts. tablespace_name)

From dba_tablespaces ts;

---- View the tablespace information of the database
Select * from V $ datafile;

Select * -- segment_name, sum (bytes)/1024
From user_extents group by segment_name;

-- 1. view the remaining tablespace size
Select tablespace_name tablespace, sum (blocks * 8192/1000000) remaining space M
From dba_free_space group by tablespace_name;

-- 2. Check the total space of all tablespaces in the system.
Select B. Name, sum (A. Bytes/1000000) Total Space
From v $ datafile A, V $ tablespace B where a. Ts # = B. Ts # group by B. Name;
--- Modify the tablespace size (physical file size)
Alter database datafile '/Oracle/APP/oradata/kfboss/datacenter. dbf' resize 3500 m;
----- View the size of each tablespace
Select tablespace_name, sum (bytes)/1024/1024 from dba_segments group by tablespace_name;

Select segment_name, bytes
From user_segments
Where segment_type = 'boss _ productstr ';

Create a tablespace:

Create tablespace webtbs datafile '/Oracle/APP/oradata/kfboss/webtbs. dbf'
Size 100 m autoextend on next 200 m
Maxsize unlimited extent management local autoallocate segment space management auto;

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.