Tuesday, July 22, 2025

WTP in python - Traffic Light Simulator

 # Traffic Light Simulator

# Input a color (red, yellow, green) and print the corresponding action:


# Red → Stop

# Yellow → Get Ready

# Green → Go


light_type=input("Please enter the light type (red, yellow, green ) : ")



if(light_type=="red"):

    print("Stop")

elif(light_type=="yellow"):

    print("Get Ready")

elif(light_type=="green"):

    print("Go")

else:

    print("wrong input")

WTP in python - Login System

 # Login System

# Ask for a username and password. 

# If both match predefined values, print "Login successful", else show appropriate error messages.

#username : abc

#password : 123



user=input("Please enter username: ")

password= input("Please enter the password:  ")


if(user=="abc" and password == "123"):

    print("Login successful")

elif(user != "abc" and password != "123"):

    print("both Incorrect Username and Password ")

elif (user != "abc"):

    print("Username is not correct ")

else:

    print("password is incorrect ")

WTP in python - Vowel or Consonant

# Vowel or Consonant

# Input a single alphabet and check whether it is a vowel or consonant.


letter=input("Please enter the letter: ")


if (letter == "a" or letter == "e" or letter == "i" or letter == "o" or letter == "u"):

    print(f"{letter} is vowel ") 

else:

    print(f"{letter} is consonant" )

 

WTP in python - Simple Calculator

 # Simple Calculator

# Ask the user to input two numbers and an operator (+, -, *, /) and perform the corresponding operation.


num1=float(input("Please enter the first number : "))

operator= input("Please enter (+,-,/,* ) : ")

num2=float(input("Please enter the second number :"))




if (operator=="+"):

    result=num1+num2

    print(f"{num1} + {num2} = {result}")


elif (operator=="-"):

    result=num1-num2

    print(f"{num1} - {num2} = {result}")


elif (operator=="/"):

    result=num1/num2

    print(f"{num1} / {num2} = {result}")


elif (operator=="*"):

    result=num1*num2

    print(f"{num1} * {num2} = {result}")


else:

    print("function not exsites as of now ")


WTP in python : Input three numbers and print the largest one

# Number Comparison

# Input three numbers and print the largest one.


# Logic Recap:

# First, check if num1 is greater than or equal to both num2 and num3.

# If not, check if num2 is greater than or equal to both num1 and num3.

# If neither is true, then num3 must be the largest.



num1=int(input("Please enter the first number: "))

num2=int(input("Please enter the second number: "))

num3=int(input("Please enter the third number: "))



if(num1 >= num2 and num1 >=num3):

    print(f"{num1} is the largest")

elif(num2>=num1 and num2 >=num3):

    print(f"{num2} is largest ")

else:

    print(f"{num3} is largest ") 

WTP in python - Leap Year Checker

# Leap Year Rules Recap:

# A year is a leap year if:

# It is divisible by 4 and not divisible by 100

# OR

# It is divisible by 400

# For example:


# 2000 → Leap year ✅ (divisible by 400)

# 1900 → Not a leap year ❌ (divisible by 100 but not 400)

# 2024 → Leap year ✅ (divisible by 4 and not 100)

#take input from user 

year = int(input("Please enter the year:  "))

if (year % 4 ==0 and year % 100 !=0) or (year % 400 == 0):

    print(f"{year} is a leap year")

else:

    print(f"{year} is not a leap year")


WTP in python - Grade Calculator


# Grade Calculator

# Input a percentage and print the grade:


# A (90–100)

# B (80–89)

# C (70–79)

# D (60–69)

# F (below 60)


percent=int(input("Please enter the percent: "))


if (percent>=90 and percent<=100):

    print(f"{percent} , Your Grade is A")

elif(percent>=80 and percent<=89):

    print(f"{percent} , Your Grade is B")

elif(percent>=70 and percent<=79):

    print(f"{percent} , Your Grade is C")

elif(percent>=60 and percent<=69):

    print(f"{percent} , Your Grade is D")

elif ( percent >0 and percent<60):

    print(f"{percent} , Your Grade is F")

else:

    print("Invalid Number") 

WTP in python - Age Group Classifier

Age Group Classifier

Input a person's age and classify them as:


Child (0–12)

Teen (13–19)

Adult (20–59)

Senior (60+)



#take the input from user


age=float(input("Please enter you Age:  "))


if(age>0 and age<=12):

    print(f"{age} , Child")

elif(age>=13 and age<=19):

    print(f"{age} ,Teen ")

elif(age>=20 and age<=59):

    print(f"{age} , Adult")

elif(age>=60):

    print(f"{age} , Senior ")

else:

    print(f"{age} , Invaild Age ")

WTP in python - check the number is Even or Odd

 

Write a program that takes an integer input and checks whether it is even or odd.


num=int(input("Please Enter the Number : "))


num_check = num % 2


if (num_check == 0):

    print(f"{num} even number")

else:

    print("odd number ")

WTP in python - check Positive, Negative, or Zero

 

Ask the user to enter a number and print whether it is positive, negative, or zero.


