Restrict table access

Hi,
We on db9.5/aix i want to users to have no acess to tables when insert is going on after
insert they can have acess.

Thanks
sam2929Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

momi_sabagCommented:
what do you mean by users have no access when insert is going on?
during the insert, the new data is not accessible to others until it is committed

what are you trying to achieve?
0
sam2929Author Commented:
i mean if they run selct they should get error like that table is loading
0
tliottaCommented:
So, while some INSERT process is running, you want it to have exclusive access? All other processes should be locked out until the INSERT process finishes?

Tom
0
Fundamentals of JavaScript

Learn the fundamentals of the popular programming language JavaScript so that you can explore the realm of web development.

momi_sabagCommented:
you can't have such an error returned
you can revoke permissions before the load start and return them once it ends, but that does not sound like a good idea to me.
which platform of db2 are you using and what is exactly the problem you are trying to solve?
0
sam2929Author Commented:
So, while some INSERT process is running, you want it to have exclusive access? All other processes should be locked out until the INSERT process finishes?

Yes
0
momi_sabagCommented:
so the process that performs the insert can issue this statement

lock table table_name in exclusive mode

once this statement is in effect, no other process will be able to access the table (unless it uses UR isolation)
note that this statement should be issued after every commit
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
DB2

From novice to tech pro — start learning today.