|
- 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 => 'TLOG',
- repair_table_name => 'REPAIR_TABLE',
- corrupt_count => num_corrupt);
- dbms_output.put_line( 'Find '|| num_corrupt||' Bolcks.' );
- END;
- select * from REPAIR_TABLE;
- DECLARE
- num_fix INT;
- BEGIN
- num_fix := 0;
- DBMS_REPAIR.FIX_CORRUPT_BLOCKS (
- schema_name => 'HR',
- object_name => 'TLOG',
- object_type => DBMS_REPAIR.TABLE_OBJECT,
- repair_table_name => 'REPAIR_TABLE',
- fix_count => num_fix);
- dbms_output.put_line( 'Fix '|| num_fix||' Bolcks.' );
- END;
- begin
- dbms_repair.skip_corrupt_blocks(schema_name => 'HR',
- object_name => 'TLOG');
- end;
- select * from ORPHAN_KEY_TABLE;
- DECLARE
- num_orphans INT;
- BEGIN
- num_orphans := 0;
- DBMS_REPAIR.DUMP_ORPHAN_KEYS (
- schema_name => 'HR',
- object_name => 'ILOG_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;
- DECLARE
- num_orphans INT;
- BEGIN
- num_orphans := 0;
- DBMS_REPAIR.DUMP_ORPHAN_KEYS (
- schema_name => 'HR',
- object_name => 'ILOG_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 keyrowid from ORPHAN_KEY_TABLE where index_name='ILOG_A';
- select * from orphan_key_table where index_name='ILOG_B' and keyrowid||' '='AAAVZYAIgAAAMABAAA'||' ';
- select index_name, dump(key) from ORPHAN_KEY_TABLE;
- select chr(65) from dual;
复制代码 为了机器排序而存储实数的算法:
例子:
- 195,2,25,12,30
-
- 100**(195-193-0)(2-1)+
- 100**(195-193-1)(25-1)+
- 100**(195-193-2)(12-1)+
- 100**(195-193-3)(30-1)
- 10000+2400+11+0.29=12411.29
复制代码
|
|