Solved

oracle lock table

Posted on 2006-07-11
15
1,218 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 142

Expert Comment

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

0
 
LVL 142

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
 

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
Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

 

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 250 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

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Suggested Solutions

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
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…

911 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now