Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

maybe for someone this is begginner's questions. I read lot of documentation and set:

`LOGPRIMARY 6
 LOGSECOND 4 
LOGFILSIZ 4096 
logarchmeth1 Disk - C:\archive
 logpath C:\active`

Number of logs in C:\active is 6 which is ok. But current number of logs in C:\archive is 40. How is that possible? I thought that maximum number of primary logs in C:\archive will be 6 and then 4 LOGSECOND (if needed, they are not preallocated).

Allowed log space is breached but new logs are created constantly in C:\archive. How is that possible? I will be thankful if someone can explain me this. On this way I do not see how can I get Transaction log full (except if I run out of total disk space) because new logs in C:\archive are created.

I am beginner so please sorry for simple question I did not find answer on Internetenter code here.

When those files will be deleted after the new online backup or when? logarchmeth1 is the destination for archive logs I set them on 6 for PRIMARY how then I have 40 logs? Thank you

share|improve this question
add comment

1 Answer 1

up vote 1 down vote accepted

When you enable archive logging in a database, you're telling DB2 that you want to retain a copy of all transaction logs that have been created. LOGPRIMARY and LOGSECOND only control how many active log files can be in use in the active log path at any given time.

Please read the documentation on database logging for more details.

share|improve this answer
    
Thank you for your reply. I really read lot of documentation but I did not understand that when they say: logprimary -"Number of primary log files configuration parameter" they mean on active logs and not on archive logs. So basically LOGPRIMARY are preallocated active logs yes? When LOGSECOND will be created? If active logs are full and maybe because of some problems cannot be archived? It says on IBM site: "When the primary log files become full, the secondary log files (of size logfilsiz) are allocated one at a time as needed, up to a maximum number as controlled by this parameter." –  Dejan Feb 18 at 7:05
    
But if primary log are full shouldn't they be archived and on that way there will be again space for primary logs and no need to created LOGSECOND? I dont quite understand that. Thank you in advance for your answers on these beginners question. Also how do you differentiate Second logs from Primary in same folder? Do they have some other remark or something? –  Dejan Feb 18 at 7:08
    
A log file can only be archived once all transactions that exist in the log file have been committed. If there are still active transactions present in a log file it is, by definition an active log file. –  Ian Bjorhovde Feb 18 at 17:14
    
This last info was useful for me thank you. –  Dejan Feb 19 at 14:17
    
This last info was useful for me thank you. If I understand well if I set for example: LOGPRIMARY 6 LOGSECOND 4 and primary logs are not archived (because some transactions are not committed), then it will create secondary logs. If they also contains uncommitted transactions we will get Transaction Log Full. If you can just confirm me if this is how it works??? I think I finally understand thanks to you. All the best! –  Dejan Feb 19 at 14:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.