Posts

Oracle Tablespace High Water Mark (HWM) Query

๐Ÿ” Purpose: To calculate the High Water Mark (HWM) in GB for each data file. The HWM is the highest block ever used by an object in the tablespace. ๐Ÿงพ Query:                SELECT                        a.tablespace_name,                      a.file_name,                     ((b.maximum + c.blocks - 1) * d.db_block_size) / 1024 / 1024 / 1024 AS highwater_in_GB                FROM                     dba_data_files a,                    (SELECT file_id, MAX(block_id) AS maximum                    FROM dba_extents      GROUP...

Kubernetes Administration – Essential Commands for IFS Cloud

This guide covers practical Kubernetes (K8s) administration tasks including managing namespaces , pods , deployments , PVCs , and PVs . Ideal for teams working with IFS Cloud deployments on Kubernetes . ๐Ÿ“ Namespace Management ๐Ÿ”ฅ Delete a Namespace                kubectl delete namespace hypdev --force ๐Ÿงฑ Pod Operations ❌ Delete or Recreate a Pod                kubectl delete pod <pod-name> --grace-period=0 --force -n <namespace> Example:                kubectl delete pod ifsapp-reporting-86b484b7cc-zws87 --grace-period=0 --force -n hypprd ๐Ÿ” Describe a Pod                kubectl describe pod <pod-name> -n <namespace> Examples:                kubectl describe pod ifsapp-proxy-xxxxxxxx-8k4ph -n hypprd          ...

Managing Oracle Data Files – Resizing and Adding

In Oracle databases, proper management of data files is essential to ensure performance, availability, and scalability. This guide explains how to view , resize , and add data files using SQL*Plus, SQL Developer, TOAD, and command-line tools. ๐Ÿ” When to Resize Data Files? Resize a data file when available free space is less than 500MB . Use caution: only resize files that are not already at their maximum size (typically 32GB for most configurations). Always connect using a privileged user like SYS or SYSTEM . ๐Ÿ”ง Monitor via Alert Log You should always monitor changes in the alert log :           # Connect as Oracle OS user                su - oracle           # Monitor the alert log in real-time                tail -900f /u01/.../trace/alert_<SID>.log ๐Ÿ“˜ Using SQL*Plus or SQL Developer View Existing Data Files    ...

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