ORACLE DATABASE-Controlfile

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

Summary: in this tutorial, you will learn What is Controlfile in  oracle database, 

Control File:


  1) The Control file is a file with a .ctl extension that is physically stored on the operating system that is a must for an Oracle database. 

2)This file also acts as the brain for our Oracle database. When the Oracle database starts, it reads the parameter file called SPFILE or PFILE and learns the location of the Control file. 


3)Because the Control file is the brain of our database, the database needs to find this file to work. If it cannot find the Control File, the Oracle database will not start and will give an error.


4)That's why, the control file is stored in 2 copies in the production databases. Oracle’s recommended configuration is that we store 3 copies on separate disks. We said the control file is very important. So why is important, what information is in the control file.

Including:-

--Database name and Identifier

--Time stamp of database creation

--Tablespace names

--Names and Locations of datafiles and Online redo Logfiles.

--Current Online Redo Logfiles sequence number(LSN)

-- Checkpoint Information

--Begin and end of Undo segments

--Redo Log Archive information

--Backup Information.


Show control file:

SQL> show parameter control

NAME                                           TYPE           VALUE

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

control_file_record_keep_time       integer   7

control_files                                         string  /home/oracle/service/oradata/control/control01.ctl,                                                                            /home/oracle/service/oradata/control/control02.ctl

control_management_pack_access      string DIAGNOSTIC+TUNING


SQL> select name from v$controlfile;

NAME

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

/home/oracle/service/oradata/control/control01.ctl

/home/oracle/service/oradata/control/control02.ctl


Note: Don't try to open or cat that control file!


                                            Thanks 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...