Move Logical Logs from the root dbspace to another dbspace:
Overview:
The database server creates the logical log files and the physical log in the root dbspace (rootdbs) when the instance is first initialized. After the intance is initialized, it is possible to move the logical logs to another dbspace. There are several reasons to move the logical logs. It may be required to utilize more space for logical logs than is available within the root dbspace. It is possible to improve performance by moving the logical log files to a dbspace on a disk not shared by active tables or by the physical log, reducing the number of writes to that disk and minimizing contention.
- Run below commands to find out Logical log space details
$onstat c|grep ^LOG$oncheck -pe|more
- create a new dbspace for logical logs
Create a new chunk
$touch logspace1$chmod 660 logspace1create a new dbspace:onspaces -c -d logspace1 -p /informix/storage/ids/logspace1 -o 0 -s 200000
- To display existing log files information
$onstat -l
- Add logical logs to the new dbspace(logspace1)
Syntax:
Run the command to create a logical log in the other dbspace once for each log to be added:
onparams -a -d dbspace -s size
where dbspace is the dbspace to create the logs in, and size is the size of the log in kilobytes.
onparams -a -d logspace1 -s 10000
Logical log successfully added.
onparams -a -d logspace1 -s 10000
Logical log successfully added.
onparams -a -d logspace1 -s 10000
Logical log successfully added.
onparams -a -d logspace1 -s 10000
Logical log successfully added.
onparams -a -d logspace1 -s 10000
Logical log successfully added.
onparams -a -d logspace1 -s 10000
Logical log successfully added.
onparams -a -d logspace1 -s 10000
Logical log successfully added.
onparams -a -d logspace1 -s 10000
Logical log successfully added.
onparams -a -d logspace1 -s 10000
Logical log successfully added.
- To check logfile details type(onstat -l)
Perform a level 0 archive. The new logs do not become available for use until after a successful level-0 backup. After adding new logs in the other dbspace, onstat -l shows the status flags of these logs as A (newly added). After the backup is complete, the status of these recently-added logs will change to F (free, available for use).
- Update LTAPEDEV and take log backup
touch /informix/storage/ids/ltapedev
Now update, LTAPEDEV parameter to above value in $INFORMIXDIR /etc/$ONCONFIG file
- Take logical log backup as below:
$ontap -a
Do log switch till “A” becomes “U”, followed by checkpoint
One of the logs in root dbspace will remain the current log (status flags including C). In order to make one of the newly added logs the current log,
Run below commands:
onmode -l
onmode –l
as many times as required so that onstat -l shows one of the newly added logs with status flags including C.
One of the logs in root dbspace will still have status flags including L, meaning that it contains the most recent checkpoint record. Create a checkpoint in the current log (one of the newly added logs)
onmode -c <= This is to move checkpoint
- Take logical log backup again
$ ontape -a
- Drop log files (These are stored in rootdbs)
A logical log can be dropped if it satisfies the following criteria:
Does not have status flags of C or L Is backed up (status flags include B)
- For all but three logical logs, run the command:
onparams -d -l log ID
- Obtain log ID from the number column of the onstat -l output.
onparams -d -l 1 -y
onparams -d -l 2 -y
onparams -d -l 3 -y
- Now, oncheck -pe output shows FREE:
Perform a level 0 archive to back up the system in the new configuration.
No comments:
Post a Comment
thedbaportfolio@gmail.com