温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

aix下sybase设备的迁移

发布时间:2020-07-14 00:00:00 来源:网络 阅读:6650 作者:zhangxuwl 栏目:关系型数据库

aix下让sybase的所有库从一个存储迁移到另一个存储,或者从一个vg迁移到另一个vg,抑或移动sybase所有库到新的位置,在aix下都可以通过拷贝相关lv实现。由于公司ibm小型机硬件原因,简单举个迁移sybase设备从rootvg上到datavg的例子。过程如下:

一、基本信息

1 数据库当前的设备如下

name phyname

------------------------------ ------------------------

master /dev/rlv_master

sysprocsdev /dev/rlv_proc


2 rootvg的lv信息

# lsvg -l rootvg

rootvg:

LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT

hd5 boot 1 1 1 closed/syncd N/A

hd6 paging 64 64 1 open/syncd N/A

hd8 jfs2log 1 1 1 open/syncd N/A

hd4 jfs2 48 48 1 open/syncd /

hd2 jfs2 64 64 1 open/syncd /usr

hd9var jfs2 48 48 1 open/syncd /var

hd3 jfs2 48 48 1 open/syncd /tmp

hd1 jfs2 1 1 1 open/syncd /home

hd10opt jfs2 48 48 1 open/syncd /opt

lg_dumplv sysdump 16 16 1 open/syncd N/A

lv_master raw 5 5 1 open/syncd N/A

lv_proc raw 5 5 1 open/syncd N/A

lv_data1 raw 16 16 1 closed/syncd N/A


3 sybase RUN_CRM 文件内容如下


$ cat RUN_CRM

#!/bin/sh

#

# Adaptive Server name: CRM

# ASE page size (KB): 2k

# Master device path: /dev/rlv_master

# Error log path: /sybase/ASE-12_5/install/CRM.log

# Configuration file path: /sybase/ASE-12_5/CRM.cfg

# Directory for shared memory files: /sybase/ASE-12_5

#

/sybase/ASE-12_5/bin/dataserver \

-sCRM \

-d/dev/rlv_master \

-e/sybase/ASE-12_5/install/CRM.log \

-c/sybase/ASE-12_5/CRM.cfg \

-M/sybase/ASE-12_5 \


4 sybase的接口文件内容如下

# cat interfaces


CRM

master tcp ether 192.168.85.9 5000

query tcp ether 192.168.85.9 5000


CRM_back

master tcp ether 192.168.85.9 5001

query tcp ether 192.168.85.9 5001


二、拷贝sybase的所有相关lv、本例sybase只有lv_master lv_proc两个lv (注意由于是简单模拟实验,所以sybase就只有这么两个lv)

1 拷贝过程如下:

cplv命令解释如下:

-y 新的lv名字

-v 目标卷组名字

# cplv -y newlv_master -v datavg lv_master

cplv: Logical volume lv_master successfully copied to newlv_master .



# cplv -y newlv_proc -v datavg lv_proc

cplv: Logical volume lv_proc successfully copied to newlv_proc .


2 拷贝lv后datavg 的lv信息如下:

# lsvg -l datavg

datavg:

LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT

lv_backup jfs2 320 320 1 open/syncd /backup

loglv00 jfs2log 1 1 1 open/syncd N/A

newlv_master raw 10 10 1 closed/syncd N/A

newlv_proc raw 10 10 1 closed/syncd N/A


三、更改lv名字

1 更改原rootvg上sybaselv的名字

chlv命令参数解释如下:

-n 为新lv名字

# chlv -n oldlv_master lv_master

# chlv -n oldlv_proc lv_proc


2 更改datavg上lv名字(由newlv_master--> lv_master| newlv_proc-->lv_proc)

# chlv -n lv_master newlv_master

# chlv -n lv_proc newlv_proc

四、启动服务后测试情况如下


1 启动主服务和备份服务

$ startserver -f RUN_CRM

$ startserver -f RUN_CRM_back


2 验证

如下可看到sybase主备服务已经启动成功

$ showserver

USER PID %CPU %MEM SZ RSS TTY STAT STIME TIME COMMAND

sybase 319558 2.0 2.0 25564 17188 pts/1 A 11:42:25 0:03 /sybase/ASE-12_5/bin/dataserver -sCRM -d/dev/rlv_master -e/sybase/ASE-12_5/install/CRM.log -c/sybase/ASE-12_5/CRM.cfg -M/sybase/ASE-12_5

sybase 286878 0.0 1.0 7016 7440 pts/1 A 11:43:14 0:00 /sybase/ASE-12_5/bin/backupserver -SCRM_back -e/sybase/ASE-12_5/install/CRM_back.log -Ldefault -Jcp850 -N25 -C20 -M/sybase/ASE-12_5/bin/sybmultbuf

验证下master库能否备份,如下:

$ isql -Usa -P -SCRM

1> dump database master to '/backup/master2.dat'

2> go

WARNING: In order to LOAD the master database, the SQL Server must run in

single-user mode. If the master database dump uses multiple volumes, you must

execute sp_volchanged on another SQL Server at LOAD time in order to signal

volume changes.

Backup Server session id is: 5. Use this value when executing the

'sp_volchanged' system stored procedure after fulfilling any volume change

request from the Backup Server.

Backup Server: 4.41.1.1: Creating new disk file /backup/master2.dat.

Backup Server: 6.28.1.1: Dumpfile name 'master132960A524 ' section number 1

mounted on disk file '/backup/master2.dat'

Backup Server: 4.58.1.1: Database master: 4546 kilobytes DUMPED.

Backup Server: 4.58.1.1: Database master: 4716 kilobytes DUMPED.

Backup Server: 4.58.1.1: Database master: 4888 kilobytes DUMPED.

Backup Server: 4.58.1.1: Database master: 5058 kilobytes DUMPED.

Backup Server: 4.58.1.1: Database master: 5230 kilobytes DUMPED.

Backup Server: 4.58.1.1: Database master: 5400 kilobytes DUMPED.

Backup Server: 4.58.1.1: Database master: 5572 kilobytes DUMPED.

Backup Server: 4.58.1.1: Database master: 5710 kilobytes DUMPED.

Backup Server: 3.43.1.1: Dump phase number 1 completed.

Backup Server: 3.43.1.1: Dump phase number 2 completed.

Backup Server: 3.43.1.1: Dump phase number 3 completed.

Backup Server: 4.58.1.1: Database master: 5718 kilobytes DUMPED.

Backup Server: 3.42.1.1: DUMP is complete (database master).




向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI