Architecting, installing and maintaining your SAS environment

Table Lock

Reply
Contributor
Posts: 63

Table Lock

Hi,

When the flow status EXIT in LSF when i checked the log file I'm getting the message 'Table lock' used by another user....What does it mean and is there any solution for this ?

Thanks,

Suman

Super Contributor
Posts: 356

Re: Table Lock

Hey

Without looking into this too much, it means another process is accessing the table you are trying to access.

Are there anyother processes running in LSF at the same time, any users using EG etc.  There are tools out there that will show you what is locking a particular file.

Cheers

Barry

Contributor
Posts: 63

Re: Table Lock

Posted in reply to twocanbazza

Thanks for the reply, Can you tell me the Tool names please

Users are not closing the session properly it could be a SAS EG, or SAS DI or any Client Tire tools. that's why when we ran the LSF we are facing Table lock errors, How do we take this ?

Thanks,

Suman

Occasional Contributor
Posts: 9

Re: Table Lock

hi

most of our sas users complaint the same , as they want to open tables at any time though the ETL jobs are running , we plan of using lock proc . But i want to know other option out of this   which make sas users do there read dataset and ETL jobs do their update dataset

PROC Star
Posts: 1,167

Re: Table Lock

Posted in reply to SatishKumar

Usually this is what database technology is used for. There are some analytics oriented database out there that are optimized for many readers / one writer. Alternatively, SAS/Share might be an option, although I haven't used it.

Aside from those, I know that many SAS users have developed home-grown synchronization processes over the years...maybe a search of SGF papers would pop some up.

Tom

Super Contributor
Posts: 356

Re: Table Lock

If you are using Windows you can see who is locking the tables with - start -> Administrative tools ->Share and Storage management


Contributor
Posts: 63

Re: Table Lock

Posted in reply to twocanbazza
Occasional Contributor
Posts: 11

Re: Table Lock

Hi ksuman,

     As everybody mentionned, this is very typical of a multi-user SAS environment. The idea that Tom proposed of using a database engine would probably be the best approach. The Base SAS engine is a very poor choice for multi-user environment as it relies on the operating system file locking mechanism.

     If you want to keep using the Base SAS engine, you can use the fuser command on any UNIX-like operating system to list active locks on a file. It is easy to build a small script that will kill the locking processes but this is a very drastic approach.

I hope this helps a little,

Yoan

Occasional Contributor
Posts: 10

Re: Table Lock

As said by

Super User
Posts: 3,252

Re: Table Lock

One brute force solution to the SAS table locking problem is to bounce your SAS workspace server(s) just prior to running your ETL jobs. This works well if your ETL jobs are run overnight in batch. Often it is good practice to restart your SAS servers on a regular basis anyway just to get rid of any orphan server processes and to do backups etc.

Of course this approach is not useful if ETL jobs have to run at the same time as user jobs....Smiley Wink

Occasional Contributor
Posts: 10

Re: Table Lock

Even we have a cleanwork utility in SAS which we can use for cleaning the workarea, all we need to do is chaning the paramters in it acooridng to your environment and schedule it to run for every 2 hours, this will clean the work area relase some of the files.

Contributor
Posts: 63

Re: Table Lock

Posted in reply to AvinashGinjupalli

Thanks Avinash,

Can you please brief me about 'clean work utility in SAS'....

Thanks,

Suman

Occasional Contributor
Posts: 10

Re: Table Lock

Suman,

cleanwork is a script which will be provided by SAS used for cleaning the temp work files, it will be available under SASHOME/SASFoundation/version(9.3/9.2)/utilities/bin on server.

All you need to do is execute the above script againist your SAS Work area.

Example:

/sas/bau/saswork is your work area where temp files will get created, you need to execute the above script againist this filesystem as shown below:

Go to the location where cleanwork available and execute it against work area: ./cleanwork /sas/bau/saswork

For locating cleanwork you can give locate cleanwork on your LINUX/UNIX server.

Thanks,

Avinash Ginjupalli.

Contributor
Posts: 63

Re: Table Lock

Posted in reply to AvinashGinjupalli

Thanks Avinash  Smiley Happy

Ask a Question
Discussion stats
  • 13 replies
  • 1553 views
  • 5 likes
  • 7 in conversation