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;