sybase ase15设备文件路径修改
2013-06-21 18:05
190 查看
有时候安装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.
Start Sybase ASE server, log to the Sybase Central as sa user and open tab Database devices.
Right click on master device and select properties.
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.
Right click on master device once again and select properties.
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).
As we can see from following picture, master device is now on new master data file:
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.
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
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.
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.
If everything is ok, then You can delete original master device file.
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.
Start Sybase ASE server, log to the Sybase Central as sa user and open tab Database devices.
Right click on master device and select properties.
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.
Right click on master device once again and select properties.
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).
As we can see from following picture, master device is now on new master data file:
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.
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
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.
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.
If everything is ok, then You can delete original master device file.
sp_configure "allow update to system tables"
相关文章推荐
- 如何查询和修改Linux操作系统生成core dump文件的默认路径
- 修改SQL Server 2005/2008 用户数据库文件默认路径和默认备份路径
- 如何修改服务中可执行文件的路径
- springMVC学习笔记---修改配置文件路径和传递数据
- LINUX-添加和修改文件搜索路径PATH变量
- 搭建strus2,修改struts.xml配置文件的路径后报错
- 修改jeesite默认文件上传路径的方法
- 超简单的升级包制作(直接覆盖相应的路径下文件)无注册表修改
- 开博第一篇——通过修改.class文件来解除构建路径错误
- CFileDialog 读/写文件时修改了程序的当前路径
- .htaccess修改服务器php.ini文件路径
- Windows无法访问指定设备路径或文件,您可能没有合适的权限访问这个项目
- linux 修改shell的执行文件路径
- Android设备修改host文件以及修改设备网关
- 在Windows下Android Studio配置文件路径修改
- 修改master库文件路径
- $(inherited) "$(SRCROOT) 修改.a文件的路径 --Library Search Paths
- oracle 修改表空间文件路径方法
- IntelliJ IDEA2017 修改缓存文件的路径(转载:https://www.cnblogs.com/acm-bingzi/p/ideaCachePath.html)
- c++判断硬盘是否连接、修改指定盘符、读取配置文件、获取exe路径