Home  >  Article  >  Database  >  表空间

表空间

WBOY
WBOYOriginal
2016-06-07 16:06:291254browse

1.查看某个用户对应的表空间和datafile 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_fi

1.查看某个用户对应的表空间和datafile
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.产看表空间信息:
(1)一般表空间查询
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)临时表空间查询
select * from dba_temp_files t where t.tablespace_name in ('TBS_TEMP_PTCL');

3.创建表空间
(1)一般表空间
create tablespace "TBS_DW_YM"
nologging
datafile '/opt/oracle/oradata/YM_tbs/TBS_DW_YM.dbf' size 50m
extent management local segment space management auto;
--extent management:区管理
--local segment space management :本地段空间管理
--auto 自动管理,一般默认情况就是,如果想改为手动管理:manual
(2)临时表空间
create
temporary tablespace "TBS_YM_TEMP"
tempfile '/opt/oracle/oradata/YM_tbs/TBS_YM_TEMP.dbf' size 50m
reuse autoextend on next 640k maxsize 1000M;
--reuse :重新运用,可以加可以不加

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn