Monday, September 4, 2023

Procedure to take a cold backup of snapshot standby database in oracle

Procedure to take a cold backup of snapshot standby database in oracle

 

Caution: Ensure you have TDE taken care.

 Step 1) Verify if the db is in snapshot standby mode

 

set lines 300
set pages 3000
select name,open_mode,database_role,db_unique_name,name ,SWITCHOVER_STATUS from v$database;
select process,status,client_process,sequence# from gv$managed_standby;

Actual output:


SQL> select name,open_mode,database_role,db_unique_name,name ,SWITCHOVER_STATUS from v$database;
NAME      OPEN_MODE            DATABASE_ROLE    DB_UNIQUE_NAME                 NAME      SWITCHOVER_STATUS
--------- -------------------- ---------------- ------------------------------ --------- --------------------
GGSRC04T  MOUNTED              SNAPSHOT STANDBY GGSRC04TSB1                    GGSRC04T  NOT ALLOWED

SQL> select process,status,client_process,sequence# from gv$managed_standby;
PROCESS   STATUS       CLIENT_P  SEQUENCE#
--------- ------------ -------- ----------
ARCH      CONNECTED    ARCH              0
DGRD      ALLOCATED    N/A               0
DGRD      ALLOCATED    N/A               0
ARCH      CONNECTED    ARCH              0
ARCH      CONNECTED    ARCH              0
ARCH      CONNECTED    ARCH              0

6 rows selected.
 

 

Step 2) Verify the db is in intended state (DV - OFF, TDE - ON)

 

select parameter,value from v$option where upper(parameter) like '%VAULT%';
select * from v$encryption_wallet;
 
Actual output:

SQL> select parameter,value from v$option where upper(parameter) like '%VAULT%';


PARAMETER                                                        VALUE
---------------------------------------------------------------- ----------------------------------------------------------------
Oracle Database Vault                                            FALSE

 

SQL> select * from v$encryption_wallet;

 

WRL_TYPE
--------------------
WRL_PARAMETER
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
STATUS                         WALLET_TYPE          WALLET_OR FULLY_BAC     CON_ID
------------------------------ -------------------- --------- --------- ----------
FILE
/u01/app/oracle/admin/GGSRC04TSB1/wallet/
OPEN                           AUTOLOGIN            SINGLE    NO                 0

 

Step 3) Ensure the db is in mount state

 

Actual output:

Already verified


Step 4) Perform the rman cold backup

 

mkdir -p /oraarch/GGSRC04TSB1/SnapshotBackup/

ls -ld /oraarch/GGSRC04TSB1/SnapshotBackup/

 

run

{

allocate channel c1 device type disk;

allocate channel c2 device type disk;

allocate channel c3 device type disk;

allocate channel c4 device type disk;

backup as compressed backupset database format '/oraarch/GGSRC04TSB1/SnapshotBackup/rman_bkp_%d_%U';

release channel c1;

release channel c2;

release channel c3;

release channel c4;

}

 

Actual Output:

 

[oracle@vcentos79-oracle-ggsrc wallet]$ rman target /
 
Recovery Manager: Release 12.2.0.1.0 - Production on Mon Sep 4 11:46:27 2023
 
Copyright (c) 1982, 2017, Oracle and/or its affiliates.  All rights reserved.
 
connected to target database: GGSRC04T (DBID=4198404018, not open)
 
RMAN> run
{
allocate channel c1 device type disk;
allocate channel c2 device type disk;
allocate channel c3 device type disk;
allocate channel c4 device type disk;
2> 3> 4> 5> 6> 7> backup as compressed backupset database format '/oraarch/GGSRC04TSB1/SnapshotBackup/rman_bkp_%d_%U';
release channel c1;
release channel c2;
release channel c3;
release channel c4;
}8> 9> 10> 11> 12>
 
using target database control file instead of recovery catalog
allocated channel: c1
channel c1: SID=44 device type=DISK
 
allocated channel: c2
channel c2: SID=46 device type=DISK
 
allocated channel: c3
channel c3: SID=43 device type=DISK
 
allocated channel: c4
channel c4: SID=37 device type=DISK
 
