Oracle On Linux Tips.

Oracle On Linux Tips.

Share

Contact information, map and directions, contact form, opening hours, services, ratings, photos, videos and announcements from Oracle On Linux Tips., Education Website, Cairo.

19/10/2025

๐Ÿงฉ How to Perform Incremental RMAN Backup in Oracle Database

๐Ÿš€ Incremental backups are a DBAโ€™s best friend when it comes to saving time and space! Instead of backing up everything, they capture only the changed blocks since the last backup โ€” keeping your backup strategy both efficient and smart.

Letโ€™s dive into how to create and manage incremental RMAN backups step by step ๐Ÿ‘‡

๐Ÿง  What Is an Incremental Backup?
An incremental backup copies only those data blocks that have changed since a previous backup.
There are two levels:

Level 0 โ†’ Full backup of all data blocks.

Level 1 โ†’ Backs up only blocks changed since the last Level 0 or Level 1 backup.

๐Ÿ“˜ Step 1๏ธโƒฃ: Connect to RMAN

rman target /

๐Ÿ“˜ Step 2๏ธโƒฃ: Take a Level 0 (Base) Backup
This is the foundation for all future incremental backups.

BACKUP INCREMENTAL LEVEL 0 DATABASE TAG 'LEVEL0_BACKUP';

๐Ÿ“˜ Step 3๏ธโƒฃ: Take a Level 1 Incremental Backup
This backs up only the changes since your last Level 0 or Level 1 backup.

BACKUP INCREMENTAL LEVEL 1 DATABASE TAG 'LEVEL1_BACKUP';

๐Ÿ’ก Tip: Schedule Level 0 weekly and Level 1 daily for a strong backup plan.

๐Ÿ“˜ Step 4๏ธโƒฃ: Use Incremental Backups for Recovery
During recovery, Oracle automatically applies incremental backups to bring the database to the desired point in time:

RECOVER DATABASE;

โš™๏ธ Optional โ€“ Cumulative Incremental Backups
You can create a cumulative incremental backup that includes all changes since the last Level 0:

BACKUP INCREMENTAL LEVEL 1 CUMULATIVE DATABASE;

๐Ÿ’ฌ Why Incremental Backups Are Important
โœ… Faster daily backups
โœ… Reduced disk space usage
โœ… Quick restore when combined with archive logs
โœ… Essential for large production databases

โœจ Best Practice:
Always crosscheck backups and validate them regularly to ensure restore readiness.

CROSSCHECK BACKUP;
VALIDATE DATABASE;

๐Ÿ’ช Incremental backups are your secret weapon for smarter database protection โ€” make them part of your daily DBA routine!

๐Ÿ‘ Like & Follow my page for more Oracle DBA tips and guides!

๐Ÿ‘‰ Facebook:
Oracle On Linux Tips.

๐Ÿ“˜ Blog: https://oracleinlinuxbyabosalma.blogspot.com

17/10/2025

๐Ÿ”ฅ Top 10 RMAN Commands Every Oracle DBA Must Know

As an Oracle DBA, mastering RMAN (Recovery Manager) is essential for ensuring your databaseโ€™s safety and recoverability. RMAN simplifies backup, restore, and recovery operations โ€” and having these 10 commands at your fingertips can save your day! ๐Ÿ’ช

Letโ€™s dive in step by step ๐Ÿ‘‡

๐Ÿ’พ 1๏ธโƒฃ Backup the Entire Database

RMAN> BACKUP DATABASE PLUS ARCHIVELOG;

This command takes a full backup of your database including archived logs. Perfect for daily scheduled backups.

๐Ÿงฉ 2๏ธโƒฃ Backup Only the Control File

RMAN> BACKUP CURRENT CONTROLFILE;

Control files are critical โ€” always keep a separate backup to recover from corruption or accidental loss.

๐Ÿงฑ 3๏ธโƒฃ Backup a Specific Tablespace

RMAN> BACKUP TABLESPACE users;

When only a specific tablespace is changed frequently, you can back it up independently.

๐Ÿ“ฆ 4๏ธโƒฃ Backup Datafile by Path

RMAN> BACKUP DATAFILE '/u01/oradata/PROD/system01.dbf';

