- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Lock the Table
Operating System - HP-UX
1748235
Members
3430
Online
108759
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-21-2003 01:13 PM
тАО05-21-2003 01:13 PM
Lock the Table
i have "table A", whenever i insert records in
"table A" similar record will be inserted into "table B" (Insert trigger in table A)
One of our process does ,
Insert into table c
Select (some calculations) from table B
then ,
delete from table B
I'm not sure when table A will be loaded.
It can be loaded anytime (means table B too)..
But our process starts at 10AM everyday, so it fetches from table B arround 10AM, If during that time table B is getting loaded , then it takes only records loaded at that time. How to make my select statement to wait until all records get loaded into table B ?
Load process is done by someother group, so we cant
change their process.Its impossible.
Our process starts when we start pulling data from
"table B". I can alter the process from this point only.
Is that possible to check whether is there any lock in
table and then start fetching data.
For eg ,
If [ ANY LOCK IN TABLE B ] then
Wait [ DONT FETCH ]
Else
[ LOCK TABLE B , SO THAT NO NEW RECORDS ARE INSERTED ]
Select from "table B"
Delete from "table B"
End
"table A" similar record will be inserted into "table B" (Insert trigger in table A)
One of our process does ,
Insert into table c
Select (some calculations) from table B
then ,
delete from table B
I'm not sure when table A will be loaded.
It can be loaded anytime (means table B too)..
But our process starts at 10AM everyday, so it fetches from table B arround 10AM, If during that time table B is getting loaded , then it takes only records loaded at that time. How to make my select statement to wait until all records get loaded into table B ?
Load process is done by someother group, so we cant
change their process.Its impossible.
Our process starts when we start pulling data from
"table B". I can alter the process from this point only.
Is that possible to check whether is there any lock in
table and then start fetching data.
For eg ,
If [ ANY LOCK IN TABLE B ] then
Wait [ DONT FETCH ]
Else
[ LOCK TABLE B , SO THAT NO NEW RECORDS ARE INSERTED ]
Select from "table B"
Delete from "table B"
End
2 REPLIES 2
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-21-2003 01:34 PM
тАО05-21-2003 01:34 PM
Re: Lock the Table
simple....
insert table D
as select * from table B;
insert table C
as select * from table D;
delete from table B
where D.record = B.record;
delete * from table D;
repeat.....
insert table D
as select * from table B;
insert table C
as select * from table D;
delete from table B
where D.record = B.record;
delete * from table D;
repeat.....
Remember, wherever you go, there you are...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-21-2003 02:29 PM
тАО05-21-2003 02:29 PM
Re: Lock the Table
This should be cleaned up quite a bit (if statements, etc) but this is a basic concept for it:
-------
declare
numcount number := '1';
begin
while numcount > 0 loop
-- xxxxx should be the object id for the
select count(*) into numcount from
v$locked_object where object_id = 'xxxxx';
dbms_lock.sleep('10');
end loop;
end;
/
--------
Hope this helps,
Brian
-------
declare
numcount number := '1';
begin
while numcount > 0 loop
-- xxxxx should be the object id for the
select count(*) into numcount from
v$locked_object where object_id = 'xxxxx';
dbms_lock.sleep('10');
end loop;
end;
/
--------
Hope this helps,
Brian
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP