9 Migrating the EBS 12.2.14 Database 12c to ASM (19c Grid)

Oracle 19c Grid Infrastructure Standalone Installation on Linux 8

Complete Guide for ASM Configuration and Database Migration


1. Software Download and Prerequisites

1.1 Download Oracle 19c Grid Software

Download the Oracle Grid Infrastructure 19c software package from Oracle eDelivery or Oracle Support website.


1.2 Create ASM Operating System User

Create the oraasm user for Grid Infrastructure ownership. The dba group should already exist; if not, create it first.

bash
# Create the ASM user with appropriate groups
useradd -g oinstall -G dba -c "ASM user" -d /home/oraasm -s /bin/bash oraasm

# Verify user creation
id oraasm
# Output: uid=54323(oraasm) gid=54322(dba) groups=54322(dba),54321(oinstall)

Note: The primary group should be oinstall with secondary group dba for proper Oracle ownership structure.


2. Disk Configuration Using UDEV

2.1 Overview

This guide uses UDEV instead of oracleasm for persistent disk naming. UDEV creates and manages /dev device nodes dynamically using sysfs information and user-defined rules.

2.2 Identify Attached Disks

Attach raw disks to the server and identify them:

bash
# List block devices
lsblk

# OR use fdisk
fdisk -l

Example output shows disks:

text
/dev/sdg
/dev/sde
/dev/sdf
/dev/sdc
/dev/sdd

2.3 Retrieve Disk Serial Numbers

Get unique identifiers for each disk to ensure persistent naming across reboots:

bash
udevadm info --query=property /dev/sdg
udevadm info --query=property /dev/sde
udevadm info --query=property /dev/sdf
udevadm info --query=property /dev/sdc
udevadm info --query=property /dev/sdd

Important: Record the ID_SERIAL value for each disk.

2.4 Create UDEV Rules File

Navigate to the UDEV rules directory and create a custom rules file:

bash
cd /etc/udev/rules.d
vi 99-oracle-asmdevices.rules

Add the following rules (replace ID_SERIAL values with your actual disk serials):

bash
ACTION=="add|change", SUBSYSTEM=="block", ENV{ID_SERIAL}=="36000c297a90d6a9681b1d2a5a1b88568", GROUP="dba", SYMLINK+="oraasm01", OWNER="oraasm", MODE="0660"
ACTION=="add|change", SUBSYSTEM=="block", ENV{ID_SERIAL}=="36000c29906aa418e9822a0947ce9ad22", GROUP="dba", SYMLINK+="oraasm02", OWNER="oraasm", MODE="0660"
ACTION=="add|change", SUBSYSTEM=="block", ENV{ID_SERIAL}=="36000c291823fef46b990dbc1fe7bebdf", GROUP="dba", SYMLINK+="oraasm03", OWNER="oraasm", MODE="0660"
ACTION=="add|change", SUBSYSTEM=="block", ENV{ID_SERIAL}=="36000c2944397980b1b7f91a3d0c99e56", GROUP="dba", SYMLINK+="oraasm04", OWNER="oraasm", MODE="0660"
ACTION=="add|change", SUBSYSTEM=="block", ENV{ID_SERIAL}=="36000c2954d200a2927a1e815945e603d", GROUP="dba", SYMLINK+="oraasm05", OWNER="oraasm", MODE="0660"

2.5 Reload UDEV Rules

Apply the new rules:

bash
# Reload rules
udevadm control --reload-rules
udevadm trigger --type=devices --action=change

# For older Oracle Linux versions (OL5):
# /sbin/udevcontrol reload_rules
# /sbin/start_udev

2.6 Verify Disk Permissions

Check that the symbolic links are created with correct permissions:

bash
ls -l /dev/oraasm01
ls -l /dev/oraasm02
ls -l /dev/oraasm03
ls -l /dev/oraasm04
ls -l /dev/oraasm05

Expected output:

text
lrwxrwxrwx. 1 root root 3 Feb 15 18:53 /dev/oraasm01 -> sdc

2.7 Configure ASM Disk Discovery

Set the ASM disk string to discover your UDEV devices:

sql
ALTER SYSTEM SET asm_diskstring='/dev/ora*' SCOPE=SPFILE;