Starting backup at 04-SEP-23
channel c1: starting compressed full datafile backup set
channel c1: specifying datafile(s) in backup set
input datafile file number=00001 name=/oradata/GGSRC04TSB1/system01.dbf
input datafile file number=00005 name=/oradata/GGSRC04TSB1/encrypt_ts1_01.dbf
channel c1: starting piece 1 at 04-SEP-23
channel c2: starting compressed full datafile backup set
channel c2: specifying datafile(s) in backup set
input datafile file number=00002 name=/oradata/GGSRC04TSB1/sysaux01.dbf
input datafile file number=00004 name=/oradata/GGSRC04TSB1/users01.dbf
channel c2: starting piece 1 at 04-SEP-23
channel c3: starting compressed full datafile backup set
channel c3: specifying datafile(s) in backup set
input datafile file number=00003 name=/oradata/GGSRC04TSB1/undotbs01.dbf
input datafile file number=00006 name=/oradata/GGSRC04TSB1/gg_data_01.dbf
channel c3: starting piece 1 at 04-SEP-23
channel c3: finished piece 1 at 04-SEP-23
piece handle=/oraarch/GGSRC04TSB1/SnapshotBackup/rman_bkp_GGSRC04T_3m25h60r_1_1 tag=TAG20230904T114634 comment=NONE
channel c3: backup set complete, elapsed time: 00:00:03
channel c1: finished piece 1 at 04-SEP-23
piece handle=/oraarch/GGSRC04TSB1/SnapshotBackup/rman_bkp_GGSRC04T_3k25h60r_1_1 tag=TAG20230904T114634 comment=NONE
channel c1: backup set complete, elapsed time: 00:00:25
channel c2: finished piece 1 at 04-SEP-23
piece handle=/oraarch/GGSRC04TSB1/SnapshotBackup/rman_bkp_GGSRC04T_3l25h60r_1_1 tag=TAG20230904T114634 comment=NONE
channel c2: backup set complete, elapsed time: 00:00:25
Finished backup at 04-SEP-23
 
Starting Control File and SPFILE Autobackup at 04-SEP-23
piece handle=/oraarch/GGSRC04TSB1/autobackup/2023_09_04/o1_mf_s_1146655442_lhcff4yp_.bkp comment=NONE
Finished Control File and SPFILE Autobackup at 04-SEP-23
 
released channel: c1
 
released channel: c2
 
released channel: c3
 
released channel: c4
 
RMAN> exit
 
 
Recovery Manager complete.

[oracle@vcentos79-oracle-ggsrc wallet]$ ls -altr /oraarch/GGSRC04TSB1/*/
/oraarch/GGSRC04TSB1/archivelog/:
total 0
drwxr-x---. 2 oracle oinstall 134 Sep  3 21:29 2023_09_03
drwxr-x---. 2 oracle oinstall   6 Sep  4 08:00 2023_09_04
drwxr-x---. 4 oracle oinstall  42 Sep  4 08:00 .
drwxr-x---. 6 oracle oinstall  81 Sep  4 11:39 ..
 
/oraarch/GGSRC04TSB1/flashback/:
total 409616
drwxr-x---. 2 oracle oinstall        60 Sep  4 11:05 .
-rw-r-----. 1 oracle oinstall 209723392 Sep  4 11:05 o1_mf_lhcc019o_.flb
-rw-r-----. 1 oracle oinstall 209723392 Sep  4 11:26 o1_mf_lhcbzy0r_.flb
drwxr-x---. 6 oracle oinstall        81 Sep  4 11:39 ..
 
/oraarch/GGSRC04TSB1/autobackup/:
total 0
drwxr-x---. 3 oracle oinstall 24 Sep  4 11:14 .
drwxr-x---. 6 oracle oinstall 81 Sep  4 11:39 ..
drwxr-x---. 2 oracle oinstall 86 Sep  4 11:47 2023_09_04
 
/oraarch/GGSRC04TSB1/SnapshotBackup/:
total 186392
drwxr-x---. 6 oracle oinstall       81 Sep  4 11:39 ..
-rw-r-----. 1 oracle oinstall  4341760 Sep  4 11:39 rman_bkp_GGSRC04T_3j25h5j3_1_1
-rw-r-----. 1 oracle oinstall 60055552 Sep  4 11:39 rman_bkp_GGSRC04T_3i25h5j2_1_1
drwxr-xr-x. 2 oracle oinstall      196 Sep  4 11:46 .
-rw-r-----. 1 oracle oinstall  4341760 Sep  4 11:46 rman_bkp_GGSRC04T_3m25h60r_1_1
-rw-r-----. 1 oracle oinstall 62070784 Sep  4 11:46 rman_bkp_GGSRC04T_3k25h60r_1_1
-rw-r-----. 1 oracle oinstall 60055552 Sep  4 11:46 rman_bkp_GGSRC04T_3l25h60r_1_1
[oracle@vcentos79-oracle-ggsrc wallet]$

 

YouTube Video:

 


Thanks


No comments:

Post a Comment

Flashback data archive steps

 Objective: Ways to track DML changes in a table Detailed objective: We should be able to track the changes in the table at any point in tim...