Bo's Oracle Station

查看: 1179|回复: 0

课程第38次

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2019-8-7 20:55:49 | 显示全部楼层 |阅读模式
  1. select  * from v$database_block_corruption;

  2. select  * from v$hm_run order by  6 desc;

  3. select  * from v$hm_check;


  4. begin
  5.    dbms_hm.run_check(
  6.    check_name => 'Data Block Integrity Check',
  7.    run_name => 'MYRUN3',
  8.    timeout => null,
  9.    input_params => 'BLC_DF_NUM=9;BLC_BL_NUM=136');
  10. end;
  11.    

  12. select  * from v$hm_check_param;


  13. SELECT a.*, b.* FROM v$hm_check_param a, v$hm_check b
  14. WHERE a.check_id = b.id and b."NAME"='Logical Block Check';

  15. select * from v$tablespace t where t."NAME"='TBSLOGICAL';

  16. select * from sys_dba_segs  s where s.segment_name='TLOGICAL';

  17. begin
  18.    dbms_hm.run_check(
  19.    check_name => 'DB Structure Integrity Check',
  20.    run_name => 'MYRUN4',
  21.    timeout => null
  22.    );
  23. end;
复制代码

adrci手工打包:
  1. adrci> help ips

  2. HELP IPS [topic]
  3.    Available Topics:
  4.         ADD
  5.         ADD FILE
  6.         ADD NEW INCIDENTS
  7.         CHECK REMOTE KEYS
  8.         COPY IN FILE
  9.         COPY OUT FILE
  10.         CREATE PACKAGE
  11.         DELETE PACKAGE
  12.         FINALIZE PACKAGE
  13.         GENERATE PACKAGE
  14.         GET MANIFEST
  15.         GET METADATA
  16.         GET REMOTE KEYS
  17.         PACK
  18.         REMOVE
  19.         REMOVE FILE
  20.         SET CONFIGURATION
  21.         SHOW CONFIGURATION
  22.         SHOW FILES
  23.         SHOW INCIDENTS
  24.         SHOW PACKAGE
  25.         UNPACK FILE
  26.         UNPACK PACKAGE
  27.         USE REMOTE KEYS
  28. adrci> help ips  GENERATE PACKAGE

  29.   Usage:  IPS GENERATE PACKAGE <package_id> [IN <path>]
  30.              [COMPLETE | INCREMENTAL]

  31.   Purpose: Create a physical package (zip file) in target directory.

  32.   Arguments:
  33.     <package_id>: ID of package to create physical package file for.
  34.     <path>:       Path where the physical package file should be generated.

  35.   Options:
  36.     COMPLETE:    The package will include all package files, even if a
  37.                  previous package sequence has been generated.
  38.                  This is the default.
  39.     INCREMENTAL: The package will only include files that have been added
  40.                  or changed since the last package generation.

  41.   Notes:
  42.     If no target path is specified, the physical package file is generated
  43.     in the current working directory.

  44.   Example:
  45.     ips generate package 12 in /tmp

  46. adrci> help ips CREATE PACKAGE

  47.   Usage:  IPS CREATE PACKAGE
  48.              [INCIDENT <incid> | PROBLEM <prob_id> | PROBLEMKEY <prob_key> |
  49.               SECONDS <seconds> | TIME <start_time> TO <end_time>]
  50.              [CORRELATE BASIC | TYPICAL | ALL]

  51.   Purpose: Create a package, and optionally select contents for the package.

  52.   Arguments:
  53.     <incid>:      ID of incident to use for selecting package contents.
  54.     <prob_id>:    ID of problem to use for selecting package contents.
  55.     <prob_key>:   Problem key to use for selecting package contents.
  56.     <seconds>:    Number of seconds before now for selecting package contents.
  57.     <start_time>: Start of time range to look for incidents in.
  58.     <end_time>:   End of time range to look for incidents in.

  59.   Options:
  60.     CORRELATE BASIC:   The package will include the incident dumps, and the
  61.                        incident process trace files.
  62.                        Additional incidents can be included automatically,
  63.                        if they share relevant correlation keys.
  64.     CORRELATE TYPICAL: The package will include the incident dumps, and all
  65.                        trace files that were modified in a time window around
  66.                        each incident.
  67.                        Additional incidents can be included automatically,
  68.                        if they share relevant correlation keys, or occurred
  69.                        in a time window around the main incidents.
  70.     CORRELATE ALL:     The package will include the incident dumps, and all
  71.                        trace files that were modified between the first
  72.                        selected incident and the last selected incident.
  73.                        Additional incidents can be included automatically,
  74.                        if they occurred in the same time range.

  75.   Notes:
  76.     If no package contents are specified (incident, problem, etc), an empty
  77.     package will be created. Files and incidents can be added later.
  78.     If no correlation level is specified, the default level is used.
  79.     The default is normally TYPICAL, but it can be changed using the command
  80.     IPS SET CONFIGURATION.

  81.   Example:
  82.     ips create package incident 861;
  83.     ips create package time '2006-12-31 23:59:59.00 -07:00' to
  84.         '2007-01-01 01:01:01.00 -07:00';

  85. adrci> ips create package  PROBLEM 1
  86. Created package 3 based on problem id 1, correlation level typical
  87. adrci>  ips generate package  3  in /home/oracle
  88. Generated package 3 in file /home/oracle/ORA1578_20190806194549_COM_1.zip, mode complete
  89. adrci>
复制代码

---------------------------------------
  1. select  * from REPAIR_TABLE;

  2. begin
  3.    dbms_repair.admin_tables(table_type => dbms_repair.REPAIR_TABLE,
  4.    action => dbms_repair.CREATE_ACTION);
  5. end;

  6. declare
  7. vcount number;
  8. begin
  9.    dbms_repair.check_object(schema_name => 'HR',object_name => 'TLOGICAL',corrupt_count => vcount);
  10.    dbms_output.put_line(vcount);
  11. end;

  12. select  * from REPAIR_TABLE;


  13. begin
  14.    dbms_repair.skip_corrupt_blocks(schema_name => 'HR',object_name => 'TLOGICAL');
  15. end;

  16. ------------------------------------------------------
  17. select  * from orphan_key_table;


  18. begin
  19.    dbms_repair.admin_tables(table_type => dbms_repair.ORPHAN_TABLE,action => dbms_repair.CREATE_ACTION);
  20. end;

  21. declare
  22.   vcount number;
  23. begin
  24.   dbms_repair.dump_orphan_keys(schema_name => 'HR',object_name => 'ILOGICAL_A',object_type => dbms_repair.INDEX_OBJECT, key_count => vcount);
  25.   dbms_output.put_line(vcount);
  26. end;

  27. select  dump(key)  from orphan_key_table  where keyrowid||'_'='AAAVsrAIgAAAEACAAA'||'_';


  28. declare
  29.   vcount number;
  30. begin
  31.   dbms_repair.dump_orphan_keys(schema_name => 'HR',object_name => 'ILOGICAL_B',object_type => dbms_repair.INDEX_OBJECT, key_count => vcount);
  32.   dbms_output.put_line(vcount);
  33. end;
复制代码




回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-5-9 21:31 , Processed in 0.042895 second(s), 24 queries .

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