?
Solved

Scripts need for purging the auditing data

Posted on 2011-09-14
4
Medium Priority
?
394 Views
Last Modified: 2013-12-19
Hi,

Can any one Please tell me how to write a script for purging the audit data from tables .

I am using the windows, i want to shedule the job using SHEDULED TASKS

I need to 2 scripts

1st is for purging the auditing data from source table ( database1) to Stage table (database 2) .
I want to keep the data in stage table for 3 months.

2nd is   purging the auditing data from Stage table(database 2) to Final table(database 2)
I want to keep the data in final table for 1 year.

Thanks
0
Comment
Question by:Cha1tu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 74

Accepted Solution

by:
sdstuber earned 2000 total points
ID: 36537222
purging "to" something doesn't make sense

a purge is a removal, so they don't go anywhere.


3 month purge...

delete your_audit_table where your_audit_timestamp < add_months(sysdate,-3)

12 month purge...

delete your_audit_table where your_audit_timestamp < add_months(sysdate,-12)
0
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 36537246
I believe they want to 'archive' then remove.

Use the date values above to export/import between the databases.
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 36537247
if you want to copy audit records from one database to another,  you've already asked that multiple times


for instance...

http://www.experts-exchange.com/Database/Oracle/Q_26927373.html

only thing different here is writing the records across a db link, which you also asked about

and including the timestamp where clause as above.
0
 
LVL 74

Expert Comment

by:sdstuber
ID: 36537264
I knew I had answered the auditing move question recently,  but it wasn't you

it was a different asker..., sorry for the confusion

http://www.experts-exchange.com/Database/Oracle/Q_27261461.html
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction A previously published article on Experts Exchange ("Joins in Oracle", http://www.experts-exchange.com/Database/Oracle/A_8249-Joins-in-Oracle.html) makes a statement about "Oracle proprietary" joins and mixes the join syntax with gen…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question