sysaux tablespace Å©±â ÁÙÀ̱â
ÀÛ¼ºÀÚ °ü¸®ÀÚ ÀÛ¼º½Ã°£ 2016-02-16 11:29:48
 

sysaux tablespace´Â 10g¿¡¼­ »õ·Î Ãß°¡µÈ system default tablespaceÀÇ Çϳª·Î ±âÁ¸¿¡ system tablespace¿¡

ÀúÀåµÇ´ø °¢Á¾ ORACLE OPTIONµéÀÇ schema°¡ ÀúÀåµÇ¸ç 10gÀÇ new featureÀÎ AWR(auto workload repository) µ¥ÀÌÅ͵éÀÌ ÀúÀåµÇ´Â tablespace ÀÔ´Ï´Ù.

awrÁ¤º¸´Â default·Î 1½Ã°£¿¡ Çѹø¾¿ data¸¦ gatheringÇÏ°í ±× Á¤º¸¸¦ 7Àϵ¿¾È ÀúÀåÇÏ°Ô µÇ¾î ÀÖ½À´Ï´Ù.

7ÀÏÀÌ Áö³ª¸é °¡Àå ¿À·¡µÈ awrÁ¤º¸¸¦ ÀÚµ¿À¸·Î »èÁ¦ÇÏ°Ô²û µÇ¾î ÀÖ½À´Ï´Ù.

awrÁ¤º¸´Â 7ÀÏ°£ ÀúÀåµÇÁö¸¸ ÁÖ±âÀûÀ¸·Î ½ÇÇàÇÏ´Â table analyze Á¤º¸´Â default·Î 31ÀÏ µ¿¾È ÀúÀåÀÌ µË´Ï´Ù.

<ÇØ°áÃ¥>

1. select dbms_stats.get_stats_history_retention from dual;
(±âº» 31ÀÏÀÔ´Ï´Ù.)

2. exec dbms_stats.alter_stats_history_retention(7);
=> ÀÏÁÖÀÏ ÁÖ±â·Î ¹Ù²Þ

3.exec dbms_stats.purge_stats(to_timestamp_tz('10-10-2008 00:00:00 Asia/Seoul','DD-MM-YYYY HH24:MI:SS TZR'));
=> AWR(auto workload repository) µ¥ÀÌÅÍ ÀúÀå °ªÀÔ´Ï´Ù. µðÆúµå ÁÖ±â 31ÀÏ ÀÌÁö¸¸
2008³â 10¿ù10ÀÏ ÀÌÀü µ¥ÀÌÅÍ »èÁ¦ => ³¯Â¥ Á¶Á¤ ÇØÁÖ½Ã¸é µË´Ï´Ù.
oracle »ç¿ë ³»ºÎ Åë°è Á¤º¸·Î ÀÚµ¿ »èÁ¦ Áֱ⸦ ÁÙÀÎ ´ÙÀ½ °ªÀ» »èÁ¦ Çϴ°̴ϴÙ.

4.alter table wri$_optstat_histgrm_history enable row movement;

5.alter table wri$_optstat_histgrm_history shrink space;
5¹ø ½ÇÇà Çؼ­ ¿¡·¯ ¾øÀ» °æ¿ì ÁøÇà
SQL> alter table wri$_optstat_histgrm_history shrink space;
alter table wri$_optstat_histgrm_history shrink space
*
1Çà¿¡ ¿À·ù:
ORA-10631: SHRINK clause should not be specified for this object
=> ¿¡·¯ ³¯ °æ¿ì 6¹ø ÁøÇà

6. 5¹ø¿¡¼­ ¿¡·¯ ³¯ °æ¿ì[index »ý¼º Äõ¸® ÃßÃâ ±¸¹® ½ÇÇà]
set long 1000
select dbms_metadata.get_ddl('INDEX','I_WRI$_OPTSTAT_H_OBJ#_ICOL#_ST','SYS') from dual;

=>°á°ú
CREATE INDEX "SYS"."I_WRI$_OPTSTAT_H_OBJ#_ICOL#_ST"
ON "SYS"."WRI$_OPTSTAT_HISTGRM_HISTORY"("OBJ#","INTCOL#",SYS_EXTRACT_UTC(
"SAVTIME"))
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "SYSAUX" nologging;


select dbms_metadata.get_ddl('INDEX','I_WRI$_OPTSTAT_H_ST','SYS') from dual;

=> °á°ú
CREATE INDEX "SYS"."I_WRI$_OPTSTAT_H_ST"
ON "SYS"."WRI$_OPTSTAT_HISTGRM_HISTORY"(SYS_EXTRACT_UTC("SAVTIME")) PCTFREE 10 INITRANS 2 MAXTRANS 255
COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1
MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "SYSAUX" nologging;

7. INDEX »èÁ¦ ¾Æ·¡ Àû¿ë ÈÄ Àç »ý¼º
drop INDEX "SYS"."I_WRI$_OPTSTAT_H_OBJ#_ICOL#_ST";

drop INDEX "SYS"."I_WRI$_OPTSTAT_H_ST";
=============================================

8. alter table WRI$_OPTSTAT_HISTGRM_HISTORY enable row movement;

9. alter table WRI$_OPTSTAT_HISTGRM_HISTORY shrink space;

10. alter table WRI$_OPTSTAT_HISTGRM_HISTORY disable row movement;

11. alter session set workarea_size_policy=manual;

12. alter session set sort_area_size=104857600;

13. À§¿¡¼­ »èÁ¦ÇÑ index »ý¼º Äõ¸® ½ÇÇà

13-1.
CREATE INDEX "SYS"."I_WRI$_OPTSTAT_H_ST"
ON "SYS"."WRI$_OPTSTAT_HISTGRM_HISTORY"(SYS_EXTRACT_UTC("SAVTIME")) PCTFREE 10 INITRANS 2 MAXTRANS 255
COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1
MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "SYSAUX" nologging;


13-2.
CREATE INDEX "SYS"."I_WRI$_OPTSTAT_H_OBJ#_ICOL#_ST"
ON "SYS"."WRI$_OPTSTAT_HISTGRM_HISTORY"("OBJ#","INTCOL#",SYS_EXTRACT_UTC(
"SAVTIME"))
PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS
STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645
PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT) TABLESPACE "SYSAUX" nologging;

14.°á°ú Á¶È¸


14-1
select occupant_name,space_usage_kbytes/1024 "MB"
from v$sysaux_occupants
order by space_usage_kbytes
/
Àû¿ë Àü
OCCUPANT_NAME                                        MB
--------------------------------------------- ----------

SM/OPTSTAT                                        4.8125
SM/AWR
Àû¿ë ÈÄ

SM/OPTSTAT                                          3.5
SM/AWR

15. SYSAUX Tablespace »ç¿ë·® üũ

select tablespace_name,sum(bytes/1024/1024) "Free(M)"
from dba_free_space
where tablespace_name = 'SYSAUX'
group by tablespace_name;


¸ñ·Ï | ÀÔ·Â | ¼öÁ¤ | ´äº¯ | »èÁ¦