Bo's Oracle Station

查看: 923|回复: 0

课程第40次(2017-09-29星期四)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2017-9-28 20:36:35 | 显示全部楼层 |阅读模式
1Z0-053第9章/1Z0-052第18章
1Z0-05219章(上完13章),1Z0-05321章(上完13章)和1Z0-063多租户部分共9章(上完0章)
总共上完全部49章中的26

Screenshot.png

  1. select  * from v$database_block_corruption;

  2. select  * from dba_indexes i where i.table_owner='HR'
  3.   and i.table_name='TLOGICAL';
  4.   
  5.   select  * from v$hm_check;
  6.   
  7.   select * from v$hm_run  order by start_time desc;
  8.   
  9.   begin
  10.      dbms_hm.run_check(check_name => 'Data Block Integrity Check',
  11.      run_name => 'MYRUN2',
  12.      timeout => 0,
  13.      input_params => 'BLC_DF_NUM=6;BLC_BL_NUM=136');
  14.      end;
复制代码
  1. [root@station90 ~]# crs_stat -t
  2. Name           Type           Target    State     Host        
  3. ------------------------------------------------------------
  4. ora.DATA.dg    ora....up.type ONLINE    ONLINE    station90   
  5. ora.FRA.dg     ora....up.type ONLINE    ONLINE    station90   
  6. ora....ER.lsnr ora....er.type ONLINE    ONLINE    station90   
  7. ora.asm        ora.asm.type   ONLINE    ONLINE    station90   
  8. ora.cssd       ora.cssd.type  ONLINE    ONLINE    station90   
  9. ora.diskmon    ora....on.type OFFLINE   OFFLINE               
  10. ora.evmd       ora.evm.type   ONLINE    ONLINE    station90   
  11. ora.ons        ora.ons.type   OFFLINE   OFFLINE               
  12. ora.orcl.db    ora....se.type ONLINE    ONLINE    station90   
  13. [root@station90 ~]# su - oracle
  14. [oracle@station90 ~]$ sqlplus /nolog

  15. SQL*Plus: Release 11.2.0.3.0 Production on Thu Sep 28 19:27:07 2017

  16. Copyright (c) 1982, 2011, Oracle.  All rights reserved.

  17. SQL> conn hr/oracle_4U
  18. Connected.
  19. SQL> select * from tlogical;
  20. ERROR:
  21. ORA-01578: ORACLE data block corrupted (file # 6, block # 136)
  22. ORA-01110: data file 6: '+DATA/orcl/datafile/tbslogical.267.955745025'
  23. ORA-26040: Data block was loaded using the NOLOGGING option



  24. no rows selected

  25. SQL> exit
  26. Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
  27. With the Partitioning, Automatic Storage Management, OLAP, Data Mining
  28. and Real Application Testing options
  29. [oracle@station90 ~]$ adrci

  30. ADRCI: Release 11.2.0.3.0 - Production on Thu Sep 28 20:09:14 2017

  31. Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

  32. ADR base = "/u01/app/oracle"
  33. adrci> help

  34. HELP [topic]
  35.    Available Topics:
  36.         CREATE REPORT
  37.         ECHO
  38.         EXIT
  39.         HELP
  40.         HOST
  41.         IPS
  42.         PURGE
  43.         RUN
  44.         SET BASE
  45.         SET BROWSER
  46.         SET CONTROL
  47.         SET ECHO
  48.         SET EDITOR
  49.         SET HOMES | HOME | HOMEPATH
  50.         SET TERMOUT
  51.         SHOW ALERT
  52.         SHOW BASE
  53.         SHOW CONTROL
  54.         SHOW HM_RUN
  55.         SHOW HOMES | HOME | HOMEPATH
  56.         SHOW INCDIR
  57.         SHOW INCIDENT
  58.         SHOW PROBLEM
  59.         SHOW REPORT
  60.         SHOW TRACEFILE
  61.         SPOOL

  62. There are other commands intended to be used directly by Oracle, type
  63. "HELP EXTENDED" to see the list

  64. adrci> help SET HOMES

  65.   Usage:  SET HOMES | HOME| HOMEPATH <homepath_str1 homepath_str2 ...>

  66.   Purpose: Set the ADR homes to query in the current ADRCI session.

  67.   Arguments:
  68.     <homepath_str1 homepath_str2 ...>: The paths of the home,
  69.     relative to the ADR base.

  70.   Note:
  71.     The "diag" directory name can be omitted from the homepath_str.
  72.     If the specified path contains multiple homes, for instance, it is
  73.     set to the database ID which is running RAC. All of the ADR homes
  74.     corresponding to the instances of the database will be added to the
  75.     current ADRCI home settings.

  76.   Example:  
  77.     set homepath diag/rdbms/aime3/aime3 diag/rdbms/aime3/aime32
  78.     set homepath rdbms/aime3

  79. adrci>
  80. adrci> set homepath diag/rdbms/orcl/orcl
  81. adrci> SHOW INCIDENT

  82. ADR Home = /u01/app/oracle/diag/rdbms/orcl/orcl:
  83. *************************************************************************
  84. INCIDENT_ID          PROBLEM_KEY                                                 CREATE_TIME                              
  85. -------------------- ----------------------------------------------------------- ----------------------------------------
  86. 12201                ORA 600 [1433]                                              2014-08-06 17:29:11.284000 +08:00      
  87. 12081                ORA 600 [1433]                                              2014-08-06 17:29:13.939000 +08:00      
  88. 13449                ORA 600 [1433]                                              2014-08-06 17:33:35.241000 +08:00      
  89. 13513                ORA 600 [1433]                                              2014-08-06 17:33:36.220000 +08:00      
  90. 13561                ORA 600 [1433]                                              2014-08-06 17:33:40.303000 +08:00      
  91. 13562                ORA 603                                                     2014-08-06 17:33:42.361000 +08:00      
  92. 13505                ORA 600 [1433]                                              2014-08-06 17:34:13.830000 +08:00      
  93. 13506                ORA 603                                                     2014-08-06 17:34:15.747000 +08:00      
  94. 13465                ORA 600 [1433]                                              2014-08-06 17:34:37.378000 +08:00      
  95. 27928                ORA 1578                                                    2017-09-26 20:20:55.029000 +08:00      
  96. 27929                ORA 1578                                                    2017-09-26 20:22:32.236000 +08:00      
  97. 27930                ORA 1578                                                    2017-09-26 20:23:08.151000 +08:00      
  98. 27931                ORA 1578                                                    2017-09-26 20:24:20.550000 +08:00      
  99. 27816                ORA 1578                                                    2017-09-26 20:57:47.664000 +08:00      
  100. 29157                ORA 1578                                                    2017-09-26 21:30:01.712000 +08:00      
  101. 30222                ORA 1578                                                    2017-09-26 21:35:11.561000 +08:00      
  102. 31526                ORA 1578                                                    2017-09-26 21:40:48.228000 +08:00      
  103. 32798                ORA 1578                                                    2017-09-26 21:44:00.679000 +08:00      
  104. 35247                ORA 1578                                                    2017-09-28 19:27:18.887000 +08:00      
  105. 35248                ORA 1578                                                    2017-09-28 19:27:20.445000 +08:00      
  106. 20 rows fetched

  107. adrci> SHOW PROBLEM

  108. ADR Home = /u01/app/oracle/diag/rdbms/orcl/orcl:
  109. *************************************************************************
  110. PROBLEM_ID           PROBLEM_KEY                                                 LAST_INCIDENT        LASTINC_TIME                             
  111. -------------------- ----------------------------------------------------------- -------------------- ----------------------------------------
  112. 2                    ORA 603                                                     13506                2014-08-06 17:34:15.747000 +08:00      
  113. 1                    ORA 600 [1433]                                              13281                2014-08-06 17:36:00.102000 +08:00      
  114. 3                    ORA 1578                                                    35248                2017-09-28 19:27:20.445000 +08:00      
  115. 3 rows fetched

  116. adrci> help show problem

  117.   Usage: SHOW PROBLEM [-p <predicate_string>]
  118.                       [-last <num> | -all]
  119.                       [-orderby (field1, field2, ...) [ASC|DSC]]

  120.   Purpose: Show the problem information. By default, this command will
  121.            only show the last 50 problems.

  122.   Options:
  123.     [-p <predicate_string>]: The predicate string must be double-quoted.
  124.     The field names that users can specify in the predicate are:
  125.         PROBLEM_ID                    number
  126.         PROBLEM_KEY                   text(550)
  127.         FIRST_INCIDENT                number
  128.         FIRSTINC_TIME                 timestamp
  129.         LAST_INCIDENT                 number
  130.         LASTINC_TIME                  timestamp
  131.         IMPACT1                       number
  132.         IMPACT2                       number
  133.         IMPACT3                       number
  134.         IMPACT4                       number
  135.         SERVICE_REQUEST               text(64)
  136.         BUG_NUMBER                    text(64)

  137.     [-last <num> | -all]: This option allows users to either select
  138.     the last <num> of qualified problems to show or to show all the
  139.     qualified problems. If this option is not specified, this command
  140.     will only show 50 incidents.

  141.     [-orderby (field1, field2, ...) [ASC|DSC]]: If specified, the results
  142.     will be ordered by the specified fields' values. By default, it will be
  143.     in the ascending order unless "DSC" is specified. Note that the field
  144.     names that can be specified here are from the "PROBLEM" relation.

  145.   Examples:  
  146.     show problem
  147.     show problem -p "problem_id>123"

  148. adrci> help

  149. HELP [topic]
  150.    Available Topics:
  151.         CREATE REPORT
  152.         ECHO
  153.         EXIT
  154.         HELP
  155.         HOST
  156.         IPS
  157.         PURGE
  158.         RUN
  159.         SET BASE
  160.         SET BROWSER
  161.         SET CONTROL
  162.         SET ECHO
  163.         SET EDITOR
  164.         SET HOMES | HOME | HOMEPATH
  165.         SET TERMOUT
  166.         SHOW ALERT
  167.         SHOW BASE
  168.         SHOW CONTROL
  169.         SHOW HM_RUN
  170.         SHOW HOMES | HOME | HOMEPATH
  171.         SHOW INCDIR
  172.         SHOW INCIDENT
  173.         SHOW PROBLEM
  174.         SHOW REPORT
  175.         SHOW TRACEFILE
  176.         SPOOL

  177. There are other commands intended to be used directly by Oracle, type
  178. "HELP EXTENDED" to see the list

  179. adrci> help ips

  180. HELP IPS [topic]
  181.    Available Topics:
  182.         ADD
  183.         ADD FILE
  184.         ADD NEW INCIDENTS
  185.         CHECK REMOTE KEYS
  186.         COPY IN FILE
  187.         COPY OUT FILE
  188.         CREATE PACKAGE
  189.         DELETE PACKAGE
  190.         FINALIZE PACKAGE
  191.         GENERATE PACKAGE
  192.         GET MANIFEST
  193.         GET METADATA
  194.         GET REMOTE KEYS
  195.         PACK
  196.         REMOVE
  197.         REMOVE FILE
  198.         SET CONFIGURATION
  199.         SHOW CONFIGURATION
  200.         SHOW FILES
  201.         SHOW INCIDENTS
  202.         SHOW PACKAGE
  203.         UNPACK FILE
  204.         UNPACK PACKAGE
  205.         USE REMOTE KEYS
  206. adrci> ips show package
  207.    PACKAGE_ID             1
  208.    PACKAGE_NAME           ORA1578_20170928201600
  209.    PACKAGE_DESCRIPTION    XXXX
  210.    DRIVING_PROBLEM        3
  211.    DRIVING_PROBLEM_KEY    ORA 1578
  212.    DRIVING_INCIDENT       27928
  213.    DRIVING_INCIDENT_TIME  2017-09-26 20:20:55.029000 +08:00
  214.    STATUS                 Generated (4)
  215.    CORRELATION_LEVEL      Typical (2)
  216.    PROBLEMS               1 main problems, 1 correlated problems
  217.    INCIDENTS              6 main incidents, 2 correlated incidents
  218.    INCLUDED_FILES         277

  219. adrci> ips show package
  220.    PACKAGE_ID             1
  221.    PACKAGE_NAME           ORA1578_20170928201600
  222.    PACKAGE_DESCRIPTION    XXXX
  223.    DRIVING_PROBLEM        3
  224.    DRIVING_PROBLEM_KEY    ORA 1578
  225.    DRIVING_INCIDENT       27928
  226.    DRIVING_INCIDENT_TIME  2017-09-26 20:20:55.029000 +08:00
  227.    STATUS                 Generated (4)
  228.    CORRELATION_LEVEL      Typical (2)
  229.    PROBLEMS               1 main problems, 1 correlated problems
  230.    INCIDENTS              6 main incidents, 2 correlated incidents
  231.    INCLUDED_FILES         311

  232. adrci> ips show package
  233.    PACKAGE_ID             1
  234.    PACKAGE_NAME           ORA1578_20170928201600
  235.    PACKAGE_DESCRIPTION    XXXX
  236.    DRIVING_PROBLEM        3
  237.    DRIVING_PROBLEM_KEY    ORA 1578
  238.    DRIVING_INCIDENT       27928
  239.    DRIVING_INCIDENT_TIME  2017-09-26 20:20:55.029000 +08:00
  240.    STATUS                 Generated (4)
  241.    CORRELATION_LEVEL      Typical (2)
  242.    PROBLEMS               1 main problems, 1 correlated problems
  243.    INCIDENTS              6 main incidents, 2 correlated incidents
  244.    INCLUDED_FILES         311

  245. adrci> show hm_run

  246. ADR Home = /u01/app/oracle/diag/rdbms/orcl/orcl:
  247. *************************************************************************

  248. **********************************************************
  249. HM RUN RECORD 1
  250. **********************************************************
  251.    RUN_ID                        1
  252.    RUN_NAME                      HM_RUN_1
  253.    CHECK_NAME                    DB Structure Integrity Check
  254.    NAME_ID                       2
  255.    MODE                          2
  256.    START_TIME                    2013-05-23 09:47:15.526684 +08:00
  257.    RESUME_TIME                   <NULL>
  258.    END_TIME                      2013-05-23 09:47:17.322008 +08:00
  259.    MODIFIED_TIME                 2013-05-23 09:47:17.322008 +08:00
  260.    TIMEOUT                       0
  261.    FLAGS                         0
  262.    STATUS                        5
  263.    SRC_INCIDENT_ID               0
  264.    NUM_INCIDENTS                 0
  265.    ERR_NUMBER                    0
  266.    REPORT_FILE                   <NULL>

  267. **********************************************************
  268. HM RUN RECORD 2
  269. **********************************************************
  270.    RUN_ID                        41
  271.    RUN_NAME                      HM_RUN_41
  272.    CHECK_NAME                    DB Structure Integrity Check
  273.    NAME_ID                       2
  274.    MODE                          2
  275.    START_TIME                    2014-08-06 17:23:30.457152 +08:00
  276.    RESUME_TIME                   <NULL>
  277.    END_TIME                      2014-08-06 17:23:30.678148 +08:00
  278.    MODIFIED_TIME                 2014-08-06 17:23:30.678148 +08:00
  279.    TIMEOUT                       0
  280.    FLAGS                         0
  281.    STATUS                        5
  282.    SRC_INCIDENT_ID               0
  283.    NUM_INCIDENTS                 0
  284.    ERR_NUMBER                    0
  285.    REPORT_FILE                   <NULL>

  286. **********************************************************
  287. HM RUN RECORD 3
  288. **********************************************************
  289.    RUN_ID                        61
  290.    RUN_NAME                      HM_RUN_61
  291.    CHECK_NAME                    DB Structure Integrity Check
  292.    NAME_ID                       2
  293.    MODE                          2
  294.    START_TIME                    2014-08-06 17:24:30.449936 +08:00
  295.    RESUME_TIME                   <NULL>
  296.    END_TIME                      2014-08-06 17:24:30.639177 +08:00
  297.    MODIFIED_TIME                 2014-08-06 17:24:30.639177 +08:00
  298.    TIMEOUT                       0
  299.    FLAGS                         0
  300.    STATUS                        5
  301.    SRC_INCIDENT_ID               0
  302.    NUM_INCIDENTS                 0
  303.    ERR_NUMBER                    0
  304.    REPORT_FILE                   <NULL>

  305. **********************************************************
  306. HM RUN RECORD 4
  307. **********************************************************
  308.    RUN_ID                        81
  309.    RUN_NAME                      HM_RUN_81
  310.    CHECK_NAME                    DB Structure Integrity Check
  311.    NAME_ID                       2
  312.    MODE                          2
  313.    START_TIME                    2014-08-06 17:25:31.333712 +08:00
  314.    RESUME_TIME                   <NULL>
  315.    END_TIME                      2014-08-06 17:25:32.152792 +08:00
  316.    MODIFIED_TIME                 2014-08-06 17:25:32.152792 +08:00
  317.    TIMEOUT                       0
  318.    FLAGS                         0
  319.    STATUS                        5
  320.    SRC_INCIDENT_ID               0
  321.    NUM_INCIDENTS                 0
  322.    ERR_NUMBER                    0
  323.    REPORT_FILE                   <NULL>

  324. **********************************************************
  325. HM RUN RECORD 5
  326. **********************************************************
  327.    RUN_ID                        101
  328.    RUN_NAME                      HM_RUN_101
  329.    CHECK_NAME                    DB Structure Integrity Check
  330.    NAME_ID                       2
  331.    MODE                          2
  332.    START_TIME                    2014-08-06 17:29:40.731026 +08:00
  333.    RESUME_TIME                   <NULL>
  334.    END_TIME                      2014-08-06 17:29:40.963195 +08:00
  335.    MODIFIED_TIME                 2014-08-06 17:29:40.963195 +08:00
  336.    TIMEOUT                       0
  337.    FLAGS                         0
  338.    STATUS                        5
  339.    SRC_INCIDENT_ID               0
  340.    NUM_INCIDENTS                 0
  341.    ERR_NUMBER                    0
  342.    REPORT_FILE                   <NULL>

  343. **********************************************************
  344. HM RUN RECORD 6
  345. **********************************************************
  346.    RUN_ID                        121
  347.    RUN_NAME                      HM_RUN_121
  348.    CHECK_NAME                    DB Structure Integrity Check
  349.    NAME_ID                       2
  350.    MODE                          2
  351.    START_TIME                    2014-08-06 17:30:52.309421 +08:00
  352.    RESUME_TIME                   <NULL>
  353.    END_TIME                      2014-08-06 17:30:52.519712 +08:00
  354.    MODIFIED_TIME                 2014-08-06 17:30:52.519712 +08:00
  355.    TIMEOUT                       0
  356.    FLAGS                         0
  357.    STATUS                        5
  358.    SRC_INCIDENT_ID               0
  359.    NUM_INCIDENTS                 0
  360.    ERR_NUMBER                    0
  361.    REPORT_FILE                   <NULL>

  362. **********************************************************
  363. HM RUN RECORD 7
  364. **********************************************************
  365.    RUN_ID                        141
  366.    RUN_NAME                      HM_RUN_141
  367.    CHECK_NAME                    DB Structure Integrity Check
  368.    NAME_ID                       2
  369.    MODE                          2
  370.    START_TIME                    2014-08-06 17:38:53.508989 +08:00
  371.    RESUME_TIME                   <NULL>
  372.    END_TIME                      <NULL>
  373.    MODIFIED_TIME                 2014-08-06 17:38:53.508989 +08:00
  374.    TIMEOUT                       0
  375.    FLAGS                         0
  376.    STATUS                        1
  377.    SRC_INCIDENT_ID               0
  378.    NUM_INCIDENTS                 0
  379.    ERR_NUMBER                    0
  380.    REPORT_FILE                   <NULL>

  381. **********************************************************
  382. HM RUN RECORD 8
  383. **********************************************************
  384.    RUN_ID                        441
  385.    RUN_NAME                      HM_RUN_441
  386.    CHECK_NAME                    DB Structure Integrity Check
  387.    NAME_ID                       2
  388.    MODE                          2
  389.    START_TIME                    2017-09-26 20:17:20.253561 +08:00
  390.    RESUME_TIME                   <NULL>
  391.    END_TIME                      2017-09-26 20:17:20.737577 +08:00
  392.    MODIFIED_TIME                 2017-09-28 20:24:48.351806 +08:00
  393.    TIMEOUT                       0
  394.    FLAGS                         0
  395.    STATUS                        5
  396.    SRC_INCIDENT_ID               0
  397.    NUM_INCIDENTS                 0
  398.    ERR_NUMBER                    0
  399.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_HM_RUN_441.hm

  400. **********************************************************
  401. HM RUN RECORD 9
  402. **********************************************************
  403.    RUN_ID                        461
  404.    RUN_NAME                      HM_RUN_461
  405.    CHECK_NAME                    DB Structure Integrity Check
  406.    NAME_ID                       2
  407.    MODE                          2
  408.    START_TIME                    2017-09-26 20:18:35.221179 +08:00
  409.    RESUME_TIME                   <NULL>
  410.    END_TIME                      2017-09-26 20:18:35.443198 +08:00
  411.    MODIFIED_TIME                 2017-09-28 20:24:48.365612 +08:00
  412.    TIMEOUT                       0
  413.    FLAGS                         0
  414.    STATUS                        5
  415.    SRC_INCIDENT_ID               0
  416.    NUM_INCIDENTS                 0
  417.    ERR_NUMBER                    0
  418.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_HM_RUN_461.hm

  419. **********************************************************
  420. HM RUN RECORD 10
  421. **********************************************************
  422.    RUN_ID                        501
  423.    RUN_NAME                      HM_RUN_501
  424.    CHECK_NAME                    DB Structure Integrity Check
  425.    NAME_ID                       2
  426.    MODE                          2
  427.    START_TIME                    2017-09-26 20:20:11.341395 +08:00
  428.    RESUME_TIME                   <NULL>
  429.    END_TIME                      2017-09-26 20:20:11.457759 +08:00
  430.    MODIFIED_TIME                 2017-09-28 20:24:48.378340 +08:00
  431.    TIMEOUT                       0
  432.    FLAGS                         0
  433.    STATUS                        5
  434.    SRC_INCIDENT_ID               0
  435.    NUM_INCIDENTS                 0
  436.    ERR_NUMBER                    0
  437.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_HM_RUN_501.hm

  438. **********************************************************
  439. HM RUN RECORD 11
  440. **********************************************************
  441.    RUN_ID                        581
  442.    RUN_NAME                      HM_RUN_581
  443.    CHECK_NAME                    Data Block Integrity Check
  444.    NAME_ID                       3
  445.    MODE                          2
  446.    START_TIME                    2017-09-26 20:20:56.728663 +08:00
  447.    RESUME_TIME                   <NULL>
  448.    END_TIME                      2017-09-26 20:20:57.343643 +08:00
  449.    MODIFIED_TIME                 2017-09-28 20:24:48.392483 +08:00
  450.    TIMEOUT                       0
  451.    FLAGS                         0
  452.    STATUS                        5
  453.    SRC_INCIDENT_ID               27928
  454.    NUM_INCIDENTS                 0
  455.    ERR_NUMBER                    0
  456.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_HM_RUN_581.hm

  457. **********************************************************
  458. HM RUN RECORD 12
  459. **********************************************************
  460.    RUN_ID                        601
  461.    RUN_NAME                      HM_RUN_601
  462.    CHECK_NAME                    DB Structure Integrity Check
  463.    NAME_ID                       2
  464.    MODE                          2
  465.    START_TIME                    2017-09-26 20:22:32.213140 +08:00
  466.    RESUME_TIME                   <NULL>
  467.    END_TIME                      2017-09-26 20:22:32.276259 +08:00
  468.    MODIFIED_TIME                 2017-09-28 20:24:48.405370 +08:00
  469.    TIMEOUT                       0
  470.    FLAGS                         0
  471.    STATUS                        5
  472.    SRC_INCIDENT_ID               0
  473.    NUM_INCIDENTS                 0
  474.    ERR_NUMBER                    0
  475.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_HM_RUN_601.hm

  476. **********************************************************
  477. HM RUN RECORD 13
  478. **********************************************************
  479.    RUN_ID                        621
  480.    RUN_NAME                      HM_RUN_621
  481.    CHECK_NAME                    DB Structure Integrity Check
  482.    NAME_ID                       2
  483.    MODE                          2
  484.    START_TIME                    2017-09-26 20:24:20.522068 +08:00
  485.    RESUME_TIME                   <NULL>
  486.    END_TIME                      2017-09-26 20:24:20.592262 +08:00
  487.    MODIFIED_TIME                 2017-09-28 20:24:48.417340 +08:00
  488.    TIMEOUT                       0
  489.    FLAGS                         0
  490.    STATUS                        5
  491.    SRC_INCIDENT_ID               0
  492.    NUM_INCIDENTS                 0
  493.    ERR_NUMBER                    0
  494.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_HM_RUN_621.hm

  495. **********************************************************
  496. HM RUN RECORD 14
  497. **********************************************************
  498.    RUN_ID                        681
  499.    RUN_NAME                      HM_RUN_681
  500.    CHECK_NAME                    DB Structure Integrity Check
  501.    NAME_ID                       2
  502.    MODE                          2
  503.    START_TIME                    2017-09-26 20:55:24.068545 +08:00
  504.    RESUME_TIME                   <NULL>
  505.    END_TIME                      2017-09-26 20:55:24.300312 +08:00
  506.    MODIFIED_TIME                 2017-09-28 20:24:48.432864 +08:00
  507.    TIMEOUT                       0
  508.    FLAGS                         0
  509.    STATUS                        5
  510.    SRC_INCIDENT_ID               0
  511.    NUM_INCIDENTS                 0
  512.    ERR_NUMBER                    0
  513.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_HM_RUN_681.hm

  514. **********************************************************
  515. HM RUN RECORD 15
  516. **********************************************************
  517.    RUN_ID                        701
  518.    RUN_NAME                      HM_RUN_701
  519.    CHECK_NAME                    DB Structure Integrity Check
  520.    NAME_ID                       2
  521.    MODE                          2
  522.    START_TIME                    2017-09-26 20:57:47.650496 +08:00
  523.    RESUME_TIME                   <NULL>
  524.    END_TIME                      2017-09-26 20:57:47.717614 +08:00
  525.    MODIFIED_TIME                 2017-09-28 20:24:48.445601 +08:00
  526.    TIMEOUT                       0
  527.    FLAGS                         0
  528.    STATUS                        5
  529.    SRC_INCIDENT_ID               0
  530.    NUM_INCIDENTS                 0
  531.    ERR_NUMBER                    0
  532.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_HM_RUN_701.hm

  533. **********************************************************
  534. HM RUN RECORD 16
  535. **********************************************************
  536.    RUN_ID                        721
  537.    RUN_NAME                      HM_RUN_721
  538.    CHECK_NAME                    DB Structure Integrity Check
  539.    NAME_ID                       2
  540.    MODE                          2
  541.    START_TIME                    2017-09-26 21:03:05.251697 +08:00
  542.    RESUME_TIME                   <NULL>
  543.    END_TIME                      2017-09-26 21:03:05.396248 +08:00
  544.    MODIFIED_TIME                 2017-09-28 20:24:48.463198 +08:00
  545.    TIMEOUT                       0
  546.    FLAGS                         0
  547.    STATUS                        5
  548.    SRC_INCIDENT_ID               0
  549.    NUM_INCIDENTS                 0
  550.    ERR_NUMBER                    0
  551.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_HM_RUN_721.hm

  552. **********************************************************
  553. HM RUN RECORD 17
  554. **********************************************************
  555.    RUN_ID                        741
  556.    RUN_NAME                      HM_RUN_741
  557.    CHECK_NAME                    DB Structure Integrity Check
  558.    NAME_ID                       2
  559.    MODE                          2
  560.    START_TIME                    2017-09-26 21:03:05.414377 +08:00
  561.    RESUME_TIME                   <NULL>
  562.    END_TIME                      2017-09-26 21:03:05.449687 +08:00
  563.    MODIFIED_TIME                 2017-09-28 20:24:48.480907 +08:00
  564.    TIMEOUT                       0
  565.    FLAGS                         0
  566.    STATUS                        5
  567.    SRC_INCIDENT_ID               0
  568.    NUM_INCIDENTS                 0
  569.    ERR_NUMBER                    0
  570.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_HM_RUN_741.hm

  571. **********************************************************
  572. HM RUN RECORD 18
  573. **********************************************************
  574.    RUN_ID                        861
  575.    RUN_NAME                      MYRUN1
  576.    CHECK_NAME                    Data Block Integrity Check
  577.    NAME_ID                       3
  578.    MODE                          0
  579.    START_TIME                    2017-09-26 21:17:06.359595 +08:00
  580.    RESUME_TIME                   <NULL>
  581.    END_TIME                      2017-09-26 21:17:06.721305 +08:00
  582.    MODIFIED_TIME                 2017-09-28 20:24:48.498125 +08:00
  583.    TIMEOUT                       100000
  584.    FLAGS                         0
  585.    STATUS                        5
  586.    SRC_INCIDENT_ID               0
  587.    NUM_INCIDENTS                 0
  588.    ERR_NUMBER                    0
  589.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_MYRUN1.hm

  590. **********************************************************
  591. HM RUN RECORD 19
  592. **********************************************************
  593.    RUN_ID                        881
  594.    RUN_NAME                      MYRUN2
  595.    CHECK_NAME                    Data Block Integrity Check
  596.    NAME_ID                       3
  597.    MODE                          0
  598.    START_TIME                    2017-09-26 21:19:07.600290 +08:00
  599.    RESUME_TIME                   <NULL>
  600.    END_TIME                      2017-09-26 21:19:07.943468 +08:00
  601.    MODIFIED_TIME                 2017-09-28 20:24:48.515356 +08:00
  602.    TIMEOUT                       10000
  603.    FLAGS                         0
  604.    STATUS                        5
  605.    SRC_INCIDENT_ID               0
  606.    NUM_INCIDENTS                 0
  607.    ERR_NUMBER                    0
  608.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_MYRUN2.hm

  609. **********************************************************
  610. HM RUN RECORD 20
  611. **********************************************************
  612.    RUN_ID                        904
  613.    RUN_NAME                      MYRUN3
  614.    CHECK_NAME                    Data Block Integrity Check
  615.    NAME_ID                       3
  616.    MODE                          0
  617.    START_TIME                    2017-09-26 21:27:02.210962 +08:00
  618.    RESUME_TIME                   <NULL>
  619.    END_TIME                      2017-09-26 21:27:02.534798 +08:00
  620.    MODIFIED_TIME                 2017-09-28 20:24:48.531019 +08:00
  621.    TIMEOUT                       10000
  622.    FLAGS                         0
  623.    STATUS                        5
  624.    SRC_INCIDENT_ID               0
  625.    NUM_INCIDENTS                 0
  626.    ERR_NUMBER                    0
  627.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_MYRUN3.hm

  628. **********************************************************
  629. HM RUN RECORD 21
  630. **********************************************************
  631.    RUN_ID                        944
  632.    RUN_NAME                      HM_RUN_944
  633.    CHECK_NAME                    DB Structure Integrity Check
  634.    NAME_ID                       2
  635.    MODE                          2
  636.    START_TIME                    2017-09-26 21:28:20.645674 +08:00
  637.    RESUME_TIME                   <NULL>
  638.    END_TIME                      2017-09-26 21:28:20.770048 +08:00
  639.    MODIFIED_TIME                 2017-09-28 20:24:48.546253 +08:00
  640.    TIMEOUT                       0
  641.    FLAGS                         0
  642.    STATUS                        5
  643.    SRC_INCIDENT_ID               0
  644.    NUM_INCIDENTS                 0
  645.    ERR_NUMBER                    0
  646.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_HM_RUN_944.hm

  647. **********************************************************
  648. HM RUN RECORD 22
  649. **********************************************************
  650.    RUN_ID                        1024
  651.    RUN_NAME                      HM_RUN_1024
  652.    CHECK_NAME                    DB Structure Integrity Check
  653.    NAME_ID                       2
  654.    MODE                          2
  655.    START_TIME                    2017-09-26 21:30:01.692307 +08:00
  656.    RESUME_TIME                   <NULL>
  657.    END_TIME                      2017-09-26 21:30:01.787426 +08:00
  658.    MODIFIED_TIME                 2017-09-28 20:24:48.561984 +08:00
  659.    TIMEOUT                       0
  660.    FLAGS                         0
  661.    STATUS                        5
  662.    SRC_INCIDENT_ID               0
  663.    NUM_INCIDENTS                 0
  664.    ERR_NUMBER                    0
  665.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_HM_RUN_1024.hm

  666. **********************************************************
  667. HM RUN RECORD 23
  668. **********************************************************
  669.    RUN_ID                        1044
  670.    RUN_NAME                      HM_RUN_1044
  671.    CHECK_NAME                    Data Block Integrity Check
  672.    NAME_ID                       3
  673.    MODE                          2
  674.    START_TIME                    2017-09-26 21:30:03.380460 +08:00
  675.    RESUME_TIME                   <NULL>
  676.    END_TIME                      2017-09-26 21:30:04.024025 +08:00
  677.    MODIFIED_TIME                 2017-09-28 20:24:48.579142 +08:00
  678.    TIMEOUT                       0
  679.    FLAGS                         0
  680.    STATUS                        5
  681.    SRC_INCIDENT_ID               29157
  682.    NUM_INCIDENTS                 0
  683.    ERR_NUMBER                    0
  684.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_HM_RUN_1044.hm

  685. **********************************************************
  686. HM RUN RECORD 24
  687. **********************************************************
  688.    RUN_ID                        1184
  689.    RUN_NAME                      HM_RUN_1184
  690.    CHECK_NAME                    DB Structure Integrity Check
  691.    NAME_ID                       2
  692.    MODE                          2
  693.    START_TIME                    2017-09-26 21:35:11.527444 +08:00
  694.    RESUME_TIME                   <NULL>
  695.    END_TIME                      2017-09-26 21:35:11.594048 +08:00
  696.    MODIFIED_TIME                 2017-09-28 20:24:48.592548 +08:00
  697.    TIMEOUT                       0
  698.    FLAGS                         0
  699.    STATUS                        5
  700.    SRC_INCIDENT_ID               0
  701.    NUM_INCIDENTS                 0
  702.    ERR_NUMBER                    0
  703.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_HM_RUN_1184.hm

  704. **********************************************************
  705. HM RUN RECORD 25
  706. **********************************************************
  707.    RUN_ID                        1204
  708.    RUN_NAME                      HM_RUN_1204
  709.    CHECK_NAME                    Data Block Integrity Check
  710.    NAME_ID                       3
  711.    MODE                          2
  712.    START_TIME                    2017-09-26 21:35:13.259094 +08:00
  713.    RESUME_TIME                   <NULL>
  714.    END_TIME                      2017-09-26 21:35:13.704350 +08:00
  715.    MODIFIED_TIME                 2017-09-28 20:24:48.606102 +08:00
  716.    TIMEOUT                       0
  717.    FLAGS                         0
  718.    STATUS                        5
  719.    SRC_INCIDENT_ID               30222
  720.    NUM_INCIDENTS                 0
  721.    ERR_NUMBER                    0
  722.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_HM_RUN_1204.hm

  723. **********************************************************
  724. HM RUN RECORD 26
  725. **********************************************************
  726.    RUN_ID                        1244
  727.    RUN_NAME                      HM_RUN_1244
  728.    CHECK_NAME                    DB Structure Integrity Check
  729.    NAME_ID                       2
  730.    MODE                          2
  731.    START_TIME                    2017-09-26 21:39:43.703672 +08:00
  732.    RESUME_TIME                   <NULL>
  733.    END_TIME                      2017-09-26 21:39:43.823675 +08:00
  734.    MODIFIED_TIME                 2017-09-28 20:24:48.619378 +08:00
  735.    TIMEOUT                       0
  736.    FLAGS                         0
  737.    STATUS                        5
  738.    SRC_INCIDENT_ID               0
  739.    NUM_INCIDENTS                 0
  740.    ERR_NUMBER                    0
  741.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_HM_RUN_1244.hm

  742. **********************************************************
  743. HM RUN RECORD 27
  744. **********************************************************
  745.    RUN_ID                        1324
  746.    RUN_NAME                      HM_RUN_1324
  747.    CHECK_NAME                    DB Structure Integrity Check
  748.    NAME_ID                       2
  749.    MODE                          2
  750.    START_TIME                    2017-09-26 21:40:48.209058 +08:00
  751.    RESUME_TIME                   <NULL>
  752.    END_TIME                      2017-09-26 21:40:48.283130 +08:00
  753.    MODIFIED_TIME                 2017-09-28 20:24:48.631908 +08:00
  754.    TIMEOUT                       0
  755.    FLAGS                         0
  756.    STATUS                        5
  757.    SRC_INCIDENT_ID               0
  758.    NUM_INCIDENTS                 0
  759.    ERR_NUMBER                    0
  760.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_HM_RUN_1324.hm

  761. **********************************************************
  762. HM RUN RECORD 28
  763. **********************************************************
  764.    RUN_ID                        1344
  765.    RUN_NAME                      HM_RUN_1344
  766.    CHECK_NAME                    Data Block Integrity Check
  767.    NAME_ID                       3
  768.    MODE                          2
  769.    START_TIME                    2017-09-26 21:40:49.974216 +08:00
  770.    RESUME_TIME                   <NULL>
  771.    END_TIME                      2017-09-26 21:40:50.538886 +08:00
  772.    MODIFIED_TIME                 2017-09-28 20:24:48.645938 +08:00
  773.    TIMEOUT                       0
  774.    FLAGS                         0
  775.    STATUS                        5
  776.    SRC_INCIDENT_ID               31526
  777.    NUM_INCIDENTS                 0
  778.    ERR_NUMBER                    0
  779.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_HM_RUN_1344.hm

  780. **********************************************************
  781. HM RUN RECORD 29
  782. **********************************************************
  783.    RUN_ID                        1384
  784.    RUN_NAME                      HM_RUN_1384
  785.    CHECK_NAME                    DB Structure Integrity Check
  786.    NAME_ID                       2
  787.    MODE                          2
  788.    START_TIME                    2017-09-26 21:43:04.713721 +08:00
  789.    RESUME_TIME                   <NULL>
  790.    END_TIME                      2017-09-26 21:43:04.861793 +08:00
  791.    MODIFIED_TIME                 2017-09-28 20:24:48.659703 +08:00
  792.    TIMEOUT                       0
  793.    FLAGS                         0
  794.    STATUS                        5
  795.    SRC_INCIDENT_ID               0
  796.    NUM_INCIDENTS                 0
  797.    ERR_NUMBER                    0
  798.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_HM_RUN_1384.hm

  799. **********************************************************
  800. HM RUN RECORD 30
  801. **********************************************************
  802.    RUN_ID                        1464
  803.    RUN_NAME                      HM_RUN_1464
  804.    CHECK_NAME                    Data Block Integrity Check
  805.    NAME_ID                       3
  806.    MODE                          2
  807.    START_TIME                    2017-09-26 21:44:02.500602 +08:00
  808.    RESUME_TIME                   <NULL>
  809.    END_TIME                      2017-09-26 21:44:03.079214 +08:00
  810.    MODIFIED_TIME                 2017-09-28 20:24:48.675693 +08:00
  811.    TIMEOUT                       0
  812.    FLAGS                         0
  813.    STATUS                        5
  814.    SRC_INCIDENT_ID               32798
  815.    NUM_INCIDENTS                 0
  816.    ERR_NUMBER                    0
  817.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_HM_RUN_1464.hm

  818. **********************************************************
  819. HM RUN RECORD 31
  820. **********************************************************
  821.    RUN_ID                        1484
  822.    RUN_NAME                      HM_RUN_1484
  823.    CHECK_NAME                    DB Structure Integrity Check
  824.    NAME_ID                       2
  825.    MODE                          2
  826.    START_TIME                    2017-09-28 19:27:18.757188 +08:00
  827.    RESUME_TIME                   <NULL>
  828.    END_TIME                      2017-09-28 19:27:18.842418 +08:00
  829.    MODIFIED_TIME                 2017-09-28 20:24:48.690006 +08:00
  830.    TIMEOUT                       0
  831.    FLAGS                         0
  832.    STATUS                        5
  833.    SRC_INCIDENT_ID               0
  834.    NUM_INCIDENTS                 0
  835.    ERR_NUMBER                    0
  836.    REPORT_FILE                   /u01/app/oracle/diag/rdbms/orcl/orcl/hm/HMREPORT_HM_RUN_1484.hm
  837. 31 rows fetched

  838. adrci> create report hm_run HM_RUN_1484;
  839. adrci> show report hm_run HM_RUN_1484
  840. <?xml version="1.0" encoding="US-ASCII"?>
  841. <HM-REPORT REPORT_ID="HM_RUN_1484">
  842.     <TITLE>HM Report: HM_RUN_1484</TITLE>
  843.     <RUN_INFO>
  844.         <CHECK_NAME>DB Structure Integrity Check</CHECK_NAME>
  845.         <RUN_ID>1484</RUN_ID>
  846.         <RUN_NAME>HM_RUN_1484</RUN_NAME>
  847.         <RUN_MODE>REACTIVE</RUN_MODE>
  848.         <RUN_STATUS>COMPLETED</RUN_STATUS>
  849.         <RUN_ERROR_NUM>0</RUN_ERROR_NUM>
  850.         <SOURCE_INCIDENT_ID>0</SOURCE_INCIDENT_ID>
  851.         <NUM_INCIDENTS_CREATED>0</NUM_INCIDENTS_CREATED>
  852.         <RUN_START_TIME>2017-09-28 19:27:18.757188 +08:00</RUN_START_TIME>
  853.         <RUN_END_TIME>2017-09-28 19:27:18.842418 +08:00</RUN_END_TIME>
  854.     </RUN_INFO>
  855.     <RUN_PARAMETERS/>
  856.     <RUN-FINDINGS/>
  857. </HM-REPORT>
  858. adrci>
复制代码

  1. BEGIN
  2. DBMS_REPAIR.ADMIN_TABLES (
  3.    table_name => 'REPAIR_TABLE',
  4.    table_type => DBMS_REPAIR.REPAIR_TABLE,
  5.    action => DBMS_REPAIR.CREATE_ACTION,
  6.    tablespace => 'USERS');
  7. END;


  8. select  * from REPAIR_TABLE;


  9. BEGIN
  10. DBMS_REPAIR.ADMIN_TABLES (
  11.    table_name => 'ORPHAN_KEY_TABLE',
  12.    table_type => DBMS_REPAIR.ORPHAN_TABLE,
  13.    action => DBMS_REPAIR.CREATE_ACTION,
  14.    tablespace => 'USERS');
  15. END;

  16. select  * from ORPHAN_KEY_TABLE;


  17. DECLARE
  18.   num_corrupt INT;
  19. BEGIN
  20. num_corrupt := 0;
  21. DBMS_REPAIR.CHECK_OBJECT (
  22.    schema_name => 'HR',
  23.            object_name => 'TLOGICAL',
  24.    repair_table_name => 'REPAIR_TABLE',
  25.    corrupt_count => num_corrupt);
  26.   dbms_output.put_line( 'Find  '|| num_corrupt||' Bolcks.'  );
  27. END;

  28. select  * from REPAIR_TABLE;

  29. ----
  30. DECLARE
  31. num_fix INT;
  32. BEGIN
  33. num_fix := 0;
  34. DBMS_REPAIR.FIX_CORRUPT_BLOCKS (
  35.            schema_name => 'HR',
  36.            object_name => 'TLOGICAL',
  37.            object_type => DBMS_REPAIR.TABLE_OBJECT,
  38.            repair_table_name => 'REPAIR_TABLE',
  39.    fix_count => num_fix);
  40.       dbms_output.put_line( 'Find  '|| num_fix||' Bolcks.'  );
  41. END;

  42. ----
  43. DECLARE
  44.   num_orphans INT;
  45. BEGIN
  46. num_orphans := 0;
  47. DBMS_REPAIR.DUMP_ORPHAN_KEYS (
  48.   schema_name => 'HR',
  49.   object_name => 'ILOGICAL_B',
  50.   object_type => DBMS_REPAIR.INDEX_OBJECT,
  51.   repair_table_name => 'REPAIR_TABLE',
  52.   orphan_table_name => 'ORPHAN_KEY_TABLE',
  53.   key_count => num_orphans);
  54. DBMS_OUTPUT.PUT_LINE('orphan key count: ' || TO_CHAR(num_orphans));
  55. END;

  56. select  * from ORPHAN_KEY_TABLE  where keyrowid||' '='AAATrIAIgAAAIABAAA'||' '
  57. and  index_name='ILOGICAL_B';

复制代码



回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-4-20 17:27 , Processed in 0.042263 second(s), 27 queries .

快速回复 返回顶部 返回列表