How to take current control file in oracle database?

 The contents are of my own testing and deployments. Not guaranteed that these might work in your environment. Please test before usage.


In this blog, I will teach you how to take control file backups in the Oracle database.


There is a lot of method in the Oracle database in a few of the below for your reference!


1)Manual method in rman

2)Backup the control file in the SQL prompt

3)Backup control file as copy 


1)Manual method in rman

This is the backup that only contains RMAN repository data for the backup within the current Rman session.

1)Connect the RMAN issues to the below commands

RMAN> BACKUP CURRENT CONTROLFILE;


Starting backup at 27-APR-23

using channel ORA_DISK_1

using channel ORA_DISK_2

using channel ORA_DISK_3

using channel ORA_DISK_4

using channel ORA_DISK_5

using channel ORA_DISK_6

using channel ORA_DISK_7

using channel ORA_DISK_8

using channel ORA_DISK_9

using channel ORA_DISK_10

using channel ORA_DISK_11

using channel ORA_DISK_12

using channel ORA_DISK_13

using channel ORA_DISK_14

using channel ORA_DISK_15

using channel ORA_DISK_16

using channel ORA_DISK_17

using channel ORA_DISK_18

using channel ORA_DISK_19

using channel ORA_DISK_20

using channel ORA_DISK_21

using channel ORA_DISK_22

using channel ORA_DISK_23

using channel ORA_DISK_24

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 27-APR-23

channel ORA_DISK_1: finished piece 1 at 27-APR-23

piece handle=/u01/ramesh/backup/Ramesh_FULL_PROD_t1135286973_s88_p1 tag=TAG20230427T212933 comment=NONE

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

Finished backup at 27-APR-23


RMAN>


***********************************************************************************

2) Back up the control file in the SQL prompt.

If you want to take a backup in sqlplus utility u can issue the below command .


SQL> ALTER DATABASE BACKUP CONTROLFILE TO '/u01/backup/control.bkp';


Database altered.


SQL> exit

Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production

With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

[oracle@oracle backup]$

[oracle@oracle backup]$ cd /u01/backup

[oracle@oracle backup]$ ll

total 139044

-rw-r-----. 1 oracle oinstall 12923904 Apr 21 12:04 1_40_1132351466.dbf

-rw-r-----. 1 oracle oinstall 34688512 Apr 21 19:31 1_41_1132351466.dbf

-rw-r-----. 1 oracle oinstall  4775936 Apr 22 18:25 1_42_1132351466.dbf

-rw-r-----. 1 oracle oinstall 37938688 Apr 22 18:26 1_43_1132351466.dbf

-rw-r-----. 1 oracle oinstall  3885056 Apr 23 11:21 1_44_1132351466.dbf

-rw-r-----. 1 oracle oinstall 27712000 Apr 27 21:18 1_45_1132351466.dbf

-rw-r-----. 1 oracle oinstall 10043392 Apr 27 21:26 control.bkp

-rw-r-----. 1 oracle oinstall 10043392 Apr 27 21:24 controlfile_copy.ctl

-rw-r--r--. 1 oracle oinstall     1706 Apr 19 20:15 impjohn.log

-rw-r-----. 1 oracle oinstall   352256 Apr 19 20:12 scott.dmp

-rw-r--r--. 1 oracle oinstall     1939 Apr 19 20:12 scott.log

[oracle@oracle backup]$


***********************************************************************************

3)Backup control file as a copy.

If you want to take a current control file copy you can use the below command. 


RMAN>BACKUP AS COPY CURRENT CONTROLFILE FORMAT '/u01/backup/controlfile_copy.ctl';


[oracle@oracle backup]$ rman target /

Recovery Manager: Release 12.1.0.2.0 - Production on Thu Apr 27 21:24:30 2023

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

connected to target database: PROD (DBID=544189800)

RMAN> BACKUP AS COPY CURRENT CONTROLFILE FORMAT '/u01/backup/controlfile_copy.ctl';

Starting backup at 27-APR-23
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=19 device type=DISK
allocated channel: ORA_DISK_2
channel ORA_DISK_2: SID=139 device type=DISK
allocated channel: ORA_DISK_3
channel ORA_DISK_3: SID=251 device type=DISK
allocated channel: ORA_DISK_4
channel ORA_DISK_4: SID=355 device type=DISK
allocated channel: ORA_DISK_5
channel ORA_DISK_5: SID=20 device type=DISK
allocated channel: ORA_DISK_6
channel ORA_DISK_6: SID=247 device type=DISK
allocated channel: ORA_DISK_7
channel ORA_DISK_7: SID=368 device type=DISK
allocated channel: ORA_DISK_8
channel ORA_DISK_8: SID=12 device type=DISK
allocated channel: ORA_DISK_9
channel ORA_DISK_9: SID=136 device type=DISK
allocated channel: ORA_DISK_10
channel ORA_DISK_10: SID=255 device type=DISK
allocated channel: ORA_DISK_11
channel ORA_DISK_11: SID=369 device type=DISK
allocated channel: ORA_DISK_12
channel ORA_DISK_12: SID=15 device type=DISK
allocated channel: ORA_DISK_13
channel ORA_DISK_13: SID=130 device type=DISK
allocated channel: ORA_DISK_14
channel ORA_DISK_14: SID=250 device type=DISK
allocated channel: ORA_DISK_15
channel ORA_DISK_15: SID=365 device type=DISK
allocated channel: ORA_DISK_16
channel ORA_DISK_16: SID=14 device type=DISK
allocated channel: ORA_DISK_17
channel ORA_DISK_17: SID=131 device type=DISK
allocated channel: ORA_DISK_18
channel ORA_DISK_18: SID=254 device type=DISK
allocated channel: ORA_DISK_19
channel ORA_DISK_19: SID=366 device type=DISK
allocated channel: ORA_DISK_20
channel ORA_DISK_20: SID=16 device type=DISK
allocated channel: ORA_DISK_21
channel ORA_DISK_21: SID=367 device type=DISK
allocated channel: ORA_DISK_22
channel ORA_DISK_22: SID=17 device type=DISK
allocated channel: ORA_DISK_23
channel ORA_DISK_23: SID=137 device type=DISK
allocated channel: ORA_DISK_24
channel ORA_DISK_24: SID=252 device type=DISK
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/u01/backup/controlfile_copy.ctl tag=TAG20230427T212448 RECID=1 STAMP=1135286688
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 27-APR-23

RMAN>
***********************************************************************************


                                                      Thank you for your time!!



0 Comments

DELETE Statement in ORACLE DB— Step by Step Internal Flow with classroom example.

Imagine your Oracle database like a school, and you’re Teacher decides to remove a student (row) from the classroom(table). Let’s see how the journey works step by step: 1)Classroom = Oracle Table 2)Students = Rows (Records) 3)Class Teacher = Oracle Server Process 4)Attendance Register = Data Dictionary User fires DELETE statement: DELETE FROM students WHERE grade = 'D'; Internal Processing Steps: Client Process Sends DELETE Statement to Server Process The teacher receives a request to remove a student from the classroom. Syntax Check (Parsing) The teacher checks if the request is grammatically correct — proper command, keywords, and a semicolon. Semantic Check Teacher verifies if the classroom exists and whether the condition (like grade = 'D') makes sense. Object Resolution Teacher confirms that the ‘students’ classroom (table) exists in the school records (data dictionary). Optimization Decides the fastest way to find those students — by roll number, grade, or al...