Skip to Main Content

Breadcrumb

Question and Answer

Chris Saxon

Thanks for the question, Ajoy.

Asked: July 04, 2016 - 12:36 pm UTC

Last updated: July 05, 2016 - 4:44 pm UTC

Version: 11.2.0.4.0

Viewed 1000+ times

You Asked

Hi,

We have a problem, each day our DR setup is getting about 300 GB of data. We have found this is due to the huge amount of archive logs being written. We have certain bulk operations that are taking place, most of which are from bulk deletes or updates which is not actually required.

Is there a way to stop the logging before a DML?

Thanks,
Ajoy

and Chris said...

How exactly are you managing your DR? If it's with Data Guard, you'll need log the operations or you're going to cause your DBAs a lot of work on the standby:

https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:6675683600346422502

If you're using some other solution, then you'll almost certainly still be causing your DBAs a lot of work to sort out the DR site.

"most of which are from bulk deletes or updates which is not actually required."

So you're doing some large scale DML you don't need to?

Then the easiest way to stop logging is:

Don't do the DML in the first place!

If you must disable logging, read
https://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5280714813869

Rating

  (1 rating)

Is this answer out of date? If it is, please let us know via a Comment

Comments

Ajoy George, July 05, 2016 - 1:33 pm UTC

Chris,

We are using Data guard to manage DR.

When I said "DMLs mostly not required", I meant we do not need the REDO logs for same as its just the data that is to be transferred to another system via a interface and deleted in 3 days.

My worry here is if I change the table to NOLOGGING and add APPEND hint:
1. there will be periodic DELETEs(to remove data already pushed via interface job), will it cause lot of unclaimed space. Is it possible to bring back High Water Mark through index rebuild? There are no other conventional INSERTS happening on the table.
2. would I be able to similarly avoid creation of REDO logs during DELETE and UPDATE using APPEND hint?
3. is it possible to alter to NOLOGGING at a query level instead of table level? or any better approach available in 11g?

Thanks,
Chris Saxon
July 05, 2016 - 4:44 pm UTC

"I meant we do not need the REDO logs".

Well, if you want to apply the changes at your DR site, then yes, you do need the redo!

If you're looking to minimize the redo, there are other options such as:

- Do the delete as a "create table as select"
- Partition the table. Then instead of deleting the data it's a truncate/drop partition operation. This will be far less redo than the delete.

Investigate these!

1. The table high water mark is unrelated to indexes. You'll need to move the table to reclaim this space.

2. Append only applies for inserts.

3. No. And if your database is in force logging mode this will ensure you always log.