ITPub博客

首页 > 数据库 > 数据库开发技术 > 利用操作系统在线移动数据库联机日志

利用操作系统在线移动数据库联机日志

原创 数据库开发技术 作者:西门吹牛 时间:2009-06-15 14:48:22 0 删除 编辑

我们有一个系统IO很高,经过检查想把四个联机日志文件系统移动到另外一个硬盘上面,按照ORACLE的方法,应该建立多余的日志组,然后再删除原来的日志组,但是利用操作系统的方法可以比较简单的实现。

环境是 oracle10G r2 + AIX 5.3

hreccp1的IO一直很高,查看发现有可以调整的余地

HRECCP1 / #lsvg -l oravg
oravg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
HHPmirrlogB jfs2 10 10 1 open/syncd /oracle/HHP/mirrlogB
HHPmirrlogA jfs2 10 10 1 open/syncd /oracle/HHP/mirrlogA
HHPoriglogB jfs2 10 10 1 open/syncd /oracle/HHP/origlogB
HHPoriglogA jfs2 10 10 1 open/syncd /oracle/HHP/origlogA
HHPoraHHP jfs2 40 40 1 open/syncd /oracle/HHP
HHPstage jfs2 20 20 1 open/syncd /oracle/stage
HHPoraarch jfs2 160 160 2 open/syncd /oracle/HHP/oraarch
HHPsapdata1 jfs2 160 160 1 open/syncd /oracle/HHP/sapdata1
HHPsapdata2 jfs2 160 160 1 open/syncd /oracle/HHP/sapdata2
HHPsapdata3 jfs2 160 160 1 open/syncd /oracle/HHP/sapdata3
HHPsapdata4 jfs2 160 160 1 open/syncd /oracle/HHP/sapdata4
HHPsapdata5 jfs2 159 159 1 open/syncd /oracle/HHP/sapdata5
loglv05 jfs2log 1 1 1 open/syncd N/A
HRECCP1 / #

HRECCP1 / #lspv -l hdisk6
hdisk6:
LV NAME LPs PPs DISTRIBUTION MOUNT POINT
HHPoriglogA 10 10 00..10..00..00..00 /oracle/HHP/origlogA
HHPmirrlogB 10 10 00..10..00..00..00 /oracle/HHP/mirrlogB
HHPoriglogB 10 10 00..10..00..00..00 /oracle/HHP/origlogB
HHPmirrlogA 10 10 00..10..00..00..00 /oracle/HHP/mirrlogA
HHPoraHHP 40 40 00..40..00..00..00 /oracle/HHP
HHPoraarch 100 100 00..100..00..00..00 /oracle/HHP/oraarch
HHPstage 20 20 00..20..00..00..00 /oracle/stage
HHPsapdata2 160 160 00..00..160..00..00 /oracle/HHP/sapdata2
HHPsapdata1 160 160 160..00..00..00..00 /oracle/HHP/sapdata1
HHPsapdata3 160 160 00..00..39..121..00 /oracle/HHP/sapdata3
HHPsapdata4 160 160 00..00..00..79..81 /oracle/HHP/sapdata4
HHPsapdata5 159 159 40..00..00..00..119 /oracle/HHP/sapdata5
HRECCP1 / #
HRECCP1 / #lspv -l hdisk8
hdisk8:
LV NAME LPs PPs DISTRIBUTION MOUNT POINT
HHPoraarch 60 60 00..39..21..00..00 /oracle/HHP/oraarch
loglv05 1 1 00..01..00..00..00 N/A

在同样的VG下面,hdisk8上面的文件系统比较少,所以打算从hdisk6分一些过来
就分这四个文件系统吧

/oracle/HHP/origlogA
/oracle/HHP/mirrlogB
/oracle/HHP/origlogB
/oracle/HHP/mirrlogA

步骤如下
screen -S lvcopy
mklvcopy HHPoriglogA 2 hdisk8
syncvg -l HHPoriglogA
rmlvcopy HHPoriglogA 1 hdisk6

mklvcopy HHPoriglogB 2 hdisk8
syncvg -l HHPoriglogB
rmlvcopy HHPoriglogB 1 hdisk6

mklvcopy HHPmirrlogA 2 hdisk8
syncvg -l HHPmirrlogA
rmlvcopy HHPmirrlogA 1 hdisk6

mklvcopy HHPmirrlogB 2 hdisk8
syncvg -l HHPmirrlogB
rmlvcopy HHPmirrlogB 1 hdisk6

实际过程如下: 仅以第一个LV同步为例

HRECCP1 / #mklvcopy HHPoriglogA 2 hdisk8

可以看到HHPoriglogA的PPS已经是两倍了,状态是stale的,还没有同步
HRECCP1 / #lsvg -l oravg
oravg:
LV NAME TYPE LPs PPs PstaleVs LV STATE MOUNT POINT
HHPmirrlogB jfs2 10 10 1 open/syncd /oracle/HHP/mirrlogB
HHPmirrlogA jfs2 10 10 1 open/syncd /oracle/HHP/mirrlogA
HHPoriglogB jfs2 10 10 1 open/syncd /oracle/HHP/origlogB
HHPoriglogA jfs2 10 20 2 open/stale /oracle/HHP/origlogA
HHPoraHHP jfs2 40 40 1 open/syncd /oracle/HHP
HHPstage jfs2 20 20 1 open/syncd /oracle/stage
HHPoraarch jfs2 160 160 2 open/syncd /oracle/HHP/oraarch
HHPsapdata1 jfs2 160 160 1 open/syncd /oracle/HHP/sapdata1
HHPsapdata2 jfs2 160 160 1 open/syncd /oracle/HHP/sapdata2
HHPsapdata3 jfs2 160 160 1 open/syncd /oracle/HHP/sapdata3
HHPsapdata4 jfs2 160 160 1 open/syncd /oracle/HHP/sapdata4
HHPsapdata5 jfs2 159 159 1 open/syncd /oracle/HHP/sapdata5
loglv05 jfs2log 1 1 1 open/syncd N/A

