Move physical Logs to other dbspace:

Overview:

When the database server initializes disk space, it places the physical log in the root dbspace. The initial size of the physical log is set by the PHYSFILE configuration parameter.


After initialize the database server for the first time, you can change the size or location of the physical log with the onparams utility.


To improve performance (specifically, to reduce the number of writes to the root dbspace and minimize disk contention), you can move the physical log out of the root dbspace to another dbspace, preferably to a disk that does not contain active tables or the logical-log files. For best performance, create the plogspace to store the physical log and allow the database server to expand the size of the physical log as needed to improve performance.

 

Run below commands to find out Physical log space:

$onstat –c |grep ^PHYS

Or

$ oncheck -pe physdbs

 

First create a chunk for new dbspace:

$cd /Informix/storage/IDS

$touch physdbs

$chmod 660 physdbs

 

Create a new dbspace and move the physical logs:


$onspaces -c -d physdbs -o -s 512000 -p <path_to_chunks>/physdbs

 

$ onparams -p -s 400000 -d physdbs


$ ontape -s -L 0

 

Note: Size is in kb.It is advisable to use the values from the online.log to set the size of the physical log or increase this a little bit more. Different values in the online.log are due to the differing loads at the time the log is written.

 

Confirm the changes have been applied but running the following and checking the results:


$oncheck -pe physdbs

 

 or


$onstat –c |grep ^PHYS

Find below difference between Plogspace and dbspace:

 

dbspace (vs) plogspace: When the physical log is in plogspace, the DB server increases the size of the physical log as needed to improve performance.

When the physical log is in dbspace, you must manually increase the size of the physical log.

To move the physical log to a dbspace, run the onparams -p -s command or the SQL administration API admin() or task() function with the create dbspace argument.

The following example changes the size and location of the physical log. The new physical-log size is 500 KB, and the log is in the dbspace11 dbspace:

onparams -p -s 500 -d dbspace11

*********Happy Learning*************

No comments:

Post a Comment

thedbaportfolio@gmail.com