# 这下该清楚了吧`~~
ALTER SYSTEM SWITCH LOGFILE ;
SWITCH LOGFILE Clause
The SWITCH LOGFILE clause lets you explicitly force Oracle to begin writing to a new redo log file group,
regardless of whether the files in the current redo log file group are full. When you force a log switch, Oracle
begins to perform. a checkpoint but returns control to you immediately rather than when the checkpoint is
complete. To use this clause, your instance must have the database open.
ALTER SYSTEM ARCHIVE LOG CURRENT ;
CURRENT Clause
Specify CURRENT to manually archive the current redo log file group of the specified thread, forcing a log switch.
If you omit the THREAD parameter, then Oracle archives all redo log file groups from all enabled threads, including
logs previous to current logs. You can specify CURRENT only when the database is open.
ALTER SYSTEM ARCHIVE LOG CURRENT NOSWITCH;
NOSWITCH
Specify NOSWITCH if you want to manually archive the current redo log file group without forcing a log switch.
This setting is used primarily with standby databases to prevent data divergence when the primary database shuts
down. Divergence implies the possibility of data loss in case of primary database failure.
You can use the NOSWITCH clause only when your instance has the database mounted but not open. If the database
is open, then this operation closes the database automatically. You must then manually shut down the database
before you can reopen it
ALTER SYSTEM CHECKPOINT
Specify CHECKPOINT to explicitly force Oracle to perform. a checkpoint, ensuring that all changes made by committed
transactions are written to datafiles on disk. You can specify this clause only when your instance has the database open.
Oracle does not return control to you until the checkpoint is complete.
Oracle Checkpoint
A checkpoint performs the following three operations:
- Every dirty block in the buffer cache is written to the data files. That is, it synchronizes the datablocks in the buffer cache
with the datafileson disk.
- It's the DBWR that writes all modified databaseblocks back to the datafiles.
- The latest SCN is written (updated) into thedatafile header.
- The latest SCN is also written to the controlfiles.
The update of the datafile headers and the control files is done by the LGWR(CKPT if CKPT is enabled). As of version 8.0,
CKPT is enabled by default.