mO SharemO Share

How to create & setup batch file if Oracle Service failed to start automatically after system startup

Oracle sometimes fails to start normally as Oracle Service type is automatic. In this scenario the work around basis user needs to restart the Oracle service manually. To handle such problem manually by the user is sometimes difficult. Below we have mentioned a batch and set the batch in Windows Task Scheduler. As a result while oracle is failed to start the normally , the task scheduler will trigger and perform the same task.

Steps to a create a batch file and setup the batch file in Task Scheduler are given below -

  1. Open a txt file and type the below commands. Then save as the txt file as Oracle_Startup name with .bat extension.

@echo off net stop OracleOraDB12Home1TNSListener net start OracleOraDB12Home1TNSListener net stop OracleServiceGINESYS net start OracleServiceGINESYS

2. Open task scheduler and then click on Create task from the right hand side menu.

3. Set a task Name, then click on Run whether user is logged on or not. Then tick on Run with highest Privileges.

4. After click on Triggers Tab and then on New , select drop down menu and choose At Startup. Then click on OK

5. Next Click Action Tab and then click on New button. In Program/ Script field, browse the file you saved as Oracle_startup.bat. After that click on OK.

6. Finally click on OK button under Create Task window. A username and password prompt will appear. Put the details there.