Many people, after mastering file system installation, ask, “How do I install ASM storage in a production environment?” Indeed, ASM, as Oracle 19c built-in storage solution, offers advantages in data redundancy and performance optimization. It offers significant advantages over traditional file systems, making it the preferred choice for production environments. This article provides a thorough explanation of single-instance ASM installation, from ASM disk group planning and graphical installation steps to script writing for silent installation. Each step includes specific commands and pitfall-avoidance tips, ensuring even beginners can succeed on their first try!
Important note: ASM installation involves an additional disk group configuration step compared to file system installation, so you need to prepare physical disks or partitions in advance; at the same time, ensure that you have completed the Oracle 19c environment planning.
I. ASM Disk Group Planning and Creation
The core of ASM is the disk group, which integrates multiple physical disks into a single logical unit, automatically achieving load balancing and failover. Before installing Oracle software, you must first plan and create your ASM disk group; this is the foundation of the ASM installation.
1.1 ASM Disk Group Planning Principles
Create at least 3 disk groups to store different data. Using typed files to avoid I/O conflicts is the best practice officially recommended by Oracle.
Disk group name Stored content disk requirements Redundancy mode
DATA Data files, control files (SSD preferred), capacity ≥100GB (production) External redundancy (RAID-dependent) / Normal redundancy (2 disks)
RECO Archived logs, backup sets Mechanical hard drive or SSD, capacity ≥ 1.5 times that of DATA External redundancy (RAID-dependent) / Normal redundancy (2 disks)
FRA Quick recovery zone (optional, can also be merged into RECO): Same as RECO. Same as RECO
Redundancy mode selection: If the server has RAID configured, select external redundancy; otherwise, select normal redundancy.
1.2 Hands-on Practice: Creating an ASM Disk (using CentOS 7 as an example)
An ASM disk can be a physical disk, a partition, or an LVM logical volume. Here, we take a raw device partition as an example. The steps are as follows (executed by the root user):
1.2.1 Identifying the Disk
View the server disk list (identify newly added disks, such as /dev/sdb and /dev/sdc)
lsblk
Or use fdisk to view
fdisk -l
Assume three new disks are detected: /dev/sdb (100GB, used for DATA), /dev/sdc (150GB, used for RECO), and /dev/sdd (50GB, used for ASM metadata).
1.2.2 Disk Partitioning
Partition /dev/sdb (same operation for other disks)
fdisk /dev/sdb
Enter the following command (follow the prompts)
n # Create a new partition
p # Primary partition
1 # Partition Number
(Enter presses the default starting sector.)
(Press Enter to end the sector by default, or enter +100G to specify the size.)
t # Change partition type
8e # Set the type to Linux LVM (ASM supports this type)
w # Save and exit
After partitioning is complete, check the partitioning results.
fdisk -l /dev/sdb # This will display the /dev/sdb1 partition.
Repeat the above steps to complete the partitioning of /dev/sdc1 and /dev/sdd1.
1.2.3 Tagging ASM Disks
Use Oracle’s asmca tool to mark the disk so that ASM can recognize it as a usable disk. First, install the ASM dependencies (as root user):
yum install -y oracleasm-support oracleasmlib oracleasm-uname -r
Then configure the ASM library and label the disk:
Initialize the ASM library (executed only the first time)
oracleasm init
Configure the user group (oinstall) to belong to the ASM disk group
oracleasm configure -i
Enter the following as prompted: oracle user, oinstall group
Mark the disk as an ASM disk (naming rule: asm-disk purpose-serial number)
oracleasm createdisk ASM_DATA_01 /dev/sdb1
oracleasm createdisk ASM_RECO_01 /dev/sdc1
oracleasm createdisk ASM_META_01 /dev/sdd1
Check the marked ASM disks (status AVAILABLE indicates normal operation).
oracleasm listdisks
1.3 Creating an ASM disk group
After the disks are marked, disk groups can be created via the graphical interface (asmca) or the command line (sqlplus). Here we will first discuss the graphical method (which will be integrated in the subsequent installation), while the command-line method will be introduced in the silent installation section.
II. Graphical Installation
The core of graphical installation is VNC connection server. The runInstaller wizard completes the Oracle software installation, ASM disk group configuration, and database creation, which includes an additional ASM configuration step compared to file system installation.
2.1 Prerequisites: VNC remote connection configuration
Install VNC Server as root user
yum install -y tigervnc-server
Switch to the oracle user and start the VNC service
su- oracle
vncserver
Set the VNC password and remember the display port (e.g., 1).
Connect to the server IP:1 locally using VNC Viewer, enter the password, and you will enter the graphical desktop.
2.2 Graphical Installation Process
First, extract the Oracle 19c installation package to the ORACLE_HOME directory (execute as the oracle user):
unzip /tmp/LINUX.X64_193000_db_home.zip -d $ORACLE_HOME
cd$ORACLE_HOME
./runInstaller
After starting the installation wizard, the first four steps are the same as file system installation (skip update, select create and configure database, server level, and typical installation). The differences begin to appear from step 5 onwards with the key configuration items:
2.2.1 Step 5: Storage Type Selection
In the storage type option, select Automatic Storage Management, and then click ASM Configuration to enter the ASM configuration interface.
If no ASM disk group has been created, select "Create new ASM disk group".
Enter the ASM disk group name and select redundancy mode;
In Disks Available, select the marked ASM disk and click OK;
Configure ASMExampleEnter the SYS user password and click Next.Repeat the above steps to create the RECO disk group.
2.2.2 Step 6: Database Storage Configuration
Returning to the installation wizard, the database files location will automatically change to +DATA, the recovery options recovery partition path will be set to +RECO, and other configurations will be consistent with the file system:
SID setting: ORCL;
Character set: AL32UTF8;
Memory allocation: 70% of physical memory (e.g., allocate 22GB of 32GB memory);
Password: sys/system password is set to Oracle123#.2.2.3 Subsequent Steps
After clicking Next, complete the prerequisite checks (if the ASM disk is in good condition, it will display “All prerequisite checks passed”). After confirming the summary information, click Install to begin the installation.
During the installation process, you will be prompted to execute two scripts as the root user (/u01/app/oraInventory/orainstRoot.sh and $ORACLE_HOME/root.sh). After execution, return to the installation interface, click OK, and wait for the installation to complete.
Tip to avoid pitfalls: If the prerequisite check indicates that the ASM disk is unavailable, check if the disk is displayed in oracleasm listdisks or re-mark the ASM disk.
III. Silent Installation
For production environments, silent deployment of ASM is recommended. The core of this method is to write three response files: Oracle software installation, ASM disk group creation, and database creation to achieve fully automated deployment.
3.1 Add a new ASM configuration file
Compared to a silent file system installation, an ASM installation involves an additional step of creating an ASM disk group, requiring the addition of an asmca.rsp response file. The template paths for all three core response files are located under $ORACLE_HOME/assistants/.
3.2 Step 1: Prepare and modify the response file
3.2.1 Copy the template file
mkdir -p /tmp/rsp
cd$ORACLE_HOME/assistants/
Copy the three core response files
cp dbca/dbca.rsp /tmp/rsp/
cp asmca/asmca.rsp /tmp/rsp/
cp ../install/response/db_install.rsp /tmp/rsp/
cd /tmp/rsp
3.2.2 Modify db_install.rsp
The key parameters are modified as follows (others are default):
vi db_install.rsp
Installation type: Install software only (database will be created manually later)
oracle.install.option=INSTALL_DB_SWONLY
Base path (consistent with environment variables)
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/19.3.0/dbhome_1
Database version: Enterprise Edition
oracle.install.db.InstallEdition=EE
Enable ASM support
oracle.install.db.isCustomInstall=true
oracle.install.db.asmSupport=true
Skip the update.
oracle.install.db.updates.enabled=false
Execute root script automatically
oracle.install.db.rootconfig.executeRootScript=true
3.2.3 Modify asmca.rsp
vi asmca.rsp
Operation type: Create disk group
operation_type=create
ASM instance configuration
asm_instance_sid=+ASM
asm_instance_password=Asm_123# # Password for the SYS user in ASM
DATA disk group configuration
diskgroup_name[0]=DATA
redundancy[0]=EXTERNAL # External redundancy
disk[0]=/dev/oracleasm/disks/ASM_DATA_01 # ASM disk path
RECO Disk Group Configuration
diskgroup_name[1]=RECO
redundancy[1]=EXTERNAL
disk[1]=/dev/oracleasm/disks/ASM_RECO_01
3.2.4 Modify dbca.rsp
vi dbca.rsp
Operation type: Create database
operationType=createDatabase
createDatabase.type=typical
Database name and instance name
gdbName=ORCL
sid=ORCL
Password Configuration
sysPassword=Oracle123#
systemPassword=Oracle123#
Storage Configuration (Core: ASM Disk Group)
storageType=ASM
datafileDestination=+DATA
recoveryAreaDestination=+RECO
Character sets and memory
characterSet=AL32UTF8
totalMemory=22528 # 22GB of memory allocated (in MB) out of a 32GB memory allocation
Automatic Backup
enableArchive=true
3.3 Step 2: Perform silent installation
3.3.1 Silent installation of Oracle software
cd$ORACLE_HOME
./runInstaller -silent-response File /tmp/rsp/db_install.rsp -log /tmp/oracle_install.log
Log monitoring: If “Successfully Setup Software” appears, the software installation was successful.
3.3.2 Silently create ASM disk groups
asmca -silent-responseFile /tmp/rsp/asmca.rsp -logfile /tmp/asmca.log
Log monitoring: tail -f /tmp/asmca.log. If “Diskgroup created successfully” appears, the disk group was created successfully. This can be verified.
asmcmdlsdg will display the DATA and RECO disk groups, with their status set to MOUNTED.
3.3.3 Configure ASM environment variables
Edit ~/.bash_profile and add the ASM instance environment variable:
vi ~/.bash_profile
Add ASM environment variables
exportORACLE_SID=+ASM
exportPATH=$ORACLE_HOME/bin:$PATH
Effective
source ~/.bash_profile
3.3.4 Silent Database Creation
Switch back to database instance environment variables (if needed)
exportORACLE_SID=ORCL
Execute silent creation command
dbca -silent-response File /tmp/rsp/dbca.rsp -logfile /tmp/dbca.log
Log monitoring: If “Database created successfully” appears, it means the database was created successfully.
3.4 Silent installation of the complete script in the production environment
!/bin/bash
Complete script for silent installation of Oracle 19c single-instance ASM
Applicable environment: CentOS 7/8, disk partitioning and ASM marking completed
1. Global variables (modify according to the actual environment)
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=$ORACLE_BASE/product/19.3.0/dbhome_1
RSP_DIR=/tmp/rsp
INSTALL_FILE=/tmp/LINUX.X64_193000_db_home.zip
SYS_PWD=Oracle123#
ASM_PWD=Asm_123#
TOTAL_MEM=22528 # Memory (MB)
2. Root user operations: Install dependency packages and ASM libraries
oracleasm—”su – root -c yum install -y binutils compat-libcap 1 glibc glibc-devel ksh libaio libaio-devel libX11 libXau libXi libXtst libgcc libstdc++ libstdc++-devel libxcb make oracleasm-support oracleasmlib oracleasm.”
3. Root user operations: Configure ASM disk (if not already configured)
su – root -c “oracleasm init”
-root-csu – root -c “oracleasm configure -i”
su-root-c “oracleasm createdisk ASM_DATA_01 /dev/sdb1.”
su – root -c “oracleasm createdisk ASM_RECO_01 /dev/sdc1”
4. Oracle user operations: Unzip the installation package
su-oracle-c “unzip $INSTALL_FILE -d $ORACLE_HOME”
the template. 5. Oracle user operations: Create response file directory and copy the template.
su-oracle-c “mkdir -p $RSP_DIR”
su – oracle -c “cp $ORACLE_HOME/assistants/dbca/dbca.rsp $RSP_DIR/”
su – oracle -c “cp $ORACLE_HOME/assistants/asmca/asmca.rsp $RSP_DIR/”
su – oracle -c “cp $ORACLE_HOME/install/response/db_install.rsp $RSP_DIR/”
6. Oracle user operations: Modify db_install.rsp
su-oracle-c “sed -i ‘s/oracle.install.option=./oracle.install.option=INSTALL_DB_SWONLY/’ $RSP_DIR/db_install.rsp” su-oracle-c “sed -i ‘s/ORACLE_BASE=./ORACLE_BASE=$ORACLE_BASE/’ $RSP_DIR/db_install.rsp”
su-oracle-c “sed -i ‘s/ORACLE_HOME=./ORACLE_HOME=$ORACLE_HOME/’ $RSP_DIR/db_install.rsp” su-oracle-c “sed -i ‘s/oracle.install.db.asmSupport=./oracle.install.db.asmSupport=true/’ $RSP_DIR/db_install.rsp”
su – oracle -c “sed -i ‘s/oracle.install.db.rootconfig.executeRootScript=.*/oracle.install.db.rootconfig.executeRootScript=true/’ $RSP_DIR/db_install.rsp”
7. Oracle user operation: Modify asmca.rsp
su-oracle-c “sed -i ‘s/operation_type=./operation_type=create/’ $RSP_DIR/asmca.rsp” su-oracle-c “sed -i ‘s/asm_instance_sid=./asm_instance_sid=+ASM/’ $RSP_DIR/asmca.rsp”
su-oracle-c “sed -i ‘s/asm_instance_password=./asm_instance_password=$ASM_PWD/’ $RSP_DIR/asmca.rsp” su-oracle-c “sed -i ‘s/diskgroup_name[0]=./diskgroup_name[0]=DATA/’ $RSP_DIR/asmca.rsp”
su-oracle-c “sed -i ‘s/redundancy[0]=./redundancy[0]=EXTERNAL/’ $RSP_DIR/asmca.rsp” su-oracle-c “sed -i ‘s/disk[0]=./disk[0]=\/dev\/oracleasm\/disks\/ASM_DATA_01/’ $RSP_DIR/asmca.rsp”
su-oracle-c “sed -i ‘s/diskgroup_name[1]=./diskgroup_name[1]=RECO/’ $RSP_DIR/asmca.rsp” su-oracle-c “sed -i ‘s/redundancy[1]=./redundancy[1]=EXTERNAL/’ $RSP_DIR/asmca.rsp”
su – oracle -c “sed -i ‘s/disk[1]=.*/disk[1]=\/dev\/oracleasm\/disks\/ASM_RECO_01/’ $RSP_DIR/asmca.rsp”
8. Oracle user operations: Modify dbca.rsp
su-oracle-c “sed -i ‘s/operationType=./operationType=createDatabase/’ $RSP_DIR/dbca.rsp” su-oracle-c “sed -i ‘s/gdbName=./gdb Name=ORCL/’$RSP_DIR/dbca.rsp’
su – oracle -c “sed -i ‘s/sid=.” /sid=ORCL/’ $RSP_DIR/dbca.rsp” su-oracle -c “sed -i ‘s/sysPassword=. /sysPassword=$SYS_PWD/’ $RSP_DIR/dbca.rsp “oracle-c
su-oracle-c “sed -i ‘s/systemPassword=./systemPassword=$SYS_PWD/’ $RSP_DIR/dbca.rsp” su-oracle-c “sed -i ‘s/storageType=./storageType=ASM/’ $RSP_DIR/dbca.rsp”
su-oracle-c “sed -i ‘s/datafileDestination=./datafileDestination=+DATA/’ $RSP_DIR/dbca.rsp” su-oracle-c “sed -i ‘s/recoveryAreaDestination=./recoveryAreaDestination=+RECO/’ $RSP_DIR/dbca.rsp”
su – oracle -c “sed -i ‘s/totalMemory=.*/totalMemory=$TOTAL_MEM/’ $RSP_DIR/dbca.rsp”
9. Oracle user operations: Silent installation of Oracle software
su – oracle -c “$ORACLE_HOME/ runInstaller -silent -responseFile $RSP_DIR/db_install.rsp -log /tmp/oracle_install.log”
10. Oracle User Operations: Silently Creating an ASM Disk Group
su – oracle -c “asmca -silent -responseFile $RSP_DIR/asmca.rsp -logfile /tmp/asmca.log”
11. Oracle User Operations: Configuring Environment Variables and Creating Databases
su – oracle -c “echo ‘export ORACLE_SID=ORCL’ >> ~/.bash_profile”
su-oracle-c “source ~/.bash_profile”
su-oracle-c “dbca -silent -responseFile $RSP_DIR/dbca.rsp -logfile /tmp/dbca.log”
12. Installation complete notification
Echo: “Oracle 19c ASM single instance installation complete!”
echo “Log paths: /tmp/oracle_install.log, /tmp/asmca.log, /tmp/dbca.log”
3.5 Common ASM Installation Errors and Solutions
Error, error reason, solution
Asmca failed to create a disk group, indicating that the disk was unavailable. The disk is not marked as an ASM disk, or permissions are insufficient. 1. Execute oracleasm listdisks to view the disks; 2. Relabel the disks. 3. Check disk permissions: chown oracle:oinstall /dev/sdb1
When silently installing software, an error message appears indicating missing ASM support. The ASM dependency package is not installed, or ASM support is not enabled in db_install.rsp. 1. Install dependencies such as oracleasm-support. 2. Ensure that oracle.install.db.asmSupport=true in db_install.rsp.
Database creation failed, indicating that the +DATA disk group is not mounted. The ASM instance is not started, or the disk group is not mounted. 1. Start the ASM instance: sqlplus / as sysasm → startup; 2. Mount the disk group: alter diskgroup DATA mount;
asmcmd cannot connect; error message: ORA-12514. ASM monitoring is not started. 1. Configure ASM listener: 2. Start listener: lsnrctl start LISTENER_ASM
IV. Post-installation verification
The verification process for ASM installation includes additional checks on ASM disk groups and instances compared to the file system verification. The following four verification steps must be completed:
4.1 Verify ASM instance and disk group
1. Switch to ASM instance environment variables
exportORACLE_SID=+ASM
2. Log in to the ASM instance
sqlplus / as sysasm
3. Check ASM instance status
SELECT status FROM v$instance; # Should be OPEN
4. Check disk group status
SELECT name, state, total_mb, free_mb FROM v$asm_diskgroup; # Should be MOUNTED, indicating available space
5. Or use asmcmd to view.
asmcmd lsdg
4.2 Verify the database listener status
Switch to database instance environment variables
exportORACLE_SID=ORCL
Check the listening status (ensure ASM and database services are included).
lsnrctl status
Normal output should include:
Service “+ASM” has 1 instance(s). Instance “+ASM”, status: READY
Service “ORCL” has 1 instance(s). Instance “ORCL,” status READY
4.3 Database connection test
Local Area Connection
sqlplus / as sysdba
remote connection
sqlplus sys/Oracle123#@192.168.1.100:1521/ORCL as sysdba
Verify the database storage path (confirm the use of ASM disk groups)
SELECT name FROM v$datafile; # The path should be +DATA/ORCL/DATAFILE/…
SELECT member FROM v$logfile; # The path should be +DATA/ORCL/ONLINELOG/…
4.4 Key Process Confirmation
View ASM processes (ora_pmon_+ASM, etc.)
ps -ef | grep ASM | grep -v grep
Check database processes (ora_pmon_ORCL, etc.)
ps-ef | grep ORCL | grep-vgrep
If both types of processes exist, it means that both the ASM instance and the database instance are running normally.
V. Key Points of ASM Installation
Although ASM installation involves disk group configuration more than file system installation, as long as you grasp the core points, you won’t encounter any problems:
Disk preparation is fundamental: the disk must be marked as an ASM-available disk; otherwise, ASM will not be able to recognize it.
Disk group planning should be reasonable: at least separate DATA and RECO and choose redundancy mode in combination with RAID.
Don’t confuse environment variables: The environment variables of ASM instances and database instances should be distinguished, and you should pay attention to modifying them when switching.
Verification must be comprehensive: it should not only verify the database but also confirm the status of the ASM instance and disk group.