# Positive, Negative, or Zero Checker

#take the input from user 

number=float(input("Please enter the number : "))


# check the condition 

if (number>0):

    print(f" {number} is postive")

elif(number<0):

    print(f"{number} is negative")

else:

    print(f"{number} is zero")

Friday, July 18, 2025

How to print in python ?

print ("Hello world ")

Download python

To download the python for various platform like Windows, Linux , MacOS 


https://www.python.org/downloads/

Python Introduction

What is python ?

  • Python is very popular programming language  and this is developed by Guido van  Rossum .

  • This is released in 1991 .

  • Python supports multiple programming paradigms, including procedural, object-oriented, and functional programming

Key characteristics
  • Interpreted: Python code is executed line by line, simplifying debugging and allowing for rapid prototyping.
  • Object-Oriented: It supports object-oriented programming, enabling developers to create reusable and modular code.
  • Dynamically Typed: Python automatically determines variable types during runtime, reducing the need for explicit type declarations and making coding more flexible.
  • High-Level: Python handles complex operations like memory management, allowing developers to focus on problem-solving rather than low-level details.
  • Platform Independent: Python code can run on various operating systems (Windows, MacOS, Linux) without modification, promoting portability.
  • Free and Open-Source: Python is freely available to download, use, and distribute, fostering a large and active community that contributes to its continuous development and extensive library ecosystem. 
Good to know :

The most recent version is python3 


Python Bootcamp -: Zero to Hero

Index :

Introduction : 

Sunday, May 25, 2025

How to take backup of oracle database plus archivelog ?

 

RMAN>


RMAN> backup database plus archivelog ;



Starting backup at 25-MAY-25

current log archived

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=278 device type=DISK

channel ORA_DISK_1: starting archived log backup set

channel ORA_DISK_1: specifying archived log(s) in backup set

input archived log thread=1 sequence=22 RECID=17 STAMP=1201966510

input archived log thread=1 sequence=23 RECID=18 STAMP=1201968926

input archived log thread=1 sequence=24 RECID=19 STAMP=1201970163

input archived log thread=1 sequence=25 RECID=20 STAMP=1202022953

input archived log thread=1 sequence=26 RECID=21 STAMP=1202026475

channel ORA_DISK_1: starting piece 1 at 25-MAY-25

channel ORA_DISK_1: finished piece 1 at 25-MAY-25

piece handle=/u01/app/oracle/fast_recovery_area/DB1/backupset/2025_05_25/o1_mf_annnn_TAG20250525T081436_n35ncf0p_.bkp tag=TAG20250525T081436 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:04

Finished backup at 25-MAY-25


Starting backup at 25-MAY-25

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=/u01/app/oracle/oradata/DB1/system01.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/DB1/sysaux01.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/DB1/undotbs01.dbf

input datafile file number=00007 name=/u01/app/oracle/oradata/DB1/users01.dbf

channel ORA_DISK_1: starting piece 1 at 25-MAY-25

channel ORA_DISK_1: finished piece 1 at 25-MAY-25

piece handle=/u01/app/oracle/fast_recovery_area/DB1/backupset/2025_05_25/o1_mf_nnndf_TAG20250525T081440_n35ncno8_.bkp tag=TAG20250525T081440 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:35

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00010 name=/u01/app/oracle/oradata/DB1/pdb/sysaux01.dbf

input datafile file number=00009 name=/u01/app/oracle/oradata/DB1/pdb/system01.dbf

input datafile file number=00011 name=/u01/app/oracle/oradata/DB1/pdb/undotbs01.dbf

input datafile file number=00012 name=/u01/app/oracle/oradata/DB1/pdb/users01.dbf

channel ORA_DISK_1: starting piece 1 at 25-MAY-25

channel ORA_DISK_1: finished piece 1 at 25-MAY-25

piece handle=/u01/app/oracle/fast_recovery_area/DB1/2FACECCE69615207E0630400040AB366/backupset/2025_05_25/o1_mf_nnndf_TAG20250525T081440_n35ndnx1_.bkp tag=TAG20250525T081440 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00017 name=/u01/app/oracle/oradata/demo1/sysaux01.dbf

input datafile file number=00016 name=/u01/app/oracle/oradata/demo1/system01.dbf

input datafile file number=00018 name=/u01/app/oracle/oradata/demo1/undotbs01.dbf

channel ORA_DISK_1: starting piece 1 at 25-MAY-25

channel ORA_DISK_1: finished piece 1 at 25-MAY-25

piece handle=/u01/app/oracle/fast_recovery_area/DB1/33E6395D57264163E0630400040A2C41/backupset/2025_05_25/o1_mf_nnndf_TAG20250525T081440_n35nf4bh_.bkp tag=TAG20250525T081440 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00006 name=/u01/app/oracle/oradata/DB1/pdbseed/sysaux01.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/DB1/pdbseed/system01.dbf

input datafile file number=00008 name=/u01/app/oracle/oradata/DB1/pdbseed/undotbs01.dbf

channel ORA_DISK_1: starting piece 1 at 25-MAY-25