现在同步
HRECCP1 / #syncvg -l HHPoriglogA
HRECCP1 / #
HRECCP1 / #

再检查状态,HHPoriglogA的状态变成syncd的了
HRECCP1 / #lsvg -l oravg
oravg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
HHPmirrlogB jfs2 10 10 1 open/syncd /oracle/HHP/mirrlogB
HHPmirrlogA jfs2 10 10 1 open/syncd /oracle/HHP/mirrlogA
HHPoriglogB jfs2 10 10 1 open/syncd /oracle/HHP/origlogB
HHPoriglogA jfs2 10 20 2 open/syncd /oracle/HHP/origlogA
HHPoraHHP jfs2 40 40 1 open/syncd /oracle/HHP
HHPstage jfs2 20 20 1 open/syncd /oracle/stage
HHPoraarch jfs2 160 160 2 open/syncd /oracle/HHP/oraarch
HHPsapdata1 jfs2 160 160 1 open/syncd /oracle/HHP/sapdata1
HHPsapdata2 jfs2 160 160 1 open/syncd /oracle/HHP/sapdata2
HHPsapdata3 jfs2 160 160 1 open/syncd /oracle/HHP/sapdata3
HHPsapdata4 jfs2 160 160 1 open/syncd /oracle/HHP/sapdata4
HHPsapdata5 jfs2 159 159 1 open/syncd /oracle/HHP/sapdata5
loglv05 jfs2log 1 1 1 open/syncd N/A

检查系统是否有错误信息,一定要检查
HRECCP1 / #errpt|more

现在还没有


把这个文件系统从hdisk6移走
HRECCP1 / #rmlvcopy HHPoriglogA 1 hdisk6

HRECCP1 / #lsvg -l oravg
oravg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
HHPmirrlogB jfs2 10 10 1 open/syncd /oracle/HHP/mirrlogB
HHPmirrlogA jfs2 10 10 1 open/syncd /oracle/HHP/mirrlogA
HHPoriglogB jfs2 10 10 1 open/syncd /oracle/HHP/origlogB
HHPoriglogA jfs2 10 10 1 open/syncd /oracle/HHP/origlogA
HHPoraHHP jfs2 40 40 1 open/syncd /oracle/HHP
HHPstage jfs2 20 20 1 open/syncd /oracle/stage
HHPoraarch jfs2 160 160 2 open/syncd /oracle/HHP/oraarch
HHPsapdata1 jfs2 160 160 1 open/syncd /oracle/HHP/sapdata1
HHPsapdata2 jfs2 160 160 1 open/syncd /oracle/HHP/sapdata2
HHPsapdata3 jfs2 160 160 1 open/syncd /oracle/HHP/sapdata3
HHPsapdata4 jfs2 160 160 1 open/syncd /oracle/HHP/sapdata4
HHPsapdata5 jfs2 159 159 1 open/syncd /oracle/HHP/sapdata5
loglv05 jfs2log 1 1 1 open/syncd N/A
HRECCP1 / #lspv -l hdisk6
hdisk6:
LV NAME LPs PPs DISTRIBUTION MOUNT POINT
HHPmirrlogB 10 10 00..10..00..00..00 /oracle/HHP/mirrlogB
HHPoriglogB 10 10 00..10..00..00..00 /oracle/HHP/origlogB
HHPmirrlogA 10 10 00..10..00..00..00 /oracle/HHP/mirrlogA
HHPoraHHP 40 40 00..40..00..00..00 /oracle/HHP
HHPoraarch 100 100 00..100..00..00..00 /oracle/HHP/oraarch
HHPstage 20 20 00..20..00..00..00 /oracle/stage
HHPsapdata2 160 160 00..00..160..00..00 /oracle/HHP/sapdata2
HHPsapdata1 160 160 160..00..00..00..00 /oracle/HHP/sapdata1
HHPsapdata3 160 160 00..00..39..121..00 /oracle/HHP/sapdata3
HHPsapdata4 160 160 00..00..00..79..81 /oracle/HHP/sapdata4
HHPsapdata5 159 159 40..00..00..00..119 /oracle/HHP/sapdata5
HRECCP1 / #lspv -l hdisk8
hdisk8:
LV NAME LPs PPs DISTRIBUTION MOUNT POINT
HHPoriglogA 10 10 10..00..00..00..00 /oracle/HHP/origlogA
HHPoraarch 60 60 00..39..21..00..00 /oracle/HHP/oraarch
loglv05 1 1 00..01..00..00..00 N/A
HRECCP1 / #

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10771/viewspace-1023133/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2013-06-13

  • 博文量
    18
  • 访问量
    123038