Use DBMS_AUDIT_MGMT for purging audit files at OS level

Few of the times we have scenario where db logon fails with ORA-09925: Unable to create audit trail file.Mostly a weekly crontab would have been set to delete the trace files, audit files etc from the server. From 11gR2 oracle introduced and started supporting dbms_audit_mgmt for managing the various audit trail types like database audit trails, operating system (OS) audit trails, and XML audit trails.

03:38:43 SYS@matrix1 > SELECT table_name, tablespace_name FROM dba_tables WHERE table_name IN ('AUD$', 'FGA_LOG$') ORDER BY table_name;

TABLE_NAME                TABLESPACE_NAME
------------------------- -------------------------
AUD$                      SYSTEM
FGA_LOG$                  SYSTEM

select segment_name,bytes/1024/1024 size_in_megabytes from dba_segments where segment_name in ('AUD$','FGA_LOG$');03:39:14 SYS@matrix1 >

SEGMENT_NAME              SIZE_IN_MEGABYTES
------------------------- -----------------
AUD$                                    128
FGA_LOG$                              .0625

2 rows selected.

Elapsed: 00:00:00.26
03:39:15 SYS@matrix1 >
03:39:16 SYS@matrix1 > @table_info
Enter value for table_name: aud$
old   9: WHERE  table_name  like UPPER('%&table_name%')
new   9: WHERE  table_name  like UPPER('%aud$%')

TABLE_NAME                     OWNER      TABLESPACE_NAME             NUM_ROWS LAST_ANALYZED               AVG_ROW_LEN     BLOCKS EMPTY_BLOCKS
------------------------------ ---------- ------------------------- ---------- --------------------------- ----------- ---------- ------------
AUD$                           SYS        SYSTEM                        630545 14-JAN-12-10:01:47                  157      15204            0

1 row selected.
07:14:09 SYS@matrix1 > select * from DBA_AUDIT_MGMT_CLEANUP_JOBS;

no rows selected

Elapsed: 00:00:00.06
07:16:51 SYS@matrix1 > select * from DBA_AUDIT_MGMT_CLEAN_EVENTS;

no rows selected
07:16:59 SYS@matrix1 > select * from DBA_AUDIT_MGMT_CONFIG_PARAMS;

PARAMETER_NAME                 PARAMETER_VALUE      AUDIT_TRAIL
------------------------------ -------------------- ----------------------------
DB AUDIT TABLESPACE            SYSAUX               STANDARD AUDIT TRAIL
DB AUDIT TABLESPACE            SYSAUX               FGA AUDIT TRAIL
AUDIT FILE MAX SIZE            10000                OS AUDIT TRAIL
AUDIT FILE MAX SIZE            10000                XML AUDIT TRAIL
AUDIT FILE MAX AGE             5                    OS AUDIT TRAIL
AUDIT FILE MAX AGE             5                    XML AUDIT TRAIL
DB AUDIT CLEAN BATCH SIZE      10000                STANDARD AUDIT TRAIL
DB AUDIT CLEAN BATCH SIZE      10000                FGA AUDIT TRAIL
OS FILE CLEAN BATCH SIZE       1000                 OS AUDIT TRAIL
OS FILE CLEAN BATCH SIZE       1000                 XML AUDIT TRAIL

Current the adump has *.aud file from 25Sept in the audit_file_dest location.

(matrix1) /u01/app/oracle/admin/matrix> du -sh *
91M     adump
(matrix1) /u01/app/oracle/admin/matrix/adump> ls -lrt *aud | wc -l
58375

To setup the audit file deletion at OS level –

1. set init cleanup –This procedure sets up the audit management infrastructure and a default cleanup interval for the audit trail records. If the audit trail tables are in the SYSTEM tablespace, then the procedure moves them to the SYSAUX tablespace.

BEGIN
DBMS_AUDIT_MGMT.INIT_CLEANUP(
audit_trail_type => dbms_audit_mgmt.AUDIT_TRAIL_OS,
default_cleanup_interval => 24*7); -->The default time interval, in hours, after which the cleanup procedure should be called.
end;
/

2. set last archive timestamp –> This procedure sets a timestamp indicating when the audit records were last archived. The audit administrator provides the timestamp to be attached to the audit records.

As i want to retain 30days of audit files on OS i use AUDIT_TRAIL_OS and set last_archive_time => sysdate – 30.If the audit location is not shared between the nodes, specify the rac_instance_number parameter.

begin
DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP(
audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_OS,
last_archive_time => sysdate - 30,
rac_instance_number => 1 );
end;
/

