Skip to Content
author's profile photo Former Member
Former Member

log_dir and LOGARCHMETH1

Hello All,

I have Installed SAP System on June 30th.

On July 6th I changed the LOGARCHMETH1 value to a location in the Disk.

Immediately took a Offline Backup(as it is mandatory) and then started DB and SAP.

Now today, My log files look like this,

Contents of LOG_DIR:

#ls -ltr

total 1258752

-rw------- 1 db2smr dbsmradm 512 Jun 30 15:00 SQLLPATH.TAG

-rw------- 1 db2smr dbsmradm 67100672 Jul 6 12:14 S0000011.LOG

-rw------- 1 db2smr dbsmradm 67100672 Jul 6 12:14 S0000010.LOG

-rw------- 1 db2smr dbsmradm 67100672 Jul 6 12:14 S0000014.LOG

-rw------- 1 db2smr dbsmradm 67100672 Jul 6 12:14 S0000013.LOG

-rw------- 1 db2smr dbsmradm 67100672 Jul 6 12:14 S0000012.LOG

-rw------- 1 db2smr dbsmradm 67100672 Jul 6 12:14 S0000016.LOG

-rw------- 1 db2smr dbsmradm 67100672 Jul 6 12:14 S0000015.LOG

-rw------- 1 db2smr dbsmradm 67100672 Jul 6 12:14 S0000018.LOG

-rw------- 1 db2smr dbsmradm 67100672 Jul 6 12:14 S0000017.LOG

-rw------- 1 db2smr dbsmradm 67100672 Jul 6 12:14 S0000019.LOG

-rw------- 1 db2smr dbsmradm 67100672 Jul 6 17:01 S0000020.LOG

-rw------- 1 db2smr dbsmradm 67100672 Jul 6 17:37 S0000021.LOG

-rw------- 1 db2smr dbsmradm 67100672 Jul 6 18:02 S0000022.LOG

-rw------- 1 db2smr dbsmradm 67100672 Jul 7 10:54 S0000023.LOG

-rw------- 1 db2smr dbsmradm 67100672 Jul 8 09:53 S0000025.LOG

-rw------- 1 db2smr dbsmradm 67100672 Jul 8 09:53 S0000024.LOG

-rw------- 1 db2smr dbsmradm 67100672 Jul 8 09:53 S0000026.LOG

-rw------- 1 db2smr dbsmradm 12619776 Jul 8 11:22 S0000007.LOG

-rw------- 1 db2smr dbsmradm 67100672 Jul 8 14:03 S0000008.LOG

-rw------- 1 db2smr dbsmradm 67100672 Jul 8 16:10 S0000009.LOG

Contents of LOGARCHMETH1

#cd /db2/archiveLog////

  1. ls -ltr

total 308640

-rw-r r 1 db2smr dbsmradm 410 Jul 6 16:50 chive

-rw-r----- 1 db2smr dbsmradm 12451840 Jul 6 17:01 S0000000.LOG

-rw-r----- 1 db2smr dbsmradm 11530240 Jul 6 17:26 S0000001.LOG

-rw-r----- 1 db2smr dbsmradm 10944512 Jul 6 18:02 S0000002.LOG

-rw-r----- 1 db2smr dbsmradm 11722752 Jul 6 19:07 S0000003.LOG

-rw-r----- 1 db2smr dbsmradm 67100672 Jul 7 15:04 S0000004.LOG

-rw-r----- 1 db2smr dbsmradm 67100672 Jul 7 17:09 S0000005.LOG

-rw-r----- 1 db2smr dbsmradm 55078912 Jul 7 19:39 S0000006.LOG

-rw-r----- 1 db2smr dbsmradm 12619776 Jul 8 11:22 S0000007.LOG

-rw-r----- 1 db2smr dbsmradm 67100672 Jul 8 14:03 S0000008.LOG

Now my questions is:

1. I will backup the Archive Logs from the dir LOGARCHMETH1. What do I do with the files of log_dir? Do they need to be backed up?

2. If answer to question 1 is NO, then active log file is in log_dir, will it be not required? can we ignore all the files in log_dir?

3. Incase of a disaster, say right now, while doing roll forward, will it ask for a log file that is present in log_dir but not in LOGARCHMETH1?

4. After switching on the parameter LOGARCHMETH1(on July 6th) it started the sequence of log files in that location from 0. But why the sequence of naming log files in log_dir got changed to 7 on Jul 8 11:22 ?

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Jul 08, 2010 at 01:18 PM

    1. I will backup the Archive Logs from the dir LOGARCHMETH1. What do I do with the files of log_dir? Do they need to be backed up?

    -- Log files under the log_dir need not be backed up. These are empty (or initialized) log files created by DB2 and do not have any relevant data. The database engine will move the log files to the LOGARCHMETH1 location once there is any data written to it. However these log files also include currently active logs (log files currently being written to by the database) and should never be deleted manually.

    2. If answer to question 1 is NO, then active log file is in log_dir, will it be not required? can we ignore all the files in log_dir?

    -- Yes, you can ignore the logs in the log_dir in terms of backup. However, these are active log files and should not be manually deleted. The only location from which you should delete log files is the logarchmeth1 location and only those log files that are NOT in the active log range (i.e. log files with numbers < First active log as shown in the db snapshot).

    3. Incase of a disaster, say right now, while doing roll forward, will it ask for a log file that is present in log_dir but not in LOGARCHMETH1?

    -- In my opinion that is possible if you have a hard crash of the database (i.e. the database doesnt get an opportunity to archive log files), however, provided you dont "delete" anything from the active log location, you will be fine. Thats because, after the rollforward is complete, all relevant log files will be archived to the LOGARCHMETH1 location.

    4. After switching on the parameter LOGARCHMETH1(on July 6th) it started the sequence of log files in that location from 0. But why the sequence of naming log files in log_dir got changed to 7 on Jul 8 11:22 ?

    -- You only see log files from #7 in the log_dir because log files prior to that number have been closed and archived (i.e. moved to the LOGARCHMETH1 location). Note that log numbers are always increasing in sequence and are unique for a given "log chain" (i.e. the C0000n directory you see in the LOGARCHMETH1 path). So, once, logs from #7 to #22 get used up, you will see a new sequence of #23 to #38 in your log_dir.

    Hope that helps!

    -Sameer

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      You cannot disable logging completely (except for specific tables for a short duration by using not logged initially or LOAD). However, you can use circular logging instead of archival logging to avoid having to archive logs and also prevent logs from accumulating in the active log directory. This also means that you will loose the ability to do a point-in-time recovery and will only be able to do a version recovery. I believe SAP requires the database to have archival logging enabled and does not support circular logging..

      - Sameer

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.