Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

oracle lock table

Posted on 2006-07-11
15
Medium Priority
?
1,271 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

Survive A High-Traffic Event with Percona

Your application or website rely on your database to deliver information about products and services to your customers. You can’t afford to have your database lose performance, lose availability or become unresponsive – even for just a few minutes.

Question has a verified solution.

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

Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

688 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