begin
DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP(
audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_OS,
last_archive_time => sysdate - 30,
rac_instance_number => 2 );
end;
/

3. setup a purge –> This procedure creates a purge job for periodically deleting the audit trail records.This procedure carries out the cleanup operation at intervals specified by the user. It calls the CLEAN_AUDIT_TRAIL Procedure to perform the cleanup operation.As i want the job to be run weekly so AUDIT_TRAIL_PURGE_INTERVAL => 24*7.

BEGIN
DBMS_AUDIT_MGMT.CREATE_PURGE_JOB (
AUDIT_TRAIL_TYPE => DBMS_AUDIT_MGMT.AUDIT_TRAIL_OS,
AUDIT_TRAIL_PURGE_INTERVAL => 24*7,
AUDIT_TRAIL_PURGE_NAME => 'Standard_OS_Audit_Trail_Purge',
USE_LAST_ARCH_TIMESTAMP => TRUE );
END;
/

Now, using the oracle views lets check –

07:42:19 SYS@matrix1 > select * from DBA_AUDIT_MGMT_CLEANUP_JOBS;
JOB_NAME                            JOB_STAT AUDIT_TRAIL                  JOB_FREQUENCY
----------------------------------- -------- ---------------------------- -------------------------
STANDARD_OS_AUDIT_TRAIL_PURGE       ENABLED  OS AUDIT TRAIL               FREQ=HOURLY;INTERVAL=168

07:43:17 SYS@matrix1 > select * from DBA_AUDIT_MGMT_LAST_ARCH_TS;

AUDIT_TRAIL          RAC_INSTANCE LAST_ARCHIVE_TS
-------------------- ------------ ---------------------------------------------------------------------------
OS AUDIT TRAIL                  1 20-DEC-11 07.41.08.000000 AM -06:00
OS AUDIT TRAIL                  2 20-DEC-11 07.41.52.000000 AM -06:00

2 rows selected.
07:59:56 SYS@matrix1 > select * from DBA_AUDIT_MGMT_CLEAN_EVENTS;

AUDIT_TRAIL                  RAC_INSTANCE CLEANUP_TIME                                                                DELETE_COUNT WAS
---------------------------- ------------ --------------------------------------------------------------------------- ------------ ---
OS AUDIT TRAIL                          1 19-JAN-12 01.43.03.761395 PM +00:00                                                 1003 NO
OS AUDIT TRAIL                          2 19-JAN-12 01.43.03.811156 PM +00:00                                                 1000 NO
OS AUDIT TRAIL                          1 19-JAN-12 01.43.12.972868 PM +00:00                                                 1000 NO
.............................

08:07:15 SYS@matrix1 > select OWNER,JOB_NAME,to_char(last_start_date,'DD-MM-YY HH24:MI:SS') Last_date_time, to_char(next_run_date,'DD-MM-YY HH24:MI:SS') Next_Date_Time, JOB_ACTION from DBA_SCHEDULER_JOBS;

OWNER      JOB_NAME                       LAST_DATE_TIME       NEXT_DATE_TIME       JOB_ACTION
---------- ------------------------------ -------------------- -------------------- --------------------------------------------------------------------------------
SYS        STANDARD_OS_AUDIT_TRAIL_PURGE  19-01-12 05:42:18    26-01-12 05:42:18    BEGIN DBMS_AUDIT_MGMT.CLEAN_AUDIT_TRAIL(4, TRUE);  END;
..........

I believe its a better and easier way for purging the audit files.To explore more check out the reference.

Reference – http://docs.oracle.com/cd/E11882_01/appdev.112/e25788/d_audit_mgmt.htm#BABFHEFH

Moving AUD$ table to another tablespace in 11gR2

From 11gR2 moving the AUD$ table to another tablespace using dbms_audit_mgmt, has been officially introduced/supported. DBMS_AUDIT_MGMT enables audit administrators to manage the various audit trail types like database audit trails, operating system (OS) audit trails, and XML audit trails. It is installed by default in Oracle 11.2 and makes thing easier.

SQL> SELECT table_name, tablespace_name FROM dba_tables WHERE table_name IN ('AUD$', 'FGA_LOG$') ORDER BY table_name;

TABLE_NAME                     TABLESPACE_NAME
------------------------------ ------------------------------
AUD$                           SYSTEM
FGA_LOG$                       SYSTEM

SQL> select segment_name,bytes/1024/1024 size_in_megabytes from dba_segments where segment_name in ('AUD$','FGA_LOG$');

SEGMENT_NAME                                                                      SIZE_IN_MEGABYTES
--------------------------------------------------------------------------------- -----------------
AUD$                                                                                          .5625
FGA_LOG$                                                                                      .0625

Now, suppose we deleted rows from aud$ and now want to shrink the table. It couldn’t be done as AUD$ is in SYSTEM tablespace whose segment space management is MANUAL.

SQL> alter table sys.aud$ enable row movement;

Table altered.

SQL> alter table sys.aud$ shrink space cascade;
alter table sys.aud$ shrink space cascade
*
ERROR at line 1:
ORA-10635: Invalid segment or tablespace type

In such cases, you can now move the AUD$ table to the tablespace with AUTO segment space management and shrink it.To do so -

SQL> BEGIN
  2  DBMS_AUDIT_MGMT.SET_AUDIT_TRAIL_LOCATION(audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD,
  3  audit_trail_location_value => 'USERS');
  4  END;
  5  /

PL/SQL procedure successfully completed.

SQL> SELECT table_name, tablespace_name FROM dba_tables WHERE table_name IN ('AUD$', 'FGA_LOG$') ORDER BY table_name;

TABLE_NAME                     TABLESPACE_NAME
------------------------------ ------------------------------
AUD$                           USERS
FGA_LOG$                       SYSTEM

SQL> select segment_name,bytes/1024/1024 size_in_megabytes from dba_segments where segment_name in ('AUD$','FGA_LOG$');

SEGMENT_NAME                                                                      SIZE_IN_MEGABYTES
--------------------------------------------------------------------------------- -----------------
AUD$                                                                                           .625
FGA_LOG$                                                                                      .0625

SQL> @table_info
Enter value for table_name: aud$
old   9: WHERE  table_name  like UPPER('%&table_name%')
new   9: WHERE  table_name  like UPPER('%aud$%')

TABLE_NAME                     OWNER                          TABLESPACE_NAME                  NUM_ROWS LAST_ANALYZED     AVG_ROW_LEN     BLOCKS EMPTY_BLOCKS
------------------------------ ------------------------------ ------------------------------ ---------- ----------------- ----------- ---------- ------------
AUD$                           SYS                            USERS                                2331 19-01-12 14:06:33         186         68            0

The last_analyed date got changed too, so seems like oracle internally analyzes it. Internally oracle does

PARSING IN CURSOR #880020292 len=94 dep=1 uid=0 oct=1 lid=0 tim=14104773154 hv=269341700 ad='287d2a1c' sqlid='99yczn480vp04'
ALTER TABLE "SYS".AUD$ MOVE TABLESPACE USERS LOB(SQLBIND, SQLTEXT) STORE AS (TABLESPACE USERS)
END OF STMT
SQL> select owner,table_name,column_name,segment_name,tablespace_name,index_name from dba_lobs where owner='SYS' and table_name='AUD$';

OWNER                          TABLE_NAME                     COLUMN_NAM SEGMENT_NAME                TABLESPACE_NAME           INDEX_NAME
------------------------------ ------------------------------ ---------- ------------------------------ ------------------------------ ------------------------------
SYS                            AUD$                           SQLBIND    SYS_LOB0000000384C00040$$   USERS                             SYS_IL0000000384C00040$$
SYS                            AUD$                           SQLTEXT    SYS_LOB0000000384C00041$$   USERS                             SYS_IL0000000384C00041$$

The SCN Issue – Addressed in Jan 2012 CPU

Recently it has been found that database can run out of SCN (as it jumps to very high values)if we use HOT BACKUP, Database Links etc causing ORA-00600 [2252].Infoworld has published an article on it -

http://www.infoworld.com/d/security/fundamental-oracle-flaw-revealed-184163-0?page=0,0

The Jan 2012 CPU patch seems to have addressed the issue.Have a look on it and decide :)

Incremental stats on partitioned tables – Blogs to read

Recently in past one week i read few blogs on “Incremental stats on partitioned tables”, which i felt are worth mentioning for remembering it myself and might be helpful to some others too.

http://oracle-randolf.blogspot.com/2012/01/incremental-partition-statistics-review.html

http://rnm1978.wordpress.com/2010/12/31/data-warehousing-and-statistics-in-oracle-11g-incremental-global-statistics/

http://jhdba.wordpress.com/2012/01/04/speeding-up-the-gathering-of-incremental-stats-on-partitioned-tables/

Happy reading :)

set newname command made easier in 11gR2

From 11gR2 oracle introduced new options for “SET NEWNAME” command.

1.SET NEWNAME FOR DATAFILE and SET NEWNAME FOR TEMPFILE
2.SET NEWNAME FOR TABLESPACE
3.SET NEWNAME FOR DATABASE

The following variables are introduced for SET NEWNAME from 11gR2 :-

%b The file name remains same as the original. For example, if a datafile is named D:\oracle\oradata\matrix\test.dbf, then %b results in test.dbf.
%f Specifies the absolute file number of the datafile for which the new name is generated.
%I Specifies the DBID.
%N Specifies the tablespace name.
%U Specifies the following format: data-D-%d_id-%I_TS-%N_FNO-%f.

Time to test :)

In my test, i am creating a duplicate database ORCL, from the rman backup of MATRIX database. As i am doing it on Windows box, i do hit ORA-600 [KSMFPG5], [0xAEC0000], which is a bug, and also mentioned in one of my previous blog.

1. taking backup of matrix database -

RMAN> run{
2> backup database format 'D:\oracle\backup\matrix\%d_%s_%p';
3> backup archivelog all format 'D:\oracle\backup\matrix\arc_%d_%s_%p';
4> }

Starting backup at 11-JAN-12
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=D:\ORACLE\ORADATA\MATRIX\SYSTEM01.DBF
..............
channel ORA_DISK_1: finished piece 1 at 11-JAN-12
piece handle=D:\ORACLE\BACKUP\MATRIX\ARC_MATRIX_10_1 tag=TAG20120111T133016 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07
Finished backup at 11-JAN-12

The database as well as the archivelog backupset exist in D:\ORACLE\BACKUP\MATRIX\

2. Duplicating db MATRIX to ORCL. Before executing the command, created ORCL pfile , passwordfile and windows service using oradim utility.

D:\scripts>set oracle_sid=ORCL

D:\scripts>sqlplus / as sysdba

SQL*Plus: Release 11.2.0.2.0 Production on Wed Jan 11 13:32:14 2012

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

Connected to an idle instance.

SQL> startup nomount
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area  150667264 bytes
Fixed Size                  1382112 bytes
Variable Size              92277024 bytes
Database Buffers           50331648 bytes
Redo Buffers                6676480 bytes
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

D:\scripts>
D:\scripts>
D:\scripts>rman auxiliary /

Recovery Manager: Release 11.2.0.2.0 - Production on Wed Jan 11 13:33:02 2012

Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.

connected to auxiliary database: ORCL (not mounted)

RMAN> run {
2>
3> SET NEWNAME FOR DATABASE   TO 'D:\oracle\oradata\orcl\%b';
4> SET NEWNAME FOR TEMPFILE 1 TO 'D:\oracle\oradata\orcl\temp01.dbf' ;
5>
6> DUPLICATE DATABASE 'MATRIX' DBID 2312606933
7>  TO ORCL
8>   BACKUP LOCATION 'D:\oracle\backup\matrix'
9> LOGFILE
10> GROUP 1 ('D:\oracle\oradata\orcl\redo01a.log',
11> 'D:\oracle\oradata\orcl\redo01b.log') SIZE 50M REUSE,
12> GROUP 2 ('D:\oracle\oradata\orcl\redo02a.log',
13> 'D:\oracle\oradata\orcl\redo02b.log') SIZE 50M REUSE,
14> GROUP 3 ('D:\oracle\oradata\orcl\redo03a.log',
15> 'D:\oracle\oradata\orcl\redo03b.log') SIZE 50M REUSE;
16> }

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting Duplicate Db at 11-JAN-12

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''MATRIX'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''ORCL'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone primary controlfile from  'D:\ORACLE\BACKUP\matrix\MATRIX_9_1';
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''MATRIX'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''ORCL'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area     150667264 bytes

Fixed Size                     1382112 bytes
Variable Size                 92277024 bytes
Database Buffers              50331648 bytes
Redo Buffers                   6676480 bytes

Starting restore at 11-JAN-12
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=130 device type=DISK

channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
output file name=D:\ORACLE\ORADATA\ORCL\CONTROL01.CTL
output file name=D:\ORACLE\ORADATA\ORCL\CONTROL02.CTL
Finished restore at 11-JAN-12

database mounted
released channel: ORA_AUX_DISK_1
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=130 device type=DISK

