ASE如何动态(不重启服务)切换错误日志

以前教程中都说切换日志的话,需要先down掉服务,在cp日志文件到其他地方,但是在12.5之后多了个存储过程sp_errorlog,可以实现动态切换日志,

用法如下

sp_errorlog 'change log','/opt/sybase/ASE-15_0/install/www3.log', 'jslog false'

 

详细介绍如下

 

sp_errorlog
Description Dynamically changes the path of the error log.
Syntax sp_errorlog “change log“, “new_path“ [,{“jslog true“ | “jslog false“}]
sp_errorlog “help”, “change log”
Parameters new_path
new path of the error log. Maximum length of new_path is 255 characters.
jslog true
the default option. If the Job Scheduler is running, change log attempts to
change the Job Scheduler Agent log to the directory where the new Adaptive
Server error log will reside. Both logs will indicate error messages, if any.
jslog false
do not change the location of the Job Scheduler Agent log.
Examples Example 1 To change the Adaptive Server error log to use a new location
without changing the location of the Job Scheduler log, use:
sp_errorlog 'change log',
'$SYBASE/$SYBASE_ASE/install/new.log', 'jslog false'
Adaptive Server error log location is changed to
$SYBASE/$SYBASE_ASE/install/new.log. However, the location of the Job
Scheduler Agent log is not changed.
Example 2 This example changes the error log location to
$SYBASE/$SYBASE_ASE/install/new.log.
If the Job Scheduler Agent is running, the agent log location is also changed to
$SYBASE/$SYBASE_ASE/install/new.log.
If the Job Scheduler Agent is not running, Adaptive Server does not change the
agent log location.You see a message that the agent log location is unchanged.
sp_errorlog 'change log',
'$SYBASE/$SYBASE_ASE/install/new.log', 'jslog true'
Example 3 This example changes the Adaptive Server error log to
$SYBASE/$SYBASE_ASE/install/new.log.
If the Job Scheduler Agent is running, the agent log is also changed to
$SYBASE/$SYBASE_ASE/install/new.log.
If the Job Scheduler Agent is not running, Adaptive Server does not change the
path of the Job Scheduler Agent log. You do not see a message that the agent
log location is unchanged.
sp_errorlog 'change log','$SYBASE/$SYBASE_ASE/install/new.log'

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值