channel ORA_DISK_1: finished piece 1 at 25-MAY-25

piece handle=/u01/app/oracle/fast_recovery_area/DB1/2FAC79D13BBE3BB3E0630400040A98FA/backupset/2025_05_25/o1_mf_nnndf_TAG20250525T081440_n35nfmyv_.bkp tag=TAG20250525T081440 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15

Finished backup at 25-MAY-25


Starting backup at 25-MAY-25

current log archived

using channel ORA_DISK_1

channel ORA_DISK_1: starting archived log backup set

channel ORA_DISK_1: specifying archived log(s) in backup set

input archived log thread=1 sequence=27 RECID=22 STAMP=1202026564

channel ORA_DISK_1: starting piece 1 at 25-MAY-25

channel ORA_DISK_1: finished piece 1 at 25-MAY-25

piece handle=/u01/app/oracle/fast_recovery_area/DB1/backupset/2025_05_25/o1_mf_annnn_TAG20250525T081604_n35ng5fm_.bkp tag=TAG20250525T081604 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

Finished backup at 25-MAY-25


Starting Control File and SPFILE Autobackup at 25-MAY-25

piece handle=/u01/app/oracle/fast_recovery_area/DB1/autobackup/2025_05_25/o1_mf_s_1202026566_n35ng924_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 25-MAY-25


RMAN>

How to recover oracle database from loss of critical data files (system.dbf) ?

Recover database from loss of critical data files 



*Should we have good backup 


SQL> show pdbs


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

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

         2 PDB$SEED                       READ ONLY  NO

         3 PDB                            MOUNTED

         4 DEMO1                          MOUNTED

SQL> alter pluggable database all open ;

alter pluggable database all open

*

ERROR at line 1:

ORA-01116: error in opening database file 1

ORA-01110: data file 1: '/u01/app/oracle/oradata/DB1/system01.dbf'

ORA-27041: unable to open file

Linux-x86_64 Error: 2: No such file or directory

Additional information: 3



SQL>



SQL> shut abort ;

ORACLE instance shut down.

SQL> exit

Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Version 19.3.0.0.0

[oracle@orcl DB1]$

[oracle@orcl DB1]$ rman target /


Recovery Manager: Release 19.0.0.0.0 - Production on Sun May 25 08:56:06 2025

Version 19.3.0.0.0


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


connected to target database (not started)


RMAN> startup mount ;


Oracle instance started

database mounted


Total System Global Area    2432695832 bytes


Fixed Size                     9137688 bytes

Variable Size                553648128 bytes

Database Buffers            1862270976 bytes

Redo Buffers                   7639040 bytes


RMAN> restore datafile 1;


Starting restore at 25-MAY-25

using target database control file instead of recovery catalog

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=257 device type=DISK


channel ORA_DISK_1: starting datafile backup set restore

channel ORA_DISK_1: specifying datafile(s) to restore from backup set

channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/DB1/system01.dbf

channel ORA_DISK_1: reading from backup piece /u01/app/oracle/fast_recovery_area/DB1/backupset/2025_05_25/o1_mf_nnndf_TAG20250525T081440_n35ncno8_.bkp

channel ORA_DISK_1: piece handle=/u01/app/oracle/fast_recovery_area/DB1/backupset/2025_05_25/o1_mf_nnndf_TAG20250525T081440_n35ncno8_.bkp tag=TAG20250525T081440

channel ORA_DISK_1: restored backup piece 1

channel ORA_DISK_1: restore complete, elapsed time: 00:00:25

Finished restore at 25-MAY-25


RMAN> recover datafile 1;


Starting recover at 25-MAY-25

using channel ORA_DISK_1


starting media recovery

media recovery complete, elapsed time: 00:00:03


Finished recover at 25-MAY-25


RMAN> alter database open ;


Statement processed


RMAN> alter pluggable database all open ;


Statement processed


RMAN> exit



Recovery Manager complete.

[oracle@orcl DB1]$ sqlplus "/as sysdba"


SQL*Plus: Release 19.0.0.0.0 - Production on Sun May 25 08:58:08 2025

Version 19.3.0.0.0


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



Connected to:

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Version 19.3.0.0.0


SQL> show pdbs


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

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

         2 PDB$SEED                       READ ONLY  NO

         3 PDB                            READ WRITE NO

         4 DEMO1                          READ WRITE NO

SQL>

Saturday, May 24, 2025

How to create Virtual Private catalog and enable the VPD (virtual private database ) feature in rman catalog with upgrade ?

[oracle@orcl ~]$

[oracle@orcl ~]$ sqlplus sys/sys@demopdb1 as sysdba


SQL*Plus: Release 19.0.0.0.0 - Production on Sat May 24 15:45:25 2025

Version 19.3.0.0.0


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



Connected to:

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Version 19.3.0.0.0


SQL> @$ORACLE_HOME/rdbms/admin/dbmsrmanvpc.sql vpd rcatowner


Checking the operating user... Passed


The VPC user schemas of the following catalogs: VPD, RCATOWNER are going to be upgraded to a new VPD model


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

