Sybase ASE Database Devices Administrator Guide (二)

Over this article,you will be learn how to use raw devices as the sybase database devices.The sybase recommand that you mirror the master device and don't specified the master as the system default disk,after installation.So you must reconfigure the system default disks and mirror the master device.This article based on aix with raw devices.

1.Creating some Logicle volumes on AIX:

 
 
  1. # mkvg -f -y datavg hdisk1  
  2. 0516-1254 mkvg: Changing the PVID in the ODM.  
  3. datavg 
  4. # mklv  -t raw -y sybdev01 datavg 5G  
  5. sybdev01  
  6. # mklv  -t raw -y sybdev02 datavg 5G  
  7. sybdev02  
  8. # mklv  -t raw -y syblog01 datavg 10G  
  9. syblog01 
  10. //Changing above raw devices owner to user sybase: 
  11. # ls -l /dev/rsyb*  
  12. crw-rw----    1 root     system       36,  1 Aug 20 09:25 /dev/rsybdev01  
  13. crw-rw----    1 root     system       36,  2 Aug 20 09:25 /dev/rsybdev02  
  14. crw-rw----    1 root     system       36,  3 Aug 20 09:26 /dev/rsyblog01 
  15. # chown sybase.sybase /dev/rsyb*  
  16. # chmod 660 /dev/rsyb* 
  17. # ls -l /dev/rsyb*  
  18. crw-rw----    1 sybase   sybase       36,  1 Aug 20 10:23 /dev/rsybdev01  
  19. crw-rw----    1 sybase   sybase       36,  2 Aug 20 10:23 /dev/rsybdev02  
  20. crw-rw----    1 sybase   sybase       36,  3 Aug 20 10:23 /dev/rsyblog01 

2.Initializing above raw devices

 
 
  1. 1> disk init name='sybdev01',physname='/dev/rsybdev01',vdevno=2,size='200M'  
  2. 2> go  
  3. Execution Time (ms.):    195            Clock Time (ms.):    195  
  4. 1> disk init name='sybdev02',physname='/dev/rsybdev02',vdevno=3,size='200M'  
  5. 2> go  
  6. Execution Time (ms.):    138            Clock Time (ms.):    138 
  7. 1> disk init name='syblog01',physname='/dev/rsyblog01',vdevno=4,size='500M'  
  8. 2> go  
  9. Execution Time (ms.):    216            Clock Time (ms.):    216 

The ASE server log output like this:

 
 
  1. #tail –f /sybase/ASE-15_0/install/H144129.log 
  2. 00:0002:00000:00021:2012/08/20 10:25:06.44 kernel Initializing virtual device 2, '/dev/rsybdev01' with dsync 'off'.  
  3. 00:0002:00000:00021:2012/08/20 10:25:06.44 kernel Virtual device 2 started using asynchronous i/o.  
  4. 00:0002:00000:00021:2012/08/20 10:25:46.04 kernel Initializing virtual device 3, '/dev/rsybdev02' with dsync 'off'.  
  5. 00:0002:00000:00021:2012/08/20 10:25:46.04 kernel Virtual device 3 started using asynchronous i/o.  
  6. 00:0002:00000:00021:2012/08/20 10:26:44.99 kernel Initializing virtual device 4, '/dev/rsyblog01' with dsync 'off'.  
  7. 00:0002:00000:00021:2012/08/20 10:26:44.99 kernel Virtual device 4 started using asynchronous i/o. 

Notice:

The initialization size can't great than raw size.If it great than raw size,you can see following errors:

 
 
  1. 00:0002:00000:00021:2012/08/20 09:59:24.59 kernel  basis_dsizecheck: attempt to write page 1572865 on device '/dev/rsybdev01' failed, system error is: No such device or address  
  2. 00:0002:00000:00021:2012/08/20 10:05:43.53 kernel  basis_dsizecheck: attempt to write page 1572865 on device '/dev/rsybdev02' failed, system error is: No such device or address 

3.Configuring the system default devices

Here i'm going to configure the sybdev01 as the system default device and unset the master devivce as the system device.You can configure one or more system default devices.

 
 
  1. 1> sp_diskdefault sybdev01,defaulton 
  2. 2> go 
  3. 1> sp_diskdefault master,defaultoff  
  4. 2> go  

Using the GUI tools to check current system default devices:

4.Mirroring devices

Before mirror,i'll create three raw devices:

 
 
  1. # mkvg -f -y stbydata hdisk2  
  2. 0516-1254 mkvg: Changing the PVID in the ODM.  
  3. stbydata  
  4. # mklv -t raw -y stby01 stbydata 3G  
  5. stby01  
  6. # r 01=02  
  7. mklv -t raw -y stby02 stbydata 3G  
  8. stby02  
  9. # mklv -t raw -y slog01 stbydata 6G  
  10. slog01  
  11. # chown sybase.sybase /dev/rstby*  
  12. # chown sybase.sybase /dev/rsl*  
  13. # chmod 660 /dev/rstby*  
  14. # chmod 660 /dev/rslo*  
  15. # ls -l /dev/rstby*  
  16. crw-rw----    1 sybase   sybase       37,  1 Aug 20 10:48 /dev/rstby01  
  17. crw-rw----    1 sybase   sybase       37,  2 Aug 20 10:48 /dev/rstby02  
  18. # ls -l /dev/rslo*  
  19. crw-rw----    1 sybase   sybase       37,  3 Aug 20 10:49 /dev/rslog01 

Now,i'm going to mirror following devices:sybdev01,sybdev02 and syblog01.

 
 
  1. 1> disk mirror name='sybdev01',mirror='/dev/rstby01',writes=noserial  
  2. 2> go 
  3. 1> disk mirror name='sybdev02',mirror='/dev/rstby02',writes=noserial  
  4. 2> go 
  5. 1> disk mirror name='syblog01',mirror='/dev/rslog01',writes=noserial  
  6. 2> go 

Viewing current mirrored devices by the GUI tools:

5.Unmirror the deivce:

 
 
  1. 1>disk umirror name='sybdev01',mode='remove' 
  2. 2>go 

If you specified mode with remove value,then you can't remirror the device.If you specified mode with retain value,you can remirror the device again.

6.Remirror the device:

 
 
  1. 1>disk remirror name='sybdev01' 
  2. 2>go 

7.Resize the ASE database devices:

 
 
  1. 1>USE master 
  2. 2>go 
  3. 1>disk resize name='sybdev01',size = '5120M',skip_alloc = true 
  4. 2>go 

Notice:

Before you resize the device,ensure that the raw device has enough space unused and it unmirrored.If you resize a mirrored device,you'll see following errors:

disk resize can proceed only when mirroring is permanently disabled.Unmirror secondary with mode ='remove' and re-execute disk resize command.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值