473,507 Members | 12,744 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how UDB reuse the Secondary Log Files

Hi All

In the Circular Logging when the Primary Log file fill up, the
database manager will creat a secondary log files for the transaction;
when this transaction finished, the secondary log files still
allocated in log directory; when all application disconnect from
database or database reactive or database restart the secondary log
files will be deleted from log directory. For each transaction log
request, database manager always first look primary log, if it is no
reuseable in primary log, then move to secondary log.

My question is
how database manager use the already allocated secondary log file?
if one transaction log is using 10% of one secondary log file, and
same time will another transaction log use the rest of 90% of same
secondary log file?
if one transaction log need to move to secondary log, does it use
existed one or to allocate new one?

Any help will be very useful
Hank
Nov 12 '05 #1
7 2825

"hank" <ga****@hotmail.com> wrote in message
news:8d**************************@posting.google.c om...
Hi All

In the Circular Logging when the Primary Log file fill up, the
database manager will creat a secondary log files for the transaction;
when this transaction finished, the secondary log files still
allocated in log directory; when all application disconnect from
database or database reactive or database restart the secondary log
files will be deleted from log directory. For each transaction log
request, database manager always first look primary log, if it is no
reuseable in primary log, then move to secondary log.

My question is
how database manager use the already allocated secondary log file? Just like db2 server use the primary log files if one transaction log is using 10% of one secondary log file, and
same time will another transaction log use the rest of 90% of same
secondary log file? Either the log file is primary or secondary, they should be used by the all
the transactions/agents. Let's say you have three primary log files log01,
log02, log03. If db2 server find out when the log03 is full, but the log01
still hold the active transactions, then db2 will allocate the secondary
files and switch the current log file to the first secondary log file. if one transaction log need to move to secondary log, does it use
existed one or to allocate new one? the existed one.
Any help will be very useful
Hank

Nov 12 '05 #2
"Fan Ruo Xin" <fa*****@sbcglobal.net> wrote in message news:<%4**************@newssvr26.news.prodigy.com> ...
"hank" <ga****@hotmail.com> wrote in message
news:8d**************************@posting.google.c om...
Hi All

In the Circular Logging when the Primary Log file fill up, the
database manager will creat a secondary log files for the transaction;
when this transaction finished, the secondary log files still
allocated in log directory; when all application disconnect from
database or database reactive or database restart the secondary log
files will be deleted from log directory. For each transaction log
request, database manager always first look primary log, if it is no
reuseable in primary log, then move to secondary log.

My question is
how database manager use the already allocated secondary log file?

Just like db2 server use the primary log files
if one transaction log is using 10% of one secondary log file, and
same time will another transaction log use the rest of 90% of same
secondary log file?

Either the log file is primary or secondary, they should be used by the all
the transactions/agents. Let's say you have three primary log files log01,
log02, log03. If db2 server find out when the log03 is full, but the log01
still hold the active transactions, then db2 will allocate the secondary
files and switch the current log file to the first secondary log file.


So, does it mean in the high cocurrent and long running transaction
processes, the database manage only can handle 126 tansaction in DB2
UDB v7.2 and 256 in DB2 UDB v8.1?
if one transaction log need to move to secondary log, does it use
existed one or to allocate new one?

the existed one.

Any help will be very useful
Hank

Nov 12 '05 #3

"hank" <ga****@hotmail.com> wrote in message
news:8d**************************@posting.google.c om...
"Fan Ruo Xin" <fa*****@sbcglobal.net> wrote in message news:<%4**************@newssvr26.news.prodigy.com> ...
"hank" <ga****@hotmail.com> wrote in message
news:8d**************************@posting.google.c om...
Hi All

In the Circular Logging when the Primary Log file fill up, the
database manager will creat a secondary log files for the transaction;
when this transaction finished, the secondary log files still
allocated in log directory; when all application disconnect from
database or database reactive or database restart the secondary log
files will be deleted from log directory. For each transaction log
request, database manager always first look primary log, if it is no
reuseable in primary log, then move to secondary log.

My question is
how database manager use the already allocated secondary log file?

Just like db2 server use the primary log files
if one transaction log is using 10% of one secondary log file, and
same time will another transaction log use the rest of 90% of same
secondary log file?

Either the log file is primary or secondary, they should be used by the all
the transactions/agents. Let's say you have three primary log files log01, log02, log03. If db2 server find out when the log03 is full, but the log01 still hold the active transactions, then db2 will allocate the secondary
files and switch the current log file to the first secondary log file.


