表空间
1.查看某個(gè)用戶相應(yīng)的表空間和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.產(chǎn)看表空間信息:
???? (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)暫時(shí)表空間查詢
?????? select * from dba_temp_files t where t.tablespace_name in ('TBS_TEMP_PTCL');
3.創(chuàng)建表空間
???? (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:區(qū)管理
??????? --local segment space management :本地段空間管理
??????? --auto 自己主動(dòng)管理,一般默認(rèn)情況就是,假設(shè)想改為手動(dòng)管理:manual
???? (2)暫時(shí)表空間
??????? 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 :又一次運(yùn)用,能夠加能夠不加
???
轉(zhuǎn)載于:https://www.cnblogs.com/yxwkf/p/5305178.html
總結(jié)
- 上一篇: 很久之前看过的电影,记不得名字
- 下一篇: 泪的告白是谁唱的啊?