重庆思庄oracle技术分享-清除控制文件的信息

通过查询v c o n t r o l f i l e r e c o r d s e c t i o n 视 图 获 得 许 多 信 息 . S Q L > s e l e c t r o w n u m − 1 a , c r s . ∗ f r o m v controlfile_record_section视图获得许多信息. SQL> select rownum -1 a, crs.* from v controlfilerecordsection.SQL>selectrownum1a,crs.fromvcontrolfile_record_section crs;

     A TYPE                         RECORD_SIZE RECORDS_TOTAL RECORDS_USED FIRST_INDEX LAST_INDEX LAST_RECID

     0 DATABASE                             316             1            1           0          0          0
     1 CKPT PROGRESS                       8180            11            0           0          0          0
     2 REDO THREAD                          256             8            1           0          0          0
     3 REDO LOG                              72            16            3           0          0          0
     4 DATAFILE                             520          1600            8           0          0          2
     5 FILENAME                             524          5298           12           0          0          0
     6 TABLESPACE                            68          1600            9           0          0          2
     7 TEMPORARY FILENAME                    56          1600            1           0          0          1
     8 RMAN CONFIGURATION                  1108            50            0           0          0          0
     9 LOG HISTORY                           56           292            4           1          4          4
    10 OFFLINE RANGE                        200          1063            0           0          0          0
    11 ARCHIVED LOG                         584           308           12           1         12         12
    12 BACKUP SET                            40          1227            0           0          0          0
    13 BACKUP PIECE                         736          1000            0           0          0          0
    14 BACKUP DATAFILE                      200          1063            0           0          0          0
    15 BACKUP REDOLOG                        76           215            0           0          0          0
    16 DATAFILE COPY                        736          1000            2           1          2          2
    17 BACKUP CORRUPTION                     44          1115            0           0          0          0
    18 COPY CORRUPTION                       40          1227            0           0          0          0
    19 DELETED OBJECT                        20           818            5           1          5          5
    20 PROXY COPY                           928          1004            0           0          0          0
    21 BACKUP SPFILE                        124           131            0           0          0          0
    22 DATABASE INCARNATION                  56           292            1           1          1          1
    23 FLASHBACK LOG                         84          2048            0           0          0          0
    24 RECOVERY DESTINATION                 180             1            1           0          0          0
    25 INSTANCE SPACE RESERVATION            28          1055            1           0          0          0
    26 REMOVABLE RECOVERY FILES              32          1000            0           0          0          0
    27 RMAN STATUS                          116           141           29           1         29         29
    28 THREAD INSTANCE NAME MAPPING          80             8            8           0          0          0
    29 MTTR                                 100             8            1           0          0          0
    30 DATAFILE HISTORY                     568            57            0           0          0          0
    31 STANDBY DATABASE MATRIX              400            31           31           0          0          0
    32 GUARANTEED RESTORE POINT             212          2048            0           0          0          0
    33 RESTORE POINT                        212          2083            0           0          0          0
    34 DATABASE BLOCK CORRUPTION             80          8384            0           0          0          0
    35 ACM OPERATION                        104            64            6           0          0          0
    36 FOREIGN ARCHIVED LOG                 604          1002            0           0          0          0

37 rows selected.

使用dbms_backup_restore包resetcfilesection可以清除对应的信息
注意:有的信息不能清除,所以在生存环境中需要使用的时候要非常谨慎
例子如下:

SQL> execute dbms_backup_restore.resetcfilesection(9);

SQL> select * from (select rownum -1 a, crs.* from v$controlfile_record_section crs) where a=9;

     A TYPE                         RECORD_SIZE RECORDS_TOTAL RECORDS_USED FIRST_INDEX LAST_INDEX LAST_RECID

     9 LOG HISTORY                           56           292            0           0          0          0

–对比发现可以清除.

SQL> execute dbms_backup_restore.resetcfilesection(11);

PL/SQL procedure successfully completed.

SQL> select * from (select rownum -1 a, crs.* from v$controlfile_record_section crs) where a=11;

     A TYPE                         RECORD_SIZE RECORDS_TOTAL RECORDS_USED FIRST_INDEX LAST_INDEX LAST_RECID

    11 ARCHIVED LOG                         584           308            0           0          0          0
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值