您好,登錄后才能下訂單哦!
job
描述 INTERVAL參數值
每天午夜12點 'TRUNC(SYSDATE + 1)'
每天早上8點30分 'TRUNC(SYSDATE + 1) + (8*60+30)/(24*60)'
每星期二中午12點 'NEXT_DAY(TRUNC(SYSDATE ), ''TUESDAY'' ) + 12/24'
每個月第一天的午夜12點 'TRUNC(LAST_DAY(SYSDATE ) + 1)'
每個季度最后一天的晚上11點 'TRUNC(ADD_MONTHS(SYSDATE + 2/24, 3 ), 'Q' ) -1/24'
每星期六和日早上6點10分 'TRUNC(LEAST(NEXT_DAY(SYSDATE, ''SATURDAY"), NEXT_DAY(SYSDATE, "SUNDAY"))) + (6×60+10)/(24×60)'
--表空間使用率
SELECT Upper(F.TABLESPACE_NAME) "表空間名",
D.TOT_GROOTTE_MB "表空間大小(M)",
D.TOT_GROOTTE_MB - F.TOTAL_BYTES "已使用空間(M)",
To_char(Round(( D.TOT_GROOTTE_MB - F.TOTAL_BYTES ) / D.TOT_GROOTTE_MB * 100, 2), '990.99')
|| '%' "使用比",
F.TOTAL_BYTES "空閑空間(M)",
F.MAX_BYTES "最大塊(M)"
FROM (SELECT TABLESPACE_NAME,
Round(Sum(BYTES) / ( 1024 * 1024 ), 2) TOTAL_BYTES,
Round(Max(BYTES) / ( 1024 * 1024 ), 2) MAX_BYTES
FROM SYS.DBA_FREE_SPACE
GROUP BY TABLESPACE_NAME) F,
(SELECT DD.TABLESPACE_NAME,
Round(Sum(DD.BYTES) / ( 1024 * 1024 ), 2) TOT_GROOTTE_MB
FROM SYS.DBA_DATA_FILES DD
GROUP BY DD.TABLESPACE_NAME) D
WHERE D.TABLESPACE_NAME = F.TABLESPACE_NAME
ORDER BY 1
alter tablespace ARVATOWMS add datafile '/opt/oracle/oradatas/otwb/WMS03.dbf' size 8000m
表大小
select round(BYTES/1024/1024,2)||'M' from user_segments where segment_name='OMS_ORDER_LOG';
計算時間差
(year(CURRENT_DATE())*365*24+month(CURRENT_DATE())*30*24+day(CURRENT_DATE())*24+hour(CURRENT_TIME())+8+minute(CURRENT_TIME())/60) - (year(lastRemindDate)*365*24+month(lastRemindDate)*30*24+day(lastRemindDate)*24+hour(lastRemindDate)+minute(lastRemindDate)/60)
列出區間內日期
SELECT TRUNC(TO_DATE('2014-01-01', 'yyyy-MM-dd')) + ROWNUM - 1 AS DATES
FROM ALL_OBJECTS
WHERE TRUNC(TO_DATE('2014-01-01', 'yyyy-mm-dd')) + ROWNUM - 1 <
TRUNC(TO_DATE('2020-01-01', 'yyyy-mm-dd'));
列出區間內月份
SELECT TO_CHAR(ADD_MONTHS(TO_DATE('2009-03','YYYY-MM'),ROWNUM-1
),'YYYY-MM') DAY_ID
FROM DUAL
CONNECT BY ROWNUM<=months_between
(to_date('2010-03', 'yyyy-mm'),to_date('2009-03', 'yyyy-mm'))+1
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。