This gives you control to back up specific datafiles instead of the entire database.

โš™๏ธ 5๏ธโƒฃ Restore the Database

RMAN> RESTORE DATABASE;

This command restores all database files from the backup โ€” used in complete or incomplete recovery scenarios.

๐Ÿ” 6๏ธโƒฃ Recover the Database

RMAN> RECOVER DATABASE;

After restoring datafiles, this applies all necessary archived logs and redo information to make the database consistent.

๐Ÿง  7๏ธโƒฃ List All Backups

RMAN> LIST BACKUP SUMMARY;

Helps you verify all backups and details like completion time, type, and piece name.

๐Ÿ“‹ 8๏ธโƒฃ Delete Old Backups

RMAN> DELETE NOPROMPT OBSOLETE;

This command removes outdated backups based on your retention policy to free up space automatically.

๐Ÿงฎ 9๏ธโƒฃ Crosscheck Backups

RMAN> CROSSCHECK BACKUP;

Ensures RMANโ€™s catalog is synchronized with the actual backup files present on disk or tape.

๐Ÿš€ ๐Ÿ”Ÿ Validate Backup Integrity

RMAN> VALIDATE DATABASE;

Verifies that all datafiles can be backed up and restored successfully โ€” a must for proactive DBAs.

โœจ ๐Ÿ’ก Pro Tip:
Always configure your retention policy and backup destination properly using:

RMAN> CONFIGURE RETENTION POLICY TO REDUNDANCY 2;
RMAN> CONFIGURE DEFAULT DEVICE TYPE TO DISK;
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;

This ensures automated, consistent, and safe backups across all operations.

๐Ÿ“˜ Conclusion:
These commands form the backbone of every Oracle DBAโ€™s backup and recovery strategy. Mastering RMAN gives you confidence that your database can always be restored โ€” no matter what happens!

๐Ÿ‘‰ Like & Follow my page for more Oracle DBA tips!
Youโ€™ll find posts about troubleshooting, performance tuning, Data Guard, cloning databases, and much more every week ๐Ÿ”ฅ

๐Ÿ‘‰ Facebook:
Oracle On Linux Tips.

๐Ÿ“˜ Blog: https://oracleinlinuxbyabosalma.blogspot.com

15/10/2025

๐Ÿงฉ How to Install Oracle Database on Linux and Restore from RMAN Backup (Step-by-Step Guide)

๐Ÿš€ In this post, weโ€™ll go through a complete DBA task โ€” installing Oracle Database on Linux and restoring it from a previously taken RMAN backup. This process is essential when setting up a new environment or recovering a production database onto a test or standby server.

๐Ÿ’ก Letโ€™s dive in step by step ๐Ÿ‘‡

๐Ÿงฑ Step 1: Pre-Installation Requirements

Before starting, make sure your Linux system meets Oracleโ€™s requirements.

โœ… System Configuration

OS: Oracle Linux / RHEL / CentOS 7+ (x86_64)

Memory: Minimum 4 GB (8 GB recommended)

Swap Space: Equal to RAM up to 16 GB

Disk Space: ~30 GB for Oracle Home + Database Files

โœ… Create Required Users & Groups

groupadd oinstall
groupadd dba
useradd -g oinstall -G dba oracle
passwd oracle

โœ… Set Kernel Parameters (edit /etc/sysctl.conf)

fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmax = 8589934592
kernel.shmall = 2097152

Then apply:

/sbin/sysctl -p

โœ… Set Limits for the Oracle User (edit /etc/security/limits.conf)

oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536

โœ… Environment Variables for Oracle User

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1
export ORACLE_SID=PROD
export PATH=$ORACLE_HOME/bin:$PATH

---

๐Ÿ—๏ธ Step 2: Install Oracle Database Software (Oracle Home)

1๏ธโƒฃ Login as the oracle user
2๏ธโƒฃ Unzip the Oracle installation files

unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip

3๏ธโƒฃ Run the installer

cd database/runInstaller

4๏ธโƒฃ Choose:

Install database software only

Single instance

Typical installation
5๏ธโƒฃ Complete the installation and run the root scripts as prompted.