Removing old VPC views in the base catalog of RCATOWNER...

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

UPGRADE STATUS:

The VPC user schemas of these catalogs: RCATOWNER

have been successfully upgraded to the new VPD model!


Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Version 19.3.0.0.0

[oracle@orcl ~]$

[oracle@orcl ~]$

[oracle@orcl ~]$ rman catalog  rcatowner/oracle_4U@demopdb1


Recovery Manager: Release 19.0.0.0.0 - Production on Sat May 24 15:46:39 2025

Version 19.3.0.0.0


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


connected to recovery catalog database


RMAN> upgrade catalog ;


recovery catalog owner is RCATOWNER

enter UPGRADE CATALOG command again to confirm catalog upgrade


RMAN> upgrade catalog ;


RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-20516: cannot upgrade the catalog when other RMAN sessions are connected to catalog


RMAN> upgrade catalog ;


recovery catalog owner is RCATOWNER

enter UPGRADE CATALOG command again to confirm catalog upgrade


RMAN> upgrade catalog ;


recovery catalog upgraded to version 19.03.00.00.00

DBMS_RCVMAN package upgraded to version 19.03.00.00

DBMS_RCVCAT package upgraded to version 19.03.00.00.


RMAN>

How to execute stored script in rman catalog database ?

 

[oracle@orcl ~]$ rman target / catalog  rcatowner/oracle_4U@demopdb1


Recovery Manager: Release 19.0.0.0.0 - Production on Sat May 24 15:24:12 2025

Version 19.3.0.0.0


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


connected to target database: DB1 (DBID=1788905834)

connected to recovery catalog database

RMAN>


RMAN>


RMAN> run {

2> execute script db_plus_arc_bkp;

3> }


executing script: db_plus_arc_bkp



Starting backup at 24-MAY-25

current log archived

allocated channel: ORA_DISK_1

channel ORA_DISK_1: SID=37 device type=DISK

channel ORA_DISK_1: starting archived log backup set

channel ORA_DISK_1: specifying archived log(s) in backup set

input archived log thread=1 sequence=17 RECID=12 STAMP=1201940579

input archived log thread=1 sequence=18 RECID=13 STAMP=1201956550

input archived log thread=1 sequence=19 RECID=14 STAMP=1201956572

input archived log thread=1 sequence=20 RECID=15 STAMP=1201961707

input archived log thread=1 sequence=21 RECID=16 STAMP=1201966425

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

channel ORA_DISK_1: finished piece 1 at 24-MAY-25

piece handle=/u01/app/oracle/fast_recovery_area/DB1/backupset/2025_05_24/o1_mf_annnn_TAG20250524T153347_n33spwhd_.bkp tag=TAG20250524T153347 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07

Finished backup at 24-MAY-25


Starting backup at 24-MAY-25

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=/u01/app/oracle/oradata/DB1/system01.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/DB1/sysaux01.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/DB1/undotbs01.dbf

input datafile file number=00007 name=/u01/app/oracle/oradata/DB1/users01.dbf

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

channel ORA_DISK_1: finished piece 1 at 24-MAY-25

piece handle=/u01/app/oracle/fast_recovery_area/DB1/backupset/2025_05_24/o1_mf_nnndf_TAG20250524T153355_n33sq62z_.bkp tag=TAG20250524T153355 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00010 name=/u01/app/oracle/oradata/DB1/pdb/sysaux01.dbf

input datafile file number=00009 name=/u01/app/oracle/oradata/DB1/pdb/system01.dbf

input datafile file number=00011 name=/u01/app/oracle/oradata/DB1/pdb/undotbs01.dbf

input datafile file number=00012 name=/u01/app/oracle/oradata/DB1/pdb/users01.dbf

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

channel ORA_DISK_1: finished piece 1 at 24-MAY-25

piece handle=/u01/app/oracle/fast_recovery_area/DB1/2FACECCE69615207E0630400040AB366/backupset/2025_05_24/o1_mf_nnndf_TAG20250524T153355_n33sqyrs_.bkp tag=TAG20250524T153355 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00017 name=/u01/app/oracle/oradata/demo1/sysaux01.dbf

input datafile file number=00016 name=/u01/app/oracle/oradata/demo1/system01.dbf

input datafile file number=00018 name=/u01/app/oracle/oradata/demo1/undotbs01.dbf

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

channel ORA_DISK_1: finished piece 1 at 24-MAY-25

piece handle=/u01/app/oracle/fast_recovery_area/DB1/33E6395D57264163E0630400040A2C41/backupset/2025_05_24/o1_mf_nnndf_TAG20250524T153355_n33srh8y_.bkp tag=TAG20250524T153355 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00006 name=/u01/app/oracle/oradata/DB1/pdbseed/sysaux01.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/DB1/pdbseed/system01.dbf

input datafile file number=00008 name=/u01/app/oracle/oradata/DB1/pdbseed/undotbs01.dbf

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

channel ORA_DISK_1: finished piece 1 at 24-MAY-25

