黄色网页视频 I 影音先锋日日狠狠久久 I 秋霞午夜毛片 I 秋霞一二三区 I 国产成人片无码视频 I 国产 精品 自在自线 I av免费观看网站 I 日本精品久久久久中文字幕5 I 91看视频 I 看全色黄大色黄女片18 I 精品不卡一区 I 亚洲最新精品 I 欧美 激情 在线 I 人妻少妇精品久久 I 国产99视频精品免费专区 I 欧美影院 I 欧美精品在欧美一区二区少妇 I av大片网站 I 国产精品黄色片 I 888久久 I 狠狠干最新 I 看看黄色一级片 I 黄色精品久久 I 三级av在线 I 69色综合 I 国产日韩欧美91 I 亚洲精品偷拍 I 激情小说亚洲图片 I 久久国产视频精品 I 国产综合精品一区二区三区 I 色婷婷国产 I 最新成人av在线 I 国产私拍精品 I 日韩成人影音 I 日日夜夜天天综合

[置頂] Oracle 數(shù)據(jù)庫(kù)表空間容量調(diào)整(表空間縮

系統(tǒng) 2282 0

--1、獲取需要釋放空間的表空間信息(包含oracle database自有表空間)
--drop table system.tbs_detail;
create table system.tbs_detail as select
a.tablespace_name,
a.bytes/1024/1024 "Sum_MB",
(a.bytes-b.bytes)/1024/1024 "used_MB",
b.bytes/1024/1024 "free_MB",
round(((a.bytes-b.bytes)/a.bytes)*100,2) "percent_used" ??
from
(select tablespace_name,sum(bytes) bytes from dba_data_files group by tablespace_name) a, ? ?
(select tablespace_name,sum(bytes) bytes,max(bytes) largest from dba_free_space group by tablespace_name) b ? ?
where a.tablespace_name=b.tablespace_name ? ?
order by ((a.bytes-b.bytes)/a.bytes) desc;


--select * from system.tbs_detail order by "Sum_MB" desc,"free_MB" desc;


--2、獲取需要釋放空間的應(yīng)用表空間數(shù)據(jù)文件使用情況
--drop table system.datafile_space;
create table system.datafile_space as?
select a.TABLESPACE_NAME,
? ? ? ?a.FILE_NAME,
? ? ? ?a.BYTES / 1024 / 1024 total,
? ? ? ?b.sum_free / 1024 / 1024 free
? from dba_data_files a,
? ? ? ?(select file_id, sum(bytes) sum_free
? ? ? ? ? from dba_free_space
? ? ? ? ?group by file_id) b
?where a.FILE_ID = b.file_id
? ?and a.TABLESPACE_NAME in (select tablespace_name
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?from system.tbs_detail
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? where (tablespace_name like '%CQLT%' or
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? tablespace_name like '%CQST%'
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? or tablespace_name like 'TS%' or tablespace_name like 'IDX%'
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? or tablespace_name like '%HX%')
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? and "Sum_MB" > 100);


--select * from system.datafile_space;
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ??
--3、生成數(shù)據(jù)文件大小重置腳本,在每個(gè)數(shù)據(jù)文件當(dāng)前實(shí)際使用空間大小基礎(chǔ)上增加 100m 空間


select 'alter database datafile ''' || file_name || ''' resize ' ||
? ? ? round(to_number(total - free + 100),0) || ' M;'
? from system.datafile_space;
??


--查看 ASM 磁盤組使用情況
sqlplus / as sysdba <<EOF
set feed off
set linesize 200
set pagesize 200
set echo off
spool /home/oracle/check_log/chktbs.log append
select name,state,type,total_mb,free_mb from v\$asm_diskgroup;
spool off
quit

EOF



?

轉(zhuǎn)載請(qǐng)注明作者出處及原文鏈接,否則將追究法律責(zé)任:

作者:xiangsir

原文鏈接:http://blog.csdn.net/xiangsir/article/details/9002201

QQ:444367417

MSN:xiangsir@hotmail.com

?


?

[置頂] Oracle 數(shù)據(jù)庫(kù)表空間容量調(diào)整(表空間縮容腳本)腳本


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對(duì)您有幫助就好】

您的支持是博主寫作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長(zhǎng)會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論