informix資料空間映象操作步驟

tonykorn97發表於2007-03-07
1,建立映象檔案
[root@tonykorn97 root]# cd /informix.links/
[root@tonykorn97 root]# mkdir m_front
[root@tonykorn97 root]# cd m_front
[root@tonykorn97 root]# touch rootdbs
[root@tonykorn97 root]# touch plogdbs
[root@tonykorn97 root]# touch llogdbs
[root@tonykorn97 root]# touch tempdbs
[root@tonykorn97 root]# touch datadbs
[root@tonykorn97 root]# chmod 660 *
[root@tonykorn97 root]# cd ..
[root@tonykorn97 root]# chown -R informix:informix m_front

2,資料檔案統一性操作
onbar -b -l -c
onmode -c
彈出磁帶

3,執行中,沒有修改onconfig檔案
[informix@tonykorn97 informix]$ ls -al /informix.links/m_front/*
-rw-rw---- 1 informix informix 0 Feb 12 22:23 /informix.links/m_front/datadbs
-rw-rw---- 1 informix informix 0 Feb 12 22:23 /informix.links/m_front/llogdbs
-rw-rw---- 1 informix informix 0 Feb 12 22:23 /informix.links/m_front/plogdbs
-rw-rw---- 1 informix informix 0 Feb 12 22:23 /informix.links/m_front/rootdbs
-rw-rw---- 1 informix informix 0 Feb 12 22:32 /informix.links/m_front/tempdbs
[informix@tonykorn97 informix]$ onspaces -m rootdbs -p /informix.links/front/rootdbs -o 0 -m /informix.links/m_front/rootdbs 0
IBM Informix Dynamic Server was initialized with no mirroring.

4,修改onconfig檔案。
MIRROR 1 # Mirroring flag (Yes = 1, No = 0)
MIRRORPATH /informix.links/m_front/rootdbs # Path for device containing mirrored root
啟動是報:
Forking 1 'soctcp' listener threads...succeeded
Starting tracing...succeeded
Initializing 1 flushers...succeeded
SENDER IS NULL NO MAIL WILL BE SENT
Initializing log/checkpoint information...succeeded
Opening primary chunks...succeeded
Opening mirror chunks...succeeded
Initializing dbspaces...Mismatch in configuration file : MIRRORPATH = /informix.links/m_front/rootdbs.
Root chunk was not mirrored.
Add mirroring using onspaces or onmonitor.
FAILED
oninit: Fatal error in shared memory initialization

5,修改onconfig檔案
只修改:
MIRROR 1 # Mirroring flag (Yes = 1, No = 0)
正常啟動
23:45:16 Onconfig parameter MIRROR modified from 0 to 1.
23:45:16 Dataskip is now OFF for all dbspaces
23:45:16 Checkpoint Completed: duration was 0 seconds.
23:45:16 Checkpoint loguniq 2328, logpos 0x10018, timestamp: 0xa7aebdc

23:45:16 Maximum server connections 0
23:45:16 On-Line Mode


6,新增rootdbs映象
[informix@tonykorn97 etc]$ onspaces -m rootdbs -p /informix.links/front/rootdbs -o 0 -m /informix.links/m_front/rootdbs 0
WARNING: Turning mirror on for 'rootdbs'.

Do you really want to continue? (y/n)y
Verifying physical disk space, please wait ...
The Space "rootdbs" is now mirrored.
[informix@tonykorn97 etc]$

日誌資訊
23:48:42 Checkpoint Completed: duration was 0 seconds.
23:48:42 Checkpoint loguniq 2328, logpos 0x111fc, timestamp: 0xa7aebed

23:48:42 Maximum server connections 0
23:48:42 The Space "rootdbs" is now mirrored.

23:48:42 Space 'rootdbs' -- Recovery Begins(0x523bb4c8)
23:48:42 Chunk Number 1 - '/informix.links/m_front/rootdbs' -- Recovery Begins(0x523bb4c8)
23:49:38 Chunk Number 1 - '/informix.links/m_front/rootdbs' -- Online
23:49:38 Checkpoint Completed: duration was 0 seconds.
23:49:38 Checkpoint loguniq 2328, logpos 0x13018, timestamp: 0xa7aebf7

23:49:38 Maximum server connections 0
23:49:38 Space 'rootdbs' -- Recovery Complete(0x523bb4c8)

7,增加其它資料空間
onspaces -m plogdbs -p /informix.links/front/plogdbs -o 0 -m /informix.links/m_front/plogdbs 0
onspaces -m llogdbs -p /informix.links/front/llogdbs -o 0 -m /informix.links/m_front/llogdbs 0
onspaces -m tempdbs -p /informix.links/front/tempdbs -o 0 -m /informix.links/m_front/tempdbs 0
onspaces -m datadbs -p /informix.links/front/datadbs -o 0 -m /informix.links/m_front/datadbs 0


[informix@tonykorn97 etc]$ onspaces -m tempdbs -p /informix.links/front/tempdbs -o 0 -m /informix.links/m_front/tempdbs 0
Cannot mirror a temporary DBspace.

此時資料空間的狀態是:
address chunk/dbs offset size free bpages flags pathname
5e0fd948 1 1 5 64000 58932 PO-B /informix.links/front/rootdbs
5e0fdad0 1 1 5 64000 0 MO-B /informix.links/m_front/rootdbs
5e90e258 2 2 5 256000 447 PO-B /informix.links/front/plogdbs
5ea0ec28 2 2 5 256000 0 MO-B /informix.links/m_front/plogdbs
5e90e3e0 3 3 5 512000 1947 PO-B /informix.links/front/llogdbs
5ea0edb0 3 3 5 512000 0 MX-B /informix.links/m_front/llogdbs
5e90e568 4 4 5 512000 511947 PO-B /informix.links/front/tempdbs
5e90e6f0 5 5 5 4008000 3971340 PO-B /informix.links/front/datadbs

8,備份
onbar -b -L 0
資料空間狀態變為:
5e0fd948 1 1 5 64000 58932 PO-B /informix.links/front/rootdbs
5e0fdad0 1 1 5 64000 0 MO-B /informix.links/m_front/rootdbs
5e90e258 2 2 5 256000 447 PO-B /informix.links/front/plogdbs
5ea0ec28 2 2 5 256000 0 MO-B /informix.links/m_front/plogdbs
5e90e3e0 3 3 5 512000 1947 PO-B /informix.links/front/llogdbs
5ea0edb0 3 3 5 512000 0 MO-B /informix.links/m_front/llogdbs
5e90e568 4 4 5 512000 511947 PO-B /informix.links/front/tempdbs
5e90e6f0 5 5 5 4008000 3971340 PO-B /informix.links/front/datadbs
5ea23e58 5 5 5 4008000 0 MO-B /informix.links/m_front/datadbs

映象刪除
[informix@test ~]$ onspaces -r plogdbs
WARNING: Turning mirror off for 'plogdbs'.

Do you really want to continue? (y/n)y
The Space "plogdbs" is no longer mirrored.
[informix@test ~]$ onstat -d

IBM Informix Dynamic Server Version 10.00.UC4 -- On-Line -- Up 00:24:06 -- 237528 Kbytes

Dbspaces
address number flags fchunk nchunks pgsize flags owner name
5111e7e8 1 0x60002 1 1 2048 M B informix rootdbs
5124d7b8 2 0x60001 2 1 2048 N B informix plogdbs
5124d918 3 0x40001 3 1 2048 N B informix llogdbs
5124da78 4 0x40001 4 1 2048 N B informix datadbs
5124dbd8 5 0x42001 5 1 2048 N TB informix tempdbs
5 active, 2047 maximum

Chunks
address chunk/dbs offset size free bpages flags pathname
5111e948 1 1 0 500000 497212 PO-B /informix.link/front/rootdbs
5111ead0 1 1 0 500000 0 MO-B /informix.link/m_front/rootdbs
5125edf0 2 2 50 500000 399947 PO-B /informix.link/front/plogdbs
5111eca0 3 3 50 500000 299947 PO-B /informix.link/front/llogdbs
5111ee28 4 4 50 2500000 2499947 PO-B /informix.link/front/datadbs
5124d630 5 5 0 500000 499947 PO-B /informix.link/front/tempdbs
5 active, 32766 maximum

NOTE: The values in the "size" and "free" columns for DBspace chunks are
displayed in terms of "pgsize" of the DBspace to which they belong.

更改映象塊的狀態

1,關閉映象塊
[informix@test ~]$ onspaces -s rootdbs -p /informix.link/m_front/rootdbs -o 0 -D
Warning: bringing down a chunk.
Do you really want to continue? (y/n)y
Chunk status successfully changed.
[informix@test ~]$ onstat -d

IBM Informix Dynamic Server Version 10.00.UC4 -- On-Line -- Up 00:37:13 -- 237528 Kbytes

Dbspaces
address number flags fchunk nchunks pgsize flags owner name
5111e7e8 1 0x60002 1 1 2048 M B informix rootdbs
5124d7b8 2 0x60001 2 1 2048 N B informix plogdbs

Chunks
address chunk/dbs offset size free bpages flags pathname
5111e948 1 1 0 500000 497212 PO-B /informix.link/front/rootdbs
5111ead0 1 1 0 500000 0 MD-B /informix.link/m_front/rootdbs

2,恢復映象塊並使它聯機
[informix@test ~]$ onspaces -s rootdbs -p /informix.link/m_front/rootdbs -o 0 -O
WARNING: bringing a down chunk into recovery state.
Do you really want to continue? (y/n)y
Verifying physical disk space, please wait ...
Chunk status successfully changed.

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/312079/viewspace-245619/,如需轉載,請註明出處,否則將追究法律責任。

相關文章