Job Seekers   Employers
dbapool: Authors | Submissions | Contact Us
   Forgot password? | Sign up
  Home   Discussion Forum   Articles   Interview Questions   FAQs   Scripts   Rewards   Analyzer   White Papers   Blog   Certification   Downloads   Tools
 

Topic: SQL*Plus and PL/SQL >> Delete Record from table without logging in Redolog..

Disclaimer: The purpose of all dbapool forums including OCP and Other Oracle Certification forums is to help each other with specific issues but not to share dump and copyrighted exam content, materials or intellectual property. You may review the entire Oracle Certification Program Candidate Agreement online Here.



  


 Title: Delete Record from table without logging in Redolog..
 Dusmanta  Posted: May 23, 2008 03:23:37 AM

 Total Post: 4
 Joined: May, 2008






 Hi,

I need to delete around 500000 of records. But i don't want rollback for the operation. Need to avoid witting into redo log.

i have tried with nologging. But I am not getting the proper result.

DELETE FROM CMF NOLOGGING WHERE ACCOUNT_NO IN (SELECT ACCOUNT_NUMBER FROM CUSTOMER_ACCOUNTS WHERE ACCOUNT_NUMBER = ACCOUNT_NO);

If i am using NOLOGGING then Redolog size is more than a simple DELETE statement.

SELECT NAME, VALUE FROM v$sysstat
WHERE NAME = 'redo size'

Please guide me if I am going in a wrong way.

Cheers:)
Dusmanta

 Murtuja
Posted: May 23, 2008 04:34:33 AM  

 Total Post: 857
 Joined: Jan, 2006






 
We can't use NOLOGGING option with delete.

NOLOGGING option can be used with
create/alter table
create/alter index
direct load

In your situation CTAS method will be useful in terms of performance.

create table CMF_temp NOLOGGING PARALLEL 4
as select * from cmf WHERE ACCOUNT_NO NOT IN (SELECT ACCOUNT_NUMBER FROM CUSTOMER_ACCOUNTS WHERE ACCOUNT_NUMBER = ACCOUNT_NO);

Drop table cmf;

create indexes on cmf_temp

alter table cmf_temp rename to cmf;





 Dusmanta
Posted: May 23, 2008 06:54:41 AM  

 Total Post: 4
 Joined: May, 2008






 

Is there any other way to avoid writting into redo log.

As in my table there is more than 20,00,000 of rec. Again recreating a temp table and dropping the table it is takeing more time.

and now it is creating more redolog for all three operations.



 Murtuja
Posted: May 23, 2008 07:09:15 AM  

 Total Post: 857
 Joined: Jan, 2006






 
Hi,

Read this link. It will convince you to follow CTAS method

http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5033906925164.

 Time Zone: EDT

  




Forum Rules & Description


Who Can Read The Forum? Any registered user or guest
Who Can Post New Topics? Any registered user
Who Can Post Replies? Any registered user




 








Get FREE Magazines

Top 10 Forum User

  Murtuja Khokhar857
  Mohammed Taj746
  positive fanatic483
  Jayanta Sur479
  Vigyan Kaushik386
  Gopu Gopi327
  Gitesh Trivedi322
  Vinoth Kumar264
  neeraj sharma258
  Ramesh Jois246






oracle Mag



  About Us Advertise Terms of Use Privacy Newsletters Contact Us    

Home   Discussion Forum   FAQs  Articles  Jobs   Newsletters  Directory  Downloads 

Our Premium Sponsor
Confio Software