DBA Data[Home] [Help]

PACKAGE: SYS.DBMS_REPAIR

Source


1 PACKAGE dbms_repair
2 
3   IS
4   ----------------------------------
5   --  OVERVIEW
6   --
7   --  The DBMS_REPAIR package consists of data corruption repair procedures
8   --
9   --  SECURITY
10   --
11   --  The package is owned by SYS.
12   --  Execution privilege is not granted to other users.
13   ----------------------------------
14   --
15   --  ENUMERATION TYPES:
16   --
17   --  Object Type Specification
18   --
19   TABLE_OBJECT constant binary_integer := 1;
20   INDEX_OBJECT constant binary_integer := 2;
21   CLUSTER_OBJECT constant binary_integer := 4;
22 
23   --
24   -- Flags Specification
25   --
26   SKIP_FLAG    constant binary_integer := 1;
27   NOSKIP_FLAG  constant binary_integer := 2;
28 
29   --
30   -- Admin Action Specification
31   --
32   CREATE_ACTION constant binary_integer := 1;
33   PURGE_ACTION  constant binary_integer := 2;
34   DROP_ACTION   constant binary_integer := 3;
35 
36   --
37   -- Admin Table Type Specification
38   --
39   REPAIR_TABLE constant binary_integer :=1;
40   ORPHAN_TABLE constant binary_integer :=2;
41 
42   --
43   -- Object Id Specification
44   --
45   ALL_INDEX_ID constant binary_integer :=0;
46 
47   --
48   -- Lock Wait Specification
49   --
50   LOCK_NOWAIT constant binary_integer := 0;
51   LOCK_WAIT   constant binary_integer := 1;
52 
53   --
54   -- Check Level Specification
55   --
56   NO_CHECKING        constant binary_integer := 1;
57   CHECK_AND_CORRECT  constant binary_integer := 2;
58   CHECK_AND_REPORT   constant binary_integer := 3;
59   BYTESWAP_NO_CHECK  constant binary_integer := 4;
60 
61   -----------------------------------
62   --
63   -- PROCEDURES AND FUNCTIONS
64   --
65   --
66 
67   --
68   -- NOTE: default table_name will be 'REPAIR_TABLE' when table_type is
69   -- REPAIR_TABLE, and will be 'ORPHAN_KEY_TABLE' when table_type is
70   -- ORPHAN_TABLE
71   procedure admin_tables(
72     table_name IN varchar2 DEFAULT 'GENERATE_DEFAULT_TABLE_NAME',
73     table_type IN binary_integer,
74     action IN binary_integer,
75     tablespace IN varchar2 DEFAULT NULL);
76 
77   --
78   procedure check_object(
79     schema_name IN varchar2,
80     object_name IN varchar2,
81     partition_name IN varchar2 DEFAULT NULL,
82     object_type IN binary_integer DEFAULT TABLE_OBJECT,
83     repair_table_name IN varchar2 DEFAULT 'REPAIR_TABLE',
84     flags IN binary_integer DEFAULT NULL,
85     relative_fno IN binary_integer DEFAULT NULL,
86     block_start IN binary_integer DEFAULT NULL,
87     block_end IN binary_integer DEFAULT NULL,
88     corrupt_count OUT binary_integer);
89 
90   --
91   procedure dump_orphan_keys(
92     schema_name IN varchar2,
93     object_name IN varchar2,
94     partition_name IN varchar2 DEFAULT NULL,
95     object_type IN binary_integer DEFAULT INDEX_OBJECT,
96     repair_table_name IN varchar2 DEFAULT 'REPAIR_TABLE',
97     orphan_table_name IN varchar2 DEFAULT 'ORPHAN_KEY_TABLE',
98     flags IN binary_integer DEFAULT NULL,
99     key_count OUT binary_integer);
100 
101   --
102   procedure fix_corrupt_blocks(
103     schema_name IN varchar2,
104     object_name IN varchar2,
105     partition_name IN varchar2 DEFAULT NULL,
106     object_type IN binary_integer DEFAULT TABLE_OBJECT,
107     repair_table_name IN varchar2 DEFAULT 'REPAIR_TABLE',
108     flags IN binary_integer DEFAULT NULL,
109     fix_count OUT binary_integer);
110 
111   --
112   procedure rebuild_freelists(
113     schema_name IN varchar2,
114     object_name IN varchar2,
115     partition_name IN varchar2 DEFAULT NULL,
116     object_type IN binary_integer DEFAULT TABLE_OBJECT);
117 
118   --
119   procedure skip_corrupt_blocks(
120     schema_name IN varchar2,
121     object_name IN varchar2,
122     object_type IN binary_integer DEFAULT TABLE_OBJECT,
123     flags IN binary_integer DEFAULT SKIP_FLAG);
124 
125   --
126   procedure segment_fix_status(
127     segment_owner IN varchar2,
128     segment_name  IN varchar2,
129     segment_type   IN binary_integer DEFAULT TABLE_OBJECT,
130     file_number    IN binary_integer DEFAULT NULL,
131     block_number   IN binary_integer DEFAULT NULL,
132     status_value   IN binary_integer DEFAULT NULL,
133     partition_name IN varchar2 DEFAULT NULL);
134 
135   --
136   procedure rebuild_shc_index(
137     segment_owner  IN varchar2,
138     cluster_name   IN varchar2);
139 
140   --
141   function online_index_clean(
142     object_id      IN binary_integer DEFAULT ALL_INDEX_ID,
143     wait_for_lock  IN binary_integer DEFAULT LOCK_WAIT)
144     return boolean;
145   --   Example Usage of online_index_clean:
146   --   DECLARE
147   --     isClean BOOLEAN;
148   --   BEGIN
149   --
150   --     isClean := FALSE;
151   --     WHILE isClean=FALSE
152   --     LOOP
153   --       isClean := DBMS_REPAIR.ONLINE_INDEX_CLEAN(DBMS_REPAIR.ALL_INDEX_ID,
154   --                                                 DBMS_REPAIR.LOCK_WAIT);
155   --       DBMS_LOCK.SLEEP(10);
156   --     END LOOP;
157   --
158   --     EXCEPTION
159   --      WHEN OTHERS THEN
160   --      RAISE;
161   --   END;
162   --   /
163 
164   --
165   procedure repair_cluster_index_keycount(
166     index_owner  IN varchar2,
167     index_name   IN varchar2,
168     check_level  IN binary_integer);
169 
170 
171 END dbms_repair;