- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ps/sql code for merge/copy/delete
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
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
Community
Resources
Forums
Blogs
- 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
01-26-2004 06:48 PM
01-26-2004 06:48 PM
Re: ps/sql code for merge/copy/delete
I am wondering. Is it possible, that while you copy data from temp to prod, new rows are inserted into temp? If so, you may miss rows, which are inserted after the insert begins.
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2004 07:30 PM
01-26-2004 07:30 PM
Re: ps/sql code for merge/copy/delete
Yes you are correct, while we copy data there are rows being inserted/appended into temp_table
via sqlldr. Do you think that we might be deleting records that were not copied over to the
prod_table? If so, how do you propose that we prevent this?
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2004 07:36 PM
01-26-2004 07:36 PM
Re: ps/sql code for merge/copy/delete
The only exception to this rule is when several parallel direct load sessions are used concurrently.
So loading in temp_table should get over before transfer to prod_table.
Refer
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96652/ch09.htm#1008227
for more on Parallel Direct Path Load
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2004 07:40 PM
01-26-2004 07:40 PM
Re: ps/sql code for merge/copy/delete
You have to synchronize the SQL Loader job and update procedure in such a way that one is running at a time.
For example: Immediately after loading in temp_table, start the procedure to upload data in prod_table.
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2004 08:28 PM
01-26-2004 08:28 PM
Re: ps/sql code for merge/copy/delete
insert into prod_table select * from temp_table where loaded = 'N';
commit;
update temp_table set loaded = 'Y' where loaded = 'N';
delete from temp_table where loaded = 'Y';
Oracle has a feature called read consistency, meaning, when you start the select from only the commited rows are considered. The update/delete however may have another set of rows, when they start. You could delete rows, which are not in your prod table yet.
My idea would be to add a timestamp field to the temp table. First you would get the latest time stamp, which you use for insert and delete. That way you would have a consistent set of rows.
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2004 09:07 PM
01-26-2004 09:07 PM
Re: ps/sql code for merge/copy/delete
This issue (read consistency) will not occur if we put commit in the last:
insert into prod_table select * from temp_table where loaded = 'N';
update temp_table set loaded = 'Y' where loaded = 'N';
delete from temp_table where loaded = 'Y';
commit;
I still think that direct loading (sql*loader) will have conflict with simultanous execution of any other DML.
sks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2004 09:42 PM
01-26-2004 09:42 PM
Re: ps/sql code for merge/copy/delete
We will test the "commit" after the update/delete transactions to see what impact it has on records being
loaded during the procedure run operation. Thanks to all for the help thus far, we appreciate it!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2004 10:02 PM
01-26-2004 10:02 PM
Re: ps/sql code for merge/copy/delete
if you precede the insert with a:
set transaction read write
then all subsequent commands til the next commit will refer to the same scn for read consistency.
Michael
- « Previous
-
- 1
- 2
- Next »