Locking Users By A Table Field Value

Dec 27, 2006

We have a table with several columns (id, title, description, area).The data in the table looks like this

1 sometitle1 description1 USA
2 sometitle2 description2 Germany
3 sometitle3 description3 Japan
4 sometitle4 description4 Honduras

We have Oracle users with their usernames and password. We would like to lock every single user to a certain area.Example:

user 1 may see only records, where AREA=USA
user 2 may see only records, where AREA=Honduras

How can I do this in Oracle. I am using Oracle Enterprise 9.2

View 1 Replies


ADVERTISEMENT

Table Locking When Many Users Retrieve Data

Sep 2, 2009

I have a "select ... into" in my PL/SQL and it doesn't retreive any data(I suppose just certain columns because if it doesn't retreive a row then the PL/SQL should throw an error) when there are many users accessing this table. It shouldn't be some table locking right? Because if it is, it should wait until the table is available then it will retreive data. Currently it just proceeds with the PL/SQL and selecting nothing in that query. what details should I look at to trace the cause of this problem.

View 4 Replies View Related

Application Express :: Application Locking - Force Logout All Current Users And Prevent Login

Jun 12, 2012

I have an application that I'd like to prevent activity in after a certain time of day, say 3pm. Is there any way I can force logout of all current users and then prevent re-login until 9am the next day (short of deleting all of their login credentials and then recreating them the next morning)?

View 7 Replies View Related

SQL & PL/SQL :: How To Know Who Is Locking Table

Apr 12, 2010

I want to Who is locking the table by an SQL statement

View 32 Replies View Related

11g Child Table Update Locking?

May 26, 2013

I've a table TXN1 transaction and has FKs to 3 different tables Account, customer, country and currency. ALL FKs are indexed (bitmap). I am updating TXN1 of amount column about 10,000 rows. (SID 1) As expected, it has taken lock type 3 SX on TXN1. But it has taken on lock type 4 (share) on Account, customer and country. Committing every 10k rows.

At the same time sid 2 is inserting into another TXN2 table which has FK to the same dimensions account, customer and currency. Only FK on ac_id is bitmap indexed. The inserts have taken SX lock(type 3) on tXN2 table (expected). But it is trying to take SX type 3 lock on account, customer, currency tables. typ3 lock taken on CCY but waiting on CST. But It is blocked by sid 1. It has resulted into Enque-TM contention and resulted into anywhere 60-300 secs wait time..

I understand update/delete in parent table results into locking of SX of child tables and need the FKs to be indexed to avoid etc.

1. Why is SID1 taking shared lock on the parent tables Account,customer,country and currency tables? The update statement is not updating any of those FK columns nor referring them in where clause(if it matters!). Is it to ensure that the parent rows are not deleted?

2. Why is SID2 taking SX lock on the dimension tables? Why is it not taking RS lock type 2 on parent rows? Why is SID1 taking shared lock type 4, but not 2?

View 13 Replies View Related

Get Table RowID Of Session That Is Locking In RAC Database

Jun 11, 2012

I am a developer and not a DBA and I need to find th correct query to find the exact rowid of the record locked on a table. This is for a RAC database and locked record can be from the web form in oracle application server. When I try to get the correct row id, I get the following error:

ORA-01410 - Invalid row id For the criteria, the output is Dbms_Rowid.rowid_create(1, -1, 36, 7845, 0), why I get a -1 for the ROW_WAIT_OBJ#?

Additional Information: The lock type is DML and the lock mode is: Row Exclusive, the table is locked and the program is web oracle forms executing.

I am executing the query in Oracle Database 11g Enterprise Edition Release 11.1.0.7.0

How to accomplish getting the correct rowid? Below is the selection criteria I have:

select vs.inst_id,
vs.audsid audsid,
locks.sid sid,

[Code]....

View 1 Replies View Related

SQL & PL/SQL :: Updating A Date Field With Field From Another Table?

Nov 14, 2011

I have a table called Customer_Type with following fields

Customer_type ,Active_date, Inactive_date
regular,11/01/2011
daily,11/04/2011
monthly,11/05/2011/11/11/2011

Tbale 2:Customer

Customer_name,Customer_type,Customer_Inactive_date
John,regular,
James,monthly,
Jake,daily,
Jill,monthly

What i wnat is to update the Customer_inactive_date with the Incative_date field from Customer_type based on their Customer_type... So james and Jill would have their rows updated in this scneario ..How can i achive this in pl/Sql