contents of Memory Script:
{
   set until scn  859591;
   set newname for datafile  1 to
 "D:\oracle\oradata\orcl\SYSTEM01.DBF";
   set newname for datafile  2 to
 "D:\oracle\oradata\orcl\SYSAUX01.DBF";
   set newname for datafile  3 to
 "D:\oracle\oradata\orcl\UNDOTBS01.DBF";
   set newname for datafile  4 to
 "D:\oracle\oradata\orcl\USERS01.DBF";
   set newname for datafile  5 to
 "D:\oracle\oradata\orcl\EXAMPLE01.DBF";
   restore
   clone database
   ;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 11-JAN-12
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to D:\oracle\oradata\orcl\SYSTEM01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00002 to D:\oracle\oradata\orcl\SYSAUX01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00003 to D:\oracle\oradata\orcl\UNDOTBS01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00004 to D:\oracle\oradata\orcl\USERS01.DBF
channel ORA_AUX_DISK_1: restoring datafile 00005 to D:\oracle\oradata\orcl\EXAMPLE01.DBF
channel ORA_AUX_DISK_1: reading from backup piece D:\ORACLE\BACKUP\MATRIX\MATRIX_8_1
channel ORA_AUX_DISK_1: piece handle=D:\ORACLE\BACKUP\MATRIX\MATRIX_8_1 tag=TAG20120111T132903
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:01:05
Finished restore at 11-JAN-12

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=6 STAMP=772292110 file name=D:\ORACLE\ORADATA\ORCL\SYSTEM01.DBF
datafile 2 switched to datafile copy
input datafile copy RECID=7 STAMP=772292110 file name=D:\ORACLE\ORADATA\ORCL\SYSAUX01.DBF
datafile 3 switched to datafile copy
input datafile copy RECID=8 STAMP=772292110 file name=D:\ORACLE\ORADATA\ORCL\UNDOTBS01.DBF
datafile 4 switched to datafile copy
input datafile copy RECID=9 STAMP=772292110 file name=D:\ORACLE\ORADATA\ORCL\USERS01.DBF
datafile 5 switched to datafile copy
input datafile copy RECID=10 STAMP=772292111 file name=D:\ORACLE\ORADATA\ORCL\EXAMPLE01.DBF

contents of Memory Script:
{
   set until scn  859591;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 11-JAN-12
using channel ORA_AUX_DISK_1

starting media recovery

channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=10
channel ORA_AUX_DISK_1: reading from backup piece D:\ORACLE\BACKUP\MATRIX\ARC_MATRIX_10_1
channel ORA_AUX_DISK_1: piece handle=D:\ORACLE\BACKUP\MATRIX\ARC_MATRIX_10_1 tag=TAG20120111T133016
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:03
archived log file name=D:\ORACLE\ARCHIVELOG\ORCL\ORCL_0000000010_0772282200_0001.ARC thread=1 sequence=10
channel clone_default: deleting archived log(s)
archived log file name=D:\ORACLE\ARCHIVELOG\ORCL\ORCL_0000000010_0772282200_0001.ARC RECID=1 STAMP=772292118
media recovery complete, elapsed time: 00:00:03
Finished recover at 11-JAN-12
Oracle instance started

Total System Global Area     150667264 bytes

Fixed Size                     1382112 bytes
Variable Size                 92277024 bytes
Database Buffers              50331648 bytes
Redo Buffers                   6676480 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''ORCL'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
   shutdown clone immediate;
}
executing Memory Script

sql statement: alter system set  db_name =  ''ORCL'' comment= ''Reset to original value by RMAN'' scope=spfile

sql statement: alter system reset  db_unique_name scope=spfile

Oracle instance shut down
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 01/11/2012 13:36:16
RMAN-05501: aborting duplication of target database
RMAN-04014: startup failed: ORA-00600: internal error code, arguments: [17099], [], [], [], [], [], [], [], [], [], [], []
ORA-00600: internal error code, arguments: [KSMFPG5], [0xAEC0000], [], [], [], [], [], [], [], [], [], []

RMAN> exit

For the ORA-600, recreated the controlfile, opened the database using RESETLOGS option and added temp file.

In earlier versions of oracle we had to mention SET NEWNAME command to rename the duplicate datafiles while restoring/duplicating the database, where we mentioned it for each and every datafile.

# set new filenames for the datafiles
SET NEWNAME FOR DATAFILE 1 TO ‘/dup/oracle/oradata/trgt/system01.dbf’;
SET NEWNAME FOR DATAFILE 2 TO ‘/dup/oracle/oradata/trgt/undotbs01.dbf’;

From 11gR2 simply using SET NEWNAME FOR DATABASE has made things easier.

Follow

Get every new post delivered to your Inbox.

Join 227 other followers