Search In The Blog

Thursday 5 January 2017

RMAN full backup on Standby (RAC) and Restoration on new server as primary (Standalone)


RMAN full backup on Standby (RAC) and Restoration on new server as primary (Standalone)

Requirement – Take RMAN full consistent backup on standby RAC database and then restore this consistent RMAN full backup on to the test server and open the restored database in READ WRITE mode.

Scenario and consideration –
1) Migration from one server to another
2) RAC to single instance
3) ASM to file system
4) Standby to Primary

Task involved in this activity-
  1. Stop recovery on standby database.
  2. Take RMAN full backup on standby database.
  3. Start recovery on standby database.
  4. Transfer backup piece to the target server.
  5. Restore rman backup and open database in READ WRITE mode.
  6. Perform post restoration activities.


We have NOT made any changes to production and standby side. We have performed restoration on test server.

1          Stop recovery on standby database.

               
SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;

Crosscheck MRP process is not running on standby database and then proceed with next step.  
               

2          RMAN full backup on standby RAC database.

Take rman full backup on standby database. Below are the script details which were used to take the RMAN full backup on standby database.

$ nohup sh rman_l0_bkp.sh &

$ cat rman_l0_bkp.sh
export ORACLE_SID=mystd1
export ORACLE_HOME=/oracle/app/oracle/product/11.2.0/dbhome_1;
/oracle/app/oracle/product/11.2.0/dbhome_1/bin/rman target / CMDFILE=/backup/rman_bkp/RMAN_BKP_TEST/rman_l0_bkp.rcv  log=/backup/rman_bkp/RMAN_BKP_TEST/rman_l0_bkp.log


$cat rman_l0_bkp.rcv 
run{
allocate channel c1 type disk format '/backup/rman_bkp/RMAN_BKP_TEST/FULL_mystd_%U';
allocate channel c2 type disk format '/backup/rman_bkp/RMAN_BKP_TEST/FULL_mystd_%U';
allocate channel c3 type disk format '/backup/rman_bkp/RMAN_BKP_TEST/FULL_mystd_%U';
allocate channel c4 type disk format '/backup/rman_bkp/RMAN_BKP_TEST/FULL_mystd_%U';
allocate channel c5 type disk format '/backup/rman_bkp/RMAN_BKP_TEST/FULL_mystd_%U';
allocate channel c6 type disk format '/backup/rman_bkp/RMAN_BKP_TEST/FULL_mystd_%U';
allocate channel c7 type disk format '/backup/rman_bkp/RMAN_BKP_TEST/FULL_mystd_%U';
allocate channel c8 type disk format '/backup/rman_bkp/RMAN_BKP_TEST/FULL_mystd_%U';
backup AS COMPRESSED BACKUPSET full database tag bkp_level_0 format '/backup/rman_bkp/RMAN_BKP_TEST/FULL_mystd_%U' database;
backup controlfile format '/backup/rman_bkp/RMAN_BKP_TEST/control_mystd_%U';
release channel c1;
release channel c2;
release channel c3;
release channel c4;
release channel c5;
release channel c6;
release channel c7;
release channel c8;
}

Start the recovery process on standby database after successful completion of RMAN full backup.

# Background redo apply. Control is returned to the session once the apply process is started.
ALTER DATABASE RECOVER MANAGED STANDBY DATABASE DISCONNECT FROM SESSION;

3.         Transfer this RMAN full backup to target server .

Use ftp or scp to transfer the backup to target server. Crosscheck the backup piece and it’s size on source and target server.

4.         Restoration of RMAN backup on target server .


          Create a PFILE for the single instance database using the production/standby RAC parameter file.
a.    please modify the following parameters depending on the directory structure of the new host: audit_file_dest, background_dump_dest, control_files, core_dump_dest, log_archive_dest_1, user_dump_dest etc
b.    remove RAC specific parameters such as cluster_database_instances, cluster_database etc
c.    for the parameter undo_tablespace, mention any one undo tablespace name

Starting from 10g it is NOT mandatory to copy the RMAN backup pieces to exactly the same location on the new host as the production location.

Below is sample init.ora file used for this activity. Please make the modification according to your application requirements.


