Solved

oracle lock table

Posted on 2006-07-11
15
1,229 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SQL Server Determine if date is recurrance date 3 54
Data center mess 4 81
Working with SharePoint Data 8 54
Powershell script 13 102
CCModeler offers a way to enter basic information like entities, attributes and relationships and export them as yEd or erviz diagram. It also can import existing Access or SQL Server tables with relationships.
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
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…

803 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