H Pawel,
Thank so much for your quick response, your suggestion about disk mirroring seems to be possible approach for me. I found a tutorial of Sybase (SyBooks Online) for using disk mirroring to remove a device, but the tutorial does not include a step that create/alter a database on the mirrored device. Therefore I can not confirm this solution can be applied for my case, I will try and let you know the result soon.
About the sp_dbxt_extend_db store procedure, I can locate it under syssystemprocs database. But it will take time to understand the logic, and then I can modify for my purpose. Besides it, there is a approach by using sysusages and sysdevices as below. That is not very efficient, but we can avoid modifying system procedure of Sybase
select db_name(u.dbid) as "DBName",d.name as "DevName",
1.00 * u.size * @@maxpagesize / 1024.00 / 1024.00 as "SizeMb",
u.crdate as “CreateDate”, d.resizedate as “ResizeDate”
FROM master..sysusages u INNER JOIN master..sysdevices d ON u.vdevno = d.vdevno
AND d.status & 2 = 2
WHERE u.dbid = db_id('MyDB')
ORDER BY u.dbid, d.name
Again, I really appreciate for your help. I continue investigating and let you know the result soon.
Thanks
Khoa Tran