*._optim_peek_user_binds=FALSE
*.audit_file_dest='/oracle/app/oracle/admin/myprod/adump'
*.audit_sys_operations=FALSE
*.audit_trail='NONE'
*.cluster_database=false
*.compatible='11.2.0.0.0'
*.control_files='/database/data/myprod/controlfile/contol01.ctl','/database/data/myprod/controlfile/control02.ctl'
*.db_block_checking='TRUE'
*.db_block_checksum='TYPICAL'
*.db_block_size=8192
*.db_create_file_dest='/database/data/myprod/datafile'
*.db_domain=''
*.db_name='myprod'
*.diagnostic_dest='/oracle/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=myprodXDB)'
*.dml_locks=800
*.job_queue_processes=10
*.log_archive_dest_1='location=/database/data/myprod/archive'
*.log_archive_format='%t_%s_%r.arc'
*.log_archive_max_processes=6
*.memory_target=0
*.nls_length_semantics='CHAR'
*.open_cursors=1000
*.optimizer_capture_sql_plan_baselines=FALSE
*.optimizer_features_enable='10.2.0.4'
*.optimizer_index_cost_adj=100
myprod.pga_aggregate_target=52428800
*.processes=350
*.query_rewrite_enabled='FALSE'
*.remote_login_passwordfile='EXCLUSIVE'
*.resource_limit=TRUE
*.sec_case_sensitive_logon=FALSE
*.session_cached_cursors=150
*.sessions=5280
*.sga_max_size=4g
#*.sga_max_target=4g
*.standby_file_management='AUTO'
*.undo_retention=7200
myprod.undo_tablespace='UNDOTBS1'

create spfile from initmyprod.ora

SQL> CREATE SPFILE FROM PFILE=’/path/initmyprod.ora’;
Use the spfile created above to STARTUP NOMOUNT the database on the new host
 
bash-2.05b$ sqlplus "/ as sysdba"

SQL*Plus: Release 11.2.0.4.0 Production on Tue Dec 27 09:53:45 2016

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

Connected to an idle instance.

SQL>

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 4275781632 bytes
Fixed Size                  2253216 bytes
Variable Size            4211084896 bytes
Database Buffers           50331648 bytes
Redo Buffers               12111872 bytes
SQL>
 
 
Now invoke RMAN and restore the controlfile specifying the location where the controlfile 
piece is transferred on this new server. You can mount the database once the controlfile 
is restored successfully.
 

RMAN> restore controlfile from '/database/RMAN/RMAN_BKP_TEST/control_mystd_msroess4_1_1’;

Starting restore at 27-DEC-16
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=156 devtype=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:02
output filename= /database/data/myprod/controlfile/contol01.ctl
output filename= /database/data/myprod/controlfile/control02.ctl

Finished restore at 27-DEC-16

RMAN>
RMAN> alter database mount;

database mounted
released channel: ORA_DISK_1

 
 
SQL> select name, open_mode,log_mode, database_role, controlfile_type from v$database;

NAME      OPEN_MODE            LOG_MODE     DATABASE_ROLE    CONTROL
--------- -------------------- ------------ ---------------- -------
MYPROD   MOUNTED              ARCHIVELOG   PHYSICAL STANDBY STANDBY
 
You can skip this step if you have restored the RMAN backup pieces to exactly the 
same location they were backed up on production. If this is not the case then you 
need to catalog the RMAN backup pieces to make RMAN aware of thier new location 
on the new host. Note that CATALOG BACKUPPIECE command is available only starting from
10g.
 
 
RMAN> catalog start with '/database/RMAN/RMAN_BKP_TEST';

searching for all files that match the pattern /database/RMAN/RMAN_BKP_TEST

List of Files Unknown to the Database
=====================================
File Name: /database/RMAN/RMAN_BKP_TEST/FULL_mystd_mlroeq5e_1_1
File Name: /database/RMAN/RMAN_BKP_TEST/FULL_mystd_mmroeq5e_1_1
File Name: /database/RMAN/RMAN_BKP_TEST/FULL_mystd_mnroeq5f_1_1
File Name: /database/RMAN/RMAN_BKP_TEST/FULL_mystd_moroeq5f_1_1
File Name: /database/RMAN/RMAN_BKP_TEST/FULL_mystd_mproeq5f_1_1
File Name: /database/RMAN/RMAN_BKP_TEST/FULL_mystd_mqroeq5g_1_1
File Name: /database/RMAN/RMAN_BKP_TEST/FULL_mystd_mrroeq5g_1_1
File Name: /database/RMAN/RMAN_BKP_TEST/control_mystd_msroess4_1_1
File Name: /database/RMAN/RMAN_BKP_TEST/nohup.out
File Name: /database/RMAN/RMAN_BKP_TEST/rman_l0_bkp.log

