analyze ¹®

ÀÌ ¹®Àº Å×À̺í, À妽º, Ŭ·¯½ºÅÍÀÇ ±¸Á¶¸¦ ºÐ¼®ÇÏ¿© ±× °á°ú¸¦ DBA_TABLES, dba_analyze_objects¿¡ ÀúÀåÇÑ´Ù.

´ÙÀ½°ú °°Àº ÀÏÀ» ÇÑ´Ù.

• index ¶Ç´Â index partition, table ¶Ç´Â table partition, index-organized table, cluster, scalar object attribute¿¡ °üÇÑ Åë°è¸¦ ¸ðÀ¸°Å³ª »èÁ¦
• index ¶Ç´Â index partition, table ¶Ç´Â table partition, index-organized table, cluster, object reference(REF)ÀÇ ±¸Á¶¸¦ À¯È¿ÇÏ°Ô ÇÔ
• tableÀ̳ª cluster¿¡ ´ëÇÑ migrated & chainedÇÑ Çà¿¡ ´ëÇÑ identify

ÀÌ ¹®À» ½ÇÇàÇÏ·Á¸é ½ºÅ°¸¶°¡ local¿¡ ÀÖ¾î¾ß Çϰí, ÀڽмÒÀ¯ÀÇ ½ºÅ°¸¶À̰ųª ¶Ç´Â ANALYZE ANY ½Ã½ºÅÛ ±ÇÇÑÀÌ ÀÖ¾î¾ß ÇÑ´Ù.

¡¼Çü½Ä¡½
ANALYZE TABLE [schema.] table [partition_extention_clause   validation_clauses;
INDEX [schema.] index LIST CHAINED ROWS [into_clause]
CLUSTER [schema.] cluster DELETE [SYSTEM] STATISTICS
¡¼¿¹Á¦¡½ SQL> connect system/manager connected SQL> analyze table jijoe.emp estimate statistics; Table analyzed SQL> select table_name, blocks from dba_tables 2 where owner = 'JIJOE' and table_name = 'EMP'; TABLE_NAME BLOCKS ------------------------------ ---------- EMP 1 SQL> ¡¼¿¹Á¦¡½ SQL> analyze table emp list chained rows; analyze table emp list chained rows * ERROR at line 1: ORA-01495: specified chain row table not found SQL> analyze table emp delete statistics; Table analyzed. SQL> ANALYZE TABLE emp VALIDATE STRUCTURE; Table analyzed. SQL>
analyze indexindex_stats¿¡ ÀÚ·á ÀúÀå
dba_analyze_objectsanalyze¹®¿¡ ÀÇÇØ ºÐ¼®µÈ Åë°èÁ¤º¸¸¦ ÀúÀåÇÏ´Â Å×À̺í
index_histogramanalyze index ... validate index ¹®À» ½ÇÇàÇϸé À妽º ۰ªÀÌ ¾ó¸¶³ª ÀÚÁÖ »ç¿ëµÇ¾ú´ÂÁö, ºÐÆ÷µµ°¡ ¾î¶²Áö¸¦ ÀÌ Å×ÀÌºí¿¡ ÀúÀåÇÔ

¡¼¿¹Á¦¡½ SQL> show user USER is "OE" SQL> ANALYZE TABLE orders DELETE STATISTICS; Table analyzed. SQL> ANALYZE INDEX inv_product_ix VALIDATE STRUCTURE; Index analyzed. SQL> ANALYZE TABLE customers VALIDATE REF UPDATE; Table analyzed. SQL> ANALYZE TABLE customers VALIDATE STRUCTURE ONLINE; Table analyzed. SQL> ANALYZE TABLE orders 2 LIST CHAINED ROWS INTO chained_rows; ¡¼¿¹Á¦¡½ SQL> show user USER is "HR" SQL> ANALYZE TABLE employees VALIDATE STRUCTURE CASCADE; Table analyzed. SQL> ¢Ð creating a cluster SQL> CREATE CLUSTER personnel 2 (department NUMBER(4)) 3 SIZE 512 4 STORAGE (initial 100k next 50k); Cluster created. ¢Ð cluster keys SQL> CREATE INDEX idx_personnel ON CLUSTER personnel; Index created. ¢Ð adding tables to a cluster SQL> CREATE TABLE dept_10 2 CLUSTER personnel (department_id) 3 AS SELECT * FROM employees WHERE department_id = 10; Table created. SQL> SQL> CREATE TABLE dept_20 2 CLUSTER personnel (department_id) 3 AS SELECT * FROM employees WHERE department_id = 20; Table created. SQL> ANALYZE CLUSTER personnel 2 VALIDATE STRUCTURE CASCADE; Cluster analyzed. SQL>