2014. 9. 18. 15:50

[Oracle] 16진수 <-> 10진수 변환

1. 16진수 -> 10진수

 

SELECT  TO_CHAR(15,'0X'), TO_CHAR(16,'0X'), TO_CHAR(17,'0X') 
  FROM  DUAL;

 >> OF   10   11

 

SELECT  TO_CHAR(15,'000X'), TO_CHAR(16,'000X'), TO_CHAR(17,'000X') 
  FROM  DUAL;

 >> 000F   0010   0011

 

 

2. 10진수 -> 16진수

 

SELECT  TO_NUMBER('F', 'XX')TO_NUMBER('10', 'XX'), TO_NUMBER('11', 'XX') 
  FROM  DUAL;

 >> 15   16   17

 

 

Trackback 0 Comment 0
2014. 9. 2. 09:11

[Oracle] IO를 많이 발생시키는 쿼리 찾기

SELECT  S.FIRST_LOAD_TIME, TO_CHAR(S.BUFFER_GETS,'999,999,999,990') BUFFER_GETS,

              S.DISK_READS, S.ROWS_PROCESSED, S.EXECUTIONS,
              SUBSTR(U.NAME,1,1) USERNAME, S.MODULE, S.SQL_TEXT
   FROM  V$SQLAREA S, SYS.USER$ U
 WHERE  S.PARSING_USER_ID = U.USER#
     AND  U.NAME <> 'SYS'
     AND  S.DISK_READS > 10000
     AND  S.FIRST_LOAD_TIME >= TO_CHAR(SYSDATE,'yyyy-mm-dd')||'/00:00:00'
 ORDER BY  S.FIRST_LOAD_TIME DESC;

 

Trackback 0 Comment 0