现在的位置: 首页 > 综合 > 正文

sybase ase15设备文件路径修改

2019年08月02日 ⁄ 综合 ⁄ 共 5116字 ⁄ 字号 评论关闭

有时候安装sybase是默认安装的,设备文件默认在$SYBASE/data目录下,安装完后有时根据应用需要将设备文件迁移到其他路径,在网上查了下,发现目前新资料不多,已有的信息多是sybase 12.0以前的东西,指导性不强。 我的环境为SLES11SP2  +  SYBASE ASE 15.5

1. 对于master设备的迁移,可以直接采用操作系统cp或mv命令移动到新路径,然后修改RUN文件中master设备的新路径就ok,当然这是在停止服务的情况下

 

2.  迁移其他设备文件

 A.   登入sybase 系统  ,执行 sp_configure  "allow update to system tables",1

B. 修改路径,以test设备、sysprocsdev 、tempdbdev 为例

1> select name,phyname from master..sysdevices
2> go
 name                           phyname                                                                                                                        
 ------------------------------ -------------------------------------------------------------------------------------------------------------------------------
 master                         /home/sybase/data/master.dat                                                                                                   
 tapedump1                      /dev/nst0                                                                                                                      
 tapedump2                      /dev/nst1                                                                                                                      
 sysprocsdev                    /home/sybase/data/sysprocs.dat                                                                                                 
 systemdbdev                    /home/sybase/data/sybsysdb.dat                                                                                                 
 tempdbdev                      /home/sybase/data/tempdbdev.dat                                                                                                 
 testdatadev                    /home/sybase/data/testdatadev.dat                                                                                               
 testlogdev                     /home/sybase/data/testlogdev.dat                                                                                                
 

update master..sysdevices set phyname='/data/aa/testdatadev.dat' where name='testdatadev' 
update master..sysdevices set phyname='/data/aa/testlogdev.dat' where name='testlogdev'

update master..sysdevices set phyname='/data/aatempdbdev.dat' where name='tempdbdev'
update master..sysdevices set phyname='/data/aa/sysprocs.dat' where name='sysprocsdev' 
update master..sysdevices set phyname='/data/aa/sybsysdb.dat' where name='systemdbdev'

C.执行 sp_configure "allow update to system tables",0

D. 关闭后,用系统命令移动用户库设备文件到新路径,然后正常启动

3. 采用镜像方法可以在在线迁移数据,停机时间更少,这是在google搜到的一篇英文文章,有较强的指导性

  http://www.dba-sybase.com/case_study_27.php

===============================================以下为文章原文================================

  • Platform: All
  • Sybase ASE version: All
  • Background story: I've been egoistically searching through google for my name, and found one old post I've forgot, regarding this subject, and now I would like to publish it.
  • Task: Describe a process of moving master device to new location.
  • Solution:This can be very helpful if You want to move master device to another location, for example, during standard installtion, it is set to standard location, and now You would like
    to move it to another. The easiest way to do this is by using device mirroring. In text which follow I am going to describe this process.

    1. Start Sybase ASE server, log to the Sybase Central as sa user and open tab Database devices.
    2. Right click on master device and select properties.
    3. In master device properties, open Mirror tab and set options as shown in picture, set new master data file name and location, and click OK.

      With this step we set a mirror of master data file to another file.

    4. Right click on master device once again and select properties.
    5. In master device properties, open Mirror tab and set options as shown in picture:

      With this step we unmirror master data file from primary(old) to secondary(new).

    6. As we can see from following picture, master device is now on new master data file:

    7. Shutdown Sybase ASE and remove old master data file from original folder to some temporay location. DO NOT DELETE ORIGINAL MASTER FILE UNTIL PROCESS IS FINISHED.
    8. Now, Sybase ASE startup script should be changed. Find Your $SYBASE\install folder and edit RUN_your_sybase_database_server_name script. 
      You will see that in this file, location of original master data file is entered. Change that entry with new master data file name and location.

      For example, original line would be: 
      C:\Sybase15\ASE-15_0\bin\sqlsrvr.exe -dC:\Sybase15\data\master.dat -sUSERX15 -eC:\Sybase15\ASE-15_0\install\USERX15.log -iC:\Sybase15\ini -MC:\Sybase15\ASE-15_0 

      Change it to:
      C:\Sybase15\ASE-15_0\bin\sqlsrvr.exe -dC:\Sybase15\data\master_new.dat -sUSERX15 -eC:\Sybase15\ASE-15_0\install\USERX15.log -iC:\Sybase15\ini -MC:\Sybase15\ASE-15_0

    9. For Sybase on UNIX this is the end of the process. Now You can start Your ASE by executing RUN_your_sybase_database_server_name script.
    10. For Windows, becauase You can start Sybase also through services.msc console, which reads Sybase startup parameters from another location one step more is needed.
      Type regedit.exe, open registry and go to the following entry:
      HKEY_LOCAL_MACHINE\SOFTWARE\SYBASE\Server\your_sybase_database_server_name\Parameters and look at the parameter Arg0
      You will see that is showing on old master device file. As in earlier step, change it to point to new master device file.
      Now start Sybase through services.msc or by executing RUN_your_sybase_database_server_name script.
    11. If everything is ok, then You can delete original master device file.

 

 

 

sp_configure  "allow update to system tables"

抱歉!评论已关闭.