上完1Z0-052第18章 My Oracle Support
上完1Z0-053第9章 ADR和上完1Z0-053第8章 RMAN Tuning
进行Scheduler
1Z0-052共19章(上完13章),1Z0-053共21章(上完15章)和1Z0-063多租户部分共9章(上完0章)
总共上完全部49章中的28章
小补丁下载:http://124.16.180.178:8080/studentguide_sec_O11g
游客,本帖隐藏的内容需要积分高于 100 才可浏览,您当前积分为 0
推送出的环境中可能丢失的/u01/app/oraInventory/ContentsXML/inventory.xml文件内容:
- <?xml version="1.0" standalone="yes" ?>
- <!-- Copyright (c) 1999, 2011, Oracle. All rights reserved. -->
- <!-- Do not modify the contents of this file by hand. -->
- <INVENTORY>
- <VERSION_INFO>
- <SAVED_WITH>11.2.0.3.0</SAVED_WITH>
- <MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
- </VERSION_INFO>
- <HOME_LIST>
- <HOME NAME="Ora11g_gridinfrahome1" LOC="/u01/app/oracle/product/11.2.0/grid" TYPE="O" IDX="1"/>
- <HOME NAME="OraDb11g_home1" LOC="/u01/app/oracle/product/11.2.0/dbhome_1" TYPE="O" IDX="2"/>
- <HOME NAME="Ora11g_gridinfrahome2" LOC="/u01/app/oracle/product/11.2.0.3/grid" TYPE="O" IDX="3"/>
- </HOME_LIST>
- <COMPOSITEHOME_LIST>
- </COMPOSITEHOME_LIST>
- </INVENTORY>
复制代码 大补丁:
- ###########
- startup upgrade //其实就是禁用新特性
- spool filename.log
- @utlu112i.sql
- @catupgrd.sql >6h
- 自动shutdown immediate
- startup
- @utlu112s.sql
- @catuppst.sql
- @utlrp.sql 2h
复制代码 逻辑坏块修复:
- select * from REPAIR_TABLE;
- BEGIN
- DBMS_REPAIR.ADMIN_TABLES (
- table_name => 'REPAIR_TABLE',
- table_type => DBMS_REPAIR.REPAIR_TABLE,
- action => DBMS_REPAIR.CREATE_ACTION,
- tablespace => 'USERS');
- END;
- select * from REPAIR_TABLE;
- select * from ORPHAN_KEY_TABLE;
- BEGIN
- DBMS_REPAIR.ADMIN_TABLES (
- table_name => 'ORPHAN_KEY_TABLE',
- table_type => DBMS_REPAIR.ORPHAN_TABLE,
- action => DBMS_REPAIR.CREATE_ACTION,
- tablespace => 'USERS');
- END;
- select * from ORPHAN_KEY_TABLE;
- ---
- DECLARE
- num_corrupt INT;
- BEGIN
- num_corrupt := 0;
- DBMS_REPAIR.CHECK_OBJECT (
- schema_name => 'HR',
- object_name => 'T05218',
- repair_table_name => 'REPAIR_TABLE',
- corrupt_count => num_corrupt);
- dbms_output.put_line( 'Find '|| num_corrupt||' Bolcks.' );
- END;
- select * from REPAIR_TABLE;
- ----
- begin
- dbms_repair.skip_corrupt_blocks(schema_name => 'HR',
- object_name => 'T05218');
- end;
- ----
-
- DECLARE
- num_orphans INT;
- BEGIN
- num_orphans := 0;
- DBMS_REPAIR.DUMP_ORPHAN_KEYS (
- schema_name => 'HR',
- object_name => 'I05218_A',
- object_type => DBMS_REPAIR.INDEX_OBJECT,
- repair_table_name => 'REPAIR_TABLE',
- orphan_table_name => 'ORPHAN_KEY_TABLE',
- key_count => num_orphans);
- DBMS_OUTPUT.PUT_LINE('orphan key count: ' || TO_CHAR(num_orphans));
- END;
- select * from ORPHAN_KEY_TABLE;
- DECLARE
- num_orphans INT;
- BEGIN
- num_orphans := 0;
- DBMS_REPAIR.DUMP_ORPHAN_KEYS (
- schema_name => 'HR',
- object_name => 'I05218_B',
- object_type => DBMS_REPAIR.INDEX_OBJECT,
- repair_table_name => 'REPAIR_TABLE',
- orphan_table_name => 'ORPHAN_KEY_TABLE',
- key_count => num_orphans);
- DBMS_OUTPUT.PUT_LINE('orphan key count: ' || TO_CHAR(num_orphans));
- END;
- select dump(key)
- from ORPHAN_KEY_TABLE where keyrowid||'X'='AAASNjAIgAAAIABAAA'||'X'
- and index_name='I05218_B';
-
- ---
-
- select dump('ABC') from dual;
-
- ---
- select dump(key)
- from ORPHAN_KEY_TABLE where keyrowid||'X'='AAASNjAIgAAAIABAAA'||'X'
- and index_name='I05218_A';
-
- ---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体检:
- begin
- dbms_hm.run_check('Data Block Integrity Check', 'mycheck',0,blc_df_num=>'5',blc_bl_num=>'175');
- end;
复制代码 RMAN调优:
- SELECT OPNAME, CONTEXT, SOFAR, TOTALWORK,
- ROUND(SOFAR/TOTALWORK*100,2) "%_COMPLETE"
- FROM V_$SESSION_LONGOPS sl
- WHERE OPNAME LIKE 'RMAN%'
- AND OPNAME NOT LIKE '%aggregate%'
- AND TOTALWORK != 0
- AND SOFAR <> TOTALWORK
- and sl.SID in (select s.sid
- from v_$session s
- where s.TERMINAL='pts/7');
复制代码- select * from v$backup_sync_io;
- select * from v$backup_async_io;
复制代码
Backup Duration: - backup duration 00:05 minimize load tablespace example ;
复制代码 Linux下Scheduler 脚本下载:http://124.16.180.178:8080/studentguide_sec_O11g
游客,本帖隐藏的内容需要积分高于 100 才可浏览,您当前积分为 0
Win下外部作业:
- <font size="3">select * from dba_scheduler_credentials;
- begin
- dbms_scheduler.create_credential(credential_name => 'cred1',
- username => 'botang',
- password => 'oracle');
- end;
- grant execute on cred1 to hr;
- grant create job to hr;
- grant create external job to hr;</font>
复制代码
run.bat:
- echo 12345 >> c:\data\a.txt
- @exit
复制代码
|