A storage migration can cause a major outage on your database which is never a good idea.
If your ASE system is using RAW devices we can reduce our outage by using the mirror command.
First connect your new storage device to the OS via whatever your preferred method.
Note: I symlink my raw devices under /dev/sybase for better reading, hence the short names.
This is the starting situation with the original data device on the old storage array:
[21] KCL01.master.1> sp_helpdevice
[21] KCL01.master.2> go
device_name physical_name description status cntrltype vdevno vpn_low vpn_high
————– ———————- ————————————————————————————— — — — – ———
datadev0 /dev/sybase/KCL01data0 raw device, special, dsync off, directio off, physical disk, 32788.00 MB, Free: 26358.00 MB 2 0 8 0 16787455
Next we setup a mirror on a data device to the raw device on the new storage array.
[22] KCL01.master.1> disk mirror name = ‘datadev0’, mirror = ‘/dev/sybase/KCL01data00’, writes = ‘serial’
[22] KCL01.master.2> go
…3286016 pages mirrored…
3286528 pages mirrored…
3287040 pages mirrored…
3287552 pages mirrored…
3288064 pages mirrored…
3288576 pages mirrored…
3289088 pages mirrored…
3289600 pages mirrored…
3290112 pages mirrored…
3290624 pages mirrored…
3291136 pages mirrored…
3291648 pages mirrored…
3292160 pages mirrored…
The remaining 13495296 pages are currently unallocated and will be mirrored as they are allocated.
Now we have a functional device mirror and are writing all changes to both devices. For large data devices the copy might take a while but your databases will not be locked during the copy.
[23] KCL01.master.1> sp_helpdevice datadev0;
device_name physical_name description status cntrltype vdevno vpn_low vpn_high
———— ———————- ————————————————————————————————————————————————————————— —— ——— —— ——- ——–datadev0 /dev/sybase/KCL01data0 raw device, special, MIRROR ENABLED, mirror = ‘/dev/sybase/KCL01data00’, serial writes, dsync off, directio off, reads mirrored, physical disk, 32788.00 MB, Free: 26358.00MB 738 0 8 0 16787455
(1 row affected)
dbname size allocated vstart lstart
———- ————- ——————- ——- ——–
sysadmin 100.00 MB Jan 9 2015 7:12PM 0 0
dbmon 10.00 MB Jan 14 2015 9:05AM 3287040 0
testdb 6320.00 MB Jul 6 2017 5:38AM 51200 63488000(1 row affected, return status = 0)
Once the copy is complete we break the mirror to the old storage.
[24] KCL01.master.1> disk unmirror name = ‘datadev0’, side = ‘primary’, mode = ‘remove’;
Checkout the end result
[25] KCL01.master.1> sp_helpdevice datadev0;
device_name physical_name description status cntrltype vdevno vpn_low vpn_high
———– —————————- ——————————————————————————————- —— ——— —— ——- ——–
datadev0 /dev/sybase/KCL01data00 raw device, special, dsync off, directio off, physical disk, 32788.00 MB, Free: 26358.00 MB 2 0 8 0 16787455(1 row affected)
dbname size allocated vstart lstart
———- ————- ——————- ——- ——–
sysadmin 100.00 MB Jan 9 2015 7:12PM 0 0
dbmon 10.00 MB Jan 14 2015 9:05AM 3287040 0
testdb 6320.00 MB Jul 6 2017 5:38AM 51200 63488000
Repeat for every raw device on the old storage array.