Skip to main content

Welcome to DBA Master – Database Tips, Tricks, and Tutorials

Welcome to DBA Master ! This blog is dedicated to all things related to database administration , SQL optimization , and performance tuning . Whether you're a beginner or a seasoned DBA, you'll find practical guides, troubleshooting tips, and real-world tutorials to help you work smarter with data. What to Expect: SQL performance tuning tips Indexing strategies Backup and recovery best practices High availability and replication techniques Database creation, configuration, and setup Monitoring queries and scripts for proactive performance management Migration guides across different database platforms Security essentials and best practices Recommended tools for DBAs Real-world error fixes and how to solve them Stay tuned — exciting content is coming soon. Feel free to bookmark and share: www.dbamaster.com ! Thanks for visiting!

Oracle Control File

 Every Oracle Database has a control file, which is a small binary file that records the physical structure of the database.

Use of Control Files

Oracle Database uses the control file to locate database files and to manage the state of the database generally.

A control file contains information such as the following:

  1. The database name and database unique identifier (DBID)
  2. The time stamp of database creation
  3. The current log sequence number
  4. Checkpoint information
  5. Information about data files, online redo log files, and archived redo log files
  6. Tablespace information
  7. RMAN backups

The control file serves the following purposes:

  • It contains information about data files, online redo log files, and so on that are required to open the database.
  • The control file tracks structural changes to the database. For example, when an administrator adds, renames, or drops a data file or online redo log file, the database updates the control file to reflect this change.
  • It contains metadata that must be accessible when the database is not open. For example, the control file contains information required to recover the database, including checkpoints.
  • Oracle Database reads and writes to the control file continuously during database use and must be available for writing whenever the database is open.

Multiplex Control Files

Every Oracle Database should have at least two control files, each stored on a different physical disks, the database can achieve redundancy and thereby avoid a single point of failure.

To check how many control file in your db:

show parameter control_files;
(OR)
select name from v$controlfile;

Add the Control File:

alter system set control_files='/u01/app/oracle/oradata/PEARL/control01.ctl','/u01/app/oracle/oradata/PEARL/control02.ctl' scope=spfile;

Down the Database:

shut immediate;
cd /u01/app/oracle/oradata/PEARL/
cp -rf control01.ctl control02.ctl

Start the Database and verify the control file:

show parameter control_files;

Multiplexing using pfile:

show parameter spfile;
create pfile='/u01/app/oracle/product/19.0.0/dbhome_1/dbs/initpearl.ora' from spfile;

Down the database:

shut immediate;

Copy from the control02 to control03.ctl

cd /u01/app/oracle/oradata/PEARL/
cp -rf control02.ctl control03.ctl

Update the control file parameter values:

vi /u01/app/oracle/product/19.0.0/dbhome_1/dbs/initpearl.ora
Before:
*.control_files='/u01/app/oracle/oradata/PEARL/control01.ctl','/u01/app/oracle/oradata/PEARL/control02.ctl'
After:
*.control_files='/u01/app/oracle/oradata/PEARL/control01.ctl','/u01/app/oracle/oradata/PEARL/control02.ctl','/u01/app/oracle/oradata/PEARL/control03.ctl'

Start the Database use pfile:

startup pfile='/u01/app/oracle/product/19.0.0/dbhome_1/dbs/initpearl.ora';
show parameter pfile;
show parameter control_files;
select name from v$controlfile;

Create Control File Trace:

ALTER DATABASE BACKUP CONTROLFILE TO TRACE AS '/path/to/tracefile.trc';

Comments

Popular posts from this blog

Oracle Database 19C Performance Tunning - PART 1

Advantages: 1. Improved Query Performance •    Optimized SQL execution plans lead to faster query response times. •    Reduces unnecessary full table scans and improves indexing strategies. •    Parallel execution tuning speeds up large data processing tasks. 2. Better Resource Utilization •    Efficient use of CPU, memory, disk I/O, and network resources. •    Reduces contention on Redo Logs, Undo Tablespaces, and Buffer Cache. •    Helps in load balancing across multiple instances in RAC (Real Application Clusters). 3. Increased System Scalability •    Ensures that the database can handle a growing number of users and transactions. •    Proper tuning allows scaling without degrading performance. •    Optimized parallel processing ensures better performance on multi-core servers. 4. Lower Infrastructure Costs •    Reduces the need for add...

Oracle RMAN Backup And Restore

RMAN: (Oracle 8) RMAN (Recovery Manager) is a utility provided by Oracle Database to perform backup, restore, and recovery operations. It is a command line tool. Features of RMAN in Oracle 19c Comprehensive Backup Capabilities: Full and incremental backups. Block-level backups for efficient data storage. Archived redo log backups. Fast Recovery Area (FRA) integration for centralized backup storage. Efficient Recovery Options: Point-in-time recovery (PITR). Complete and incomplete recovery. Flashback database capabilities for quick undo of changes. Multitenant Database Support: RMAN fully supports container databases (CDBs) and pluggable databases (PDBs). Provides flexibility to back up and recover individual PDBs or entire CDBs. Automatic Space Management: Manages disk space in the FRA. Automatically deletes obsolete backups and archived logs. Data Deduplication and Compression: Backup optimization through block-level deduplication. Built-in compression algorithms to reduce storage req...

Oracle 19c Database Software Installation in OEL8

 Pre-requisites for OS level:            Set the static IP Address     Disable the Firewall (systemctl stop firewalld & systemctl disable firewalld)     set SELINUX=permissive on /etc/selinux/config  ##Need to restart the server use init 6 Oracle Installation Pre-requisites Methods     Automatic Setup     Manual Setup      Automatic requisites Setup: (avoid step 1 to step 5): dnf install -y oracle-database-preinstall-19c Install the dependencies: curl -o oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64/getPackage/oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm dnf -y localinstall oracle-database-preinstall-19c-1.0-2.el8.x86_64.rpm Manual Setup: step 1: Add the karenl parameters and values vi /etc/sysctl.conf     fs.file-max = 6815744 kernel.sem = 250 32000 100 128 kernel....