So, does it mean in the high cocurrent and long running transaction
processes, the database manage only can handle 126 tansaction in DB2
UDB v7.2 and 256 in DB2 UDB v8.1?

=========
No. First, the active log file doesn't mean it is current log file. There
may be a couple of active log files, when all the primary + secondary files
is used, then you will get "log full". But there is only one current log
file (it might be primary log file, or seconday log file). All the active
transactions will write to the current log file. And db2 server will know
which transaction corresponse which session.
How many concurrent transactions can db2 server handle? This is not
determined by the number of log files. This will be determined by the number
of concurrent db2 agents, which will be the min(max_agents,
max_applications), of course there is also os limits ....
========= if one transaction log need to move to secondary log, does it use
existed one or to allocate new one?

the existed one.

Any help will be very useful
Hank

Nov 12 '05 #4
"Fan Ruo Xin" <fa*****@sbcglobal.net> wrote in message news:<aj**********@newssvr26.news.prodigy.com>...
"hank" <ga****@hotmail.com> wrote in message
news:8d**************************@posting.google.c om...
"Fan Ruo Xin" <fa*****@sbcglobal.net> wrote in message

news:<%4**************@newssvr26.news.prodigy.com> ...
"hank" <ga****@hotmail.com> wrote in message
news:8d**************************@posting.google.c om...
> Hi All
>
> In the Circular Logging when the Primary Log file fill up, the
> database manager will creat a secondary log files for the transaction;
> when this transaction finished, the secondary log files still
> allocated in log directory; when all application disconnect from
> database or database reactive or database restart the secondary log
> files will be deleted from log directory. For each transaction log
> request, database manager always first look primary log, if it is no
> reuseable in primary log, then move to secondary log.
>
> My question is
> how database manager use the already allocated secondary log file? Just like db2 server use the primary log files > if one transaction log is using 10% of one secondary log file, and
> same time will another transaction log use the rest of 90% of same
> secondary log file?
Either the log file is primary or secondary, they should be used by the all the transactions/agents. Let's say you have three primary log files log01, log02, log03. If db2 server find out when the log03 is full, but the log01 still hold the active transactions, then db2 will allocate the secondary
files and switch the current log file to the first secondary log file.


So, does it mean in the high cocurrent and long running transaction
processes, the database manage only can handle 126 tansaction in DB2
UDB v7.2 and 256 in DB2 UDB v8.1?

=========
No. First, the active log file doesn't mean it is current log file. There
may be a couple of active log files, when all the primary + secondary files
is used, then you will get "log full". But there is only one current log
file (it might be primary log file, or seconday log file). All the active
transactions will write to the current log file. And db2 server will know
which transaction corresponse which session.
How many concurrent transactions can db2 server handle? This is not
determined by the number of log files. This will be determined by the number
of concurrent db2 agents, which will be the min(max_agents,
max_applications), of course there is also os limits ....
=========

Thank you for you response, but one log file become reuseable when it
is not a current log file and not a active log file, if all log file
is used now but not all fill up, which log file is reuseable? if not,
where to allocate the log space for this transaction?
> if one transaction log need to move to secondary log, does it use
> existed one or to allocate new one? the existed one. >
> Any help will be very useful
>
>
> Hank

Nov 12 '05 #5

"hank" <ga****@hotmail.com> wrote in message
news:8d**************************@posting.google.c om...
"Fan Ruo Xin" <fa*****@sbcglobal.net> wrote in message news:<aj**********@newssvr26.news.prodigy.com>...
"hank" <ga****@hotmail.com> wrote in message
news:8d**************************@posting.google.c om...
"Fan Ruo Xin" <fa*****@sbcglobal.net> wrote in message

news:<%4**************@newssvr26.news.prodigy.com> ...
> "hank" <ga****@hotmail.com> wrote in message
> news:8d**************************@posting.google.c om...
> > Hi All
> >
> > In the Circular Logging when the Primary Log file fill up, the
> > database manager will creat a secondary log files for the transaction; > > when this transaction finished, the secondary log files still
> > allocated in log directory; when all application disconnect from
> > database or database reactive or database restart the secondary log > > files will be deleted from log directory. For each transaction log
> > request, database manager always first look primary log, if it is no > > reuseable in primary log, then move to secondary log.
> >
> > My question is
> > how database manager use the already allocated secondary log file?

