Oracle Database Error Solutions & DBA Knowledge Base

Practical, step-by-step Oracle Database troubleshooting and administration resources for DBAs, developers, Oracle E-Business Suite administrators, and IT professionals.

Explore practical guidance covering Oracle Database errors, RMAN backup and recovery, Data Guard, ASM, RAC, performance tuning, installation, patching, cloning, Oracle Linux administration, and Oracle E-Business Suite.

Our troubleshooting guides explain common causes, diagnostic steps, SQL queries, configuration checks, and recommended solutions to help database professionals understand problems and resolve them systematically.

Start with the Oracle Error Codes Guide or explore the main DBA topic areas to find detailed technical articles and practical administration resources.

How to Change the Boot Sequence of Oracle Linux 7 (Complete Enterprise GRUB2 Administration Guide)

How to Change the Boot Sequence of Oracle Linux 7 (Complete Enterprise GRUB2 Administration Guide)

📅 Last Updated: August 2026

This guide has been completely updated for Oracle Linux 7 and covers the proper enterprise methods for changing the default boot sequence using GRUB2. It explains the Oracle Linux boot process, BIOS versus UEFI boot modes, Unbreakable Enterprise Kernel (UEK), Red Hat Compatible Kernel (RHCK), kernel management utilities, and enterprise best practices for safely changing the default boot entry.


Oracle Linux uses the GRUB2 (GRand Unified Bootloader version 2) bootloader to load the operating system during startup. Every installed kernel appears as a boot menu entry, allowing administrators to select which kernel should start automatically.

After installing a new kernel, upgrading Oracle Linux, testing kernel patches, installing the Oracle Unbreakable Enterprise Kernel (UEK), or troubleshooting boot problems, administrators often need to change the default boot entry so that the server consistently boots into the desired kernel.

Changing the boot sequence incorrectly may prevent a server from starting with the expected kernel. Therefore, administrators should always verify the current boot configuration before making any modifications.

This guide explains the Oracle Linux boot architecture, GRUB2 configuration, BIOS and UEFI differences, kernel management utilities, verification steps, troubleshooting procedures, and enterprise recommendations for safely managing the boot sequence.

Quick Solution

Verify the Oracle Linux version, determine whether the system boots in BIOS or UEFI mode, identify the currently configured default kernel, review available boot menu entries, change the default boot entry using grub2-set-default or grubby, regenerate the GRUB configuration only when required, reboot the server, and verify that the correct kernel is loaded successfully.


What is GRUB2?

GRUB2 (GRand Unified Bootloader version 2) is the default bootloader used by Oracle Linux. It initializes the boot process, displays the boot menu, loads the selected Linux kernel, and transfers control to the operating system.

GRUB2 supports multiple operating systems, multiple Linux kernels, recovery entries, and advanced boot configuration options, making it suitable for enterprise server environments.


Oracle Linux Boot Process Overview

When an Oracle Linux server starts, several components work together before the operating system becomes available.

  1. System firmware (BIOS or UEFI) performs hardware initialization.
  2. The firmware loads the GRUB2 bootloader.
  3. GRUB2 reads its configuration and displays the boot menu.
  4. The selected Linux kernel is loaded into memory.
  5. The initramfs image initializes required drivers.
  6. The kernel starts the systemd initialization process.
  7. Oracle Linux boots into the configured target.

BIOS vs UEFI Booting

Oracle Linux supports both Legacy BIOS and Unified Extensible Firmware Interface (UEFI) boot modes. Understanding which mode the server uses is important because GRUB configuration file locations differ between the two environments.

Feature Legacy BIOS UEFI
Firmware BIOS UEFI Firmware
Boot Loader GRUB2 GRUB2 EFI
Partition Style Usually MBR Usually GPT
EFI System Partition No Yes
Recommended for New Servers No Yes

Why Change the Boot Sequence?

Changing the default boot entry is a common administrative task in enterprise Linux environments.

Typical reasons include:

  • Booting into a newly installed Oracle UEK kernel.
  • Rolling back to an earlier kernel after an unsuccessful update.
  • Testing a newly installed kernel before making it permanent.
  • Recovering from kernel-related boot issues.
  • Selecting a specific kernel for Oracle Database certification requirements.
  • Maintaining consistency across clustered servers.

Understanding UEK and RHCK

Oracle Linux commonly provides two kernel families:

  • UEK (Unbreakable Enterprise Kernel) — Oracle's performance-optimized kernel designed for Oracle workloads.
  • RHCK (Red Hat Compatible Kernel) — Maintains compatibility with Red Hat Enterprise Linux.

Many Oracle Database, Oracle RAC, and Oracle E-Business Suite deployments use UEK because it includes Oracle performance enhancements and enterprise optimizations.


Applies To

  • Oracle Linux 7
  • Oracle Linux 8 (concepts apply)
  • Oracle Linux 9 (concepts apply)
  • GRUB2
  • Oracle UEK
  • RHCK
  • Oracle Database Servers
  • Oracle RAC
  • Oracle Grid Infrastructure
  • Oracle E-Business Suite
  • Oracle Cloud Infrastructure (OCI)

Common Use Cases

  • Kernel upgrades.
  • Kernel rollback.
  • Oracle Database certification testing.
  • Oracle RAC maintenance.
  • Oracle Linux patching.
  • Production server recovery.
  • Cloud instance administration.
  • Disaster recovery testing.

Prerequisites

  • Root or sudo privileges.
  • Oracle Linux 7 server.
  • GRUB2 bootloader installed.
  • Access to the server console or SSH.
  • Knowledge of the target kernel.
  • Maintenance window for production servers.
  • Verified system backup.

GRUB2 Architecture Overview

GRUB2 consists of several components that work together during system startup. The firmware loads the GRUB2 bootloader, which reads its configuration, displays available boot entries, and loads the selected kernel and initramfs image into memory. After the kernel initializes hardware and essential drivers, the systemd process completes the operating system startup.

Rather than editing bootloader files manually, Oracle recommends using GRUB management utilities that safely update boot configuration and preserve consistency across kernel updates.


Why Verify the Boot Configuration First?

Many administrators immediately change the default boot entry without confirming which kernel is currently configured or whether the system is running in BIOS or UEFI mode. This can result in booting an unintended kernel or creating unnecessary troubleshooting during maintenance windows.

Before modifying the boot sequence, verify the operating system version, identify the firmware mode, list all available boot entries, determine the current default kernel, and confirm that the target kernel is installed and supported.

Oracle Linux Administrator Recommendation

Never edit /boot/grub2/grub.cfg manually. Use supported tools such as grubby, grub2-set-default, and grub2-reboot to manage boot entries safely. Always verify the current boot configuration before changing the default kernel, especially on production systems running Oracle Database or Oracle RAC.


Step 1 – Verify the Oracle Linux Version

Before modifying the boot sequence, verify the Oracle Linux release to ensure the appropriate GRUB2 management commands are available.

cat /etc/os-release

Example output:

NAME="Oracle Linux Server"
VERSION="7.9"
ID="ol"

Step 2 – Determine Whether the System Uses BIOS or UEFI

The GRUB configuration location depends on whether the server boots in Legacy BIOS or UEFI mode.

[ -d /sys/firmware/efi ] && echo "UEFI Boot" || echo "Legacy BIOS Boot"

Record the firmware mode before making any bootloader changes.


Step 3 – Display Available GRUB Menu Entries

List all configured boot menu entries.

grep '^menuentry' /boot/grub2/grub.cfg

Review the output carefully and identify the kernel you want the server to boot by default.


Step 4 – Identify the Current Default Kernel

Display the kernel currently configured as the default.

grubby --default-kernel

To view detailed information about all installed kernels, run:

grubby --info=ALL

Step 5 – Change the Default Boot Entry Using grub2-set-default

If the GRUB configuration uses GRUB_DEFAULT=saved, change the default boot entry by specifying either the menu index or the exact menu entry title.

Example using a menu index:

