블로그 이미지
redkite

카테고리

분류 전체보기 (291)
00.SI프로젝트 산출물 (0)
00.센터 운영 문서 (0)
01.DBMS ============.. (0)
01.오라클 (117)
01.MS-SQL (15)
01.MySQL (30)
01.PostgreSql (0)
01.DB튜닝 (28)
====================.. (0)
02.SERVER ==========.. (0)
02.서버-공통 (11)
02.서버-Linux (58)
02.서버-Unix (12)
02.서버-Windows (2)
====================.. (0)
03.APPLICATION =====.. (11)
====================.. (0)
04.ETC =============.. (0)
04.보안 (5)
====================.. (0)
05.개인자료 (1)
06.캠핑관련 (0)
07.OA관련 (1)
Total
Today
Yesterday

달력

« » 2024.5
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

공지사항

최근에 올라온 글

오라클을 통해 작업할

insert시점에서 정상적으로 인덱싱이 되지 않는 경우가 발생한다.

특히 결합인덱스를 많이 사용하고 있는 경우 발생될 확률이 높다.

 

이런경우 오라클의 Analyzed 통해서 해결이 가능하고

어느정도의 실행속도를 향상 시킬 수있다.

(실제 오라클사에서도 3개월에 한번씩은 Analyze 실행하라 권고하고 있다.)

 

[Analyzed 확인 방법]

select table_name, num_rows, to_char(last_analyzed, 'yyyymmdd') from user_tables

select index_name, num_rows, to_char(last_analyzed, 'yyyymmdd') from user_indexes

 

ex) select table_name, num_rows, to_char(last_analyzed, 'yyyymmdd') from user_tables;

TABLE_NAME NUM_ROWS TO_CHAR(
------------------------------ ---------- --------
ABS_TYPE 38
20040101

ANNIVERS 183 20040101
APPRFLDRHISTORY 570
20040101
APPRFOLDER 16885
20040101
APPRFOLDER_ERR 3670
20040101
APPRFORM 359
20040101
.
.
.
USR_INFO_ADMIN 0
20040101
VAR_DEPT_INFO 0
20040101
VIEW_TYPE 0
20040101
WASTEBOX 0
20040101
ZIP_CODE 44195
20040101

252 rows selected.

 

참고 : desc user_tables 에서 보통 num_rows 로도 확인 가능

 

 

[특정 Table Analyze 하는 방법]

 

analyze table document compute statistics

ex) DOCUMENT Table Analyze

 

analyze index xpkdocbox compute statistics

ex) XPKDOCBOX Index Analyze

 

[전체 Table Analyze 하는 간단한 방법]

 

1. vi analyze_all.sql
select 'analyze table || table_name || estimate statistics;' from user_tables

 

2. @analyze_all.sql

 

3. set heading off
set echo off
set feedback off
set pagesize 300 (line
300 미만일 경우)
spool analyze_table.sql
/
spool off

 

4. vi analyze_table.sql
필요없는 Line 제거 정리

 

5. @analyze_table.sql

 


[
전체 Index Analyze 하는 간단한 방법]

 

 

1. vi analyze_all.sql
select 'analyze '||object_type||' ps_mom.'||object_name||' compute statistics; '

from dba_objects

where owner = 'PS_MOM'

and object_type in('TABLE','INDEX')

/

 

2. @analyze_all.sql

 

3. set heading off
set echo off
set feedback off
set pagesize 300 (line
300 미만일 경우)
spool analyze_index.sql
/
spool off

 

4. vi analyze_index.sql
필요없는 Line 제거 정리

 

5. @analyze_index.sql

'01.오라클 > 008.DB 통계 및 공간 관리' 카테고리의 다른 글

[오라클]SHRINK SPACE 관리  (0) 2012.12.19
[오라클]DBMS STAT PACK 이용  (0) 2012.12.19
Posted by redkite
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함