Just like db2 server use the primary log files
> > if one transaction log is using 10% of one secondary log file, and
> > same time will another transaction log use the rest of 90% of same
> > secondary log file?
> Either the log file is primary or secondary, they should be used by the
all
> the transactions/agents. Let's say you have three primary log files

log01,
> log02, log03. If db2 server find out when the log03 is full, but the

log01
> still hold the active transactions, then db2 will allocate the
secondary > files and switch the current log file to the first secondary log file.
So, does it mean in the high cocurrent and long running transaction
processes, the database manage only can handle 126 tansaction in DB2
UDB v7.2 and 256 in DB2 UDB v8.1?

=========
No. First, the active log file doesn't mean it is current log file. There may be a couple of active log files, when all the primary + secondary files is used, then you will get "log full". But there is only one current log
file (it might be primary log file, or seconday log file). All the active transactions will write to the current log file. And db2 server will know which transaction corresponse which session.
How many concurrent transactions can db2 server handle? This is not
determined by the number of log files. This will be determined by the number of concurrent db2 agents, which will be the min(max_agents,
max_applications), of course there is also os limits ....
=========

Thank you for you response, but one log file become reuseable when it
is not a current log file and not a active log file,

====
a log file become reuseable is when
- no active transactions in this log file
and
- this log file is externalized (the corresponding data pages are written
to disk)
if all log file is used now but not all fill up, which log file is reuseable?
===========
For the non-recoverable database, DB2 server will switch the current log
file to the next one only when the current log file full, i.e. when the
current log file is filled up. (db2 internally will keep some space, which
will be used for ROLLBACK the transactions, or backward phase during the
CRASH RECOVERY.)
if not, where to allocate the log space for this transaction?

========
If all the log files (primary + secondary) are filled up, and none of them
can be reused, you will get "log full" error. db2 will rollback the
transaction which caused the log full, this transact may not the longest
one.

> > if one transaction log need to move to secondary log, does it use
> > existed one or to allocate new one?

the existed one.
> >
> > Any help will be very useful
> >
> >
> > Hank

Nov 12 '05 #6
> ====
a log file become reuseable is when
- no active transactions in this log file
and
- this log file is externalized (the corresponding data pages are written
to disk)
if all log file is used now but not all fill up, which log file is

reuseable?
===========
For the non-recoverable database, DB2 server will switch the current log
file to the next one only when the current log file full, i.e. when the
current log file is filled up. (db2 internally will keep some space, which
will be used for ROLLBACK the transactions, or backward phase during the
CRASH RECOVERY.)
if not, where to allocate the log space for this transaction?

========
If all the log files (primary + secondary) are filled up, and none of them
can be reused, you will get "log full" error. db2 will rollback the
transaction which caused the log full, this transact may not the longest
one.


Thanks so much

Hank
Nov 12 '05 #7
ARCHIVE LOG --- All transactions either rolled back or
committed/externalized to table.
ACTIVE LOG --- At least one transaction either in flight or
committed/not-externalized.
NEXT ACTIVE LOG --- File id of next log to be used and currently empty.

Say:
S0000001.log and S0000002.log are ARCHIVE, S0000003.log is FULL and ACTIVE
and S0000004.log is NOT FULL and ACTIVE and Current; and S0000005.log is
NEXT ACTIVE.
If S000004 fills up and S0000003 is still ACTIVE then logging will happen in
S0000005. If the situation does not change and S0000005 fills then S0000006
will get allocated and so on.
If you are in LOG RETAIN=RECOVERY and USEREXIT=ON then DB2 will have
archived logs 1,2,3. In that case, DB2 will rename log 1 to log 5 instead
of allocating a new one and reuse its space. It will do the same for log 2.
You would now have log 3 and 4 and 5 (Old No. 1)ACTIVE and 6 (Old No.2) NEXT
ACTIVE.
If DB2 cannot rename and reuse, then it will allocate new files on demand.
Your limit therefore for the log space in total becomes the file systems
capacity.

Now, if LOGSECOND is NOT set to -1 but to a positive integer, then the limit
is: from the the first acitve (Log3), the space used cannot be more than the
total number of files=Lofprimary+logsecond. Assume they are set to 10 and
15 respectively. Then if if Log3 is active and you have a very long running
transaction and 3 stays active, you would get a log full condition when DB2
attempts to open S0000028. The db will go automatically in crash restart
mode.
If LOGSECOND=-1, then DB2 will keep opening logs on demand until it runs out
of file system space (This V8 only).
HTH, Pierre.
"hank" <ga****@hotmail.com> a écrit dans le message de
news:8d**************************@posting.google.c om...
"Fan Ruo Xin" <fa*****@sbcglobal.net> wrote in message

