Posts

Showing posts from May, 2025

DB Restoration | Standard Oracle Database (no EBS, ASM, or PDB configurations).

Image
Background  Objective :  Restore the TEST2 test instance using an existing production backup. Pre-Restoration Step :  A backup of the current TEST database was performed prior to initiating the restoration process. Database Specifications : Size : Approximately 3.5 TB Architecture : Standard Oracle Database (no EBS, ASM, or PDB configurations). Storage : All database-related files, including DB_HOME , are located under the /u01 mount point. Compute Resources : The instance is equipped with 48 CPUs; 16 RMAN channels were allocated to optimize the restoration process. Pre-Restoration Checks Production DB size:                 SQL> SELECT SUM(bytes)/1024/1024/1024 AS "Total Database Size (GB)" FROM dba_data_files; Mount point space: Ensure there is enough disk space to accommodate the restored datafiles, control files, and log files. spfile path:                 SQL> S...

RMAN Sample Script

 EXAMPLE : 1 export ORACLE_HOME=/u01/app/oracle/product/12.1.0/dbhome_1 <<Has to be change>> export ORACLE_SID=TEST2 <<Has to be change>> export PATH=$ORACLE_HOME/bin:$PATH fdate=`date "+%d-%b-%Y"` ddate=`date -d "-5 days" "+%d-%b-%Y"` BACKUP_LOCATION=/mnt/backup/TEST2_BACKUP; <<Has to be change>> export BACKUP_LOCATION BACKLOGDIR=/mnt/backup/TEST2_BACKUP <<Has to be change>> export BACKLOGDIR LOGFILE=$BACKLOGDIR/RMAN_`date +%d%m%Y-%H%M`.log export LOGFILE; cd $BACKUP_LOCATION mkdir RMAN_$fdate echo " RMAN PROD_DATABASE backup started at `date`" >> $LOGFILE $ORACLE_HOME/bin/rman nocatalog <<EOF | tee $LOGFILE connect target / run { allocate channel d1 type disk; allocate channel d2 type disk; backup as compressed backupset filesperset 5 incremental level 0 database format  '$BACKUP_LOCATION/RMAN_$fdate/%d_data_full_%s_%p_%u' plus archivelog format '$BACKUP_LOCATION/RMAN_$fdat...

Setting Oracle Environment Variables

🐧 Setting Oracle Environment Variables on Linux 1. Open Terminal and Switch to the Oracle User:                 su - oracle 2. Set Environment Variables:                export ORACLE_BASE=/u01/app/oracle                export ORACLE_HOME=$ORACLE_BASE/product/23.0.0/dbhome_1                export ORACLE_SID=orcl                export PATH=$ORACLE_HOME/bin:$PATH These variables define the base directory for Oracle software ( ORACLE_BASE ), the location of the Oracle home directory ( ORACLE_HOME ), the Oracle System Identifier ( ORACLE_SID ), and update the system PATH to include Oracle binaries. 3. Make Variables Persistent: To ensure these settings persist across sessions, add them to the Oracle user's profile script:           ...

Oracle Database Basic Consepts (Start / Stop / Check Database Status)

🟢 Starting the Oracle Database                SQL> STARTUP; This command initiates the Oracle instance, mounts the database, and opens it for use. For environments using pluggable databases (PDBs), you may need to open them separately:                SQL>  ALTER PLUGGABLE DATABASE ALL OPEN; 🔴 Shutting Down the Oracle Database                SQL> SHUTDOWN IMMEDIATE; This command performs a clean shutdown, rolling back uncommitted transactions and disconnecting users. For emergency situations where immediate shutdown is required, you can use:                SQL> SHUTDOWN ABORT; 🔍 Checking Database Status 1. Verify Oracle Processes: On Unix/Linux:                ps -ef | grep pmon If the pmon process is running, the database instance is act...