Do you really want to catalog the above files (enter YES or NO)? YES
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /database/RMAN/RMAN_BKP_TEST/FULL_mystd_mlroeq5e_1_1
File Name: /database/RMAN/RMAN_BKP_TEST/FULL_mystd_mmroeq5e_1_1
File Name: /database/RMAN/RMAN_BKP_TEST/FULL_mystd_mnroeq5f_1_1
File Name: /database/RMAN/RMAN_BKP_TEST/FULL_mystd_moroeq5f_1_1
File Name: /database/RMAN/RMAN_BKP_TEST/FULL_mystd_mproeq5f_1_1
File Name: /database/RMAN/RMAN_BKP_TEST/FULL_mystd_mqroeq5g_1_1
File Name: /database/RMAN/RMAN_BKP_TEST/FULL_mystd_mrroeq5g_1_1
File Name: /database/RMAN/RMAN_BKP_TEST/control_mystd_msroess4_1_1

List of Files Which Where Not Cataloged
=======================================
File Name: /database/RMAN/RMAN_BKP_TEST/nohup.out
  RMAN-07517: Reason: The file header is corrupted
File Name: /database/RMAN/RMAN_BKP_TEST/rman_l0_bkp.log

RMAN>
 
 
Kindly start the database restoration now. Use below command to restore the database. 
Here we are restoring from ASM to normal file system so use SET NEWNAME to set the 
new location for datafiles.
 
$ nohup sh restore_l0_bkp.sh &
 
$ cat restore_l0_bkp.sh
export ORACLE_SID=myprod
export ORACLE_HOME=/oracle/app/oracle/11.2.0.4/db_4;
/oracle/app/oracle/11.2.0.4/db_4/bin/rman target / CMDFILE=/database/RMAN/RMAN_BKP_TEST/restore_l0_bkp.rcv  log=/database/RMAN/RMAN_BKP_TEST/restore_l0_bkp_27122016_2.log
 
 
run {
set newname for datafile '+DATADG/mystd/datafile/system.279.915710127' to '/database/data/myprod/datafile/system.279.915710127';
set newname for datafile '+DATADG/mystd/datafile/sysaux.292.915706221' to '/database/data/myprod/datafile/sysaux.292.915706221';
set newname for datafile '+DATADG/mystd/datafile/undotbs1.296.915706231' to '/database/data/myprod/datafile/undotbs1.296.915706231';
set newname for datafile '+DATADG/mystd/datafile/undotbs2.256.915713215' to '/database/data/myprod/datafile/undotbs2.256.915713215';
set newname for datafile '+DATADG/mystd/datafile/users.301.915709147' to '/database/data/myprod/datafile/users.301.915709147';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_data.328.915806215' to '/database/data/myprod/datafile/ifsapp_data.328.915806215';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_index.271.915711639' to '/database/data/myprod/datafile/ifsapp_index.271.915711639';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_lob.298.915709137' to '/database/data/myprod/datafile/ifsapp_lob.298.915709137';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_report_data.278.915713227' to '/database/data/myprod/datafile/ifsapp_report_data.278.915713227';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_report_index.302.915709151' to '/database/data/myprod/datafile/ifsapp_report_index.302.915709151';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_archive_data.303.915709151' to '/database/data/myprod/datafile/ifsapp_archive_data.303.915709151';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_archive_index.262.915711663' to '/database/data/myprod/datafile/ifsapp_archive_index.262.915711663';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_data.257.915713195' to '/database/data/myprod/datafile/ifsapp_data.257.915713195';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_data.333.915806225' to '/database/data/myprod/datafile/ifsapp_data.333.915806225';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_data.327.915806203' to '/database/data/myprod/datafile/ifsapp_data.327.915806203';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_data.287.915713185' to '/database/data/myprod/datafile/ifsapp_data.287.915713185';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_data.305.915710103' to '/database/data/myprod/datafile/ifsapp_data.305.915710103';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_index.286.915710111' to '/database/data/myprod/datafile/ifsapp_index.286.915710111';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_index.293.915706211' to '/database/data/myprod/datafile/ifsapp_index.293.915706211';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_index.304.915710093' to '/database/data/myprod/datafile/ifsapp_index.304.915710093';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_lob.297.915709117' to '/database/data/myprod/datafile/ifsapp_lob.297.915709117';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_lob.295.915706191' to '/database/data/myprod/datafile/ifsapp_lob.295.915706191';
set newname for datafile '+DATADG/mystd/datafile/perfstat.282.915711661' to '/database/data/myprod/datafile/perfstat.282.915711661';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_lob.294.915706201' to '/database/data/myprod/datafile/ifsapp_lob.294.915706201';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_data.284.915711629' to '/database/data/myprod/datafile/ifsapp_data.284.915711629';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_lob.265.915713223' to '/database/data/myprod/datafile/ifsapp_lob.265.915713223';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_index.277.915713205' to '/database/data/myprod/datafile/ifsapp_index.277.915713205';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_index.299.915709127' to '/database/data/myprod/datafile/ifsapp_index.299.915709127';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_data.264.915711647' to '/database/data/myprod/datafile/ifsapp_data.264.915711647';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_data.267.915711659' to '/database/data/myprod/datafile/ifsapp_data.267.915711659';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_index.300.915707617' to '/database/data/myprod/datafile/ifsapp_index.300.915707617';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_data.266.915710123' to '/database/data/myprod/datafile/ifsapp_data.266.915710123';
set newname for datafile '+DATADG/mystd/datafile/perfstat.306.915710129' to '/database/data/myprod/datafile/perfstat.306.915710129';
set newname for datafile '+DATADG/mystd/datafile/ifsapp_index.337.930138391' to '/database/data/myprod/datafile/ifsapp_index.337.930138391';
restore database;
switch datafile all;
}
 
 
Switch datafile all is required to update the datafile header with new file location.
 