I have teh code using merge function..I want something in traditional old fashion..

The sql statements are below

CREATE TABLE CUSTOMER_TYPE
(
type_code VARCHAR2(10),

[Code]....

View 5 Replies View Related

List All Users That Have Privileges On A Table

Aug 6, 2011

Is possible to list all users that have any privilege on a specific table?

View 2 Replies View Related

Audit Dml On Few Table For Non Application Users

Oct 12, 2013

I want to audit  dml on few table for non application users.can I omit only application users from audit so that whenever new user is created we need not to add audit for user.do i have to create audit logon trigger for this which check first the application user names from table and if logged user is not application user auditing will start for it.

View 4 Replies View Related

PL/SQL :: All Users To Be Able To View All Records From Table

Aug 1, 2013

I need all users to be able to view all records from table TABLE1. I would like to provide insert/ update/ delete privilege if the column "TABLE1"."UPD" = 'Y'. If TABLE1.UPD = 'N', then the users can only do select on the record. I don't know if the roles can handle based on row values.

View 5 Replies View Related

Server Administration :: System And Users Table Space

Oct 15, 2011

a newbie dba here..

select TABLESPACE_NAME,
sum(BYTES) Total_free_space,
max(BYTES) largest_free_extent
from dba_free_space
group by TABLESPACE_NAME
/

result output is attached .txt file.

the SYSTEM & USERS table space shows only <10 mb free space. Is it a bad sign? What I should do ?

View 7 Replies View Related

Row Locking In Production

Jan 10, 2013

I am facing the row lock issue in production. I have been trying to resolve the issue but i coud'nt. I traced out by using different queries which sql query is locking which but everything looks good.

And i also checked for connections open and close everything is in good place but unable to resolve the issue. we are running a batch file which runs in every night some of the records are processing and if any one record is failed it is blocking another records.My oracle version is oracle 10.2.0

View 1 Replies View Related

SQL & PL/SQL :: Locking And Foreign Key Indexes

Sep 1, 2013

Say we have an employee(id_emp) table with a primary key on id_emp. We have also some history tables emp_stuff with columns say (id_emp, dat_event, some_stuff) with primary key id_emp, dat_event.

This means that we have a unique index on (id_emp,dat_event). We also have a foreign key id_emp that references employee(id_emp). When we update id_emp on employee, we still have a lock on emp_stuff. According to this (end of the page) :

Quote:So, in short, with releases prior to Oracle Database 11g Release 1, you will want an index on the foreign key of the child table if you do any of the following:

Update the parent table primary key
Delete from the parent table
Merge into the parent table

So is id_emp in emp_stuff considered as indexed (through the unique index of the primary key) or do we have to add an explicit index
like this CREATE INDEX emp_stuff ON emp_stuff(id_emp) to avoide child table locks?

View 33 Replies View Related

Forms :: Record Locking?

Oct 21, 2010

I have developed a form, containing 5 tab pages and also referencing to 5 tables.tab page a of table a some fields are required and some or not.when i open form and start entering record, and then i change mine and dont enter and want to navigate to some other page, it simply allows me to leave it blank and move to some other tab page.

tab page b of table bsome fields are required and some or not.when i open this tab page and one i click in the first field and then do not enter anything in it and want to leave it , it does not allow me to leave blank.what could be the reason. why one tab page allow me to leave blank and navigate and why the other does not?first field of both tab pages are required.

View 2 Replies View Related

Way To Resolve Database Locking

Aug 27, 2013

11.2.0.1  I am still resolving the locking issues in our database Often the delete is blocked by some transaction. The operations said that it is intermittent. Last night they were able to delete the 1M transactions without the locking.But the past days lock often occurred, and they have to bounced the database to release the locks.

 I there a way I can compare what happened last night why the batch was able to delete smoothly , and compare it against the other night where the delete was blocked?By using ASH, AWR, ADDM? I also run now this procedure, to identify the blocking sql statement: 

SQL> exec  dbms_workload_repository.add_colored_sql(sql_id => 'fn3qv2dhsu3nb');        

PL/SQL procedure successfully completed.Can I now run AWR,ASH,ADDM, to identify/capture the sql being run?

View 21 Replies View Related

PL/SQL :: Row Locking During Update Statement?

Aug 9, 2013

Using Oracle 11gr2. If I call the following update statement from session A, session A will lock the row until a commit/rollback statement is issued from session A. If session B calls the same update statement and same row, session B will have to wait until the lock is released in session A. However, the application developers are speaking in terms of threads. Could it be possible that the update statement is called within the same session by multiple requests? If yes, could the case statement be evaluated without the row being locked which could lead to false results? Trying to keep this post brief. tableA has columnA (primary key, number) and columnB (number) 

{update tableAset columnB = case when columnB = 3 then   4  when columnB = 4 then   5   else  columnB    endwhere columnA = 6;}

Could 2 requests (almost at the exact same time) in the same session evaluate columnB as 3. The desired result would be the first request sets the column to 4 and the second request sets the column to 5.

View 4 Replies View Related

Archive Processes Locking In Oracle

Nov 9, 2010

I am having a data guard setup done in oracle 10g(10.2.0.4.0) WINDOWS Platform. some of the archive process are locked in primary db side.

PROCESS STATUS LOG_SEQUENCE STAT
-------- ---------- ------------ ----
0 ACTIVE 0 IDLE
1 ACTIVE 804462 IDLE
2 ACTIVE 0 IDLE
3 ACTIVE 0 IDLE
4 ACTIVE 0 IDLE
5 ACTIVE 800011 BUSY
6 ACTIVE 0 IDLE
7 ACTIVE 800009 BUSY
8 ACTIVE 0 IDLE
9 ACTIVE 802335 BUSY
10 ACTIVE 0 IDLE

Shall we kill the locking archive processes? killing archive processes will cause any problem?

View 4 Replies View Related

Performance Tuning :: Locking Of Two Sessions?

Apr 27, 2012

how to avoid oracle deadlock with two sessions. Here is my example, We use Select query with For Update in order to get the unique number from a table. When one user has accessed this query, while the other user tries, System gives a Performace slow and when checked it is due to locking of this select query with For update.

We don't want to use For update WAIT or FOR UPDATE NOWAIT since these will result in missing of number.

View 3 Replies View Related

SQL & PL/SQL :: Locking Views (rows Of Data While Updating)

Nov 10, 2011

I have a set of rows based on a complex view from multiple table.

I will be updating some of its columns from front-end . Is there any possible ways to lock those rows of data while updating and no other users can update it;

View 5 Replies View Related

Server Administration :: Sessions And LGWR Locking?

Jul 13, 2010

We had an issue last week were we had a session with a very basic SQL query lock up the database, spiking the CPU at 100%. When you would kill the session, the lock would just jump to another session and so on. We finally had to restart the database since our clients were being kicked out. After the restart of the database, the LGWR ended up locking and held the CPU between 85-95%. The archive logs were switching every 5 minutes, when normally it would be every 45min. We spoke with Oracle Support, but they just ended up brushing the issue off and saying it was a hardware issue and were not able to provide any kind of backing to that.

View 4 Replies View Related

Performance Tuning :: One Procedure Is Blocking And Another Is Locking It

Jan 25, 2011

I am new to performance tuning. One procedure is blocking and another is locking it.

SQL> @glockers
Oracle OS

INSTANCE SID TY Usernam SERIAL# SPID Process LMODE REQUEST
---------- ------ -- ------- ---------- ------------ ------- ------------------------------------ ------------------------------------
[code]...

View 1 Replies View Related

SQL & PL/SQL :: Automate Locking / Unlocking Of User Accounts

Nov 1, 2011

I have been plagued by people logging into my database and making changes when a clone is in process.. Having said that ,I am looking to lock accounts and unlock them when I am done.

I envision my code looking something like this:

sqlplus -s / <<END
SET PAGESIZE 0
SET FEEDBACK OFF
SET VERIFY OFF;
set heading off;
spool /tmp/lockusers.sql
select 'alter user ' || username || ' account lock;' from dba_users where username not in (....) and not locked?;
spool off;
END;

sqlplus -s / <<END
@/tmp/lockusers.sql
END;

When it comes time to unlock the accounts I want to be able to unlock those accounts I previously locked and not all of them. Is there a query, I can use that can tell me when the accounts were locked or some other way about going about this so I dont unlock accounts that were locked prior to my lock script running?

View 9 Replies View Related

PL/SQL :: How Database Handles Record Locking When Aggregate Function Called

Jul 17, 2012

how the DB handles record locking when an aggregate function is called? For instance:

...
select count(*)
into   v_count
from   x;

...Is there a lock maintained on table x for the duration of the transaction so no rows can be inserted or deleted?

View 4 Replies View Related

Hibernate Optimistic Locking Versus Database Isolation Levels

Jan 26, 2013

Among Hibernate optimistic locking & Database Isolation levels, which one to use? Which gives the better consistency, concurrency and scalability. I read in couple of links that Isolation level will suffer if there is a huge load on the application with multiple users access the appliation at the same time, moreover in islation levels normally we need to look for READ_COMITTED and NON_REPEATABLE_READ to get a better performance? Whether these are true? Whether we can use both Hibernate optimistic locking(version & timestamp) & Database Isolation levels in the same application? What are the implications using these? Which one will be preferred over the other and when?

View 2 Replies View Related

SQL & PL/SQL :: Update Table Field From Another?

Mar 28, 2011

I'm trying to update a field from another field in the same table.

I got a Table with 3 fields.

CREATE TABLE CONTENT
( LID_id NUMBER(6,0) NOT NULL ENABLE,
LPRECIS VARCHAR2(4000 CHAR),
LCOMMENT VARCHAR2(4000 CHAR)
)

How to update "LPRECIS" from "lCOMMENT" only where "LPRECIS" is NULL ?I used this statement but it's wrong.

UPDATE CONTENT
SET LPRECIS=(SELECT LCOMMENT
FROM CONTENT
WHERE LPRECIS IS NULL)

View 2 Replies View Related

SQL & PL/SQL :: Querying Same Field In A Table Twice

Jul 5, 2012

I am trying to subtract the time from where status = Delivered from the status = Picked Up. All the data is in the same table. Let's call it table1 and I want to return the values: PTN, NAME and the time difference. Is this possible to do?

PTN NAME DATE STATUS
11014419 Joe Dickson 2012-06-25 14:55:58 Delivered
11014419 Mike Draia 2012-06-25 14:28:17 Loaded
11014419 Bob Geber 2012-06-25 13:14:31 Received
11014419 Bob Geber 2012-06-25 13:14:31 Picked Up
11014419 Bob Geber 2012-06-25 13:14:31 Printed

View 3 Replies View Related

Partitioned Table Based On Field

Nov 27, 2012

I have partitioned the table based on field.But when I am selecting by Partition or by the field I am getting Explain plan as Table Access full.I am pasting the sql and Explain Plan here. The table has two partition by BOOKING_DT_WID. One less than 20100801 and other less than 99991231.

CODESELECT * FROM WC_BOOKING_SALESREP_F WHERE BOOKING_DT_WID >= 20100801;
SELECT * FROM WC_BOOKING_SALESREP_F  PARTITION(SALESREP_LESS1_99991231);
Here is the Explain Plan for the same.
CODESELECT STATEMENT  ALL_ROWSCost: 1,501  Bytes: 293,923,641  Cardinality: 809,707                  
    4 PX COORDINATOR              
[code]....

How do I know if the sql is doing partition prune.

View 1 Replies View Related

SQL & PL/SQL :: Select Rows From Table With Same Particular Field?

Aug 20, 2012

select the rows from a table with the same particular field in PL/SQL. Actually I don't want to write two loops one inserted into another.

View 7 Replies View Related

SQL & PL/SQL :: Redirect Insert To Another Table When Field Has Some Value?

May 31, 2012

What I need to do is redirect an insert to another table when a field has some value. This is what I have:

CREATE TABLE TEST.TEAMS
(
NAME VARCHAR2(255 CHAR),

[Code]....

This is the result when I try to insert a record

INSERT INTO TEST.TEAMS ( NAME, LOCATION, PLACE ) VALUES (
'Belgrano', 'Cordoba', 1);

ORA-04091: table TEST.TEAMS is mutating, trigger/function may not see it

View 5 Replies View Related

SQL & PL/SQL :: Insert Into Table And Add Extra Field Value

Sep 19, 2011

I need to copy records from a working table to a history table. I have the following sql statement

insert into test.history
(equip_ID, state, manufacturer, install_year, capacity,
group_ID, Test_status)
select (equip_ID, state, manufacturer, install_year, capacity,
group_ID, Test_status
from test.info_AP

Table test.history has one more field in it called test_year. I need to fill this field when I do the insert. Can't use an after update trigger as the field is currently set to not allow nulls.

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved