Question

TRUNCATING AUD$

Rating7.4Very Good

Dear all,

I am creating a PS/SQL package to truncate SYS.AUD$ after backing up the data

1) insert into mybackupAUD as select * from SYS.AUD$
2) TRUNCATE TABLE SYS.AUD$

My question is the following:

How do I avoid any new records in my SYS.AUD$ between steps 1 and 2.

Example:
-Insert as select Done at 14:32:00
-User XX login at 14:32:01
-Truncate at 14:32:02

I lost login audit of User X.  

I am posting this question with 125 points, but I am ready to give all my available points (380) if I get an answer that works!

Many thanks in advance.

Z;D

  1. insert into table
    INSERT INTO t1 (id, name, empno,title) VALUES (1,'SAM',(SELECT empno FROM t2 WHERE id = '1001' AND status = 'Active'),'MGR') The select query can retrieve more than one row (very rare) then insert fails. i can use by puttin…
  2. ORA-02019 - Select from a remote DB and…
    We have a scenario involving 3 databases. (Say A, B, C) In databaase B, a proc runs selecting a table from database A and inserting into database C. We get a ORA-02019 error during this query. Here are some more details: Database B: The proc resides here. For this database, db_domain=' ' Select * from glob…
  3. Select existing string if exists from on etable and i…
    We have a lookup table that has a list of facilities with a unique ID assigned. When a user creates a record, the facility name is inserted into a lookup table and assigned a unique ID. If the user types a name that is already in existance, then the code should pull the existing name from the lookup table and insert into the record table; otherwise, disregard the insert …
  4. two million recs using insert select...
    Hi Guru's, I have 3 insert select queries in a single script, just select from a single table B and insert into tableA the query won't finish at all... i have a trigger on the tableA (where i'm inserting into), this trigger basically updates another tableC when ever ther is an insert on table A... Please advise... this would be run once in a …
  5. What would be the best way to select and insert…
    a_table has 22 columns: a_id, a_name, a_1, a_2, a_2...a_20. I need to select from this table (which is in a different schema) and insert into my_table 20 times: insert into my_table(select a_id, a_name, a_1 where a_1 is not null); insert into my_table(select a_id, a_name, a_2 where a_2 is not null); . .…

Solution

Sign up now to view this solution! It's quick, easy, and secure to subscribe. We will return you to this solution, unlocked, when you’re done.

About this Solution
View This Solution - Start Your 30 Day Free Trial
Zone
General
Tags
truncate
Participating Experts
2
Solution Grade
A

Replies

 
by:

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: Zopilote

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: seazodiac

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: seazodiac

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: Zopilote

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: seazodiac

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: vc01778

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: vc01778

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: Zopilote

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: seazodiac

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: Zopilote

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: seazodiac

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: seazodiac

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

 
by: Zopilote

All comments and solutions are available to Premium Service Members only. Sign up to view the solution to this question. Already a member? Log in to view this solution.

Stay Connected

Oracle Around the Web

The latest Oracle news, tips, and tricks

Oracle Unveils Netra SPARC T3 Servers

New Carrier-Grade Blade and Rackmount Servers Deliver Better Performance, Density and Power Efficiency for the Communications Industry ...

read more

Oracle fixes 21 flaws in Java SE, Java for Business

Oracle is fixing 21 flaws in its Java SE and Java for Business products in its February critical patch update issued this week ...

read more

Obama’s Silicon Valley “Tech Supper”

Why was he there? Who wasn’t invited and why? What did they talk about? Why was he really there? These are the questions being debated ...

read more

Featured Oracle Experts

slightwv

slightwv has answered more than 2,000 Oracle questions and oversees database management within the U.S. Government. Slightwv

sdstuber

A regular presenter at the Collaborate conference, Oracle developer sdstuber is a top expert in PL/SQL and Oracle 9, 10 and 11. sdstuber

Testimonials

What users are saying about our experts

"The Oracle gurus provide answers, solutions and valuable workarounds"

User: schwertner

"Wow! Excellent, valuable explanation. Hats off to you"

User: aseshu70

"Solution worked fantastic and performs excellent! Thanks heaps"

User: klausbrandlhuber

Top Experts

  1. slightwv

    2,000

    0 points yesterday

    Profile

BrowseBecome an Expert