Friday, November 21, 2014

Database Lock File - .lk file


Database Lock file is text file which will create when database having one or more connection. This file will be existing in the database directory where .db file reside.
When DB is having single user mode connection it will not allow more than one user to connect at a time. It will throw error if you connect using “mpro”, or if it already user connect via “pro” command.
mpro /path/to/dbase/dbname
            ** The database <file-name> is in use in single-user mode. (263)

When DB is having multiuser open connection it will allow you to connect to DB using “pro” command. You can able to connect DB only using “mpro” command.
pro /path/to/dbase/dbname
            ** The database <file-name> is in use in multi-user mode. (276)

It is very curious now what is the containing element in the small text file which controlling the Database connections. Let me clear you on this
           1.      The mode of DB started (single or multi)
           2.      Pid of the process which started DB.
           3.      Hostname of the process that started DB.
When the process asks DB to start progress will check the .lk file in the .db file location and if .lk file is not exist it will create one and enters the .lk file necessary entry and starts the database.
If .lk file is already exist and if it valid it will throw error either 276 or 263 according to the mode of connection.
Validation is as below
                 a.       It will check the hostname which is present in .lk file and the process which is connected if both matches then it valid. If it does not matches directly it threw error.
                 b.      It then check for pid which is active or not, if it is active then .lk is valid, if not you can remove .lk file and start DB.
                 c.       If .lk file is valid we cannot start the DB as we get appropriate error in the console.

.lk file is crucial file which having the connection control details it should not deleted ascommon file. Deleting the .lk file may lead to database to be corrupted.

In some situation like abnormal shutdown/unclean shutdown which will unable to remove the entry of .lk file we can remove it only if no progress process is not running on the server but the risky factor should be taken. 

Wednesday, November 5, 2014

Progress Openedge database license file.



License file is a Text file which contains the details of Progress DB connections. This file is placed in the same location where .db file exist and naming convention of this file is dbname.lic (if database name is dbname). if this file having issue in writing then information will be recorded in .lg file itself.
License file is space delimited and having 12 columns in it, these columns represent different meaning as below
1.     Current date
2.     Current time
3.     Number of licensed users specified by the configuration file (if -1 shows, it means that an unlimited number of users are licensed)
4.     Current number of total connections
5.     Maximum number of total connections
6.     Minimum number of total connections
7.     Current number of interactive connections
8.     Maximum number of interactive connections for the last hour
9.     Minimum number of interactive connections for the past hour
10. Current number of batch connections
11. Maximum number of batch connections for the past hour
12.   Minimum number of batch connections for the past hour  

It will resets the value once it writes to .lic file. APW BIW AIW and WDOG process will not be counted and recorded in the file. Webspeed and appserver connection will be recorded in 7,8 and 9th column, There is no option to start DB without writing to lic file. You should not delete lic file when DB is up and running, if lic file is deleted when DB is down it will create the new one at the time of starting the DB