473,386 Members | 1,973 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

How to find Log File usage ?

Hi,
How can I find out how much space has been used in the log file
and how much of it is free or yet to be used ?
Thanks,
Hype
Nov 12 '05 #1
4 12420
db2 command : Get snapshot for database ...
Log space available to the database (Bytes)
Log space used by the database (Bytes)
Maximum secondary log space used (Bytes)
Maximum total log space used (Bytes)
Secondary logs allocated currently
Log pages read
Log pages written

db2 sql udf : SNAPSHOT_DATABASE table function

PM

"hype" <hy********@yahoo.com> a écrit dans le message de
news:71**************************@posting.google.c om...
Hi,
How can I find out how much space has been used in the log file
and how much of it is free or yet to be used ?
Thanks,
Hype

Nov 12 '05 #2
I'm not aware of a easy way to gather this information, but what
should work is the following:
do a "snapshot for database" for the particular database. look for
these information:
Log space available to the database (Bytes)= 55185
Log space used by the database (Bytes) = 5044815

Divide "log space used" by the log file size for your database and you
will get a number which you must add to your "First active log file"
(you get this through the DB CFG). The resulting number should be the
logfile where DB2 actually writes in.

HTH
Joachim

PS: in V8 you can get the snapshot information via a SQL Table
function

hy********@yahoo.com (hype) wrote in message news:<71**************************@posting.google. com>...
Hi,
How can I find out how much space has been used in the log file
and how much of it is free or yet to be used ?
Thanks,
Hype

Nov 12 '05 #3
Thanks for the replies.
However,

with Circular logging, I see the following output always
despite running a few thousand insert statements.

Log space available to the database (Bytes)= 20400000
Log space used by the database (Bytes) = 0
Maximum secondary log space used (Bytes) = 0
Maximum total log space used (Bytes) = 0
Secondary logs allocated currently = 0
Log pages read = 1
Log pages written = 0
Appl id holding the oldest transaction = 0

But when I changed to archival logging, I see,

Log space available to the database (Bytes)= 20400000
Log space used by the database (Bytes) = 0
Maximum secondary log space used (Bytes) = 0
Maximum total log space used (Bytes) = 197575
Secondary logs allocated currently = 0
Log pages read = 1
Log pages written = 2372
Appl id holding the oldest transaction = 0

The "Log space used by the database (Bytes)" does not increase ?
What is the reason behind this, should I turn on some counters ?

Thanks,
Hype
Nov 12 '05 #4

Log pages written = 0
vs
Log pages written = 2372

If no log pages were yet written, there is not currently any used space in
the log files. (still in the buffer(s))

DB CFG LOGBUFSZ ?
mincommit may imply a 1 sec delay
auto commit is off?
Your update transaction commited? (Commit statements attempted and similar
elements in the snapshot data)

Some shapshot data require the timestamp switch on. (i don't think it's the
case here.)
You may use the database system monitor to determine how much of the log
buffer space

is used for a particular transaction (or unit of work).

Refer to the log_space_used (unit of work log space used) monitor element.

In v8 and maybe prior versions, you can write event monitor data to sql
tables.

I'm pretty sure both values would be the same. (sql snapshot vs get snapshot
command vs event monitor data)

Personnaly, i have no problems.

DB SALES_DB
Log retain for recovery enabled (LOGRETAIN) = OFF

+-1000 inserts...

db2 get snapshot for database on ***
Log space available to the database (Bytes)= 4852796
Log space used by the database (Bytes) = 247204
Maximum secondary log space used (Bytes) = 0
Maximum total log space used (Bytes) = 247204
Secondary logs allocated currently = 0
Log pages read = 0
Log pages written = 55

db2 get snapshot for database on ***
Commit statements attempted = 4
Internal commits = 5
PM

"hype" <hy********@yahoo.com> a écrit dans le message de
news:71**************************@posting.google.c om...
Thanks for the replies.
However,

with Circular logging, I see the following output always
despite running a few thousand insert statements.

Log space available to the database (Bytes)= 20400000
Log space used by the database (Bytes) = 0
Maximum secondary log space used (Bytes) = 0
Maximum total log space used (Bytes) = 0
Secondary logs allocated currently = 0
Log pages read = 1
Log pages written = 0
Appl id holding the oldest transaction = 0

But when I changed to archival logging, I see,

Log space available to the database (Bytes)= 20400000
Log space used by the database (Bytes) = 0
Maximum secondary log space used (Bytes) = 0
Maximum total log space used (Bytes) = 197575
Secondary logs allocated currently = 0
Log pages read = 1
Log pages written = 2372
Appl id holding the oldest transaction = 0

The "Log space used by the database (Bytes)" does not increase ?
What is the reason behind this, should I turn on some counters ?

Thanks,
Hype

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Joe Hershman | last post by:
all, not sure what the best place to post this one, hopefully someone can help because this is a real show stopper. i am getting the error shown below when i try to build a deployment project. ...
2
by: jlacefie | last post by:
Hello, I am having trouble with the following code using ASP.Net 2.0. I recieve an error on the line File.OpenRead(fPath) stating could not find file . The fPath comes from a textbox control...
4
by: isha123 | last post by:
how can i find the cpu usage of my windows XP SP2 machine from command line? And also how can i execute this command with Perl? or is there anyother way to find CPU usage for XP machine using Perl?
3
by: Amritha.Datta | last post by:
Can anyone tell me why the below code returns error? Exception Details: System.IO.FileNotFoundException: Could not find file Dim strLFolder As String = "c:\Temp\F Files" Dim intClientID As...
2
by: jjlagtap | last post by:
Hey everyone When I try to open a file i get the Exception listed below. The weird thing is it works when I run the web app locally and when i use a remote server and open a file on my computer....
0
by: Learning.Net | last post by:
I have a window application that uses ActiveX browser component for testing web site automatically using mshtml. Though application is running fine but there is abnormally high page file usage....
1
by: santhescript01 | last post by:
I have a window application that uses ActiveX browser component for testing web site automatically using mshtml. Though application is running fine but there is abnormally high page file usage....
0
by: chandan | last post by:
Hi All, I am creating a web setup Project using VS 2005.First time its works fine, But when I closed the solution and again open solution and try to build web setup project then there is an error...
0
by: Gabriel Genellina | last post by:
En Wed, 20 Aug 2008 17:10:15 -0300, aditya shukla <adityashukla1983@gmail.comescribió: You have 3 leading underscores in __main__ so the if statement is skipped and nothing happens. I'd use the...
6
by: =?Utf-8?B?U2NvdHQgVHJpY2s=?= | last post by:
I followed the instructions from MSDN for Webclient UploadFile and I get an error: Could not find file 'C:\testfile.xls'. If I add the file (c:\testfile.xls) to the server I do not get the error...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.