piece handle=/u01/app/oracle/fast_recovery_area/DB1/2FAC79D13BBE3BB3E0630400040A98FA/backupset/2025_05_24/o1_mf_nnndf_TAG20250524T153355_n33srxtp_.bkp tag=TAG20250524T153355 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15

Finished backup at 24-MAY-25


Starting backup at 24-MAY-25

current log archived

using channel ORA_DISK_1

channel ORA_DISK_1: starting archived log backup set

channel ORA_DISK_1: specifying archived log(s) in backup set

input archived log thread=1 sequence=22 RECID=17 STAMP=1201966510

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

channel ORA_DISK_1: finished piece 1 at 24-MAY-25

piece handle=/u01/app/oracle/fast_recovery_area/DB1/backupset/2025_05_24/o1_mf_annnn_TAG20250524T153511_n33ssj1p_.bkp tag=TAG20250524T153511 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:02

Finished backup at 24-MAY-25


Starting Control File and SPFILE Autobackup at 24-MAY-25

piece handle=/u01/app/oracle/fast_recovery_area/DB1/autobackup/2025_05_24/o1_mf_s_1201966514_n33ssnvx_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 24-MAY-25


RMAN retention policy will be applied to the command

RMAN retention policy is set to redundancy 1

using channel ORA_DISK_1

Deleting the following obsolete backups and copies:

Type                 Key    Completion Time    Filename/Handle

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

Archive Log          154    24-MAY-25          /u01/app/oracle/fast_recovery_area/DB1/archivelog/2025_05_24/o1_mf_1_17_n330h31n_.arc

Archive Log          155    24-MAY-25          /u01/app/oracle/fast_recovery_area/DB1/archivelog/2025_05_24/o1_mf_1_18_n33j24vq_.arc

Archive Log          156    24-MAY-25          /u01/app/oracle/fast_recovery_area/DB1/archivelog/2025_05_24/o1_mf_1_19_n33j2wbt_.arc

Archive Log          157    24-MAY-25          /u01/app/oracle/fast_recovery_area/DB1/archivelog/2025_05_24/o1_mf_1_20_n33o3c4t_.arc

Archive Log          194    24-MAY-25          /u01/app/oracle/fast_recovery_area/DB1/archivelog/2025_05_24/o1_mf_1_21_n33spson_.arc

Backup Set           199    24-MAY-25

  Backup Piece       200    24-MAY-25          /u01/app/oracle/fast_recovery_area/DB1/backupset/2025_05_24/o1_mf_annnn_TAG20250524T153347_n33spwhd_.bkp


Do you really want to delete the above objects (enter YES or NO)? YES

deleted archived log

archived log file name=/u01/app/oracle/fast_recovery_area/DB1/archivelog/2025_05_24/o1_mf_1_17_n330h31n_.arc RECID=12 STAMP=1201940579

deleted archived log

archived log file name=/u01/app/oracle/fast_recovery_area/DB1/archivelog/2025_05_24/o1_mf_1_18_n33j24vq_.arc RECID=13 STAMP=1201956550

deleted archived log

archived log file name=/u01/app/oracle/fast_recovery_area/DB1/archivelog/2025_05_24/o1_mf_1_19_n33j2wbt_.arc RECID=14 STAMP=1201956572

deleted archived log

archived log file name=/u01/app/oracle/fast_recovery_area/DB1/archivelog/2025_05_24/o1_mf_1_20_n33o3c4t_.arc RECID=15 STAMP=1201961707

deleted archived log

archived log file name=/u01/app/oracle/fast_recovery_area/DB1/archivelog/2025_05_24/o1_mf_1_21_n33spson_.arc RECID=16 STAMP=1201966425

deleted backup piece

backup piece handle=/u01/app/oracle/fast_recovery_area/DB1/backupset/2025_05_24/o1_mf_annnn_TAG20250524T153347_n33spwhd_.bkp RECID=42 STAMP=1201966428

Deleted 6 objects



RMAN>

How to create stored script using recovery catalog and replace the script if needed ?

 


[oracle@orcl ~]$

[oracle@orcl ~]$

[oracle@orcl ~]$ rman target / catalog  rcatowner/oracle_4U@demopdb1


Recovery Manager: Release 19.0.0.0.0 - Production on Sat May 24 15:24:12 2025

Version 19.3.0.0.0


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


connected to target database: DB1 (DBID=1788905834)

connected to recovery catalog database


RMAN> list script names;


List of Stored Scripts in Recovery Catalog


        No scripts in recovery catalog


RMAN> create script db_plus_arc_bkp

2> {

3> backup database plus archivelog ;

4> }


created script db_plus_arc_bkp


RMAN> list script names;


List of Stored Scripts in Recovery Catalog



    Scripts of Target Database DB1


       Script Name

       Description

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

       db_plus_arc_bkp


RMAN> print script db_plus_arc_bkp;


printing stored script: db_plus_arc_bkp

{

backup database plus archivelog ;

}


RMAN> replace script db_plus_arc_bkp

2> {

3> backup database plus archivelog ;

4> delete obsolete ;

5> }


replaced script db_plus_arc_bkp


