What is a tablespace?
1. view the tablespace and datafile corresponding to a user
Select t1.username, t2.tablespace _ name, t2.file _ name, t1.temporary _ tablespace, t3.file _ name
From dba_users t1
Left join
Dba_data_files t2
On t1.default _ tablespace = t2.tablespace _ name
Left join
Dba_temp_files t3
On t1.temporary _ tablespace = t3.tablespace _ name
Where
Lower (t1.username) in
('Lbi _ sys_ptcl ', 'lbi _ ods_ptcl', 'lbi _ ods_ptcl ', 'lbi _ edm_ptcl', 'lbi _ ls_ptcl ', 'lbi _ dm_ptcl ', 'lbi _ dim_ptcl ')
2. Production table space information:
(1) General tablespace Query
Select * from dba_data_files t where t. tablespace_name in (
'Tbs _ DIM_PTCL ', 'tbs _ LS_PTCL', 'tbs _ ODS_PTCL ', 'tbs _ DM_PTCL', 'tbs _ EDM_PTCL ', 'tbs _ SYS_PTCL ');
(2) Temporary tablespace Query
Select * from dba_temp_files t where t. tablespace_name in ('tbs _ TEMP_PTCL ');
3. Create a tablespace
(1) General tablespace
Create tablespace "TBS_DW_YM"
Nologging
Datafile '/opt/oracle/oradata/YM_tbs/tbs_dw_ym.dbf' size 50 m
Extent management local segment space management auto;
-- Extent management: zone management
-- Local segment space management: local lot space management
-- Auto automatic management. Generally, the default value is: manual.
(2) Temporary tablespace
Create
Temporary tablespace "TBS_YM_TEMP"
Tempfile '/opt/oracle/oradata/YM_tbs/tbs_ym_temp.dbf' size 50 m
Reuse autoextend on next 640 k maxsize 1000 M;
-- Reuse: re-use, can be added without adding
How to Create a tablespace in oracle
Either Enterprise Manager (EM) or sqlplus can be used. The EM is a graphical interface.
If sqlplus is used, as follows:
Sqlplus/as sysdba
SQL> create tablespace tbsname datafile 'file path and file name' size 500 m;
How to Create a tablespace in oracle
Either Enterprise Manager (EM) or sqlplus can be used. The EM is a graphical interface.
If sqlplus is used, as follows:
Sqlplus/as sysdba
SQL> create tablespace tbsname datafile 'file path and file name' size 500 m;