The scripts are created using the cat command, with all the “$” characters escaped. If you want to manually create these files, rather than using the cat command, remember to remove the “\” characters before the “$” characters.
Create a “scripts” directory.
Create an environment file called “setEnv.sh”. The “$” characters are escaped using “\”. If you are not creating the file with the cat command, you will need to remove the escape characters.
cat > /home/oracle/scripts/setEnv.sh <<EOF
Add a reference to the “setEnv.sh” file at the end of the “/home/oracle/.bash_profile” file.
echo “. /home/oracle/scripts/setEnv.sh” >> /home/oracle/.bash_profile
Create a “start_all.sh” and “stop_all.sh” script that can be called from a startup/shutdown service. Make sure the ownership and permissions are correct.
cat > /home/oracle/scripts/start_all.sh <<EOF
cat > /home/oracle/scripts/stop_all.sh <<EOF
chown -R oracle:oinstall /home/oracle/scripts
chmod u+x /home/oracle/scripts/*.sh
Once the installation is complete and you’ve edited the “/etc/oratab”, you should be able to start/stop the database with the following scripts run from the “oracle” user.