Here are the steps I have been using to enable autostarting of Oracle Database Enterprise Edition 10g, 11g or 12c during boot time of Oracle Linux 5 and 6. I also use these steps with Oracle Linux 7. These steps are useful for the kinds of demonstration and development setups that I typically need.
These steps are not needed for Oracle XE, since its install will prompt whether to autostart the DB and will configure the system automatically.
Create a file /etc/init.d/dbora using dbora
# chmod 750 /etc/init.d/dbora
On Oracle Linux 5 and 6 run:
# chkconfig --add dbora # chkconfig dbora on
On Oracle Linux 7 run:
# systemctl enable dbora
In /etc/oratab, change the autostart field from N to Y for any databases that you want autostarted.
The DB will start and stop at machine boot and shutdown.
Or it can be manually controlled with:
# service dbora start
# service dbora stop
On Oracle Linux 7, use 'systemctl start dbora' and 'systemctl stop dbora'.
To also start all pluggable databases when the container database starts, run this in SQL*Plus as SYSDBA:
create or replace trigger sys.after_startup after startup on database begin execute immediate 'alter pluggable database all open'; end after_startup; /
If you want to read more, check the official documentation about auto starting here.