alter system switch logfile做不做完全检查点?
时间:2010-11-12 来源:lovegigi1999
alter system switch logfile不做完全检查点
sys@FOX> SELECT GROUP#,SEQUENCE#,STATUS,ARCHIVED,FIRST_CHANGE# FROM V$LOG;
GROUP# SEQUENCE# STATUS ARC FIRST_CHANGE#
---------------- ---------------- ---------------- --- ----------------
1 8 CURRENT NO 2460063263
3 rows selected.
sys@FOX> select FILE#,checkpoint_change#,recover, fuzzy,status from v$datafile_header;
FILE# CHECKPOINT_CHANGE# REC FUZ STATUS
----- ------------------ --- --- -------
1 2460063194 NO YES ONLINE
2 2460063194 NO YES ONLINE
3 2460063194 NO YES ONLINE
4 2460063991 NO YES ONLINE
5 2460063194 NO YES ONLINE
6 2460063194 NO YES ONLINE
7 2460063194 NO YES ONLINE
8 2460063194 NO YES ONLINE
9 2460063991 NO YES ONLINE
9 rows selected.
sys@FOX> select FILE#,status,CHECKPOINT_CHANGE#,name from v$datafile;
FILE# STATUS CHECKPOINT_CHANGE# NAME
----- ------- ------------------ ---------------------------------------------
1 SYSTEM 2460063194 D:\ORACLE\ORADATA\FOX\SYSTEM01.DBF
2 ONLINE 2460063194 D:\ORACLE\ORADATA\FOX\UNDOTBS01.DBF
3 ONLINE 2460063194 D:\ORACLE\ORADATA\FOX\INDX01.DBF
4 ONLINE 2460063991 D:\ORACLE\ORADATA\FOX\TOOLS01.DBF
5 ONLINE 2460063194 D:\ORACLE\ORADATA\FOX\USERS01.DBF
6 ONLINE 2460063194 D:\ORACLE\ORADATA\FOX\DEMO01.DBF
7 ONLINE 2460063194 D:\BACKUP_DIR\TESTING_LMT.DBF
8 ONLINE 2460063194 D:\ORACLE\ORADATA\FOX\RMAN.DBF
9 ONLINE 2460063991 D:\TOOL02.DBF
9 rows selected.
sys@FOX> alter system switch logfile;
System altered.
sys@FOX> select FILE#,checkpoint_change#,recover, fuzzy,status from v$datafile_header;
FILE# CHECKPOINT_CHANGE# REC FUZ STATUS
----- ------------------ --- --- -------
1 2460063194 NO YES ONLINE
2 2460063194 NO YES ONLINE
3 2460063194 NO YES ONLINE
4 2460063991 NO YES ONLINE
5 2460063194 NO YES ONLINE
6 2460063194 NO YES ONLINE
7 2460063194 NO YES ONLINE
8 2460063194 NO YES ONLINE
9 2460063991 NO YES ONLINE
9 rows selected.
sys@FOX> select FILE#,status,CHECKPOINT_CHANGE#,name from v$datafile;
FILE# STATUS CHECKPOINT_CHANGE# NAME
----- ------- ------------------ ---------------------------------------------
1 SYSTEM 2460063263 D:\ORACLE\ORADATA\FOX\SYSTEM01.DBF
2 ONLINE 2460063263 D:\ORACLE\ORADATA\FOX\UNDOTBS01.DBF
3 ONLINE 2460063263 D:\ORACLE\ORADATA\FOX\INDX01.DBF
4 ONLINE 2460063991 D:\ORACLE\ORADATA\FOX\TOOLS01.DBF
5 ONLINE 2460063263 D:\ORACLE\ORADATA\FOX\USERS01.DBF
6 ONLINE 2460063263 D:\ORACLE\ORADATA\FOX\DEMO01.DBF
7 ONLINE 2460063263 D:\BACKUP_DIR\TESTING_LMT.DBF
8 ONLINE 2460063263 D:\ORACLE\ORADATA\FOX\RMAN.DBF
9 ONLINE 2460063991 D:\TOOL02.DBF
9 rows selected.
switch logfile时只是用switch前的current日志的first_change#更新了v$datafile的检查点小于它的检查点
sys@FOX> SELECT GROUP#,SEQUENCE#,STATUS,ARCHIVED,FIRST_CHANGE# FROM V$LOG;
GROUP# SEQUENCE# STATUS ARC FIRST_CHANGE#
---------------- ---------------- ---------------- --- ----------------
1 8 ACTIVE YES 2460063263
2 9 CURRENT NO 2460064045
3 7 INACTIVE YES 2460063194
3 rows selected.
sys@FOX> SELECT FILE#, STATUS, ERROR, RECOVER, TABLESPACE_NAME, NAME FROM V$DATAFILE_HEADER
2 WHERE RECOVER = 'YES' OR (RECOVER IS NULL AND ERROR IS NOT NULL);
no rows selected
sys@FOX> alter system checkpoint;
System altered.
sys@FOX> SELECT GROUP#,SEQUENCE#,STATUS,ARCHIVED,FIRST_CHANGE# FROM V$LOG;
GROUP# SEQUENCE# STATUS ARC FIRST_CHANGE#
---------------- ---------------- ---------------- --- ----------------
1 8 INACTIVE YES 2460063263
2 9 CURRENT NO 2460064045
3 7 INACTIVE YES 2460063194
3 rows selected.
sys@FOX> select FILE#,status,CHECKPOINT_CHANGE#,name from v$datafile;
FILE# STATUS CHECKPOINT_CHANGE# NAME
----- ------- ------------------ ---------------------------------------------
1 SYSTEM 2460064082 D:\ORACLE\ORADATA\FOX\SYSTEM01.DBF
2 ONLINE 2460064082 D:\ORACLE\ORADATA\FOX\UNDOTBS01.DBF
3 ONLINE 2460064082 D:\ORACLE\ORADATA\FOX\INDX01.DBF
4 ONLINE 2460064082 D:\ORACLE\ORADATA\FOX\TOOLS01.DBF
5 ONLINE 2460064082 D:\ORACLE\ORADATA\FOX\USERS01.DBF
6 ONLINE 2460064082 D:\ORACLE\ORADATA\FOX\DEMO01.DBF
7 ONLINE 2460064082 D:\BACKUP_DIR\TESTING_LMT.DBF
8 ONLINE 2460064082 D:\ORACLE\ORADATA\FOX\RMAN.DBF
9 ONLINE 2460064082 D:\TOOL02.DBF
9 rows selected.
alter system checkpoint;做了完全检查点
sys@FOX> select FILE#,checkpoint_change#,recover, fuzzy,status from v$datafile_header;
FILE# CHECKPOINT_CHANGE# REC FUZ STATUS
----- ------------------ --- --- -------
1 2460064082 NO YES ONLINE
2 2460064082 NO YES ONLINE
3 2460064082 NO YES ONLINE
4 2460064082 NO YES ONLINE
5 2460064082 NO YES ONLINE
6 2460064082 NO YES ONLINE
7 2460064082 NO YES ONLINE
8 2460064082 NO YES ONLINE
sys@FOX> SELECT GROUP#,SEQUENCE#,STATUS,ARCHIVED,FIRST_CHANGE# FROM V$LOG;
GROUP# SEQUENCE# STATUS ARC FIRST_CHANGE#
---------------- ---------------- ---------------- --- ----------------
1 8 CURRENT NO 2460063263
3 rows selected.
sys@FOX> select FILE#,checkpoint_change#,recover, fuzzy,status from v$datafile_header;
FILE# CHECKPOINT_CHANGE# REC FUZ STATUS
----- ------------------ --- --- -------
1 2460063194 NO YES ONLINE
2 2460063194 NO YES ONLINE
3 2460063194 NO YES ONLINE
4 2460063991 NO YES ONLINE
5 2460063194 NO YES ONLINE
6 2460063194 NO YES ONLINE
7 2460063194 NO YES ONLINE
8 2460063194 NO YES ONLINE
9 2460063991 NO YES ONLINE
9 rows selected.
sys@FOX> select FILE#,status,CHECKPOINT_CHANGE#,name from v$datafile;
FILE# STATUS CHECKPOINT_CHANGE# NAME
----- ------- ------------------ ---------------------------------------------
1 SYSTEM 2460063194 D:\ORACLE\ORADATA\FOX\SYSTEM01.DBF
2 ONLINE 2460063194 D:\ORACLE\ORADATA\FOX\UNDOTBS01.DBF
3 ONLINE 2460063194 D:\ORACLE\ORADATA\FOX\INDX01.DBF
4 ONLINE 2460063991 D:\ORACLE\ORADATA\FOX\TOOLS01.DBF
5 ONLINE 2460063194 D:\ORACLE\ORADATA\FOX\USERS01.DBF
6 ONLINE 2460063194 D:\ORACLE\ORADATA\FOX\DEMO01.DBF
7 ONLINE 2460063194 D:\BACKUP_DIR\TESTING_LMT.DBF
8 ONLINE 2460063194 D:\ORACLE\ORADATA\FOX\RMAN.DBF
9 ONLINE 2460063991 D:\TOOL02.DBF
9 rows selected.
sys@FOX> alter system switch logfile;
System altered.
sys@FOX> select FILE#,checkpoint_change#,recover, fuzzy,status from v$datafile_header;
FILE# CHECKPOINT_CHANGE# REC FUZ STATUS
----- ------------------ --- --- -------
1 2460063194 NO YES ONLINE
2 2460063194 NO YES ONLINE
3 2460063194 NO YES ONLINE
4 2460063991 NO YES ONLINE
5 2460063194 NO YES ONLINE
6 2460063194 NO YES ONLINE
7 2460063194 NO YES ONLINE
8 2460063194 NO YES ONLINE
9 2460063991 NO YES ONLINE
9 rows selected.
sys@FOX> select FILE#,status,CHECKPOINT_CHANGE#,name from v$datafile;
FILE# STATUS CHECKPOINT_CHANGE# NAME
----- ------- ------------------ ---------------------------------------------
1 SYSTEM 2460063263 D:\ORACLE\ORADATA\FOX\SYSTEM01.DBF
2 ONLINE 2460063263 D:\ORACLE\ORADATA\FOX\UNDOTBS01.DBF
3 ONLINE 2460063263 D:\ORACLE\ORADATA\FOX\INDX01.DBF
4 ONLINE 2460063991 D:\ORACLE\ORADATA\FOX\TOOLS01.DBF
5 ONLINE 2460063263 D:\ORACLE\ORADATA\FOX\USERS01.DBF
6 ONLINE 2460063263 D:\ORACLE\ORADATA\FOX\DEMO01.DBF
7 ONLINE 2460063263 D:\BACKUP_DIR\TESTING_LMT.DBF
8 ONLINE 2460063263 D:\ORACLE\ORADATA\FOX\RMAN.DBF
9 ONLINE 2460063991 D:\TOOL02.DBF
9 rows selected.
switch logfile时只是用switch前的current日志的first_change#更新了v$datafile的检查点小于它的检查点
sys@FOX> SELECT GROUP#,SEQUENCE#,STATUS,ARCHIVED,FIRST_CHANGE# FROM V$LOG;
GROUP# SEQUENCE# STATUS ARC FIRST_CHANGE#
---------------- ---------------- ---------------- --- ----------------
1 8 ACTIVE YES 2460063263
2 9 CURRENT NO 2460064045
3 7 INACTIVE YES 2460063194
3 rows selected.
sys@FOX> SELECT FILE#, STATUS, ERROR, RECOVER, TABLESPACE_NAME, NAME FROM V$DATAFILE_HEADER
2 WHERE RECOVER = 'YES' OR (RECOVER IS NULL AND ERROR IS NOT NULL);
no rows selected
sys@FOX> alter system checkpoint;
System altered.
sys@FOX> SELECT GROUP#,SEQUENCE#,STATUS,ARCHIVED,FIRST_CHANGE# FROM V$LOG;
GROUP# SEQUENCE# STATUS ARC FIRST_CHANGE#
---------------- ---------------- ---------------- --- ----------------
1 8 INACTIVE YES 2460063263
2 9 CURRENT NO 2460064045
3 7 INACTIVE YES 2460063194
3 rows selected.
sys@FOX> select FILE#,status,CHECKPOINT_CHANGE#,name from v$datafile;
FILE# STATUS CHECKPOINT_CHANGE# NAME
----- ------- ------------------ ---------------------------------------------
1 SYSTEM 2460064082 D:\ORACLE\ORADATA\FOX\SYSTEM01.DBF
2 ONLINE 2460064082 D:\ORACLE\ORADATA\FOX\UNDOTBS01.DBF
3 ONLINE 2460064082 D:\ORACLE\ORADATA\FOX\INDX01.DBF
4 ONLINE 2460064082 D:\ORACLE\ORADATA\FOX\TOOLS01.DBF
5 ONLINE 2460064082 D:\ORACLE\ORADATA\FOX\USERS01.DBF
6 ONLINE 2460064082 D:\ORACLE\ORADATA\FOX\DEMO01.DBF
7 ONLINE 2460064082 D:\BACKUP_DIR\TESTING_LMT.DBF
8 ONLINE 2460064082 D:\ORACLE\ORADATA\FOX\RMAN.DBF
9 ONLINE 2460064082 D:\TOOL02.DBF
9 rows selected.
alter system checkpoint;做了完全检查点
sys@FOX> select FILE#,checkpoint_change#,recover, fuzzy,status from v$datafile_header;
FILE# CHECKPOINT_CHANGE# REC FUZ STATUS
----- ------------------ --- --- -------
1 2460064082 NO YES ONLINE
2 2460064082 NO YES ONLINE
3 2460064082 NO YES ONLINE
4 2460064082 NO YES ONLINE
5 2460064082 NO YES ONLINE
6 2460064082 NO YES ONLINE
7 2460064082 NO YES ONLINE
8 2460064082 NO YES ONLINE
相关阅读 更多 +