SQL> col name for a50
SQL> /
RECID FIRST_TIME NAME
---------- ------------ --------------------------------------------------
1 23-FEB-18
2 23-FEB-18
3 23-FEB-18
4 23-FEB-18
5 23-FEB-18
6 23-FEB-18
7 23-FEB-18
8 23-FEB-18
9 23-FEB-18
10 23-FEB-18
11 23-FEB-18
RECID FIRST_TIME NAME
---------- ------------ --------------------------------------------------
12 23-FEB-18
13 23-FEB-18
14 23-FEB-18
15 23-FEB-18
16 23-FEB-18
17 23-FEB-18
18 23-FEB-18
19 24-FEB-18
20 24-FEB-18
21 24-FEB-18
22 24-FEB-18
RECID FIRST_TIME NAME
---------- ------------ --------------------------------------------------
23 24-FEB-18
24 24-FEB-18
25 24-FEB-18
26 24-FEB-18
27 24-FEB-18
28 24-FEB-18
29 24-FEB-18
30 24-FEB-18
31 24-FEB-18
32 24-FEB-18
33 24-FEB-18
RECID FIRST_TIME NAME
---------- ------------ --------------------------------------------------
34 24-FEB-18
35 24-FEB-18
36 24-FEB-18
37 24-FEB-18
38 24-FEB-18
39 24-FEB-18
40 24-FEB-18
41 24-FEB-18
42 24-FEB-18
查看空值文件编号
SQL> select rownum-1 session_id, type from v$controlfile_record_section;
SESSION_ID TYPE
---------- ----------------------------
0 DATABASE
1 CKPT PROGRESS
2 REDO THREAD
3 REDO LOG
4 DATAFILE
5 FILENAME
6 TABLESPACE
7 TEMPORARY FILENAME
8 RMAN CONFIGURATION
9 LOG HISTORY
10 OFFLINE RANGE
SESSION_ID TYPE
---------- ----------------------------
11 ARCHIVED LOG
12 BACKUP SET
13 BACKUP PIECE
14 BACKUP DATAFILE
15 BACKUP REDOLOG
16 DATAFILE COPY
17 BACKUP CORRUPTION
18 COPY CORRUPTION
19 DELETED OBJECT
20 PROXY COPY
21 BACKUP SPFILE
SESSION_ID TYPE
---------- ----------------------------
22 DATABASE INCARNATION
23 FLASHBACK LOG
24 RECOVERY DESTINATION
25 INSTANCE SPACE RESERVATION
26 REMOVABLE RECOVERY FILES
27 RMAN STATUS
28 THREAD INSTANCE NAME MAPPING
29 MTTR
30 DATAFILE HISTORY
31 STANDBY DATABASE MATRIX
32 GUARANTEED RESTORE POINT
SESSION_ID TYPE
---------- ----------------------------
33 RESTORE POINT
34 DATABASE BLOCK CORRUPTION
35 ACM OPERATION
36 FOREIGN ARCHIVED LOG
37 rows selected.
清楚v$archived_log的信息
SQL> execute sys.dbms_backup_restore.resetCfileSection(11);
PL/SQL procedure successfully completed.
再次查看
SQL> select recid,first_time,name from v$archived_log;
no rows selected
将未过期的归档日志重新注册
RMAN> catalog start with '+OCR_VOT/orcl/archivelog/';
searching for all files that match the pattern +OCR_VOT/orcl/archivelog/
List of Files Unknown to the Database
=====================================
File Name: +ocr_vot/orcl/ARCHIVELOG/2018_03_09/thread_2_seq_41.301.970334445
File Name: +ocr_vot/orcl/ARCHIVELOG/2018_03_09/thread_2_seq_42.302.970334533
Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: +ocr_vot/orcl/ARCHIVELOG/2018_03_09/thread_2_seq_41.301.970334445
File Name: +ocr_vot/orcl/ARCHIVELOG/2018_03_09/thread_2_seq_42.302.970334533
重新查询v$archived_log
SQL> select recid,first_time,name from v$archived_log;
RECID FIRST_TIME NAME
---------- ------------ --------------------------------------------------
1 09-MAR-18 +OCR_VOT/orcl/archivelog/2018_03_09/thread_2_seq_4
1.301.970334445
2 09-MAR-18 +OCR_VOT/orcl/archivelog/2018_03_09/thread_2_seq_4
2.302.970334533
SQL> /
RECID FIRST_TIME NAME
---------- ------------ --------------------------------------------------
1 23-FEB-18
2 23-FEB-18
3 23-FEB-18
4 23-FEB-18
5 23-FEB-18
6 23-FEB-18
7 23-FEB-18
8 23-FEB-18
9 23-FEB-18
10 23-FEB-18
11 23-FEB-18
RECID FIRST_TIME NAME
---------- ------------ --------------------------------------------------
12 23-FEB-18
13 23-FEB-18
14 23-FEB-18
15 23-FEB-18
16 23-FEB-18
17 23-FEB-18
18 23-FEB-18
19 24-FEB-18
20 24-FEB-18
21 24-FEB-18
22 24-FEB-18
RECID FIRST_TIME NAME
---------- ------------ --------------------------------------------------
23 24-FEB-18
24 24-FEB-18
25 24-FEB-18
26 24-FEB-18
27 24-FEB-18
28 24-FEB-18
29 24-FEB-18
30 24-FEB-18
31 24-FEB-18
32 24-FEB-18
33 24-FEB-18
RECID FIRST_TIME NAME
---------- ------------ --------------------------------------------------
34 24-FEB-18
35 24-FEB-18
36 24-FEB-18
37 24-FEB-18
38 24-FEB-18
39 24-FEB-18
40 24-FEB-18
41 24-FEB-18
42 24-FEB-18
查看空值文件编号
SQL> select rownum-1 session_id, type from v$controlfile_record_section;
SESSION_ID TYPE
---------- ----------------------------
0 DATABASE
1 CKPT PROGRESS
2 REDO THREAD
3 REDO LOG
4 DATAFILE
5 FILENAME
6 TABLESPACE
7 TEMPORARY FILENAME
8 RMAN CONFIGURATION
9 LOG HISTORY
10 OFFLINE RANGE
SESSION_ID TYPE
---------- ----------------------------
11 ARCHIVED LOG
12 BACKUP SET
13 BACKUP PIECE
14 BACKUP DATAFILE
15 BACKUP REDOLOG
16 DATAFILE COPY
17 BACKUP CORRUPTION
18 COPY CORRUPTION
19 DELETED OBJECT
20 PROXY COPY
21 BACKUP SPFILE
SESSION_ID TYPE
---------- ----------------------------
22 DATABASE INCARNATION
23 FLASHBACK LOG
24 RECOVERY DESTINATION
25 INSTANCE SPACE RESERVATION
26 REMOVABLE RECOVERY FILES
27 RMAN STATUS
28 THREAD INSTANCE NAME MAPPING
29 MTTR
30 DATAFILE HISTORY
31 STANDBY DATABASE MATRIX
32 GUARANTEED RESTORE POINT
SESSION_ID TYPE
---------- ----------------------------
33 RESTORE POINT
34 DATABASE BLOCK CORRUPTION
35 ACM OPERATION
36 FOREIGN ARCHIVED LOG
37 rows selected.
清楚v$archived_log的信息
SQL> execute sys.dbms_backup_restore.resetCfileSection(11);
PL/SQL procedure successfully completed.
再次查看
SQL> select recid,first_time,name from v$archived_log;
no rows selected
将未过期的归档日志重新注册
RMAN> catalog start with '+OCR_VOT/orcl/archivelog/';
searching for all files that match the pattern +OCR_VOT/orcl/archivelog/
List of Files Unknown to the Database
=====================================
File Name: +ocr_vot/orcl/ARCHIVELOG/2018_03_09/thread_2_seq_41.301.970334445
File Name: +ocr_vot/orcl/ARCHIVELOG/2018_03_09/thread_2_seq_42.302.970334533
Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done
List of Cataloged Files
=======================
File Name: +ocr_vot/orcl/ARCHIVELOG/2018_03_09/thread_2_seq_41.301.970334445
File Name: +ocr_vot/orcl/ARCHIVELOG/2018_03_09/thread_2_seq_42.302.970334533
重新查询v$archived_log
SQL> select recid,first_time,name from v$archived_log;
RECID FIRST_TIME NAME
---------- ------------ --------------------------------------------------
1 09-MAR-18 +OCR_VOT/orcl/archivelog/2018_03_09/thread_2_seq_4
1.301.970334445
2 09-MAR-18 +OCR_VOT/orcl/archivelog/2018_03_09/thread_2_seq_4
2.302.970334533