Active log

一、概述

The active log files record transactions that are in progress on the server.

The active log stores all the transactions that have not yet been committed. The active log always contains the most recent log records. If a failure occurs, the changes that were made but not committed are rolled back, and all committed transactions, which might not have been physically written to disk, are reapplied and committed again.

The location and size of the active log are set during initial configuration of a new or upgraded server (or by specifying the ACTIVELOGDIR and the ACTIVELOGSIZE parameters of the DSMSERV FORMAT or DSMSERV LOADFORMAT utility). Both the location and size can be changed later. To change the size of the active log,

活动日志默认是16384 MD(16 GB),最大为131072MB(128GB)最小的活动日志为2048MB(2GB)。当估计活动日志的大小时候,要考虑到最大工作负荷时的状态。对于简单的别分和归档没有重复数据删除,20GB的活动日志是可以的。如果使用的是一个重复删除的大象对象数据库(例如图像设备),活动日志的大小因为数据库大小的20%。

二、增加活动日志的大小

If the log is running out of space, the current transaction is rolled back, and the server issues an error message and halts. You cannot restart the server until the active log size is increased.

To increase the size of the active log while the server is halted, complete the following steps:

1.Issue the DSMSERV DISPLAY LOG offline utility to display the size of the active log.

2.Ensure that the location for the active log has enough space for the increased log size. If a log mirror exists, its location must also have enough space for the increased log size.

3.Halt the server.

4.In the dsmserv.opt file, update the ACTIVELOGSIZE server option to the new maximum size of the active log, in megabytes. For example, to change the active log to its maximum size of 128 GB, enter the following server option:

activelogsize 131072

5.If you will use a new active log directory, update the directory name specified in the ACTIVELOGDIR server option. The new directory must be empty and must be accessible to the user ID of the database manager.

6.Restart the server.

 日志文件当达到最大限度的时候,都是按照512MB自动增加的。如果存在日志镜像,那么日志文件也会相应的自动增加。

三、移动活动日志文件

You can move only the active log from one directory to another.

1.Halt the server.

2.Create a new active log directory. For example:

    mkdir /activelog2

    mkdir p:\tsm\activelog

3.Update the dsmserv.opt option file for the new active log directory. For example:

  activelogdir /activelog2

  activelogdir p:\tsm\activelog

4.Restart the server. The active logs are automatically moved by the database manager from the old directory to the new directory.

5.Optional: Remove the old directory.

Active log mirror

一、概述

The active log mirror is a copy of the active log that can be used if the active log files cannot be read. All changes made to the active log are also written to the log mirror. There can be only one active log mirror.

Mirroring the active log can protect the database when a hardware failure occurs on the device where the active log is stored. Mirroring the active log provides another level of protection in addition to placing the active log on hardware that has high-availability features. Creating a log mirror is optional but recommended. Place the active log directory and the log mirror directory on different physical devices. If you increase the size of the active log, the log mirror size is increased automatically.

Mirroring the log can affect performance, because of the doubled I/O activity that is required to maintain the mirror. The additional space that the log mirror requires is another factor to consider.
You can create the log mirror during initial configuration of a new or upgraded server. If you use the DSMSERV LOADFORMAT utility instead of the wizard to configure the server, you specify the MIRRORLOGDIR parameter If the log mirror directory is not created at that time, you can create it later by specifying the MIRRORLOGDIR option in the server options file, dsmserv.opt.
 
Archive log
一、概述
1.归档日志是包含不活动日志的副本,用于提供前滚操作等归档日志是恢复过程中不可缺少的一项内容。
2.归档日志文件是基于数据库全备份的,每次执行一次数据库全被,就会删除过期的归档日志文件。归档日志不可以手动删除。需要监管活动和归档日志,如果活动日志和归档日志接近满了,检查归档日志,如果归档日志也满了,运行一个或多个数据库全备份。
3.如果归档日志空间已满,则如果设置了Archeive faileover log则备份到这里,如果没有,则备份到活动日志目录中。
 
二 、Moving only the archive log
You can move only the archive log from one directory to another.
1.Halt the server.
2.Create an new archive log directory. For example:
 
   mkdir /archivelog2
   mkdir q:\tsm\archivelog
 
3.Update the dsmserv.opt option file for the new archive log directory. For example:
 
  archlogdir /archivelog2
  archlogdir q:\tsm\archivelog
 
4.Restart the server.
Move the archive logs from the old directory to the new directory. Preserve any subdirectory structure. Use and verify a recursive copy directory command. For example:
 
  cp -r /archivelog/*   /archivelog2
  xcopy /s k:\tsm\archivelog\*   q:\tsm\archivelog
 
5.Optional: Remove the old directory.
 
Archive failover log
一、概述
The archive failover log, also called a secondary archive log, is the directory that the server uses to store archive log files when the archive log directory is full. Its use is optional but highly recommended.
Specifying an archive failover log directory can prevent problems that occur if the archive log runs out of space. Place the archive log directory and the archive failover log directory on different physical drives.
You can specify the location of the failover log directory during initial configuration of a new or upgraded server (or with the ARCHFAILOVERLOGDIR parameter of the DSMSERV FORMAT or DSMSERV LOADFORMAT utility). If it is not created through the utilities, it can be created later by specifying the ARCHFAILOVERLOGDIR in the server options file, dsmserv.opt. See Adding optional logs after server initialization for details.
 
二、Adding optional logs after server initialization
You can specify an archive failover log and a mirror log if they were not created during server initialization.
Complete the following procedure to add one or both of the logs.
Create the directories for the logs. The directories must be accessible to the user ID of the database manager.
1.Halt the server.
2.Add the log server option or options to the server options file, dsmserv.opt. For example:
  
  archfailoverlogdir /archfailoverlog
  mirrorlogdir /mirrorlog
 
  archfailoverlogdir h:\tsm\archfailoverlog
  mirrorlogdir n:\tsm\mirrorlog
3.Save the server options file.
4.Halt and restart the server.