How to edit the /etc/oratab file in Azure VM for Oracle database

In this tutorial we will learn how to edit /etc/oratab file to automate the startup/shutdown of an Oracle database.

2 min read

When the oraenv script is run, it reads the oratab file found in /etc to determine where the Oracle home for a given database is located.  The oratab file contains entries in the form of ORACLE_SID:ORACLE_HOME:Y, the last character being a Y or N indicating if the database should be started and stopped with the dbstart and dbstop commands, respectively.

In this tutorial we will learn how to edit /etc/oratab file to automate the startup/shutdown of an Oracle database.



Here is a typical oratab entry:

cdb1:/u01/app/oracle/product/12.1.0/dbhome_1:Y

Edit /etc/oratab file

  1. Sign on as root
sudo su -

2.  Open the file /etc/oratab using the following command:

cat /etc/oratab
use cat command
see the content inside file /etc/oratab


3.  Using vim editor we will edit the file /etc/oratab and change the default N to Y using following command:

vi /etc/oratab

You will see output that looks similar to the following:

edit using vi command in bash
You will see output like this after using vi command in bash

4.  Type i to enter insert mode.

5.  Now edit the file and change N to Y

6.  Press ESC and then type :wq! then press Enter to save the changes and exit vim.

Whoa! you have changed the /etc/oratab file using bash shell editor.



Confirming the Changes

  1. Open the file again using following command
cat /etc/oratab

You will see output that looks similar to the following:

confirm changes made to ratab file
Confirm the changes made to /etc/oratab file


Featured Oracle

Connect Oracle Database to Datagrip IDE

In this tutorial, we will connect the Oracle database to the DataGrip IDE.

2 min read
Featured Oracle

How to install Oracle database in Microsoft Azure VM

In this tutorial, we will learn how to set up an Oracle database on a remote server and access it by using our browser.

7 min read