本篇文章為大家展示了如何進行oracle switch logfile日志切換以及alter system checkpoint做了什么,內(nèi)容簡明扼要并且容易理解,絕對能使你眼前一亮,通過這篇文章的詳細介紹希望你能有所收獲。
創(chuàng)新互聯(lián)建站是專業(yè)的新興網(wǎng)站建設公司,新興接單;提供成都網(wǎng)站建設、成都做網(wǎng)站,網(wǎng)頁設計,網(wǎng)站設計,建網(wǎng)站,PHP網(wǎng)站建設等專業(yè)做網(wǎng)站服務;采用PHP框架,可快速的進行新興網(wǎng)站開發(fā)網(wǎng)頁制作和功能擴展;專業(yè)做搜索引擎喜愛的網(wǎng)站,專業(yè)的做網(wǎng)站團隊,希望更多企業(yè)前來合作!
日志切換或checkpoint到底發(fā)生了什么?
1,剛變成active的日志文件(即由last_change#到next_change#的redo)被 dbwr寫入到數(shù)據(jù)文件
2,ckpt更新所有數(shù)據(jù)文件頭的start scn即v$datafile_header.checkpoint_change#為剛變成active的日志文件
的first_change#
3,ckpt同時更新控制文件的檢查點scn,即v$database.checkpoint_change#為active狀態(tài)日志文件的first_change#
/***********測試開始*************/
/**********檢查點發(fā)生前的數(shù)據(jù)文件頭scn*********/
SQL> select checkpoint_change# from v$datafile_header;
CHECKPOINT_CHANGE#
------------------
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
CHECKPOINT_CHANGE#
------------------
10590730
21 rows selected
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARCHIVED STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- -------- ---------------- ------------- ----------- ------------ -----------
3 1 817 52428800 512 1 NO INACTIVE 10453013 2013/3/24 1 10454569 2013/3/24 1
4 1 818 209715200 512 1 NO INACTIVE 10454569 2013/3/24 1 10492795 2013/3/24 1
5 1 819 209715200 512 1 NO INACTIVE 10492795 2013/3/24 1 10560992 2013/3/25 1
6 1 820 209715200 512 1 NO INACTIVE 10560992 2013/3/25 1 10561002 2013/3/25 1
7 1 821 209715200 512 1 NO INACTIVE 10561002 2013/3/25 1 10561202 2013/3/25 1
8 1 822 209715200 512 1 NO INACTIVE 10561202 2013/3/25 1 10588922 2013/3/25 1
9 1 816 209715200 512 1 NO INACTIVE 10446578 2013/3/24 1 10453013 2013/3/24 1
10 1 823 20971520 512 1 NO CURRENT 10588922 2013/3/25 1 281474976710
8 rows selected
SQL> select checkpoint_change# from v$database;
CHECKPOINT_CHANGE#
------------------
10590730
SQL> select checkpoint_change# from v$datafile;
CHECKPOINT_CHANGE#
------------------
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
CHECKPOINT_CHANGE#
------------------
10590730
21 rows selected
/*********日志切換后各個scn*****************/
SQL> alter system switch logfile;
System altered
SQL> select checkpoint_change# from v$datafile;
CHECKPOINT_CHANGE#
------------------
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
CHECKPOINT_CHANGE#
------------------
10590730
21 rows selected
SQL> select checkpoint_change# from v$database;
CHECKPOINT_CHANGE#
------------------
10590730
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARCHIVED STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- -------- ---------------- ------------- ----------- ------------ -----------
3 1 817 52428800 512 1 NO INACTIVE 10453013 2013/3/24 1 10454569 2013/3/24 1
4 1 818 209715200 512 1 NO INACTIVE 10454569 2013/3/24 1 10492795 2013/3/24 1
5 1 819 209715200 512 1 NO INACTIVE 10492795 2013/3/24 1 10560992 2013/3/25 1
6 1 820 209715200 512 1 NO INACTIVE 10560992 2013/3/25 1 10561002 2013/3/25 1
7 1 821 209715200 512 1 NO INACTIVE 10561002 2013/3/25 1 10561202 2013/3/25 1
8 1 822 209715200 512 1 NO INACTIVE 10561202 2013/3/25 1 10588922 2013/3/25 1
9 1 824 209715200 512 1 NO CURRENT 10591778 2013/3/25 1 281474976710
10 1 823 20971520 512 1 NO ACTIVE 10588922 2013/3/25 1 10591778 2013/3/25 1
8 rows selected
SQL> select checkpoint_change# from v$datafile_header;
CHECKPOINT_CHANGE#
------------------
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
CHECKPOINT_CHANGE#
------------------
10590730
21 rows selected
小結:alter system checkpoint不會觸發(fā)變更數(shù)據(jù)文件及數(shù)據(jù)文件頭的檢查點scn
/***********再看下日志切換是怎么樣的情況********************/
/**************日志切換前*************************/
SQL> select checkpoint_change# from v$datafile_header;
CHECKPOINT_CHANGE#
------------------
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
CHECKPOINT_CHANGE#
------------------
10590730
21 rows selected
SQL> select checkpoint_change# from v$datafile;
CHECKPOINT_CHANGE#
------------------
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
10590730
CHECKPOINT_CHANGE#
------------------
10590730
21 rows selected
SQL> select checkpoint_change# from v$database;
CHECKPOINT_CHANGE#
------------------
10590730
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARCHIVED STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- -------- ---------------- ------------- ----------- ------------ -----------
3 1 817 52428800 512 1 NO INACTIVE 10453013 2013/3/24 1 10454569 2013/3/24 1
4 1 818 209715200 512 1 NO INACTIVE 10454569 2013/3/24 1 10492795 2013/3/24 1
5 1 819 209715200 512 1 NO INACTIVE 10492795 2013/3/24 1 10560992 2013/3/25 1
6 1 820 209715200 512 1 NO INACTIVE 10560992 2013/3/25 1 10561002 2013/3/25 1
7 1 821 209715200 512 1 NO INACTIVE 10561002 2013/3/25 1 10561202 2013/3/25 1
8 1 822 209715200 512 1 NO INACTIVE 10561202 2013/3/25 1 10588922 2013/3/25 1
9 1 824 209715200 512 1 NO CURRENT 10591778 2013/3/25 1 281474976710
10 1 823 20971520 512 1 NO ACTIVE 10588922 2013/3/25 1 10591778 2013/3/25 1
8 rows selected
SQL>
/***********日志切換后****************/
SQL> alter system switch logfile;
System altered
SQL> select * from v$log;
GROUP# THREAD# SEQUENCE# BYTES BLOCKSIZE MEMBERS ARCHIVED STATUS FIRST_CHANGE# FIRST_TIME NEXT_CHANGE# NEXT_TIME
---------- ---------- ---------- ---------- ---------- ---------- -------- ---------------- ------------- ----------- ------------ -----------
3 1 825 52428800 512 1 NO CURRENT 10592541 2013/3/25 1 281474976710
4 1 818 209715200 512 1 NO INACTIVE 10454569 2013/3/24 1 10492795 2013/3/24 1
5 1 819 209715200 512 1 NO INACTIVE 10492795 2013/3/24 1 10560992 2013/3/25 1
6 1 820 209715200 512 1 NO INACTIVE 10560992 2013/3/25 1 10561002 2013/3/25 1
7 1 821 209715200 512 1 NO INACTIVE 10561002 2013/3/25 1 10561202 2013/3/25 1
8 1 822 209715200 512 1 NO INACTIVE 10561202 2013/3/25 1 10588922 2013/3/25 1
9 1 824 209715200 512 1 NO ACTIVE 10591778 2013/3/25 1 10592541 2013/3/25 1
10 1 823 20971520 512 1 NO INACTIVE 10588922 2013/3/25 1 10591778 2013/3/25 1
8 rows selected
/***參考上面日志信息,控制文件的檢查點scn及數(shù)據(jù)文件及數(shù)據(jù)文件頭的scn已經(jīng)更新active日志的first_change#/
SQL> select checkpoint_change# from v$database;
CHECKPOINT_CHANGE#
------------------
10591778
SQL> select checkpoint_change# from v$datafile;
CHECKPOINT_CHANGE#
------------------
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
CHECKPOINT_CHANGE#
------------------
10591778
21 rows selected
SQL> select checkpoint_change# from v$datafile_header;
CHECKPOINT_CHANGE#
------------------
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
10591778
CHECKPOINT_CHANGE#
------------------
10591778
21 rows selected
上述內(nèi)容就是如何進行oracle switch logfile日志切換以及alter system checkpoint做了什么,你們學到知識或技能了嗎?如果還想學到更多技能或者豐富自己的知識儲備,歡迎關注創(chuàng)新互聯(lián)行業(yè)資訊頻道。
當前標題:如何進行oracleswitchlogfile日志切換以及altersystemcheckpoint做了什么
文章起源:http://aaarwkj.com/article10/gjgodo.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供搜索引擎優(yōu)化、手機網(wǎng)站建設、網(wǎng)站制作、用戶體驗、商城網(wǎng)站、網(wǎng)站導航
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)