Bo's Oracle Station

查看: 2450|回复: 0

课程第38-41次(2017-06-17星期六上下午、2017-06-20星期二和2017-06-22星期四)

[复制链接]

1005

主题

1469

帖子

1万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
12012
发表于 2017-6-17 11:42:27 | 显示全部楼层 |阅读模式
上完1Z0-05218 My Oracle Support
上完1Z0-0539 ADR和上完1Z0-0538章 RMAN Tuning
进行Scheduler
1Z0-052
19章(上完13章),1Z0-05321章(上完15章)和1Z0-063多租户部分共9章(上完0章)
总共上完全部49章中的28


小补丁下载:http://124.16.180.178:8080/studentguide_sec_O11g
游客,本帖隐藏的内容需要积分高于 100 才可浏览,您当前积分为 0


推送出的环境中可能丢失的/u01/app/oraInventory/ContentsXML/inventory.xml文件内容:
  1. <?xml version="1.0" standalone="yes" ?>
  2. <!-- Copyright (c) 1999, 2011, Oracle. All rights reserved. -->
  3. <!-- Do not modify the contents of this file by hand. -->
  4. <INVENTORY>
  5. <VERSION_INFO>
  6.    <SAVED_WITH>11.2.0.3.0</SAVED_WITH>
  7.    <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
  8. </VERSION_INFO>
  9. <HOME_LIST>
  10. <HOME NAME="Ora11g_gridinfrahome1" LOC="/u01/app/oracle/product/11.2.0/grid" TYPE="O" IDX="1"/>
  11. <HOME NAME="OraDb11g_home1" LOC="/u01/app/oracle/product/11.2.0/dbhome_1" TYPE="O" IDX="2"/>
  12. <HOME NAME="Ora11g_gridinfrahome2" LOC="/u01/app/oracle/product/11.2.0.3/grid" TYPE="O" IDX="3"/>
  13. </HOME_LIST>
  14. <COMPOSITEHOME_LIST>
  15. </COMPOSITEHOME_LIST>
  16. </INVENTORY>
复制代码
大补丁:
  1. ###########
  2.     startup upgrade   //其实就是禁用新特性
  3.     spool filename.log
  4.     @utlu112i.sql         
  5.     @catupgrd.sql >6h
  6.     自动shutdown immediate
  7.     startup
  8.     @utlu112s.sql
  9.     @catuppst.sql
  10.     @utlrp.sql   2h  
复制代码
逻辑坏块修复:

  1. select  * from REPAIR_TABLE;

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

  9. select  * from REPAIR_TABLE;

  10. select  * from ORPHAN_KEY_TABLE;

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

  18. select  * from ORPHAN_KEY_TABLE;

  19. ---

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

  31. select  * from REPAIR_TABLE;

  32. ----

  33. begin
  34.    dbms_repair.skip_corrupt_blocks(schema_name => 'HR',
  35.    object_name =>  'T05218');
  36. end;
  37. ----

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

  51. select  * from ORPHAN_KEY_TABLE;


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


  65. select   dump(key)
  66. from ORPHAN_KEY_TABLE  where keyrowid||'X'='AAASNjAIgAAAIABAAA'||'X'
  67.   and index_name='I05218_B';
  68.                                                    
  69.   ---
  70.   
  71.   select  dump('ABC')  from dual;      
  72.   
  73.   ---
  74.   select   dump(key)
  75. from ORPHAN_KEY_TABLE  where keyrowid||'X'='AAASNjAIgAAAIABAAA'||'X'
  76.   and index_name='I05218_A';
  77.         
  78.   ---195,18,91,33=179032
复制代码
逻辑坏块dump

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

ADR体检:
  1. begin
  2. dbms_hm.run_check('Data Block Integrity Check',                                             'mycheck',0,blc_df_num=>'5',blc_bl_num=>'175');
  3. end;
复制代码
RMAN调优:
  1. SELECT OPNAME, CONTEXT, SOFAR, TOTALWORK,
  2.     ROUND(SOFAR/TOTALWORK*100,2) "%_COMPLETE"
  3.     FROM V_$SESSION_LONGOPS sl
  4.     WHERE OPNAME LIKE 'RMAN%'
  5.     AND OPNAME NOT LIKE '%aggregate%'
  6.     AND TOTALWORK != 0
  7.     AND SOFAR <> TOTALWORK
  8.     and sl.SID  in (select   s.sid
  9. from v_$session s
  10. where s.TERMINAL='pts/7');
复制代码
  1. select  * from v$backup_sync_io;

  2. select  * from v$backup_async_io;
复制代码

Backup Duration:
  1. backup duration 00:05  minimize load  tablespace example ;
复制代码
LinuxScheduler  脚本下载:http://124.16.180.178:8080/studentguide_sec_O11g
游客,本帖隐藏的内容需要积分高于 100 才可浏览,您当前积分为 0

Win下外部作业:

image002.png

  1. <font size="3">select * from dba_scheduler_credentials;
  2. begin
  3. dbms_scheduler.create_credential(credential_name => 'cred1',
  4. username => 'botang',
  5. password => 'oracle');
  6. end;
  7. grant execute on cred1 to hr;
  8. grant create job to hr;
  9. grant create external job to hr;</font>
复制代码

run.bat

  1. echo 12345 >> c:\data\a.txt
  2. @exit
复制代码



回复

使用道具 举报

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

本版积分规则

QQ|手机版|Bo's Oracle Station   

GMT+8, 2024-11-22 05:16 , Processed in 0.046001 second(s), 31 queries .

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