grub2-set-default 0

Example using the menu entry name:

grub2-set-default "Oracle Linux Server (5.x.x-xxx.el7uek.x86_64)"

Replace the kernel version with the appropriate entry displayed on your system.


Step 6 – Alternative Method Using grubby

Oracle recommends using the grubby utility for persistent kernel management because it updates the bootloader configuration automatically.

Set the default kernel by specifying its full path.

grubby --set-default /boot/vmlinuz-5.x.x-xxx.el7uek.x86_64

This method is particularly useful after kernel upgrades when multiple kernels are installed.


Step 7 – Regenerate the GRUB Configuration (Only When Required)

Normally, changing the default kernel with grubby or grub2-set-default does not require rebuilding the GRUB configuration. However, if the configuration has been modified or rebuilt, regenerate it using the appropriate command.

For Legacy BIOS systems:

grub2-mkconfig -o /boot/grub2/grub.cfg

For UEFI systems:

grub2-mkconfig -o /boot/efi/EFI/redhat/grub.cfg

Do not edit grub.cfg manually.


Step 8 – Verify the New Default Boot Entry

Confirm that the intended kernel is now configured as the default.

grubby --default-kernel

Verify that the reported kernel matches the one you selected.


Step 9 – Reboot the Server

Restart the server so that the new boot configuration takes effect.

reboot

Step 10 – Validate the Running Kernel

After the server restarts, verify that the expected kernel is running.

uname -r

Compare the output with the kernel configured as the default.


Troubleshooting Checklist

  • Verify the Oracle Linux version.
  • Determine whether the system boots in BIOS or UEFI mode.
  • Review all GRUB menu entries.
  • Confirm that the desired kernel is installed.
  • Use grubby or grub2-set-default instead of editing GRUB files manually.
  • Regenerate the GRUB configuration only when necessary.
  • Verify the configured default kernel before rebooting.
  • Confirm the running kernel after reboot using uname -r.
  • Maintain console access during production maintenance windows.

Production Case Study

Following a quarterly patch cycle, an Oracle Database server received a new Unbreakable Enterprise Kernel (UEK). Before placing the server back into production, the DBA verified the firmware mode, reviewed the available GRUB entries, confirmed the installed kernels using grubby --info=ALL, and selected the new UEK as the default boot kernel using grubby --set-default. After rebooting, the administrator verified the active kernel with uname -r and completed application validation. Because the change was performed using supported GRUB management tools, the configuration remained consistent through future kernel updates.


GRUB2 Management Best Practices

Proper GRUB2 administration is essential for maintaining stable Oracle Linux servers. Incorrect bootloader modifications can result in boot failures, unexpected kernel selection, or extended production downtime.

  • Always verify the current boot configuration before making changes.
  • Use grubby or grub2-set-default instead of editing GRUB configuration files manually.
  • Keep at least one previous working kernel installed for recovery.
  • Document all kernel and bootloader changes.
  • Perform kernel changes during approved maintenance windows.
  • Verify the active kernel after every reboot.
  • Maintain console or remote management access during kernel upgrades.

Kernel Management Recommendations

Oracle Linux may have multiple installed kernels, including Oracle Unbreakable Enterprise Kernel (UEK) and Red Hat Compatible Kernel (RHCK). Administrators should manage kernels carefully to maintain compatibility with Oracle software and enterprise applications.

  • Remove obsolete kernels only after confirming they are no longer required.
  • Retain at least one known-good kernel for rollback purposes.
  • Test newly installed kernels in non-production environments first.
  • Verify Oracle certification requirements before changing kernels.
  • Review installed kernels periodically using the grubby utility.

Using grub2-reboot for a One-Time Boot

In situations where a different kernel is required for a single restart, use grub2-reboot. Unlike grub2-set-default, this command changes the boot entry only for the next reboot and then automatically returns to the permanent default kernel.

Example:

grub2-reboot 1

reboot

This method is useful when testing a newly installed kernel without permanently changing the system's default boot configuration.


BIOS vs UEFI Administration Considerations

