2026-03-12 20:23:15
This commit is contained in:
62
vg/controlfile_sections_reset.sql
Normal file
62
vg/controlfile_sections_reset.sql
Normal file
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
*
|
||||
* Author : Vishal Gupta
|
||||
* Purpose : Display controlfile record sections
|
||||
* Parameters :
|
||||
*
|
||||
* Revision History:
|
||||
* ===================
|
||||
* Date Author Description
|
||||
* --------- ------------ -----------------------------------------
|
||||
* 22-Jul-16 Vishal Gupta Created
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
set serveroutput on
|
||||
set lines 1000
|
||||
set trimspool on
|
||||
|
||||
SELECT type
|
||||
, (record_size * records_total) TotalSize
|
||||
, (record_size * records_used) UsedSize
|
||||
, a.record_size, a.records_total, a.records_used
|
||||
FROM V$CONTROLFILE_RECORD_SECTION a
|
||||
where type in ('DATABASE BLOCK CORRUPTION'
|
||||
,'COPY CORRUPTION'
|
||||
,'DELETED OBJECT'
|
||||
,'BACKUP CORRUPTION'
|
||||
)
|
||||
order by type ;
|
||||
|
||||
|
||||
BEGIN
|
||||
for i in (SELECT type
|
||||
, (record_size * records_total) TotalSize
|
||||
, (record_size * records_used) UsedSize
|
||||
, a.record_size, a.records_total, a.records_used
|
||||
FROM V$CONTROLFILE_RECORD_SECTION a
|
||||
where type in ('DATABASE BLOCK CORRUPTION'
|
||||
,'COPY CORRUPTION'
|
||||
,'DELETED OBJECT'
|
||||
,'BACKUP CORRUPTION'
|
||||
)
|
||||
and records_used > 0
|
||||
)
|
||||
LOOP
|
||||
dbms_output.put_line('Reseting Controlfile section ...');
|
||||
/* Reset BACKUP CORRUPTION section */
|
||||
dbms_backup_restore.ResetCfileSection(17);
|
||||
|
||||
/* Reset COPY CORRUPTION section */
|
||||
dbms_backup_restore.ResetCfileSection(18);
|
||||
|
||||
/* Reset DELETED OBJECTS section */
|
||||
dbms_backup_restore.ResetCfileSection(19);
|
||||
|
||||
/* Reset DATABASE BLOCK CORRUPTION section */
|
||||
dbms_backup_restore.ResetCfileSection(35);
|
||||
END LOOP;
|
||||
END;
|
||||
/
|
||||
Reference in New Issue
Block a user