[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2461
  • Last Modified:

Diasable redo log for the table

I have a table which is heavily inserted with data periodically and goes to the order of 5G over the period of 20days and then it is cleaned by trigger. So given point of time it holds only last 20days worth of data.
Question is I want to disable the redo log for this table so that when I recover the database I can skip this table as the data is not critical to recover and we can improve the recovery time by skipping it.

What is the best way to do it, I know there is NOARCHIVELOG option I can set, but according to ORacle documentation that one still generates logs and not reliable.

Any ideas?
0
shasta123
Asked:
shasta123
  • 2
  • 2
  • 2
  • +2
3 Solutions
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
you cannot disable redo log at all.
NOARCHIVELOG only avoids dumping out the redo log into .arc files (for recovery), but that's all.

the only thing you can do is ensure that the redo logs are big enough, that you have a couple of them, and that they are located on the fastest disks on your sever.
0
 
virtual_voidCommented:
You can disable redo log for a table by changing it to nologging mode:

C:\downloads\script>sqlplus "/ as sysdba"

SQL*Plus: Release 10.2.0.1.0 - Production on Mon Mar 20 15:47:02 2006

Copyright (c) 1982, 2005, Oracle.  All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options

SQL> create table amittest as select * from v$session;

Table created.

SQL> alter table amittest nologging;

Table altered.

SQL>

Thanks
0
 
RCorfmanCommented:
This will help, but for it to be effective, the tablespace it is in also must be a 'nologging' tablespace (otherwise the tablespace logs). And not all DML will operate in loglogging mode, there are a lot of restrictions in getting this to work (we struggled with this on our data warehouse). In fact, updates and deletes to NOT honor nologging.

For inserts, you need to force the insert to be a direct-path insert by using the
insert /*+ append */  hint on the insert.

Per the manual:
Only the following operations support the NOLOGGING mode for DML:
Direct-path INSERT (serial or parallel)
Direct Loader (SQL*Loader)

I'm afraid for this delete/cleanup, there isn't much you can do. You COULD consider doing a direct-path insert to a new table of all the columns you want, then doing a truncate of the table, and rename the tables. This won't help if you have referential integrity constraints pointing to the table...
0
Get your Disaster Recovery as a Service basics

Disaster Recovery as a Service is one go-to solution that revolutionizes DR planning. Implementing DRaaS could be an efficient process, easily accessible to non-DR experts. Learn about monitoring, testing, executing failovers and failbacks to ensure a "healthy" DR environment.

 
Mark GeerlingsDatabase AdministratorCommented:
When you say that after 20 days the data in this table is: "cleaned by trigger" how is that done, with a "delete..." command?  If so, and if you have Oracle's Enterprise Edition, you could partition this table, then simply drop an entire partition when the data is no longer needed.  That will go much faster and generate *MUCH* less redo, at least for the delete.

You also indicated that NOARCHIVELOG is unreliable.  I disagree, it may not be as thorough as you would like, since NOARCHIVELOG only applies to certain types of inserts and/or data loads, but I have always found it to be reliable in those cases.
0
 
shasta123Author Commented:
I have not forgotten your replies, trying to digest them all.
0
 
shasta123Author Commented:
Sorry for the late reply, but our table is not loaded once in bulk so that i could use the direct path serial load.

It is a table which is inserted by a server process periodically? How do i skip the redo for this table so that for recovery i can skip this table ?
0
 
Mark GeerlingsDatabase AdministratorCommented:
Does your "server process" that does the inserts use this syntax: "insert into [table_name] ... select ... from [some other table(s) or view(s)]"?

If not, and you can't use a direct path load either, then no, you cannot disable redo logiing for this table.

What does your "server process" look like?  Is it a stored procedure?
0
 
RCorfmanCommented:
Also, if you are only inserting one or two records, you wouldn't want to use direct path. It only makes sense if you are really doing a bulk insert.
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 2
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now