What is a tablespace?

Source: Internet
Author: User

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;

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.