When I run my recovery for a tablespace point in time recovery, I keep getting:
RMAN-06136: ORACLE error from auxiliary database: ORA-04031: unable to allocate 1056 bytes of shared memory
On my target system here is the info for the pools:
SQL> select pool, sum(bytes)/1024/1024 Mbytes from v$sgastat group by pool;
POOL MBYTES
------------ ----------
918.84494
java pool 16
streams pool 16
shared pool 1024.00521
large pool 16
SQL> select * from v$sgainfo;
NAME BYTES RES
-------------------------------- ---------- ---
Fixed SGA Size 2131168 No
Redo Buffers 5046272 No
Buffer Cache Size 956301312 Yes
Shared Pool Size 1073741824 Yes
Large Pool Size 16777216 Yes
Java Pool Size 16777216 Yes
Streams Pool Size 16777216 Yes
Shared IO Pool Size 0 Yes
Granule Size 16777216 No
Maximum SGA Size 2137886720 No
Startup overhead in Shared Pool 184549376 No
NAME BYTES RES
-------------------------------- ---------- ---
Free SGA Memory Available 50331648
12 rows selected.
You can see below that what my AUX DB is setting as well. Here is my info from my catalog
SQL> select pool, sum(bytes)/1024/1024 Mbytes from v$sgastat group by pool;
POOL MBYTES
------------ ----------
176.632385
java pool 4
shared pool 260.00457
large pool 4
SQL> select * from v$sgainfo;
NAME BYTES RES
-------------------------------- ---------- ---
Fixed SGA Size 2133568 No
Redo Buffers 6918144 No
Buffer Cache Size 176160768 Yes
Shared Pool Size 272629760 Yes
Large Pool Size 4194304 Yes
Java Pool Size 4194304 Yes
Streams Pool Size 0 Yes
Shared IO Pool Size 0 Yes
Granule Size 4194304 No
Maximum SGA Size 784998400 No
Startup overhead in Shared Pool 67108864 No
NAME BYTES RES
-------------------------------- ---------- ---
Free SGA Memory Available 318767104
12 rows selected.
So my specs on the db's are:
Version- 11.1.0.7
Type - RAC, 2 Nodes Cluster
Server - Win2003, SP4, 3GHz, 4GB RAM, 64bit
Originally the target was set to 3GB's of a SGA_MAX_SIZE but I dropped it down to 2048M.
I assume the Aux DB's is where the error is happening as the export fails from there. Now, when I dropped the size of the target, I would have guessed that the shared_pool would have increased on the aux DB but it didn't. How can I get my aux db to get more space for the shared pool and actually complete my recovery.
Recovery Manager: Release 11.1.0.7.0 - Production on Wed Mar 24 14:12:49 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
RMAN> connect target dbaraman@edbtest2
target database Password:
connected to target database: EDBTEST (DBID=3958911274)
RMAN> connect catalog rman@rmancat
recovery catalog database Password:
connected to recovery catalog database
RMAN> run{
2> set newname for datafile 1 to "+DATA";
3> set newname for datafile 2 to "+DATA";
4> set newname for datafile 3 to "+DATA";
5> set newname for datafile 4 to "+DATA";
6> RECOVER TABLESPACE RAMANS
7> until time "to_date('23-MAR-2010 13:36:00','DD-MON-YYYY HH24:MI:SS')"
8> AUXILIARY DESTINATION 'C:\EDBTEST2_backup\oradata\auxdest';
9> }
executing command: SET NEWNAME
starting full resync of recovery catalog
full resync complete
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting recover at 24-MAR-10
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=495 instance=edbtest2 device type=DISK
Creating automatic instance, with SID='srmk'
initialization parameters used for automatic instance:
db_name=EDBTEST
compatible=11.1.0.0.0
db_block_size=8192
db_files=200
db_unique_name=tspitr_EDBTEST_srmk
large_pool_size=1M
shared_pool_size=110M
processes=50
#No auxiliary parameter file used
db_create_file_dest=C:\EDBTEST2_backup\oradata\auxdest
control_files=C:\EDBTEST2_backup\oradata\auxdest/cntrl_tspitr_EDBTEST_srmk.f
starting up automatic instance EDBTEST
Oracle instance started
Total System Global Area 204632064 bytes
Fixed Size 2127912 bytes
Variable Size 146802648 bytes
Database Buffers 50331648 bytes
Redo Buffers 5369856 bytes
Automatic instance created
contents of Memory Script:
{
# set the until clause
set until time "to_date('23-MAR-2010 13:36:00','DD-MON-YYYY HH24:MI:SS')";
# restore the controlfile
restore clone controlfile;
# mount the controlfile
sql clone 'alter database mount clone database';
# archive current online log for tspitr to a resent until time
sql 'alter system archive log current';
# avoid unnecessary autobackups for structural changes during TSPITR
sql 'begin dbms_backup_restore.AutoBackupFlag(FALSE); end;';
# resync catalog after controlfile restore
resync catalog;
}
executing Memory Script
executing command: SET until clause
Starting restore at 24-MAR-10
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=39 device type=DISK
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: reading from backup piece +FLASH/edbtest/autobackup/2010_03_23/s_714403881.525.714403883
channel ORA_AUX_DISK_1: piece handle=+FLASH/edbtest/autobackup/2010_03_23/s_714403881.525.714403883 tag=TAG20100323T133121
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
output file name=C:\EDBTEST2_BACKUP\ORADATA\AUXDEST\CNTRL_TSPITR_EDBTEST_SRMK.F
Finished restore at 24-MAR-10
sql statement: alter database mount clone database
sql statement: alter system archive log current
sql statement: begin dbms_backup_restore.AutoBackupFlag(FALSE); end;
starting full resync of recovery catalog
full resync complete
contents of Memory Script:
{
# generated tablespace point-in-time recovery script
# set the until clause
set until time "to_date('23-MAR-2010 13:36:00','DD-MON-YYYY HH24:MI:SS')";
# set a destination filename for restore
set newname for datafile 1 to
"+DATA";
# set a destination filename for restore
set newname for datafile 3 to
"+DATA";
# set a destination filename for restore
set newname for datafile 4 to
"+DATA";
# set a destination filename for restore
set newname for datafile 2 to
"+DATA";
# set an omf destination tempfile
set newname for clone tempfile 1 to new;
# set a destination filename for restore
set newname for datafile 21 to
"+DATA/edbtest/datafile/ramans.285.714403881";
# rename all tempfiles
switch clone tempfile all;
# restore the tablespaces in the recovery set plus the auxiliary tablespaces
restore clone datafile 1, 3, 4, 2, 21;
switch clone datafile all;
#online the datafiles restored or flipped
sql clone "alter database datafile 1 online";
#online the datafiles restored or flipped
sql clone "alter database datafile 3 online";
#online the datafiles restored or flipped
sql clone "alter database datafile 4 online";
#online the datafiles restored or flipped
sql clone "alter database datafile 2 online";
#online the datafiles restored or flipped
sql clone "alter database datafile 21 online";
# make the controlfile point at the restored datafiles, then recover them
recover clone database tablespace "RAMANS", "SYSTEM", "UNDOTBS1", "UNDOTBS2", "SYSAUX" delete archivelog;
alter clone database open resetlogs;
}
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
executing command: SET NEWNAME
renamed tempfile 1 to C:\EDBTEST2_BACKUP\ORADATA\AUXDEST\TSPITR_EDBTEST_SRMK\DATAFILE\O1_MF_TEMP_%U_.TMP in control file
Starting restore at 24-MAR-10
using channel ORA_AUX_DISK_1
creating datafile file number=21 name=+DATA/edbtest/datafile/ramans.285.714403881
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 +DATA
channel ORA_AUX_DISK_1: restoring datafile 00003 to +DATA
channel ORA_AUX_DISK_1: restoring datafile 00004 to +DATA
channel ORA_AUX_DISK_1: restoring datafile 00002 to +DATA
channel ORA_AUX_DISK_1: reading from backup piece +FLASH/edbtest/backupset/2010_03_23/nnndn0_tag20100323t120356_0.502.714398639
channel ORA_AUX_DISK_1: piece handle=+FLASH/edbtest/backupset/2010_03_23/nnndn0_tag20100323t120356_0.502.714398639 tag=TAG20100323T120356
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:09:15
Finished restore at 24-MAR-10
datafile 1 switched to datafile copy
input datafile copy RECID=5 STAMP=714493490 file name=+DATA/tspitr_edbtest_srmk/datafile/system.283.714492973
datafile 2 switched to datafile copy
input datafile copy RECID=6 STAMP=714493490 file name=+DATA/tspitr_edbtest_srmk/datafile/sysaux.289.714492949
datafile 3 switched to datafile copy
input datafile copy RECID=7 STAMP=714493490 file name=+DATA/tspitr_edbtest_srmk/datafile/undotbs1.287.714492935
datafile 4 switched to datafile copy
input datafile copy RECID=8 STAMP=714493491 file name=+DATA/tspitr_edbtest_srmk/datafile/undotbs2.288.714492943
sql statement: alter database datafile 1 online
sql statement: alter database datafile 3 online
sql statement: alter database datafile 4 online
sql statement: alter database datafile 2 online
sql statement: alter database datafile 21 online
Starting recover at 24-MAR-10
using channel ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: starting incremental datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
destination for restore of datafile 00001: +DATA/tspitr_edbtest_srmk/datafile/system.283.714492973
destination for restore of datafile 00003: +DATA/tspitr_edbtest_srmk/datafile/undotbs1.287.714492935
destination for restore of datafile 00004: +DATA/tspitr_edbtest_srmk/datafile/undotbs2.288.714492943
destination for restore of datafile 00002: +DATA/tspitr_edbtest_srmk/datafile/sysaux.289.714492949
channel ORA_AUX_DISK_1: reading from backup piece +FLASH/edbtest/backupset/2010_03_23/nnndn1_tag20100323t124021_0.514.714400821
channel ORA_AUX_DISK_1: piece handle=+FLASH/edbtest/backupset/2010_03_23/nnndn1_tag20100323t124021_0.514.714400821 tag=TAG20100323T124021
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
starting media recovery
archived log for thread 1 with sequence 316 is already on disk as file +FLASH/edbtest/archivelog/2010_03_23/thread_1_seq_316.734.714405211
archived log for thread 2 with sequence 207 is already on disk as file +FLASH/edbtest/archivelog/2010_03_23/thread_2_seq_207.733.714405211
archived log file name=+FLASH/edbtest/archivelog/2010_03_23/thread_2_seq_207.733.714405211 thread=2 sequence=207
archived log file name=+FLASH/edbtest/archivelog/2010_03_23/thread_1_seq_316.734.714405211 thread=1 sequence=316
media recovery complete, elapsed time: 00:00:02
Finished recover at 24-MAR-10
database opened
contents of Memory Script:
{
# export the tablespaces in the recovery set
host 'exp userid =
'********'
point_in_time_recover=y tablespaces= RAMANS file=
tspitr_a.dmp';
# shutdown clone before import
shutdown clone immediate
# import the tablespaces in the recovery set
host 'imp userid =
'********'
point_in_time_recover=y file=tspitr_a.dmp';
# online/offline the tablespace imported
sql "alter tablespace RAMANS online";
sql "alter tablespace RAMANS offline";
# enable autobackups in case user does open resetlogs from RMAN after TSPITR
sql 'begin dbms_backup_restore.AutoBackupFlag(TRUE); end;';
# resync catalog after tspitr finished
resync catalog;
}
executing Memory Script
Export: Release 11.1.0.7.0 - Production on Wed Mar 24 14:25:51 2010
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
EXP-00056: ORACLE error 604 encountered
ORA-00604: error occurred at recursive SQL level 3
ORA-04031: unable to allocate 88 bytes of shared memory ("shared pool","select /*+ rule */ bucket_cn...","sql area","opn: qkexrInitOpn")
EXP-00000: Export terminated unsuccessfully
host command complete
Removing automatic instance
shutting down automatic instance
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 03/24/2010 14:26:09
RMAN-06136: ORACLE error from auxiliary database: ORA-04031: unable to allocate 544 bytes of shared memory ("shared pool","DBMS_BACKUP_RESTORE","PL/SQL DIANA","
PAR.C:parapt:Page")
RMAN-03015: error occurred in stored script Memory Script
RMAN-06136: ORACLE error from auxiliary database: ORA-04031: unable to allocate 1056 bytes of shared memory ("shared pool","DBMS_BACKUP_RESTORE","PL/SQL DIANA",
"PAR.C:parapt:Page")
RMAN>