RMAN> print script db_plus_arc_bkp;


printing stored script: db_plus_arc_bkp

{

backup database plus archivelog ;

delete obsolete ;

}


RMAN>

How to manually resync oracle database with catalog database ?

 [oracle@orcl ~]$

[oracle@orcl ~]$

[oracle@orcl ~]$ rman target / catalog  rcatowner/oracle_4U@demopdb1


Recovery Manager: Release 19.0.0.0.0 - Production on Sat May 24 15:11:11 2025

Version 19.3.0.0.0


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


connected to target database: DB1 (DBID=1788905834)

connected to recovery catalog database


RMAN> resync catalog ;


starting full resync of recovery catalog

full resync complete


RMAN>

How to register database in recovery catalog ?

[oracle@orcl ~]$

[oracle@orcl ~]$

[oracle@orcl ~]$ rman target / catalog  rcatowner/oracle_4U@demopdb1


Recovery Manager: Release 19.0.0.0.0 - Production on Sat May 24 15:07:56 2025

Version 19.3.0.0.0


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


connected to target database: DB1 (DBID=1788905834)

connected to recovery catalog database


RMAN> register database ;


database registered in recovery catalog

starting full resync of recovery catalog

full resync complete


RMAN>

How to create recovery catalog ?

 


[oracle@orcl ~]$

[oracle@orcl ~]$ sqlplus "/as sysdba"


SQL*Plus: Release 19.0.0.0.0 - Production on Sat May 24 14:41:25 2025

Version 19.3.0.0.0


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



Connected to:

Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production

Version 19.3.0.0.0



SQL> show pdbs


    CON_ID CON_NAME                       OPEN MODE  RESTRICTED

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

         2 PDB$SEED                       READ ONLY  NO

         3 DEMOPDB1                       MOUNTED

SQL> alter pluggable database demopdb1 open read write ;


Pluggable database altered.


SQL> show con_name


CON_NAME

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

CDB$ROOT

SQL>





SQL> alter session set container =demopdb1;


Session altered.




SQL> create tablespace rcat datafile '/u01/app/oracle/oradata/DB2/rcat.dbf' size 15M;


Tablespace created.


SQL>



SQL>

SQL> CREATE USER rcatowner IDENTIFIED BY oracle_4U

TEMPORARY TABLESPACE temp

DEFAULT TABLESPACE rca  2    3  t

QUOTA UNLIMIT  4  ED ON rcat;


User created.




SQL> grant recovery_catalog_owner to rcatowner;


Grant succeeded.


SQL>



[oracle@orcl ~]$

[oracle@orcl ~]$

[oracle@orcl ~]$ rman


Recovery Manager: Release 19.0.0.0.0 - Production on Sat May 24 14:54:57 2025

Version 19.3.0.0.0


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


RMAN> connect catalog rcatowner/oracle_4U@demopdb1


connected to recovery catalog database


RMAN> create catalog;



recovery catalog created


RMAN>

RMAN>




How to create tablespace in oracle database ?

 

SQL>

SQL>  create tablespace rcat datafile '/u01/app/oracle/oradata/DB2/rcat.dbf' size 15M;


Tablespace created.


SQL>

How to drop tablespace in oracle database ?

 



SQL> DROP TABLESPACE rcat INCLUDING CONTENTS AND DATAFILES;


Tablespace dropped.


SQL>

How backup database using rman keep forever ?

 


RMAN> backup database keep forever ;


Starting backup at 24-MAY-25


using channel ORA_DISK_1

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of backup command at 05/24/2025 14:12:06

RMAN-06522: KEEP FOREVER option is not supported without the recovery catalog


RMAN>




RMAN> backup database keep until time 'sysdate+1';


Starting backup at 24-MAY-25


using channel ORA_DISK_1

backup will be obsolete on date 25-MAY-25

archived logs required to recover from this backup will be backed up

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=/u01/app/oracle/oradata/DB1/system01.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/DB1/sysaux01.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/DB1/undotbs01.dbf

input datafile file number=00007 name=/u01/app/oracle/oradata/DB1/users01.dbf

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 05/24/2025 14:13:04

ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes

continuing other job steps, job failed will not be re-run

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00010 name=/u01/app/oracle/oradata/DB1/pdb/sysaux01.dbf

input datafile file number=00009 name=/u01/app/oracle/oradata/DB1/pdb/system01.dbf

input datafile file number=00011 name=/u01/app/oracle/oradata/DB1/pdb/undotbs01.dbf

input datafile file number=00012 name=/u01/app/oracle/oradata/DB1/pdb/users01.dbf

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 05/24/2025 14:13:06

ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes

continuing other job steps, job failed will not be re-run

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00017 name=/u01/app/oracle/oradata/demo1/sysaux01.dbf

input datafile file number=00016 name=/u01/app/oracle/oradata/demo1/system01.dbf

input datafile file number=00018 name=/u01/app/oracle/oradata/demo1/undotbs01.dbf

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 05/24/2025 14:13:07

ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes

continuing other job steps, job failed will not be re-run

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00006 name=/u01/app/oracle/oradata/DB1/pdbseed/sysaux01.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/DB1/pdbseed/system01.dbf

input datafile file number=00008 name=/u01/app/oracle/oradata/DB1/pdbseed/undotbs01.dbf

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of backup command at 05/24/2025 14:13:08

ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes


RMAN>



RMAN> backup database keep until time 'sysdate+1';


Starting backup at 24-MAY-25


using channel ORA_DISK_1

backup will be obsolete on date 25-MAY-25

archived logs required to recover from this backup will be backed up

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=/u01/app/oracle/oradata/DB1/system01.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/DB1/sysaux01.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/DB1/undotbs01.dbf

input datafile file number=00007 name=/u01/app/oracle/oradata/DB1/users01.dbf

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 05/24/2025 14:13:04

ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes

continuing other job steps, job failed will not be re-run

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00010 name=/u01/app/oracle/oradata/DB1/pdb/sysaux01.dbf

input datafile file number=00009 name=/u01/app/oracle/oradata/DB1/pdb/system01.dbf

input datafile file number=00011 name=/u01/app/oracle/oradata/DB1/pdb/undotbs01.dbf

input datafile file number=00012 name=/u01/app/oracle/oradata/DB1/pdb/users01.dbf

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 05/24/2025 14:13:06

ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes

continuing other job steps, job failed will not be re-run

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00017 name=/u01/app/oracle/oradata/demo1/sysaux01.dbf

input datafile file number=00016 name=/u01/app/oracle/oradata/demo1/system01.dbf

input datafile file number=00018 name=/u01/app/oracle/oradata/demo1/undotbs01.dbf

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

RMAN-03009: failure of backup command on ORA_DISK_1 channel at 05/24/2025 14:13:07

ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes

continuing other job steps, job failed will not be re-run

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00006 name=/u01/app/oracle/oradata/DB1/pdbseed/sysaux01.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/DB1/pdbseed/system01.dbf

input datafile file number=00008 name=/u01/app/oracle/oradata/DB1/pdbseed/undotbs01.dbf

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of backup command at 05/24/2025 14:13:08

ORA-19811: cannot have files in DB_RECOVERY_FILE_DEST with keep attributes


RMAN>


RMAN>


RMAN> backup database format '/u01/app/oracle/%U' keep until time 'sysdate+1';


Starting backup at 24-MAY-25


using channel ORA_DISK_1

backup will be obsolete on date 25-MAY-25

archived logs required to recover from this backup will be backed up

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=/u01/app/oracle/oradata/DB1/system01.dbf

input datafile file number=00003 name=/u01/app/oracle/oradata/DB1/sysaux01.dbf

input datafile file number=00004 name=/u01/app/oracle/oradata/DB1/undotbs01.dbf

input datafile file number=00007 name=/u01/app/oracle/oradata/DB1/users01.dbf

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

channel ORA_DISK_1: finished piece 1 at 24-MAY-25

piece handle=/u01/app/oracle/2n3q8ulb_1_1 tag=TAG20250524T141402 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:25

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00010 name=/u01/app/oracle/oradata/DB1/pdb/sysaux01.dbf

input datafile file number=00009 name=/u01/app/oracle/oradata/DB1/pdb/system01.dbf

input datafile file number=00011 name=/u01/app/oracle/oradata/DB1/pdb/undotbs01.dbf

input datafile file number=00012 name=/u01/app/oracle/oradata/DB1/pdb/users01.dbf

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

channel ORA_DISK_1: finished piece 1 at 24-MAY-25

piece handle=/u01/app/oracle/2o3q8um4_1_1 tag=TAG20250524T141402 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00017 name=/u01/app/oracle/oradata/demo1/sysaux01.dbf

input datafile file number=00016 name=/u01/app/oracle/oradata/demo1/system01.dbf

input datafile file number=00018 name=/u01/app/oracle/oradata/demo1/undotbs01.dbf

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

channel ORA_DISK_1: finished piece 1 at 24-MAY-25

piece handle=/u01/app/oracle/2p3q8umj_1_1 tag=TAG20250524T141402 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:15

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

input datafile file number=00006 name=/u01/app/oracle/oradata/DB1/pdbseed/sysaux01.dbf

input datafile file number=00005 name=/u01/app/oracle/oradata/DB1/pdbseed/system01.dbf

input datafile file number=00008 name=/u01/app/oracle/oradata/DB1/pdbseed/undotbs01.dbf

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

channel ORA_DISK_1: finished piece 1 at 24-MAY-25

piece handle=/u01/app/oracle/2q3q8un3_1_1 tag=TAG20250524T141402 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:07

current log archived


using channel ORA_DISK_1

backup will be obsolete on date 25-MAY-25

archived logs required to recover from this backup will be backed up

channel ORA_DISK_1: starting archived log backup set

channel ORA_DISK_1: specifying archived log(s) in backup set

input archived log thread=1 sequence=20 RECID=15 STAMP=1201961707

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

channel ORA_DISK_1: finished piece 1 at 24-MAY-25

