Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

oracle lock table

Posted on 2006-07-11
15
Medium Priority
?
1,277 Views
Last Modified: 2007-12-19
actually .. i wish lock whole table in my database to prevent the user to login in for the table in my database to select, insert, update ...and others.

 The LOCK TABLE IN LOCK_MODE [NOWAIT] is not i want ...

 How about the command for ALTER TABLE table_name ENABLE TABLE lock?

 any option
0
Comment
Question by:pgsystech
  • 6
  • 5
  • 2
  • +1
15 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17088302
what you want is:
DENY SELECT, UPDATE, DELETE, INSERT FOR <username> ON <tablename>;

0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 17088311
actually, REVOKE and not DENY:
REVOKE SELECT, UPDATE, DELETE, INSERT FOR <username> ON <tablename>;
0
 
LVL 25

Expert Comment

by:jrb1
ID: 17088359
Please delete that last question you entered.  Keep your comments/responses all in a single question.  (The question about lock modes is fine, but there seem to be three duplicate questions out there.)
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:pgsystech
ID: 17088382
Lock whole table in oracle ...

rgrds
Gt
0
 
LVL 25

Expert Comment

by:jrb1
ID: 17088412
Do you mean, lock all tables?  What users?  Even remove "select" access?  What are you trying to accomplish?
0
 
LVL 16

Expert Comment

by:MohanKNair
ID: 17088548
Use "SELECT FOR UPDATE statement"
http://www.experts-exchange.com/Databases/Oracle/Q_21010749.html

Set transaction mode
SET TRANSACTION ISOLATION LEVEL <mode>
http://www.ss64.com/orasyntax/10locking.html
0
 
LVL 16

Expert Comment

by:MohanKNair
ID: 17088573
0
 

Author Comment

by:pgsystech
ID: 17088768
I like to lock one of the my tables in my database

Thank
GT
0
 

Author Comment

by:pgsystech
ID: 17096197
Hi,
any opinion ..for me to lock the one of my tables in my database...


rgrds
tech
0
 
LVL 16

Expert Comment

by:MohanKNair
ID: 17097072
A LOCK TABLE statement manually overrides default locking. The following statement acquires exclusive table locks for the EMP_TAB and DEPT_TAB tables.

LOCK TABLE Emp_tab, Dept_tab IN EXCLUSIVE MODE NOWAIT;


LOCK TABLE Emp_tab IN ROW SHARE MODE;
LOCK TABLE Emp_tab IN ROW EXCLUSIVE MODE;
LOCK TABLE Emp_tab IN SHARE MODE;


See this link
http://www.stanford.edu/dept/itss/docs/oracle/10g/appdev.101/b10795/adfns_sq.htm#1024828
0
 

Author Comment

by:pgsystech
ID: 17105463
The question is where i peform locking in my table , pls refer below :

 SQL> LOCK TABLE HR.ABC IN EXCLUSIVE MODE;

The command, i perform once...can able to lock the table under schema name HR. However,  when I log in as another username as TONG...

 I able to select the table In HR schema and a I also can select the table .....

 any Opnion to lock this table ABC under HR.schema.  also, i and user also cannot perform select, insert,update in the particular locking table. Only Administrator got rights to done it.

I also did not want drop the table yet.. and lock the tables...

rgrds
GT
0
 
LVL 16

Expert Comment

by:MohanKNair
ID: 17105648
It is not possible to lock the table for select statements.
0
 

Author Comment

by:pgsystech
ID: 17106057
But the way.. Have any idea to turn off particular table in database?

rgrds
GT
0
 
LVL 16

Accepted Solution

by:
MohanKNair earned 750 total points
ID: 17106197
The best option is to rename the table. When it is required rename back to original name.
0
 

Author Comment

by:pgsystech
ID: 17119565
hI mohan,

Thank..for this option...I wish to use rename matter to solve it.


Rgrd
GT
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
In today's business world, data is more important than ever for informing marketing campaigns. Accessing and using data, however, may not come naturally to some creative marketing professionals. Here are four tips for adapting to wield data for insi…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

876 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question