Crosscheck the rman log and alert log for any errors. If everything is fine then proceed 
with further steps.
 
Once RMAN restore/recovery finishes, you will want to rename the online redolog files 
before opening the database in case the production path of redo log files is not available 
on the new host. After renaming the redolog files, the database can be opened.
 
Kindly change STANDBY_FILE_MANAGEMENT parameter to “MANUAL” which is required 
to rename the redolog file. Revert it to its original value after completion of the activity.
 
SQL> ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=’MANUAL’ SCOPE=BOTH;

System altered.
 
 
 
alter database rename file '+DATADG/mystd/onlinelog/group_7.310.915719101' to '/database/data/myprod/redologs/group_7.310.915719101';
alter database rename file '+DATADG/mystd/onlinelog/group_8.318.915719101' to '/database/data/myprod/redologs/group_8.318.915719101';
alter database rename file '+DATADG/mystd/onlinelog/group_9.319.915719101' to '/database/data/myprod/redologs/group_9.319.915719101';
alter database rename file '+DATADG/mystd/onlinelog/group_10.320.915719103' to '/database/data/myprod/redologs/group_10.320.915719103';
alter database rename file '+DATADG/mystd/onlinelog/group_11.321.915719103' to '/database/data/myprod/redologs/group_11.321.915719103';
alter database rename file '+DATADG/mystd/onlinelog/group_12.322.915719103' to '/database/data/myprod/redologs/group_12.322.915719103';
alter database rename file '+FRADG/mystd/onlinelog/group_7.2850.915719101' to '/database/data/myprod/redologs/group_7.2850.915719101';
alter database rename file '+FRADG/mystd/onlinelog/group_8.2851.915719101' to '/database/data/myprod/redologs/group_8.2851.915719101';
alter database rename file '+FRADG/mystd/onlinelog/group_9.2852.915719101' to '/database/data/myprod/redologs/group_9.2852.915719101';
alter database rename file '+FRADG/mystd/onlinelog/group_10.2853.915719103' to '/database/data/myprod/redologs/group_10.2853.915719103';
alter database rename file '+FRADG/mystd/onlinelog/group_11.2854.915719103' to '/database/data/myprod/redologs/group_11.2854.915719103';
alter database rename file '+FRADG/mystd/onlinelog/group_12.2855.915719103' to '/database/data/myprod/redologs/group_12.2855.915719103';
alter database rename file '+DATADG/mystd/onlinelog/group_13.324.915719103' to '/database/data/myprod/redologs/group_13.324.915719103';
alter database rename file '+FRADG/mystd/onlinelog/group_13.2856.915719105' to '/database/data/myprod/redologs/group_13.2856.915719105';
alter database rename file '+DATADG/mystd/onlinelog/group_14.326.915719105' to '/database/data/myprod/redologs/group_14.326.915719105';
alter database rename file '+FRADG/mystd/onlinelog/group_14.2857.915719105' to '/database/data/myprod/redologs/group_14.2857.915719105';
alter database rename file '+DATADG/mystd/onlinelog/group_15.258.915718903' to '/database/data/myprod/redologs/group_15.258.915718903';
alter database rename file '+FRADG/mystd/onlinelog/group_15.2837.915718903' to '/database/data/myprod/redologs/group_15.2837.915718903';
alter database rename file '+DATADG/mystd/onlinelog/group_16.312.915718903' to '/database/data/myprod/redologs/group_16.312.915718903';
alter database rename file '+FRADG/mystd/onlinelog/group_16.2839.915718903' to '/database/data/myprod/redologs/group_16.2839.915718903';
alter database rename file '+DATADG/mystd/onlinelog/group_17.314.915718905' to '/database/data/myprod/redologs/group_17.314.915718905';
alter database rename file '+FRADG/mystd/onlinelog/group_17.2842.915718905' to '/database/data/myprod/redologs/group_17.2842.915718905';
alter database rename file '+DATADG/mystd/onlinelog/group_18.316.915718905' to '/database/data/myprod/redologs/group_18.316.915718905';
alter database rename file '+FRADG/mystd/onlinelog/group_18.2844.915718905' to '/database/data/myprod/redologs/group_18.2844.915718905';
alter database rename file '+DATADG/mystd/onlinelog/group_19.317.915718905' to '/database/data/myprod/redologs/group_19.317.915718905';
alter database rename file '+FRADG/mystd/onlinelog/group_19.2845.915718907' to '/database/data/myprod/redologs/group_19.2845.915718907';
alter database rename file '+DATADG/mystd/onlinelog/group_20.259.915718901' to '/database/data/myprod/redologs/group_20.259.915718901';
alter database rename file '+FRADG/mystd/onlinelog/group_20.2835.915718903' to '/database/data/myprod/redologs/group_20.2835.915718903';
alter database rename file '+DATADG/mystd/onlinelog/group_21.311.915718903' to '/database/data/myprod/redologs/group_21.311.915718903';
alter database rename file '+FRADG/mystd/onlinelog/group_21.2838.915718903' to '/database/data/myprod/redologs/group_21.2838.915718903';
alter database rename file '+DATADG/mystd/onlinelog/group_22.315.915718905' to '/database/data/myprod/redologs/group_22.315.915718905';
alter database rename file '+FRADG/mystd/onlinelog/group_22.2843.915718905' to '/database/data/myprod/redologs/group_22.2843.915718905';
alter database rename file '+DATADG/mystd/onlinelog/group_23.313.915718903' to '/database/data/myprod/redologs/group_23.313.915718903';
alter database rename file '+FRADG/mystd/onlinelog/group_23.2841.915718905' to '/database/data/myprod/redologs/group_23.2841.915718905';
alter database rename file '+DATADG/mystd/onlinelog/group_24.276.915718901' to '/database/data/myprod/redologs/group_24.276.915718901';
alter database rename file '+FRADG/mystd/onlinelog/group_24.2836.915718903' to '/database/data/myprod/redologs/group_24.2836.915718903';
 
 
Make sure that all redolog member should be named to new location and this new location 
is exists on the target server. Also all datafile headers should have 
unique checkpoint_change# number for all datafiles.
 
