Sybase 移機方式

完整的資料移機,使用 dump, load database, bcp

安裝部分

安裝過程不贅述,但是記得確認下列資訊

  1. page size 如果沒有要升級,記得設定為一樣
isql -Usa -SSybaseServer -w1000 -e -n

將原 master 相關資訊倒入新機

這部分將會使用 bcp ,所以代表平常要用 bcp 備份 master 的部分 table,然而我下面僅會列出平常有用到的,如果你的架構有更複雜的設定,千萬不要忘記同時也要備份相關的 table。 我平常會備份之 table

  1. master.sysdevices (參考用,不會倒回去,這個要手動重新產生)
  2. master.sysloginroles
  3. master.syslogins
  4. master.syssrvroles
  5. master.sysusages
sp_configure "allow updates", 1

bcp master..syslogins in D:\backup\20111210\syslogins_20111210_modify.txt -Usa -Ssybase -b 1 -c
bcp master..syssrvroles in D:\backup\20111210\syssrvroles_20111210_modify.txt -Usa -Ssybase -b 1 -c
bcp master..sysloginroles in D:\backup\20111210\sysloginroles_20111210.txt -Usa -Ssybase -b 1 -c

update sysservers set srvnetname='SYBASE_BS' where srvid=1

disk init name = "MIS_T_data01", physname = "D:\sybase\data\MIS_T_data01.dat", size = "2G"
disk init name = "MIS_T_data02", physname = "D:\sybase\data\MIS_T_data02.dat", size = "2G"
disk init name = "MIS_T_data03", physname = "D:\sybase\data\MIS_T_data03.dat", size = "2G"
disk init name = "MIS_T_data04", physname = "D:\sybase\data\MIS_T_data04.dat", size = "2G"
disk init name = "MIS_T_data05", physname = "D:\sybase\data\MIS_T_data05.dat", size = "2G"
disk init name = "MIS_T_data06", physname = "D:\sybase\data\MIS_T_data06.dat", size = "2G"
disk init name = "MIS_T_log01", physname = "D:\sybase\data\MIS_T_log01.dat", size = "2G"
disk init name = "MIS_T_log02", physname = "D:\sybase\data\MIS_T_log02.dat", size = "2G"
disk init name = "MIS_T_log03", physname = "D:\sybase\data\MIS_T_log03.dat", size = "2G"
disk init name = "MIS_T_log04", physname = "D:\sybase\data\MIS_T_log04.dat", size = "2G"
CREATE DATABASE MIS_T ON MIS_T_data01 = '2G', MIS_T_data02 = '2G', MIS_T_data03 = '2G', MIS_T_data04 = '2G', MIS_T_data05 = '2G', MIS_T_data06 = '2G' log ON MIS_T_log01 = '2G', MIS_T_log02 = '2G', MIS_T_log03 = '2G', MIS_T_log04 = '2G' for load
LOAD DATABASE MIS_T from "D:\backup\20111210\MIS_T_20111210060114.dmp"

disk init name = "MIS_E_data01", physname = "D:\sybase\data\MIS_E_data01.dat", size = "2G"
disk init name = "MIS_E_log01", physname = "D:\sybase\data\MIS_E_log01.dat", size = "2G"
CREATE DATABASE MIS_E ON MIS_E_data01 = '2G' log ON MIS_E_log01 = '2G' for load

disk init name = "MIS_E_TRG_data01", physname = "D:\sybase\data\MIS_E_TRG_data01.dat", size = "2G"
disk init name = "MIS_E_TRG_log01", physname = "D:\sybase\data\MIS_E_TRG_log01.dat", size = "2G"
CREATE DATABASE MIS_E_TRG ON MIS_E_TRG_data01 = '2G' log ON MIS_E_TRG_log01 = '2G' for load

disk init name = "MIS_T_NEW_data01", physname = "D:\sybase\data\MIS_T_NEW_data01.dat", size = "2G"
disk init name = "MIS_T_NEW_log01", physname = "D:\sybase\data\MIS_T_NEW_log01.dat", size = "2G"
CREATE DATABASE MIS_E_NEW ON MIS_E_NEW_data01 = '2G' log ON MIS_E_NEW_log01 = '2G' for load

disk init name = "MIS_T_NEW_TRG_data01", physname = "D:\sybase\data\MIS_T_NEW_TRG_data01.dat", size = "2G"
disk init name = "MIS_T_NEW_TRG_data02", physname = "D:\sybase\data\MIS_T_NEW_TRG_data02.dat", size = "2G"
disk init name = "MIS_T_NEW_TRG_log01", physname = "D:\sybase\data\MIS_T_NEW_TRG_log01.dat", size = "2G"
disk init name = "MIS_T_NEW_TRG_log02", physname = "D:\sybase\data\MIS_T_NEW_TRG_log02.dat", size = "2G"
CREATE DATABASE MIS_E_NEW_TRG ON MIS_E_NEW_TRG_data01 = '2G',MIS_T_NEW_TRG_data02='2G' log ON MIS_E_NEW_TRG_log01 = '2G',MIS_T_NEW_TRG_log02='2G' for load

disk init name = "MIS_T_TRG_data01", physname = "D:\sybase\data\MIS_T_TRG_data01.dat", size = "2G"
disk init name = "MIS_T_TRG_log01", physname = "D:\sybase\data\MIS_T_TRG_log01.dat", size = "2G"
CREATE DATABASE MIS_T_TRG ON MIS_T_TRG_data01 = '2G' log ON MIS_T_TRG_log01 = '2G' for load

待續

sybase/move.txt · 上一次變更: 2011/12/13 03:43 由 jal
上一頁 | 下一頁 | 回首頁 | RSS Feed | Facebook