botang 发表于 2019-8-7 20:55:49

课程第38次

select* from v$database_block_corruption;

select* from v$hm_run order by6 desc;

select* from v$hm_check;


begin
   dbms_hm.run_check(
   check_name => 'Data Block Integrity Check',
   run_name => 'MYRUN3',
   timeout => null,
   input_params => 'BLC_DF_NUM=9;BLC_BL_NUM=136');
end;
   

select* from v$hm_check_param;


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

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

select * from sys_dba_segss where s.segment_name='TLOGICAL';

begin
   dbms_hm.run_check(
   check_name => 'DB Structure Integrity Check',
   run_name => 'MYRUN4',
   timeout => null
   );
end;

adrci手工打包:adrci> help ips

HELP IPS
   Available Topics:
      ADD
      ADD FILE
      ADD NEW INCIDENTS
      CHECK REMOTE KEYS
      COPY IN FILE
      COPY OUT FILE
      CREATE PACKAGE
      DELETE PACKAGE
      FINALIZE PACKAGE
      GENERATE PACKAGE
      GET MANIFEST
      GET METADATA
      GET REMOTE KEYS
      PACK
      REMOVE
      REMOVE FILE
      SET CONFIGURATION
      SHOW CONFIGURATION
      SHOW FILES
      SHOW INCIDENTS
      SHOW PACKAGE
      UNPACK FILE
      UNPACK PACKAGE
      USE REMOTE KEYS
adrci> help ipsGENERATE PACKAGE

Usage:IPS GENERATE PACKAGE <package_id>
            

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

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

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

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

Example:
    ips generate package 12 in /tmp

adrci> help ips CREATE PACKAGE

Usage:IPS CREATE PACKAGE
             [INCIDENT <incid> | PROBLEM <prob_id> | PROBLEMKEY <prob_key> |
            SECONDS <seconds> | TIME <start_time> TO <end_time>]
            

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

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

Options:
    CORRELATE BASIC:   The package will include the incident dumps, and the
                     incident process trace files.
                     Additional incidents can be included automatically,
                     if they share relevant correlation keys.
    CORRELATE TYPICAL: The package will include the incident dumps, and all
                     trace files that were modified in a time window around
                     each incident.
                     Additional incidents can be included automatically,
                     if they share relevant correlation keys, or occurred
                     in a time window around the main incidents.
    CORRELATE ALL:   The package will include the incident dumps, and all
                     trace files that were modified between the first
                     selected incident and the last selected incident.
                     Additional incidents can be included automatically,
                     if they occurred in the same time range.

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

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

adrci> ips create packagePROBLEM 1
Created package 3 based on problem id 1, correlation level typical
adrci>ips generate package3in /home/oracle
Generated package 3 in file /home/oracle/ORA1578_20190806194549_COM_1.zip, mode complete
adrci>

---------------------------------------
select* from REPAIR_TABLE;

begin
   dbms_repair.admin_tables(table_type => dbms_repair.REPAIR_TABLE,
   action => dbms_repair.CREATE_ACTION);
end;

declare
vcount number;
begin
   dbms_repair.check_object(schema_name => 'HR',object_name => 'TLOGICAL',corrupt_count => vcount);
   dbms_output.put_line(vcount);
end;

select* from REPAIR_TABLE;


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

------------------------------------------------------
select* from orphan_key_table;


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

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

selectdump(key)from orphan_key_tablewhere keyrowid||'_'='AAAVsrAIgAAAEACAAA'||'_';


declare
vcount number;
begin
dbms_repair.dump_orphan_keys(schema_name => 'HR',object_name => 'ILOGICAL_B',object_type => dbms_repair.INDEX_OBJECT, key_count => vcount);
dbms_output.put_line(vcount);
end;



页: [1]
查看完整版本: 课程第38次