2.8 Add Disks to ASM Disk Group

Add the discovered disks to your diskgroup:

sql
ALTER DISKGROUP TEST ADD DISK '/dev/oraasm01' REBALANCE POWER 5;
ALTER DISKGROUP TEST ADD DISK '/dev/oraasm02' REBALANCE POWER 5;
ALTER DISKGROUP TEST ADD DISK '/dev/oraasm03' REBALANCE POWER 5;
ALTER DISKGROUP TEST ADD DISK '/dev/oraasm04' REBALANCE POWER 5;
ALTER DISKGROUP TEST ADD DISK '/dev/oraasm05' REBALANCE POWER 5;

Verify disk status:

sql
SET PAGES 40000 LINES 120
COL PATH FOR A30
SELECT DISK_NUMBER, MOUNT_STATUS, HEADER_STATUS, MODE_STATUS, STATE, PATH 
FROM V$ASM_DISK;

Expected output:

text
DISK_NUMBER MOUNT_S HEADER_STATU MODE_ST STATE    PATH
----------- ------- ------------ ------- -------- ------------------------------
          4 CACHED  MEMBER       ONLINE  NORMAL   /dev/oraasm05
          2 CACHED  MEMBER       ONLINE  NORMAL   /dev/oraasm03
          3 CACHED  MEMBER       ONLINE  NORMAL   /dev/oraasm04
          0 CACHED  MEMBER       ONLINE  NORMAL   /dev/oraasm01
          1 CACHED  MEMBER       ONLINE  NORMAL   /dev/oraasm02

3. Grid Infrastructure Installation

3.1 Create Directory Structure

Create the Grid home directory:

bash
# Switch to oraasm user
su - oraasm

# Create grid home directory
mkdir -p /u01/app/FBS/db/grid19c

3.2 Copy and Extract Software

Copy the installation zip file and extract:

bash
# Copy software
cp /tmp/LINUX.X64_193000_grid_home.zip /u01/app/FBS/db/grid19c/

# Navigate to grid home
cd /u01/app/FBS/db/grid19c

# Extract the zip file
unzip LINUX.X64_193000_grid_home.zip

# Remove zip file after extraction
rm LINUX.X64_193000_grid_home.zip

3.3 Install Prerequisite Packages

Install the Oracle database pre-installation package as root:

bash
# Search for preinstall package
yum search preinstall

# Install Oracle 19c preinstall
yum install oracle-database-preinstall-19c.x86_64 -y

3.4 Install CVU Disk Package

Install the Cluster Verification Utility (CVU) disk package from the extracted Grid software:

bash
# Install CVU disk package
rpm -ivh /u01/app/FBS/db/grid19c/cv/rpm/cvuqdisk-1.0.10-1.rpm

Expected output:

text
Preparing...                          ################################# [100%]
Updating / installing...
   1:cvuqdisk-1.0.10-1                ################################# [100%]

4. Launch Grid Installer

4.1 Start the Installation

Launch the Grid Setup wizard as oraasm user:

bash
/u01/app/FBS/db/grid19c/gridSetup.sh

4.2 Installation Steps


  1. Disk Group Configuration:

    • Disk Group Name: EBS_DATA

    • Redundancy: EXTERNAL

    • Discovery Path: /dev/ora*


  1. Disk Selection:

    • Verify all new disks appear in the disk selection screen

 


 

 





  1. Grid Base Directory:

    • Specify the Grid Base location when prompted

 


 

  1. Inventory Management:

    • If other Oracle products exist, backup existing inventory:

    bash
    # As root
    cd /oraapps122/oracle
    cp -r oraInventory oraInventory_bkp
    chmod -R 777 oraInventory

 

 

 


 

 


4.3 Execute Root Scripts

After the installer completes file copying, execute the root script:

bash
# Run root.sh as root user
/u01/app/FBS/db/grid19c/root.sh

Root script output example:

text
Performing root user operation.
The following environment variables are set as:
    ORACLE_OWNER= oraasm
    ORACLE_HOME=  /u01/app/FBS/db/grid19c

Enter the full pathname of the local bin directory: [/usr/local/bin]:
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...

Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.

LOCAL ADD MODE
Creating OCR keys for user 'oraasm', privgrp 'dba'..
Operation successful.
CRS-4664: Node fbstest successfully pinned.
2022/02/15 21:36:12 CLSRSC-327: Successfully configured Oracle Restart for a standalone server

 

5. Post-Installation Validation

5.1 Verify Grid Infrastructure

Login as oraasm and validate the installation:

bash
# Set environment
. oraenv
ORACLE_SID = [oraasm] ? +ASM
The Oracle base has been set to /oraapps122/app/ASM19c

# Verify ORACLE_HOME
echo $ORACLE_HOME
# Output: /u01/app/FBS/db/grid19c

5.2 Check Cluster Resources

bash
crsctl stat res -t

Expected output:

text
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.EBS_DATA.dg
               ONLINE  ONLINE       fbstest                STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       fbstest                STABLE
ora.asm
               ONLINE  ONLINE       fbstest                Started,STABLE
ora.ons
               OFFLINE OFFLINE      fbstest                STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       fbstest                STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       fbstest                STABLE
--------------------------------------------------------------------------------

5.3 Verify ASM Disk Group

bash
asmcmd lsdg

Expected output:

text
State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512             512   4096  4194304    122880   122780                0          122780              0             N  EBS_DATA/

5.4 Create ASM Password File

Create a password file for ASM authentication:

bash
# Create password file (use -f to force overwrite)
asmcmd pwcreate --asm '+EBS_DATA/orapwasm' -f
Enter password: ********

# Verify creation
asmcmd pwget --asm
# Output: +EBS_DATA/orapwasm

5.5 Flush Password Cache

bash
sqlplus / as sysasm
SQL> ALTER SYSTEM FLUSH PASSWORDFILE_METADATA_CACHE;

5.6 Set Oracle Binary Permissions

Ensure proper permissions on Oracle binaries:

bash
# Check permissions
ls -lhrt $GRID_HOME/bin/oracle
ls -lhrt $ORACLE_HOME/bin/oracle

# Set correct permissions (6751)
cd $GRID_HOME/bin
chmod 6751 oracle

Note: For cluster environments, ensure identical permissions on all nodes.

5.7 Register Database with SRVCTL

As the Oracle database owner:

bash
cd $ORACLE_HOME/bin
srvctl add database -d FBS -o /u01/app/FBS/db/tech_st/12.1.0

5.8 Configure TNSNAMES.ORA

Add ASM entry to the database TNSNAMES ifile:

bash
cat /u01/app/FBS/db/tech_st/12.1.0/network/admin/FBS_fbstest/FBS_fbstest_ifile.ora

Add the following line:

text
+ASM=(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = fbstest.finsys.co.ke)(PORT = 1521)))(CONNECT_DATA =(ORACLE_SID = +ASM)))

6. Migrate Database to ASM Storage

6.1 Configure Database Parameters

Update database initialization parameters to use ASM:

sql
-- Set control file location
ALTER SYSTEM SET control_files='+EBS_DATA' SCOPE=SPFILE;

-- Set file creation destination
ALTER SYSTEM SET db_create_file_dest='+EBS_DATA' SCOPE=SPFILE;

-- Set recovery destination (optional)
ALTER SYSTEM SET db_recovery_file_dest='+EBS_DATA' SCOPE=SPFILE;

6.2 Start Database in NOMOUNT Mode

sql
SHUTDOWN IMMEDIATE;
STARTUP NOMOUNT;
-- Note: ORA-32004 may appear for obsolete parameters, but is harmless

6.3 Restore Control File

Restore the control file from filesystem to ASM:

sql
RMAN> RESTORE CONTROLFILE FROM '/u01/app/FBS/db/apps_st/data/cntrl01.dbf';

Expected output:

text
Starting restore at 18-FEB-22
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=204 device type=DISK
channel ORA_DISK_1: copied control file copy
output file name=+EBS_DATA/FBS/CONTROLFILE/current.259.1096979313
Finished restore at 18-FEB-22

6.4 Mount Database and Copy Datafiles

Mount the database and copy datafiles to ASM:

sql
RMAN> ALTER DATABASE MOUNT;
RMAN> BACKUP AS COPY DATABASE FORMAT '+EBS_DATA';

Note: This process can take considerable time for large databases (e.g., 100GB EBS database).

6.5 Switch Database to Copy

Switch the database to use the ASM copies, updating the control file:

sql
RMAN> SWITCH DATABASE TO COPY;

This command updates all datafile pointers in the control file to the new ASM locations.

6.6 Migrate Temp Files

Migrate temporary files to ASM:

sql
RMAN> RUN {
   SET NEWNAME FOR TEMPFILE '/u01/app/FBS/db/apps_st/data/temp01.dbf' TO '+EBS_DATA';
   SET NEWNAME FOR TEMPFILE '/u01/app/FBS/db/apps_st/data/temp02.dbf' TO '+EBS_DATA';
   SET NEWNAME FOR TEMPFILE '/u01/app/FBS/db/apps_st/data/temp0001.dbf' TO '+EBS_DATA';
   SWITCH TEMPFILE ALL;
}

Expected output:

text
renamed tempfile 1 to +EBS_DATA in control file
renamed tempfile 2 to +EBS_DATA in control file
renamed tempfile 3 to +EBS_DATA in control file

6.7 Open Database

sql
RMAN> ALTER DATABASE OPEN;

7. Post-Migration Validation

7.1 Verify Database Files

Check that all database files are on ASM:

sql
-- Check control files
SELECT NAME FROM V$CONTROLFILE;

-- Check datafiles
SELECT NAME FROM V$DATAFILE;

-- Check temp files
SELECT NAME FROM V$TEMPFILE;

-- Check redo logs
SELECT GROUP#, TYPE, MEMBER FROM V$LOGFILE;

7.2 Migrate Redo Log Files

If redo logs are still on filesystem, migrate them:

sql
-- Check current redo log groups
SELECT GROUP#, THREAD#, SEQUENCE#, BYTES/1024/1024 AS "Size in MB", MEMBERS, STATUS 
FROM V$LOG;

-- Add new log group
ALTER DATABASE ADD LOGFILE ('+EBS_DATA','+EBS_DATA') SIZE 1000M;

-- Drop inactive log groups and recreate
ALTER DATABASE DROP LOGFILE GROUP 2;
ALTER DATABASE ADD LOGFILE ('+EBS_DATA','+EBS_DATA') SIZE 1000M;
ALTER SYSTEM SWITCH LOGFILE;
ALTER DATABASE DROP LOGFILE GROUP 1;
ALTER DATABASE ADD LOGFILE ('+EBS_DATA','+EBS_DATA') SIZE 1000M;

-- Verify redo logs
SELECT GROUP#, TYPE, MEMBER FROM V$LOGFILE;

Expected output:

text
    GROUP# TYPE    MEMBER
---------- ------- --------------------------------------------------
         2 ONLINE  +EBS_DATA/FBS/ONLINELOG/group_2.324.1096983873
         2 ONLINE  +EBS_DATA/FBS/ONLINELOG/group_2.325.1096983901
         1 ONLINE  +EBS_DATA/FBS/ONLINELOG/group_1.326.1096984173
         1 ONLINE  +EBS_DATA/FBS/ONLINELOG/group_1.327.1096984207
         3 ONLINE  +EBS_DATA/FBS/ONLINELOG/group_3.258.1096983689
         3 ONLINE  +EBS_DATA/FBS/ONLINELOG/group_3.257.1096983723

8. Final Verification

8.1 Application Validation

After migration, log into your EBS application and verify:

  • All functionalities work correctly

  • Database connections are stable

  • Performance is acceptable

8.2 Key References

For additional information, refer to:

  • Oracle Support Document ID 337737.1: Oracle Clusterware (CRS/GI) - ASM - Database Version Compatibility


Summary

This guide covered the complete process of:

  1. Installing Oracle 19c Grid Infrastructure on Linux 8

  2. Configuring ASM disks using UDEV for persistent naming

  3. Creating and managing ASM disk groups

  4. Migrating an existing database from filesystem to ASM storage

  5. Validating the complete migration

All database files (control files, datafiles, temp files, and redo logs) have been successfully migrated to ASM storage, and the database is ready for production use with the new Grid Infrastructure environment.

No comments:

Post a Comment