sybase ASE日誌溢出解決方式探究,sybasease

來源:互聯網
上載者:User

sybase ASE日誌溢出解決方式探究,sybasease


1.準備資料庫環境

--建立裝置disk init name='dat1',physname='/opt/sybase/data/dat1',size='1M'disk init name='log1',physname='/opt/sybase/data/log1',size='1M'--裝置太小,擴充disk resize name='dat1',size='1M'--建立資料庫create database test on dat1='2M' log on log1='1M'


2.插入資料一直到日誌滿

use testgocreate table person(name varchar(64)) insert into person values('name')insert into person select * from person--truncate table persondbcc checktable('syslogs')


3.出現現象如下

1.free為7%,進程出現logsuspend狀態,資料庫日誌中出現 xtasks are sleeping .for space to become available in the log segment for database test2.進程狀態為LOGSUSPEND

 

4.經測試,執行如下操作可以解決問題

1.如果 syslogshold無資料,則可以直接執行dump transaction test with truncate_only

2.如果 syslogshold有資料,則直接執行dump transaction test with truncate_only,可能報如下錯誤

‘DUMP TRANSACTION for database 'test' could not truncate the log. Either extend the log using ALTER DATABASE ... LOG ON command or eliminate the oldest active transaction in database 'test' shown in syslogshold table.’

 這個時候可以選擇三種方式進行處理

     1.kill進程,用kill with status_only監控復原進度

     2.重啟服務

     3.增加裝置

 重啟方式測試:

 

[root@sybasehost ~]# isql -Usa -P -S ASE12_5_4                                                                                1> shutdown  2> go2 task(s) are sleeping waiting for space to become available in the log segmentfor database test.

日誌中出現如下資訊:

SHUTDOWN is waiting for 1 process(es) to complete.SHUTDOWN is waiting for 1 process(es) to complete.

進程hang住,這時從另外一個視窗進去,用shutdown with nowait停掉,然後重啟,重啟後使用者庫標紅,狀態為suspend

執行執行online database test,報錯如下

 

  SQL Server could not bring database 'test' online.


執行dump transaction test with truncate_only,然後online database test成功

 

增加裝置方式測試

disk init name='log2',physname='/opt/sybase/data/log2',size='1M'alter database test log on log2   ='1M'

顯示執行成功

Extending database by 512 pages (1.0 megabytes) on disk log2Warning: Using ALTER DATABASE to extend the log segment will cause user thresholds on the log segment within 128 pages of the last chance threshold to be disabled.執行時間: 1.471 秒


原來掛起的進程自動繼續執行

已插入 8192 行Space available in the log segment has fallen critically low in database 'test'.  All future modifications to this database will be suspended until the log is successfully dumped and space becomes available.The transaction log in database test is almost full.  Your transaction is being suspended until space is made available in the log.執行時間: 158.9 秒


 

總結:

 

出現日誌掛起,可以採用三種方式處理

     1.kill進程,用kill with status_only監控復原進度

     2.重啟服務,記著要用shutdown with nowait,重啟後要先截斷日誌再online資料庫

     3.增加裝置


 


sybase 錯誤記錄檔在哪看

12.0版本以前直接在安裝目錄下的install目錄
12.0版本以後在sybase安裝目錄下 ASE-12_x 目錄下的install目錄
 
sybase ASE 125使用問題

sybooks.sybase.com/nav/base.do

這是SYBASE所有的官方文檔。
ASE12.5的文檔有中文的:
infocenter.sybase.com/...le.htm
 

相關文章

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.