Although GRUB2 administration is similar on both firmware types, administrators should understand the differences between Legacy BIOS and UEFI systems.

Administrative Task Legacy BIOS UEFI
Firmware BIOS UEFI
Boot Partition /boot EFI System Partition (ESP)
GRUB Configuration /boot/grub2/grub.cfg EFI boot configuration
Kernel Management grubby / grub2-set-default grubby / grub2-set-default

Regardless of the firmware mode, avoid editing generated GRUB configuration files directly.


Basic GRUB Recovery Tips

If the system fails to boot after changing the default kernel, recovery is often straightforward.

  • Select an earlier working kernel from the GRUB menu.
  • Use rescue mode if normal boot is unavailable.
  • Verify that the selected kernel still exists under /boot.
  • Reconfigure the default boot entry using grubby.
  • Regenerate the GRUB configuration if necessary.
  • Restore the server from backup if configuration corruption has occurred.

Common Administrator Mistakes

  • Editing /boot/grub2/grub.cfg manually.
  • Removing all previous kernels after an update.
  • Changing the default kernel without verification.
  • Ignoring BIOS versus UEFI differences.
  • Rebooting production servers without confirming the selected kernel.
  • Failing to validate the running kernel after restart.
  • Performing kernel changes outside scheduled maintenance windows.
  • Not maintaining console access for recovery.

Frequently Asked Questions (FAQ)

What is the recommended utility for managing default kernels?

Oracle recommends using grubby for kernel management because it safely updates the bootloader configuration and remains consistent across kernel updates.

Can I edit grub.cfg manually?

No. The grub.cfg file is generated automatically. Manual modifications may be overwritten during future updates and can introduce boot problems.

What is the difference between grub2-set-default and grub2-reboot?

grub2-set-default changes the permanent default boot entry, whereas grub2-reboot changes the boot entry for the next reboot only.

Can I safely remove old kernels?

Yes, but only after confirming that the current kernel is stable. Always retain at least one known-working kernel for emergency recovery.

Does this procedure apply to Oracle Cloud Infrastructure (OCI)?

Yes. Oracle Linux instances running on OCI also use GRUB2 and support the same kernel management utilities. Exercise caution when rebooting cloud instances and ensure console access is available if recovery is required.


Related Oracle Linux Articles


About the Author

Rana Abdul Wahid is an Oracle Database and Oracle E-Business Suite Consultant with more than 15 years of experience in Oracle Database Administration, Oracle E-Business Suite Application DBA, Oracle Cloud Infrastructure (OCI), Oracle RAC, Oracle Data Guard, Linux/UNIX administration, RMAN Backup & Recovery, MySQL, Microsoft SQL Server, PostgreSQL, and enterprise infrastructure management.

His expertise includes Oracle Linux server administration, kernel management, enterprise patching, Oracle infrastructure support, disaster recovery planning, and production support for mission-critical environments.

Learn more about the author →


Conclusion

Managing the default boot sequence is a routine but critical task for Oracle Linux administrators. Whether switching between UEK and RHCK kernels, validating newly installed kernels, or recovering from a failed update, using supported GRUB2 management utilities helps ensure consistent and reliable server operation.

By verifying the firmware mode, reviewing installed kernels, selecting the correct default boot entry with grubby or grub2-set-default, validating the configuration before reboot, and confirming the running kernel after startup, administrators can safely manage Oracle Linux boot environments while minimizing operational risk.

Final Oracle Linux Administrator Recommendation

Treat kernel and bootloader changes as controlled maintenance activities. Always back up critical systems, retain at least one known-good kernel for recovery, avoid manual edits to GRUB configuration files, and use supported Oracle Linux tools such as grubby, grub2-set-default, and grub2-reboot. Verifying the active kernel after every reboot ensures a stable, secure, and production-ready Oracle Linux environment.

Found this guide helpful? Explore the Oracle Error Codes Guide for more Oracle Linux, Oracle Database, Oracle E-Business Suite, and enterprise Linux administration tutorials.

Comments