Monday, February 6, 2023

ORACLE::To Take RMAN Backups before oracle patch:Windows Server#check backup status

 ORACLE::To Take RMAN Backups before oracle patch

C:\Users\cyberarkloginname>rman target sys/Password

Recovery Manager: Release 19.0.0.0.0 - Production on Sat Sep 3 10:01:37 2022

Version 19.3.0.0.0

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

connected to target database (not started)

=========================================================================

run {

allocate channel ch00 type disk;

allocate channel ch01 type disk;

allocate channel ch02 type disk;

backup format 'E:\DUMPS\ORACLEBACKUPS\full_db_%t_%sp%p' filesperset 10 database plus archivelog;

release channel ch00;

release channel ch01;

release channel ch02;

allocate channel ch00 type disk;

backup format 'E:\DUMPS\ORACLEBACKUPS\cntrl_%s_%p_%t' CURRENT CONTROLFILE;

backup format 'E:\DUMPS\ORACLEBACKUPS\spfile_%s_%p_%t' spfile;

release channel ch00;

}

--TO run below if any error during backups.

crosscheck archivelog all;

delete expired archivelog all;

---TO check the on backup duration of RMAN backup

 SELECT sid, serial#, context, sofar, totalwork,

 round(sofar/totalwork*100,2) "% Complete"

 FROM v$session_longops

 WHERE opname LIKE 'RMAN%'

 AND opname NOT LIKE '%aggregate%'

 AND totalwork != 0

 AND sofar != totalwork; 

SQL>  SELECT sid, serial#, context, sofar, totalwork, round(sofar/totalwork*100,2) "% Complete" FROM v$session_longops WHERE opname LIKE 'RMAN%' AND opname NOT LIKE '%aggregate%' AND totalwork != 0 AND sofar != totalwork;

       SID    SERIAL#    CONTEXT      SOFAR  TOTALWORK % Complete

---------- ---------- ---------- ---------- ---------- ----------

       503      43163          1    1192190    4532222       26.3


SQL> /

=========================================================================

No comments:

Post a Comment

MYSQL:::Seamless Data Archiving: Exporting, Importing, and Pruning MySQL Tables

  Seamless Data Archiving: Exporting, Importing, and Pruning MySQL Tables Introduction: In the dynamic landscape of database management...