当前位置:编程学习 > 网站相关 >>

浅析控制文件的创建

  当我们用不同方式创建控制文件的时候,可能会对控制文件中的信息产生不同的影响,下面分别介绍以noresetlogs方式、resetlogs方式创建控制文件,以查看控制文件中信息的变化。
一:以noresetlogs方式创建控制文件
1  重建控制文件语句如下
STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE "CRM" NORESETLOGS ARCHIVELOG
    MAXLOGFILES 16
    MAXLOGMEMBERS 3
    MAXDATAFILES 100
    MAXINSTANCES 8
    MAXLOGHISTORY 292
LOGFILE
 GROUP 1 (
    '/oracle/app/db1/dbs/log1CRM.dbf',
    '/oracle/CRM2/CRM/redo01b.log'
 ) SIZE 200M,
 GROUP 2 (
    '/oracle/app/db1/dbs/log2CRM.dbf',
    '/oracle/CRM2/CRM/redo02b.log'
 ) SIZE 50M,
 GROUP 3 (
    '/oracle/CRM2/CRM/redo03.log',
    '/oracle/CRM2/CRM/redo03b.log'
 ) SIZE 200M,
 GROUP 4 (
    '/oracle/CRM2/CRM/redo04.log',
    '/oracle/CRM2/CRM/redo04b.log'
 ) SIZE 200M,
 GROUP 5 (
    '/oracle/CRM2/CRM/redo05.log',
    '/oracle/CRM2/CRM/redo05b.log'
 ) SIZE 200M,
 GROUP 6 (
    '/oracle/CRM2/CRM/redo06.log',
    '/oracle/CRM2/CRM/redo06b.log'
 ) SIZE 200M
DATAFILE
 '/oracle/test/system1.dbf',
 '/oracle/test/zxb.dbf',
 '/oracle/test/sysaux01.dbf',
 '/oracle/test/users01.dbf',
 '/oracle/test/zxa.dbf',
 '/oracle/test/test1.dbf',
 '/oracle/test/zxc.dbf',
 '/oracle/test/undotbs1.dbf',
 '/oracle/test/zxbig.dbf'
CHARACTER SET ZHS16GBK
;
2转储 数据文件头部信息如下:
V10 STYLE FILE HEADER:
        Compatibility Vsn = 169869568=0xa200100
        Db ID=3601019238=0xd6a33166, Db Name='CRM'
        Activation ID=0=0x0
        Control Seq=9739=0x260b, File size=640=0x280
        File Number=4, Blksiz=8192, File Type=3 DATA
Tablespace #4 - USERS rel_fn:4
Creation   at   scn: 0x0000.000027b9 10/22/2005 21:45:00
Backup taken at scn: 0x0000.00000000 01/01/1988 00:00:00 thread:0
 reset logs count:0x2fac7053 scn: 0x0000.802c8c23 reset logs terminal rcv data:0x0 scn: 0x0000.00000000
 prev reset logs count:0x2fac6f51 scn: 0x0000.802c3dfd prev reset logs terminal rcv data:0x0 scn: 0x0000.00000000
 recovered at 12/05/2012 05:28:04
 status:0x0 root dba:0x00000000 chkpt cnt: 1183 ctl cnt:1182
begin-hot-backup file size: 0
Checkpointed at scn: 0x0000.8031da6a(2150750826) 11/22/2012 19:25:50 
 thread:1 rba:(0x1e.c8f.10)
3 转储新控制文件信息如下:
----------------------------------------------------------------------------------------------------
DATABASE ENTRY
----------------------------------------------------------------------------------------------------
 (size = 316, compat size = 316, section max = 1, section in-use = 1,
 last-recid= 0, old-recno = 0, last-recno = 0)
 (extent = 1, blkno = 1, numrecs = 1)
 12/05/2012 05:47:51
 DB Name "CRM"
 Database flags = 0x00400103 0x00001000
 Controlfile Creation Timestamp 12/05/2012 05:47:52
 Incmplt recovery scn: 0x0000.00000000
 Resetlogs scn: 0x0000.802c8c23 Resetlogs Timestamp 11/20/2012 07:01:39
 Prior resetlogs scn: 0x0000.802c3dfd Prior resetlogs Timestamp 11/20/2012 06:57:21
 Redo Version: compatible=0xa200100
 #Data files = 9, #Online files = 9
 Database checkpoint: Thread=1 scn: 0x0000.a5aaadfd
 Threads: #Enabled=1, #Open=0, Head=0, Tail=0
