블로그 이미지
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.12
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

공지사항

최근에 올라온 글

SELECT
        A.OWNER,
        A.TABLE_COUNT,
        A.VIEW_COUNT,
        B.PK_COUNT,
        A.INDEX_COUNT,
        B.UK_COUNT,
        B.FK_COUNT,
        B.CK_COUNT,
        A.SYNONYM_COUNT,
        A.SEQUENCE_COUNT,
        A.FUNCTION_COUNT,
        A.PROCEDURE_COUNT,
        A.PACKAGE_COUNT,  
        A.PACKAGE_BODY_COUNT,
        A.TRIGGER_COUNT,
        A.LOB_COUNT,
        A.TABLE_PARTITION_COUNT,
        A.INDEX_PARTITION_COUNT,
        A.CLUSTER_COUNT,   
        A.LIBRARY_COUNT,   
        A.DIRECTORY_COUNT,   
        A.JAVA_SOURCE_COUNT,   
        A.JAVA_CLASS_COUNT,
        A.JAVA_RESOURCE_COUNT,
        A.JAVA_DATA_COUNT,
        A.INDEXTYPE_COUNT,
        A.OPERATOR_COUNT,
        A.TYPE_COUNT,
        A.TYPE_BODY_COUNT,
        A.RESOURCE_PLAN_COUNT,
        A.CONSUMER_GROUP_COUNT,
        A.MATERIALIZED_VIEW_COUNT,
        A.TABLE_SUBPARTITION_COUNT,
        A.INDEX_SUBPARTITION_COUNT,
        A.LOB_PARTITION_COUNT,
        A.LOB_SUBPARTITION_COUNT,
        A.DIMENSION_COUNT,
        A.CONTEXT_COUNT,  
        A.RULE_SET_COUNT,  
        A.XML_SCHEMA_COUNT,
        A.SECURITY_PROFILE_COUNT,
        A.RULE_COUNT,
        A.CAPTURE_COUNT,
        A.APPLY_COUNT,
        A.EVALUATION_CONTEXT_COUNT,
        A.PROGRAM_COUNT,
        A.JOB_COUNT,
        A.JOB_CLASS_COUNT,
        A.SCHEDULE_COUNT,
        A.WINDOW_COUNT,
        A.WINDOW_GROUP_COUNT,
        A.CHAIN_COUNT,
        A.NEXT_OBJECT_COUNT,
        A.QUEUE_COUNT,
        A.FILE_GROUP_COUNT
 FROM
 (SELECT /*+ ALL_ROWS */
         U.NAME                      AS OWNER,
         SUM(DECODE(O.TYPE#,  0, 1)) AS NEXT_OBJECT_COUNT,
         SUM(DECODE(O.TYPE#,  1, 1)) AS INDEX_COUNT,
         SUM(DECODE(O.TYPE#,  2, 1)) AS TABLE_COUNT,
         SUM(DECODE(O.TYPE#,  3, 1)) AS CLUSTER_COUNT,
         SUM(DECODE(O.TYPE#,  4, 1)) AS VIEW_COUNT,
         SUM(DECODE(O.TYPE#,  5, 1)) AS SYNONYM_COUNT,
         SUM(DECODE(O.TYPE#,  6, 1)) AS SEQUENCE_COUNT,
         SUM(DECODE(O.TYPE#,  7, 1)) AS PROCEDURE_COUNT,
         SUM(DECODE(O.TYPE#,  8, 1)) AS FUNCTION_COUNT,
         SUM(DECODE(O.TYPE#,  9, 1)) AS PACKAGE_COUNT, 
         SUM(DECODE(O.TYPE#, 11, 1)) AS PACKAGE_BODY_COUNT,
         SUM(DECODE(O.TYPE#, 12, 1)) AS TRIGGER_COUNT,
         SUM(DECODE(O.TYPE#, 13, 1)) AS TYPE_COUNT,
         SUM(DECODE(O.TYPE#, 14, 1)) AS TYPE_BODY_COUNT,
         SUM(DECODE(O.TYPE#, 19, 1)) AS TABLE_PARTITION_COUNT,
         SUM(DECODE(O.TYPE#, 20, 1)) AS INDEX_PARTITION_COUNT,
         SUM(DECODE(O.TYPE#, 21, 1)) AS LOB_COUNT,
         SUM(DECODE(O.TYPE#, 22, 1)) AS LIBRARY_COUNT,
         SUM(DECODE(O.TYPE#, 23, 1)) AS DIRECTORY_COUNT,
         SUM(DECODE(O.TYPE#, 24, 1)) AS QUEUE_COUNT,
         SUM(DECODE(O.TYPE#, 28, 1)) AS JAVA_SOURCE_COUNT,
         SUM(DECODE(O.TYPE#, 29, 1)) AS JAVA_CLASS_COUNT,
         SUM(DECODE(O.TYPE#, 30, 1)) AS JAVA_RESOURCE_COUNT,
         SUM(DECODE(O.TYPE#, 32, 1)) AS INDEXTYPE_COUNT,
         SUM(DECODE(O.TYPE#, 33, 1)) AS OPERATOR_COUNT,
         SUM(DECODE(O.TYPE#, 34, 1)) AS TABLE_SUBPARTITION_COUNT,
         SUM(DECODE(O.TYPE#, 35, 1)) AS INDEX_SUBPARTITION_COUNT,
         SUM(DECODE(O.TYPE#, 40, 1)) AS LOB_PARTITION_COUNT,
         SUM(DECODE(O.TYPE#, 41, 1)) AS LOB_SUBPARTITION_COUNT,
         SUM(DECODE(O.TYPE#, 42, NVL((SELECT DISTINCT 'REWRITE EQUIVALENCE'
                                        FROM SYS.SUM$ S
                                       WHERE S.OBJ#=O.OBJ#
                                         AND bitand(S.XPFLAGS, 8388608) = 8388608),
                                      1))) AS MATERIALIZED_VIEW_COUNT,
         SUM(DECODE(O.TYPE#, 43, 1)) AS DIMENSION_COUNT,
         SUM(DECODE(O.TYPE#, 44, 1)) AS CONTEXT_COUNT,
         SUM(DECODE(O.TYPE#, 46, 1)) AS RULE_SET_COUNT,
         SUM(DECODE(O.TYPE#, 47, 1)) AS RESOURCE_PLAN_COUNT,
         SUM(DECODE(O.TYPE#, 48, 1)) AS CONSUMER_GROUP_COUNT,
         SUM(DECODE(O.TYPE#, 55, 1)) AS XML_SCHEMA_COUNT,
         SUM(DECODE(O.TYPE#, 56, 1)) AS JAVA_DATA_COUNT,
         SUM(DECODE(O.TYPE#, 57, 1)) AS SECURITY_PROFILE_COUNT, 
         SUM(DECODE(O.TYPE#, 59, 1)) AS RULE_COUNT, 
         SUM(DECODE(O.TYPE#, 60, 1)) AS CAPTURE_COUNT, 
         SUM(DECODE(O.TYPE#, 61, 1)) AS APPLY_COUNT,
         SUM(DECODE(O.TYPE#, 62, 1)) AS EVALUATION_CONTEXT_COUNT,
         SUM(DECODE(O.TYPE#, 66, 1)) AS JOB_COUNT,
         SUM(DECODE(O.TYPE#, 67, 1)) AS PROGRAM_COUNT,
         SUM(DECODE(O.TYPE#, 68, 1)) AS JOB_CLASS_COUNT,
         SUM(DECODE(O.TYPE#, 69, 1)) AS WINDOW_COUNT,
         SUM(DECODE(O.TYPE#, 72, 1)) AS WINDOW_GROUP_COUNT,
         SUM(DECODE(O.TYPE#, 74, 1)) AS SCHEDULE_COUNT,
         SUM(DECODE(O.TYPE#, 79, 1)) AS CHAIN_COUNT,
         SUM(DECODE(O.TYPE#, 81, 1)) AS FILE_GROUP_COUNT
    FROM SYS.OBJ$ O, SYS.USER$ U
   WHERE O.OWNER# = U.USER# 
     AND U.NAME NOT IN ('SYS','SYSTEM','BIZMAX','DBSNMP','OUTLN','WMSYS','ORDSYS','TSMSYS',
                        'ORDPLUGINS','RMAN','MDSYS','CTXSYS','WKSYS','WKPROXY','ODM',
                        'ODM_MTR','OLAPSYS','PERFSTAT','ORANGE','WASJMS','SYSMAN',
                        'TMAX','DBMSTOOL','MIBWINE' )
   GROUP BY U.NAME ) A,
  (SELECT /*+ ALL_ROWS */
         OWNER                       AS OWNER,
         SUM(DECODE(C.CONSTRAINT_TYPE, 'P', 1)) AS PK_COUNT,
         SUM(DECODE(C.CONSTRAINT_TYPE, 'U', 1)) AS UK_COUNT,
         SUM(DECODE(C.CONSTRAINT_TYPE, 'R', 1)) AS FK_COUNT,
         SUM(DECODE(C.CONSTRAINT_TYPE, 'C', 1)) AS CK_COUNT 
    FROM SYS.DBA_CONSTRAINTS C
   WHERE C.OWNER NOT IN ('SYS','SYSTEM','BIZMAX','DBSNMP','OUTLN','WMSYS','ORDSYS','TSMSYS',
                         'ORDPLUGINS','RMAN','MDSYS','CTXSYS','WKSYS','WKPROXY','ODM',
                         'ODM_MTR','OLAPSYS','PERFSTAT','ORANGE','WASJMS','SYSMAN',
                         'TMAX','DBMSTOOL','MIBWINE' )
     AND C.GENERATED = 'USER NAME'
   GROUP BY C.OWNER ) B
   WHERE A.OWNER = B.OWNER(+);

 

Posted by redkite
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함