.LK file

Arunselvan

Member
I have just started DB in single user mode... Inadvertently I didn't logout from single user mode... After sometimes session got expired... Now when i tried to log in to DB, It was showing that "Database in single user mode". Now what is solution for this????

is it right to remove .lk file????

or is there any other way??????
 

raviraju

Member
see that database in mutiluser mode or not and by -busy than you can easily see that db is in mutiusermode or not. than you can remove .lk file. and after restart db the .lk file create automatically
 

cj_brandt

Active Member
Can you kill the pid of the session that was using the database in single user mode ?

That would be better than removing the lk file.
 

raviraju

Member
Lock file (extension .lk) .A file created when you start a PROGRESS
session against a database. If your database was shut down
abnormally (such as a system failure), you may need to delete the
lock file in order to connect to the database.
 

Arunselvan

Member
I know that..I want to know what actually .LK file contains???? .... But i don't know whether or not i can delete .lk file....... Plz give me answer....
 

Cringer

ProgressTalk.com Moderator
Staff member
I really wouldn't go deleting a .lk file. As per suggestion above, find the PID of the session that's holding the lock and kill it. If that doesn't work then maybe restart the database. If it's in single user mode then it won't matter to take it offline.
 

RealHeavyDude

Well-Known Member
The .lk file contains information about the usage of the database - whether it is in single-user or multi-user mode. As soon as a process accesses the database ( starting the database sever or accessing the database in single-user mode ) an .lk file is created that gets deleted automatically when the process that accesses the database terminates gracefully. If it does not then the .lk file will remain and prevent you to access the database successfully. Usually you can just try to delete the file. If the process is still alive then the OS won't let you delete it. In that case you must kill the process. If the process is gone then the OS will allow you to delete the file and you are fine.

Heavy Regards, RealHeavyDude.
 

cj_brandt

Active Member
If you remove a lock file with the original session still connected to the database, then another user can connect to the db while the first session remains logged in.
Now you have 2 users using the database in single user mode and you can get timestamp issues when one user logs out and then attempts to log back in.

┌──────────────────────────────────── Error ────────────────────────────────────┐
│ ** The database was last used Mon Aug 13 14:08:48 2012. (886) │
│ ** The before-image file expected Mon Aug 13 14:09:14 2012. (887) │
│ ** Those dates don't match, so you have the wrong copy of one of them. (888) │
│ │
│ ───────────────────────────────────────────────────────────────────────────── │
│ <OK> │
└───────────────────────────────────────────────────────────────────────────────┘
 

RealHeavyDude

Well-Known Member
Wow! Never tried that one. The last time I tried to remove the .lk file the OS rejected my attempt claiming the file was in use. Should have tried it again before I've posted that the OS will not allow you to delete the .lk file as long as it is in use ...

Heavy Regards, RealHeavyDude.
 

RealHeavyDude

Well-Known Member
Do you have a time-stamp issue?

If you have, your database is corrupted and the only way to recover is to restore your last good backup and roll forward any after image extents (hopefully you have after image enabled).

Heavy Regards, RealHeavyDude.
 
Top