SQL> select distinct(to_char(checkpoint_change#)) from v$datafile_header;

(TO_CHAR(CHECKPOINT_CHANGE#))
----------------------------------------
43459235999

SQL>
 

SQL> select name,open_mode,log_mode,database_role,controlfile_type from v$database;

NAME      OPEN_MODE            LOG_MODE     DATABASE_ROLE    CONTROL
--------- -------------------- ------------ ---------------- -------
MYPROD   MOUNTED              ARCHIVELOG   PHYSICAL STANDBY STANDBY
 
Standby database can be activated as a primary database using the following statements. 
Also you can see that database_role and controlfile_type has been changed to PRIMARY 
and CURRENT respectively.
 
 
SQL> ALTER DATABASE ACTIVATE STANDBY DATABASE;

Database altered.

SQL> select name,open_mode,log_mode,database_role,controlfile_type from v$database;

NAME      OPEN_MODE            LOG_MODE     DATABASE_ROLE    CONTROL
--------- -------------------- ------------ ---------------- -------
MYPROD   MOUNTED              ARCHIVELOG   PRIMARY          CURRENT

 
SQL> alter database open;

Database altered.

SQL> select name,open_mode,log_mode, database_role , controlfile_type from v$database;

NAME      OPEN_MODE            LOG_MODE     DATABASE_ROLE    CONTROL
--------- -------------------- ------------ ---------------- -------
MYPROD   READ WRITE           ARCHIVELOG   PRIMARY          CURRENT

 
You have successfully restored backup and opened database in READ WRITE mode.

 

5.     Post restoration activities


Kindly remove redolog groups for redo threads of other instances.
 
SQL> select THREAD#, STATUS, ENABLED from v$thread;

   THREAD# STATUS ENABLED
---------- ------ --------
         1 OPEN   PUBLIC
         2 CLOSED PRIVATE
 
SQL> select group# from v$log where THREAD#=2;

    GROUP#
----------
        10
        11
        12
        14

SQL> alter database disable thread 2;

Database altered.

SQL> alter database drop logfile group 10;

Database altered.

SQL> alter database drop logfile group 11;

Database altered.

SQL> alter database drop logfile group 12;

Database altered.

SQL> alter database drop logfile group 14;

Database altered.

SQL>
SQL> select group# from v$log where THREAD#=2;

no rows selected

SQL> select THREAD#, STATUS, ENABLED from v$thread;

   THREAD# STATUS ENABLED
---------- ------ --------
         1 OPEN   PUBLIC
 
 
Now remove the undo tablespaces of other instances and create a new temporary 
tablespace to complete the activity.
 
SQL> sho parameter undo;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
undo_management                      string      AUTO
undo_retention                       integer     7200
undo_tablespace                      string      UNDOTBS1
SQL>
SQL> select tablespace_name from dba_tablespaces where contents='UNDO';

TABLESPACE_NAME
------------------------------
UNDOTBS1
UNDOTBS2

SQL>
SQL> drop tablespace UNDOTBS2 including contents and datafiles;

Tablespace dropped.

SQL>
SQL> select name from v$tempfile;

NAME
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
/database/data/myprod/datafile/MYPROD/datafile/o1_mf_temp_d66hwb1s_.tmp
/database/data/myprod/datafile/MYPROD/datafile/o1_mf_temp_d66hw9yo_.tmp
/database/data/myprod/datafile/MYPROD/datafile/o1_mf_temp_d66hw9v4_.tmp

SQL>
SQL> select tablespace_name from dba_tablespaces where contents='TEMPORARY';

TABLESPACE_NAME
------------------------------
TEMP

SQL>
SQL> create temporary tablespace TEMP1 tempfile
SQL> '/database/data/myprod/datafile/MYPROD/datafile/o1_mf_temp_d66hwb
SQL> 1s_1.dbf' size 100m;

Tablespace created.

SQL>
SQL> alter database default temporary tablespace TEMP1;

Database altered.

SQL> drop tablespace TEMP including contents and datafiles;

Tablespace dropped.


Note - Please note that this method is useful if you want to restore consistent backup only.

 I will be very happy if this exercise helpful for you in any manner. THANK YOU!!!
  


References:

HowTo Restore RMAN Disk backups of RAC Database to Single Instance On Another Node (Doc ID 415579.1)
How to take consistent backups at standby site (Doc ID 1292126.1)
Using RMAN Effectively In A Dataguard Environment. (Doc ID 848716.1)




No comments:

Post a Comment