Oracle On Linux Tips.
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
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
Click here to claim your Sponsored Listing.