piece handle=/u01/app/oracle/2r3q8unc_1_1 tag=TAG20250524T141402 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01


using channel ORA_DISK_1

backup will be obsolete on date 25-MAY-25

archived logs required to recover from this backup will be backed up

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

including current SPFILE in backup set

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

channel ORA_DISK_1: finished piece 1 at 24-MAY-25

piece handle=/u01/app/oracle/2s3q8und_1_1 tag=TAG20250524T141402 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01


using channel ORA_DISK_1

backup will be obsolete on date 25-MAY-25

archived logs required to recover from this backup will be backed up

channel ORA_DISK_1: starting full datafile backup set

channel ORA_DISK_1: specifying datafile(s) in backup set

including current control file in backup set

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

channel ORA_DISK_1: finished piece 1 at 24-MAY-25

piece handle=/u01/app/oracle/2t3q8unf_1_1 tag=TAG20250524T141402 comment=NONE

channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01

Finished backup at 24-MAY-25


RMAN>

RMAN-06603: TO DESTINATION option must be specified with RECOVERY AREA, RECOVERY FILES or DB_RECOVERY_FILE_DEST on disk device

 

RMAN> backup recovery area;


Starting backup at 24-MAY-25

using channel ORA_DISK_1

specification does not match any datafile copy in the repository

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of backup command at 05/24/2025 13:47:36

RMAN-06603: TO DESTINATION option must be specified with RECOVERY AREA, RECOVERY FILES or DB_RECOVERY_FILE_DEST on disk device


RMAN> backup recovery files;


Starting backup at 24-MAY-25

using channel ORA_DISK_1

specification does not match any datafile copy in the repository

RMAN-00571: ===========================================================

RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============

RMAN-00571: ===========================================================

RMAN-03002: failure of backup command at 05/24/2025 13:47:50

RMAN-06603: TO DESTINATION option must be specified with RECOVERY AREA, RECOVERY FILES or DB_RECOVERY_FILE_DEST on disk device



Note : we have to specify the destination directory path where we need to take backup 


BACKUP RECOVERY AREA TO DESTINATION 'u01/app/oracle/backup';

How to take backup of backupset in oracle RMAN ?

 RMAN> backup backupset all;


Starting backup at 24-MAY-25

using channel ORA_DISK_1

channel ORA_DISK_1: input backup set: count=78, stamp=1201960787, piece=1

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

skipping backup piece handle /u01/app/oracle/fast_recovery_area/DB1/autobackup/2025_05_24/o1_mf_s_1201960787_n33n6o4x_.bkp; already exists

channel ORA_DISK_1: finished piece 1 at 24-MAY-25

channel ORA_DISK_1: backup piece complete, elapsed time: 00:00:00

channel ORA_DISK_1: input backup set: count=79, stamp=1201960815, piece=1

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

channel ORA_DISK_1: backup piece /u01/app/oracle/fast_recovery_area/DB1/backupset/2025_05_24/o1_mf_nnndf_TAG20250524T140015_n33n7jcg_.bkp

piece handle=/u01/app/oracle/fast_recovery_area/DB1/backupset/2025_05_24/o1_mf_nnnnf__n33n7v8r_.bkp comment=NONE

channel ORA_DISK_1: finished piece 1 at 24-MAY-25

channel ORA_DISK_1: backup piece complete, elapsed time: 00:00:02

channel ORA_DISK_1: input backup set: count=80, stamp=1201960817, piece=1

channel ORA_DISK_1: starting piece 1 at 24-MAY-25

skipping backup piece handle /u01/app/oracle/fast_recovery_area/DB1/autobackup/2025_05_24/o1_mf_s_1201960817_n33n7m82_.bkp; already exists

channel ORA_DISK_1: finished piece 1 at 24-MAY-25

channel ORA_DISK_1: backup piece complete, elapsed time: 00:00:00

Finished backup at 24-MAY-25


Starting Control File and SPFILE Autobackup at 24-MAY-25

piece handle=/u01/app/oracle/fast_recovery_area/DB1/autobackup/2025_05_24/o1_mf_s_1201960828_n33n7y5b_.bkp comment=NONE

Finished Control File and SPFILE Autobackup at 24-MAY-25


RMAN>

How to backup all recovery files in oracle ?

 RMAN> backup recovery files to destination '/u01/app/oracle/';


Starting backup at 24-MAY-25

using channel ORA_DISK_1

specification does not match any datafile copy in the repository

skipping archived logs of thread 1 from sequence 17 to 19; already backed up

skipping backup set key 19; already backed up 1 time(s)

skipping backup set key 20; already backed up 1 time(s)

skipping backup set key 21; already backed up 1 time(s)

skipping backup set key 22; already backed up 1 time(s)

skipping backup set key 23; already backed up 1 time(s)

skipping backup set key 24; already backed up 1 time(s)

skipping backup set key 25; already backed up 1 time(s)

skipping backup set key 26; already backed up 1 time(s)

skipping backup set key 27; already backed up 1 time(s)

skipping backup set key 28; already backed up 1 time(s)

Finished backup at 24-MAY-25


RMAN>