Bo's Oracle Station

查看: 2183|回复: 0

(52-21)第36/37次:2016-01-05星期二, 2016-01-07星期四

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2016-1-6 09:43:34 | 显示全部楼层 |阅读模式
本帖最后由 botang 于 2016-1-8 17:37 编辑

(52-21)上完1Z0-052第18章
100^(193-193-0)(2-1)=1
100^(193-193-0)(11-1)=10
100^(194-193-0)(2-1)=100
100^(194-193-0)(11-1)=1000
100^(194-193-0)(2-1)+
   100^(194-193-1)(11-1)=110
100^(194-193-0)(12-1)=1100
100^(62-62-0)(101-100)=1
100^(62-62-0)(101-91)=10
100^(62-61-0)(101-100)=100
123456.789
100^(195-193-0)(13-1)+
100^(195-193-1)(35-1)+
100^(195-193-2)(57-1)+
100^(195-193-3)(79-1)+
100^(195-193-4)(91-1)=120000+3400+56+0.78+0.009=
123456.789
-123456.789
100^(62-60-0)(101-89)+
100^(62-60-1)(101-67)+
100^(62-60-2)(101-45)+
100^(62-60-3)(101-23)+
100^(62-60-4)(101-11)=120000+3400+56+0.78+0.009=
-123456.789
-123456.78901
100^(62-60-0)(101-89)+
100^(62-60-1)(101-67)+
100^(62-60-2)(101-45)+
100^(62-60-3)(101-23)+
100^(62-60-4)(101-11)+
100^(62-60-5)(101-91)
=120000+3400+56+0.78+0.009+ 0.00001=
-123456.78901
  1. select  * from v$backup_corruption;

  2. select  * from v$copy_corruption;

  3. select  * from v$database_block_corruption;

  4. drop tablespace tbs05309 including contents and datafiles ;

  5. create tablespace tbs05309  datafile size 5M  nologging;

  6. ---
  7. BEGIN
  8. DBMS_REPAIR.ADMIN_TABLES (
  9.    table_name => 'REPAIR_TABLE',
  10.    table_type => DBMS_REPAIR.REPAIR_TABLE,
  11.    action => DBMS_REPAIR.CREATE_ACTION,
  12.    tablespace => 'USERS');
  13. END;

  14. BEGIN
  15. DBMS_REPAIR.ADMIN_TABLES (
  16.    table_name => 'ORPHAN_KEY_TABLE',
  17.    table_type => DBMS_REPAIR.ORPHAN_TABLE,
  18.    action => DBMS_REPAIR.CREATE_ACTION,
  19.    tablespace => 'USERS');
  20. END;

  21. select  * from REPAIR_TABLE;

  22. select  * from ORPHAN_KEY_TABLE;

  23. DECLARE
  24.   num_corrupt INT;
  25. BEGIN
  26. num_corrupt := 0;
  27. DBMS_REPAIR.CHECK_OBJECT (
  28.    schema_name => 'HR',
  29.            object_name => 'T05309',
  30.    repair_table_name => 'REPAIR_TABLE',
  31.    corrupt_count => num_corrupt);
  32.   dbms_output.put_line( 'Find  '|| num_corrupt||' Bolcks.'  );
  33. END;

  34. select  * from REPAIR_TABLE;

  35. select  * from ORPHAN_KEY_TABLE;

  36. DECLARE
  37.   num_orphans INT;
  38. BEGIN
  39. num_orphans := 0;
  40. DBMS_REPAIR.DUMP_ORPHAN_KEYS (
  41.   schema_name => 'HR',
  42.   object_name => 'ICOL1',
  43.   object_type => DBMS_REPAIR.INDEX_OBJECT,
  44.   repair_table_name => 'REPAIR_TABLE',
  45.   orphan_table_name => 'ORPHAN_KEY_TABLE',
  46.   key_count => num_orphans);
  47. DBMS_OUTPUT.PUT_LINE('orphan key count: ' || TO_CHAR(num_orphans));
  48. END;


  49. DECLARE
  50.   num_orphans INT;
  51. BEGIN
  52. num_orphans := 0;
  53. DBMS_REPAIR.DUMP_ORPHAN_KEYS (
  54.   schema_name => 'HR',
  55.   object_name => 'ICOL2',
  56.   object_type => DBMS_REPAIR.INDEX_OBJECT,
  57.   repair_table_name => 'REPAIR_TABLE',
  58.   orphan_table_name => 'ORPHAN_KEY_TABLE',
  59.   key_count => num_orphans);
  60. DBMS_OUTPUT.PUT_LINE('orphan key count: ' || TO_CHAR(num_orphans));
  61. END;

  62. select  * from ORPHAN_KEY_TABLE;

  63. begin
  64.    dbms_repair.skip_corrupt_blocks('HR','T05309');
  65. end;


  66. -----
  67. select  * from ORPHAN_KEY_TABLE;

  68.   select  dump(key)   from orphan_key_table where keyrowid||' '='AAAUi7AIgAAAIABAAA'||' ';
  69.   ASCII
  70.   
  71.   WULONGW
  72.   1979    640K        IBM  sort >2  SDL oracle;
  73.   
  74.   -------
  75.   -------
  76.   195 13 49 69 11
  77.   120000+4800+68+0.1=124868.1
  78.   100^(195-193-0)(13-1)+
  79.    100^(195-193-1)(49-1)+100^(195-193-2)(69-1) +100^(195-193-3)(11-1)
  80.    ----
  81.    ----
  82.    




复制代码




回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-5-3 22:52 , Processed in 0.131254 second(s), 24 queries .

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