โœ… Verify installation:

lsnrctl status
sqlplus / as sysdba

---

๐Ÿ’พ Step 3: Restore Database from RMAN Backup

Now that Oracle Home is ready, weโ€™ll restore the database.

โœ… Set up directories

mkdir -p /u01/app/oracle/oradata/PROD
mkdir -p /u01/app/oracle/backup

โœ… Start the instance in NOMOUNT mode

rman target /
startup nomount;

โœ… Restore the control file

restore controlfile from '/u01/app/oracle/backup/c-1234567890-20231011-00';
alter database mount;

โœ… Catalog and restore database files

catalog start with '/u01/app/oracle/backup/';
restore database;
recover database;

โœ… Open the database

alter database open resetlogs;

---

๐Ÿ” Step 4: Post-Restore Checks

Validate datafiles:

select name from v$datafile;

Check archive log mode:

archive log list;

Test connectivity using:

sqlplus system@PROD

โœ… Everything should now be working โ€” your database has been successfully restored!

---

โœจ Like & Follow my page for more real-world Oracle DBA guides and Linux tips!

๐Ÿ‘‰ Facebook:
Oracle On Linux Tips.

๐Ÿ“˜ Blog: https://oracleinlinuxbyabosalma.blogspot.com

13/10/2025

๐Ÿงฉ How to Rename a Datafile in Oracle Database

Renaming a datafile is sometimes necessary after restoring from backup or reorganizing your storage structure โš™๏ธ
Letโ€™s see how to safely rename a datafile in just a few steps ๐Ÿ‘‡

๐Ÿ” Step-by-Step Guide

1๏ธโƒฃ Identify the datafile you want to rename:

SELECT file_id, file_name FROM dba_data_files;

2๏ธโƒฃ Shutdown the database cleanly:

SHUTDOWN IMMEDIATE;

3๏ธโƒฃ Rename the file at the OS level:

mv /u01/oradata/PROD/users01.dbf /u01/oradata/PROD/users_data.dbf

4๏ธโƒฃ Start the database in MOUNT mode:

STARTUP MOUNT;

5๏ธโƒฃ Update the control file with the new name:

ALTER DATABASE RENAME FILE '/u01/oradata/PROD/users01.dbf'
TO '/u01/oradata/PROD/users_data.dbf';

6๏ธโƒฃ Open the database:

ALTER DATABASE OPEN;

โœ… Thatโ€™s it! Your datafile has been successfully renamed.

๐Ÿ’ก DBA Tip

Always take a control file backup after renaming datafiles โ€” it helps during future recovery operations.

๐Ÿ’ฌ Like this post?
๐Ÿ‘‰ Follow my page for more Oracle DBA tips and practical guides!

๐Ÿ‘‰ Facebook: https://www.facebook.com/people/Oracle-On-Linux-Tips/61581062542160/
๐Ÿ“˜ Blog: https://oracleinlinuxbyabosalma.blogspot.com

13/10/2025

๐Ÿงฉ How to Move a Datafile to Another Location in Oracle Database

Sometimes you may need to move a datafile โ€” for example, to a new storage location, after disk reorganization, or to balance I/O load โš™๏ธ

Letโ€™s go through it step by step ๐Ÿ‘‡

๐Ÿ” Step-by-Step Guide

1๏ธโƒฃ Check the current location of the datafile:

SELECT file_id, file_name FROM dba_data_files;

2๏ธโƒฃ Shutdown the database cleanly:

SHUTDOWN IMMEDIATE;

3๏ธโƒฃ Move the datafile to the new location (using OS command):

mv /u01/oradata/PROD/users01.dbf /u02/oradata/PROD/users01.dbf

4๏ธโƒฃ Mount the database:

STARTUP MOUNT;

5๏ธโƒฃ Update the control file with the new location:

ALTER DATABASE RENAME FILE '/u01/oradata/PROD/users01.dbf'
TO '/u02/oradata/PROD/users01.dbf';

6๏ธโƒฃ Open the database:

ALTER DATABASE OPEN;

โœ… Done! Your datafile has been successfully moved without any data loss.

๐Ÿ’ก DBA Tip