--------------------------------------------------------------------------------
 CHECKPOINT PROGRESS RECORDS
-------------------------------------------------------------------------------
 (size = 8180, compat size = 8180, section max = 11, section in-use = 0,
 last-recid= 0, old-recno = 0, last-recno = 0)
 (extent = 1, blkno = 2, numrecs = 11)
THREAD #1 - status:0x0 flags:0x0 dirty:0
low cache rba:(0x0.0.0) on disk rba:(0x0.0.0)
on disk scn: 0x0000.00000000 01/01/1988 00:00:00
resetlogs scn: 0x0000.00000000 01/01/1988 00:00:00
heartbeat: 801186341 mount id: 3609678535
-------------------------------------------------------------------------------------
DATA FILE #4:
 (name #18) /oracle/test/users01.dbf
creation size=0 block size=8192 status=0x12 head=18 tail=18 dup=1
 tablespace 4, index=4 krfil=4 prev_file=0
 unrecoverable scn: 0x0000.00000000 01/01/1988 00:00:00
 Checkpoint cnt:1183 scn: 0x0000.a5aaadfd 01/01/1988 00:00:00
 Stop scn: 0x0000.a5aaadfd (2779426301)12/05/2012 05:47:52
 Creation Checkpointed at scn: 0x0000.000027b9 10/22/2005 21:45:00
 thread:0 rba:(0x0.0.0)
 
4 转储当前联机日志最后一个记录如下
REDO RECORD - Thread:1 RBA: 0x000040.0000e490.0160 LEN: 0x0064 VLD: 0x02
SCN: 0x0000.a5aaadfb SUBSCN: 1 12/05/2012 04:52:27
CHANGE #1 MEDIA RECOVERY MARKER SCN:0x0000.00000000 SEQ: 0 OP:23.1
 Block Written - afn: 1 rdba: 0x0040edc8 BFT:(1024,4255176) non-BFT:(1,60872)
                   scn: 0x0000.a5aaadf9 seq: 0x07 易做图:0x04
 Block Written - afn: 1 rdba: 0x0040006a BFT:(1024,4194410) non-BFT:(1,106)
                   scn: 0x0000.a5aaadfa seq: 0x01 易做图:0x06
 Block Written - afn: 1 rdba: 0x00400009 BFT:(1024,4194313) non-BFT:(1,9)
                   scn: 0x0000.a5aaadfa seq: 0x01 易做图:0x04
END OF REDO DUMP
----- Redo read statistics for thread 1 -----
Read rate (ASYNC): 29255Kb in 41.53s => 0.69 Mb/sec
Total physical reads: 29255Kb
Longest record: 10Kb, moves: 0/92501 (0%)
Change moves: 41327/182885 (22%), moved: 10Mb
Longest LWN: 1537Kb, moves: 7/364 (1%), moved: 6Mb
Last redo scn: 0x0000.a5aaadfb (2779426299)
5总结:
Noresetlogs方式创建控制文件
数据文件头部情况
控制文件中记录数据文件信息
检查点计数值
chkpt cnt: 1183
检查点计数值
Checkpoint cnt:1183
检查点scn值
0x8031da6a
检查点scn值
scn: 0xa5aaadfd
Redo 块地址
rba:(0x1e.c8f.10)
Stop scn
Stop scn: 0xa5aaadfd
Database checkpoint: Thread=1 scn: 0x0000.a5aaadfd
Checkpoint cnt:1183 scn: 0x0000.a5aaadfd 01/01/1988 00:00:00
 
 Stop scn: 0x0000.a5aaadfd (2779426301)12/05/2012 05:47:52
补充:综合编程 , 其他综合 ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,