Sybase database: Log is too large to start

Source: Internet
Author: User
Tags documentation log reserved sybase sybase database

Q: There is a question about Sybase: I open the database always remind: Cannot open transaction log file-----cannot use log file "Hms2000.log" since it is shorter than experted. I directly deleted the log, also can not start normally, said the file could not be found. Excuse me, what's going on here? Attach an error log record:

I. 10/09 09:58:38. Sybase Adaptive Server Anywhere network server Version 7.0.2.1402
I. 10/09 09:58:38. This software contains confidential and trade secret information of
I. 10/09 09:58:38. Sybase, INC use, duplication or disclosure of the software and
I. 10/09 09:58:38. Documentation by the U.S. Government are subject to restrictions set forth
I. 10/09 09:58:38. In a license agreement between the government and Sybase, Inc. or other
I. 10/09 09:58:38. Written agreement specifying the government ' s rights to-use the software
I. 10/09 09:58:38. and any applicable FAR provisions, for example, FAR 52.227-19.
I. 10/09 09:58:38.
I. 10/09 09:58:38. Copyright 1989-2000 Sybase, Inc. All rights reserved.
I. 10/09 09:58:38. All unpublished rights reserved.
I. 10/09 09:58:38.
I. 10/09 09:58:38. Sybase, Inc 6475 Christie Avenue, Emeryville, CA 94608, USA
I. 10/09 09:58:38. Networked Seat (per-seat) model. Access to the server is limited to seat (s).
I. 10/09 09:58:38. This server was licensed to:
I. 10/09 09:58:38. Lb
I. 10/09 09:58:38.
I. 10/09 09:58:38. 10240K of memory used for caching
I. 10/09 09:58:38. Minimum cache size:10240k, maximum cache size:230848k
I. 10/09 09:58:38. Using a maximum page size of 1024 bytes
I. 10/09 09:58:38. Starting database "XXXXXXX" (C:\Program files\sybase\ Data server \xxxxxxx.db) at Sun Oct 09 2005 09:58
I. 10/09 09:58:38. Database Recovery in progress
I. 10/09 09:58:38. Last checkpoint at Sat Oct 08 2005 19:15
I. 10/09 09:58:38. Checkpoint log ...
I. 10/09 09:59:03. Transaction log:xxxxxxx. LOG ...
E. 10/09 09:59:03. Error:cannot Open transaction log file-Can ' t use log file ' XXXXXXX. LOG "Since it is shorter than expected
I. 10/09 09:59:03. Error:cannot Open transaction log file-Can ' t use log file ' XXXXXXX. LOG "Since it is shorter than expected
E. 10/09 09:59:03. Cannot open transaction log file-Can ' t use log file ' XXXXXXX. LOG "Since it is shorter than expected
I. 10/09 09:59:04. Database server stopped at Sun Oct 09 2005 09:59
I. 10/09 10:58:33. Sybase Adaptive Server Anywhere network server Version 7.0.2.1402
I. 10/09 10:58:33. This software contains confidential and trade secret information of
I. 10/09 10:58:33. Sybase, INC use, duplication or disclosure of the software and
I. 10/09 10:58:33. Documentation by the U.S. Government are subject to restrictions set forth
I. 10/09 10:58:33. In a license agreement between the government and Sybase, Inc. or other
I. 10/09 10:58:33. Written agreement specifying the government ' s rights to-use the software
I. 10/09 10:58:33. and any applicable FAR provisions, for example, FAR 52.227-19.
I. 10/09 10:58:33.
I. 10/09 10:58:33. Copyright 1989-2000 Sybase, Inc. All rights reserved.
I. 10/09 10:58:33. All unpublished rights reserved.
I. 10/09 10:58:33.
I. 10/09 10:58:33. Sybase, Inc 6475 Christie Avenue, Emeryville, CA 94608, USA
I. 10/09 10:58:33. Networked Seat (per-seat) model. Access to the server is limited to seat (s).
I. 10/09 10:58:33. This server was licensed to:
I. 10/09 10:58:33. Lb
I. 10/09 10:58:33.
I. 10/09 10:58:33. 10240K of memory used for caching
I. 10/09 10:58:33. Minimum cache size:10240k, maximum cache size:230848k
I. 10/09 10:58:33. Using a maximum page size of 1024 bytes
I. 10/09 10:58:33. Starting database "XXXXXXX" (C:\Program files\sybase\ Data server \xxxxxxx.db) at Sun Oct 09 2005 10:58
I. 10/09 10:58:33. Database Recovery in progress
I. 10/09 10:58:33. Last checkpoint at Sat Oct 08 2005 19:15
I. 10/09 10:58:33. Checkpoint log ...
I. 10/09 10:58:55. Transaction log:xxxxxxx. LOG ...
E. 10/09 10:58:55. Error:cannot Open transaction log file-Can ' t use log file ' XXXXXXX. LOG "Since it is shorter than expected
I. 10/09 10:58:55. Error:cannot Open transaction log file-Can ' t use log file ' XXXXXXX. LOG "Since it is shorter than expected
E. 10/09 10:58:55. Cannot open transaction log file-Can ' t use log file ' XXXXXXX. LOG "Since it is shorter than expected
I. 10/09 10:58:57. Database server stopped at Sun Oct 09 2005 10:58

A: The first thing to determine is that the method of deleting the log directly is undesirable. Your problem, because the log is not timely collation caused itself too large, so that the database can not start normally.

We know that SYBASE SQL Server uses transactions (Transaction) to track changes in all databases. A transaction is a unit of work for SQL Server. A transaction contains one or more T-SQL statements that are executed as a whole. Each database has its own transaction log (Transaction log), which is the system table (syslogs). The transaction log automatically records each transaction issued by each user. Log for the data security and integrity of the database is essential, we must be familiar with the database development and maintenance knowledge of the log.

I. How SYBASE SQL Server logs and reads log information

SYBASE SQL Server is the first log-memory mechanism. Whenever a user executes a statement that will modify the database, SQL Server automatically writes the changes to the log. All the changes generated by a statement are recorded in the log, and they are written to the data page in a copy of the buffer. The data page is saved in a buffer, and the data page is written to disk until the memory is required by another data page. If a statement in a transaction does not complete, SQL Server rolls back all the changes generated by the transaction. This ensures the consistency and integrity of the entire database system.

Second, the log equipment

Log and database data, need to be stored on the database device, log and data can be stored on the same device, can also be stored separately. In general, you should store the data and log of a database on different database devices. This has the following advantages: First, you can back up the backup transaction log separately, the other is to prevent the database overflow, the third is to see log space usage.

There is no very precise way to determine the size of the log device being built. In general, for a new database, the log size should be about 30% of the size of the database. The log size also depends on how frequently the database is modified. If the database is modified frequently, the log grows very quickly. So the log space size depends on how the database is used by the user. In addition, there are other factors affecting the log size, we should be based on the actual operation of the estimated log size, and interval of time to back up and clear the log.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.