Always perform this during maintenance windows, and make sure to take a backup before any file-level change.

๐Ÿ’ฌ Like this post?
๐Ÿ‘‰ Follow my page for more Oracle DBA tips and tutorials!

๐Ÿ‘‰ Facebook: https://www.facebook.com/people/Oracle-On-Linux-Tips/61581062542160/
๐Ÿ“˜ Blog: https://oracleinlinuxbyabosalma.blogspot.com

13/10/2025

๐Ÿงฉ How to Add a Datafile to a Tablespace in Oracle Database

Adding a new datafile is a common task for DBAs when a tablespace runs out of space. Letโ€™s see how to do it quickly ๐Ÿ‘‡

๐Ÿ” Step-by-Step Guide

1๏ธโƒฃ Check tablespace size:

SELECT tablespace_name, file_name, bytes/1024/1024 AS size_mb FROM dba_data_files;

2๏ธโƒฃ Add a new datafile:

ALTER DATABASE DATAFILE '/u01/oradata/PROD/users02.dbf' SIZE 500M AUTOEXTEND ON NEXT 100M MAXSIZE UNLIMITED;

3๏ธโƒฃ Verify the addition:

SELECT file_name, bytes/1024/1024 AS size_mb FROM dba_data_files WHERE tablespace_name='USERS';

โœ… Thatโ€™s it! Youโ€™ve successfully added a new datafile to your tablespace.

๐Ÿ“˜ DBA Tip

Always plan tablespace growth and monitor autoextend settings to avoid sudden space issues.

๐Ÿ’ฌ Like this post?
๐Ÿ‘‰ Follow my page for more Oracle tips and daily DBA insights!

๐Ÿ‘‰ Facebook: https://www.facebook.com/people/Oracle-On-Linux-Tips/61581062542160/
๐Ÿ“˜ Blog: https://oracleinlinuxbyabosalma.blogspot.com

13/10/2025

๐Ÿงฉ How to Drop or Delete a Datafile in Oracle Database

Sometimes, as part of storage reorganization or database cleanup, you may need to drop an unused datafile from a tablespace. However, itโ€™s important to do this safely to avoid corrupting data or impacting performance. Letโ€™s go step by step ๐Ÿง 

๐Ÿช„ 1๏ธโƒฃ Step 1: Identify the Datafile

List all datafiles and their associated tablespaces:

SQL> SELECT file_id, file_name, tablespace_name, bytes/1024/1024 AS size_mb
FROM dba_data_files
ORDER BY tablespace_name;

๐Ÿ‘‰ This helps you confirm which datafile you intend to remove.

๐Ÿช„ 2๏ธโƒฃ Step 2: Check If the Datafile Is Empty

Before dropping, make sure no objects exist in that datafile:

SQL> SELECT segment_name, tablespace_name, file_id
FROM dba_extents
WHERE file_id = ;

๐Ÿ’ก If no rows are returned, itโ€™s safe to drop the file.

๐Ÿช„ 3๏ธโƒฃ Step 3: Drop the Datafile

Use the following command to remove the datafile from the tablespace:

SQL> ALTER DATABASE DATAFILE '/u01/app/oracle/oradata/PROD/users02.dbf' OFFLINE DROP;

โš ๏ธ This marks the file as dropped but doesnโ€™t remove it from the OS yet.

๐Ÿช„ 4๏ธโƒฃ Step 4: Remove the File from the Operating System

After confirming itโ€™s no longer used by Oracle:

$ rm /u01/app/oracle/oradata/PROD/users02.dbf

๐Ÿช„ 5๏ธโƒฃ Step 5: Verify

Finally, check that the file is gone from the database view:

SQL> SELECT file_name FROM dba_data_files;

โœ… Youโ€™ve now safely dropped a datafile that was no longer needed โ€” improving space management and organization in your Oracle database.

๐Ÿ‘‰ Facebook: https://www.facebook.com/people/Oracle-On-Linux-Tips/61581062542160/

๐Ÿ“˜ Blog: https://oracleinlinuxbyabosalma.blogspot.com

Want your school to be the top-listed School/college in Cairo?
Click here to claim your Sponsored Listing.

Culinary Team

Attire

Address

Cairo