Friday, July 18, 2025

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>