sybase ase15设备文件路径修改

原创 2013年06月21日 18:05:23

有时候安装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"

Sybase修改interfaces文件(ip、端口、服务名等)

标签: 杂谈 分类: 数据库 sybase的interfaces中存储了sybase的服务名、IP地址与端口,该文件在sybase用户主目录下,其修改方法有两种:1、通过dscp命令进行修改,示例...
  • davidmeng10
  • davidmeng10
  • 2015年12月17日 17:10
  • 2303

SYBASE存储过程详解

http://hi.baidu.com/smilejianai/item/1113b688704b59c599255f15     SYBASE存储过程详解     ...
  • iblessu
  • iblessu
  • 2013年05月14日 15:19
  • 12682

sybase 触发器创建

SYBASE触发器及应用2009-04-10 10:361 触发器的创建方法   一般地,创建触发器的语法如下:   Create Trigger触发器名称   On 表名&&指定所创建的触发器...
  • samrtian
  • samrtian
  • 2016年03月03日 18:29
  • 1026

Sybase IQ,你需要知道的基础

Sybase IQ,你需要知道的基础  Sybase IQ,你需要知道的基础: 第一,知道IQ跟其它的关系型数据库相比,它的主要特征是什么?包括查询快、数据压缩比高、Load快,但是插入更...
  • u014774781
  • u014774781
  • 2016年07月15日 11:49
  • 2116

Sybase的安装、配置及使用(五) Sybase数据库的常用工具说明

第五章  Sybase数据库的常用工具说明 Sybase的数据库安装目录中提供了我们常用的几种工具,依次打开开始->程序->Sybase,这里只说明我们常用的几种工具。如下图: 1.Dsedi...
  • payton_liu
  • payton_liu
  • 2014年12月02日 14:39
  • 585

教程番外1——设备实例与设备类

1 简述在教程1中,我们在INF文件中添加了一个自己的设备类,并为其分配了一个GUID,还定义了注册表项,先回顾一下INF文件中的相关部分:; 版本域 [Version] ... Class=HUST...
  • hustd10
  • hustd10
  • 2016年02月05日 17:40
  • 2344

SybaseASE系统表的应用

SybaseASE系统表的应用 一、 问题背景 在排查江西、湖南地区数字法院系统数据库CPU高和慢SQL问题时,发现系统中有很多简单的全表扫描SQL,原因是一些子表外键没有索引导致。 添加缺失外健索引...
  • wangzhen3798
  • wangzhen3798
  • 2017年05月31日 10:37
  • 238

SYBASE字符集的配置

一、修改客户端字符集 查看/sybase/locales/locales.dat  %sybase%/locales/locales.dat 找到对应操作系统下的字符集配置,如win...
  • xuepiaohan2006
  • xuepiaohan2006
  • 2014年03月18日 15:00
  • 648

sybase dump还原备忘

公司数据库人员走了,留下一个数据库
  • strSpecial
  • strSpecial
  • 2014年10月14日 09:50
  • 1898

Sybase 转换格式 convert(varchar(10),字段名,转换格式)

转自:http://blog.sina.com.cn/s/blog_8297f0d001013uqf.html   convert(varchar(10),字段名,转换格式) sybase下co...
  • liu76xt
  • liu76xt
  • 2015年05月27日 09:40
  • 6356
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:sybase ase15设备文件路径修改
举报原因:
原因补充:

(最多只允许输入30个字)