Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Truncate a Log File

Posted on 2006-11-10
4
Medium Priority
?
3,230 Views
Last Modified: 2008-01-09
I am new to adaptive server anywhere, I have a log file that I want to trunacte is there a tool in sybase central that can do that
0
Comment
Question by:brogrimes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 

Expert Comment

by:Veneno
ID: 17915151
I don't know if there is such a tool on Sybase Central. But try to run this command while logged to Sybase or on your Database Manager software:

dump tran [database_name] with truncate_only

or

dump tran [database_name] with no_log
0
 
LVL 24

Expert Comment

by:Joe Woodhouse
ID: 17920568
In Sybase Central, right click on the database, you should get an option for Backup/Restore/Dump. (Don't have it in front of me, can't remember the exact menu option.)

You should know that both "dump tran ... with truncate_only" and "... with no_log" will disable all regular transaction (incremental) dumps in a database until a full dump database is done. This can be very important in production databases!

Further, "no_log" has some risks associated with it. You should regard it as last resort, only for when all other versions of "dump tran" fail.
0
 
LVL 3

Expert Comment

by:knel1234
ID: 17973126
Hi,

If you have transactions logs as part of your recovery plan, then I would do the following.  First, dump tran [database name] with truncate_only (Joes suggestion).  Second, immediately dump the database.  Note, until you dump the db you will be at risk for recovery.  You probably should do a little research into why this has occurred.  Long running transaction (was it valid/invalid), developers missing commits, users not committing, etc.

cheers
knel
0
 
LVL 3

Accepted Solution

by:
knel1234 earned 1500 total points
ID: 18006214
Hi,

I occurs to me that you asked us about truncating the Log File.  I am think now that you meant the text file that is produce by Sybase for Information and error messages about your running server.  Follow the instructions below to download and install.  Then  in a cmd window run the following
copy srv_log_file.log srv_log_file_archive.log
"tail -1000 srv_log_file.log > srv_log_file_trim.log" - this takes the last (tail) 1000 lines adjust this number as desired
review and make sure you have the information/error messages for the time period you desire
"copy srv_log_file_trim.log srv_log_file.log"

knel


SUMMARY: Display the most recent results of a log file with the tail command for Windows XP.
 
The tail command, on most Unix-style operating systems, lets you display the last 10 or so lines of a text file. It also supports a feature allowing you to keep a file lock on a particular file, displaying new lines as they appear. This is most commonly used for displaying the results of log or debug files, letting you see only the most recent activity of a particular process.

While Windows XP does not normally come with a 'tail' tool, it is available in the Windows 2003 Resource Kit. It is a large download, but besides the 'tail' command, the Windows 2003 Resource Kit also provides tools to remap keys, query the Active Directory, and more. To download and install the Resource Kit:

1. Go to the Microsoft Windows Server 2003 download section at http://www.microsoft.com/windowsserver2003/
downloads/tools/default.mspx. Or, if that link does not work, visit http://www.microsoft.com/ and search for "Windows 2003". Once there, choose the "Downloads -> Tools" link.

2. Select the link "Windows Server 2003 Resource Kit Tools".

3. Click the "Download" link. Choose to register or not, depending on your choice, and follow the on-screen instructions to download and install the product. The default install directory is "C:\Program Files\Windows Resource Kits\Tools\".

Once the Windows 2003 Resource Kit is installed, you may need to reboot your machine for the directory "C:\Program Files\Windows Resource Kits\Tools\" to be added to your path.

Now that the tail command is available, to see the online help, enter the following DOS command:

tail /?
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question