news:<aj**********@newssvr26.news.prodigy.com>...
"hank" <ga****@hotmail.com> wrote in message
news:8d**************************@posting.google.c om...
"Fan Ruo Xin" <fa*****@sbcglobal.net> wrote in message

news:<%4**************@newssvr26.news.prodigy.com> ...
> "hank" <ga****@hotmail.com> wrote in message
> news:8d**************************@posting.google.c om...
> > Hi All
> >
> > In the Circular Logging when the Primary Log file fill up, the
> > database manager will creat a secondary log files for the transaction; > > when this transaction finished, the secondary log files still
> > allocated in log directory; when all application disconnect from
> > database or database reactive or database restart the secondary log > > files will be deleted from log directory. For each transaction log
> > request, database manager always first look primary log, if it is no > > reuseable in primary log, then move to secondary log.
> >
> > My question is
> > how database manager use the already allocated secondary log file?

Just like db2 server use the primary log files
> > if one transaction log is using 10% of one secondary log file, and
> > same time will another transaction log use the rest of 90% of same
> > secondary log file?
> Either the log file is primary or secondary, they should be used by the
all
> the transactions/agents. Let's say you have three primary log files

log01,
> log02, log03. If db2 server find out when the log03 is full, but the

log01
> still hold the active transactions, then db2 will allocate the
secondary > files and switch the current log file to the first secondary log file.
So, does it mean in the high cocurrent and long running transaction
processes, the database manage only can handle 126 tansaction in DB2
UDB v7.2 and 256 in DB2 UDB v8.1?

=========
No. First, the active log file doesn't mean it is current log file. There may be a couple of active log files, when all the primary + secondary files is used, then you will get "log full". But there is only one current log
file (it might be primary log file, or seconday log file). All the active transactions will write to the current log file. And db2 server will know which transaction corresponse which session.
How many concurrent transactions can db2 server handle? This is not
determined by the number of log files. This will be determined by the number of concurrent db2 agents, which will be the min(max_agents,
max_applications), of course there is also os limits ....
=========

Thank you for you response, but one log file become reuseable when it
is not a current log file and not a active log file, if all log file
is used now but not all fill up, which log file is reuseable? if not,
where to allocate the log space for this transaction?

> > if one transaction log need to move to secondary log, does it use
> > existed one or to allocate new one?

the existed one.
> >
> > Any help will be very useful
> >
> >
> > Hank


Nov 12 '05 #8

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

Similar topics

6
3669
by: Frank Oquendo | last post by:
I'm looking for advice from people who are using C# in a production environment with multiple developers. How do you reuse your code between projects? Do you organize your class files into...
2
1473
by: Daniel Granatshtein | last post by:
I am writing for both Windows XP and Pocket PC an application that implements the same behavior. In the architecture design I am using several foundation libraries for better code reuse. The...
1
5630
by: developmental2 | last post by:
Hi all..! If I want to split an SQL DB into several physical files (as its 500GB disk ran out of space, won't even run shrinks any more, and we bought another 500GB disk to add to the PC)...
4
2039
by: Bob Weiner | last post by:
Hi, I am an IT person who uses .Net to support our infrastructure. Since I have been doing this for a while it would be a misnomer for classify myself as a newbie; perpetual amatuer seems more...
8
2181
by: WebSnozz | last post by:
I have an application written in C that does a lot of low level stuff. It does a lot of things like casting from void*'s. I want to create a new GUI for it in either C# or MC++, but reuse the...
0
1127
by: Axlin | last post by:
Hi. Could someone tell me what did i miss out in my steps when i configured our production database to our development database? I tried on 2 separate servers and also between 2 separate...
0
1352
by: santhoshv | last post by:
My log files became full and I killed the application which used up the log space and finally i was able to free up the log space. Now the issue is that I have freed up the Primary log space but...
2
7564
by: Kvara prasad | last post by:
For creating a user database three important files named primary, secondary & transaction log files. so my question is 'what is the difference between primary & secondary files?' and is 'what is the...
1
1321
by: smileprince00 | last post by:
hi friends, i am new learner of this sql server 2008.my question is if my primary data file i.e .mdf is restricted to certain amount of memory like 100mb..i have some more secondary data files.i.e...
0
7221
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
7109
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
7372
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...
1
7029
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7481
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5039
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1537
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
758
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.