informix数据空间镜像操作步骤

转载

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/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/312079/viewspace-245619/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值