Skip to main content

How to create batch file to start and stop Oracle Service on Windows

Everytime you want to start or stop a database service you will have to either do this using sqlplus prompt or through windows services. There is a much simpler way of stopping or starting a database.

Follow the steps below.

Create a file with an extension .bat for example start.bat

Open this file and add the following line in it.


Create another file as stop.bat, open this file and add the following line.

NET STOP OracleServiceORCL

Here I have 3 words,

1. NET helps start and stop services.
2. START/STOP -- Keyword means start or stop the services
3. OracleServiceORCL -- This is the service name of the database which has been installed on my windows.

To start the database just double click on start.bat and to stop the database double click on stop.bat.

To know the service name of the database on your machine, follow the steps below.

1. Go to Control Panel --> Administrative Tools --> Click on Services icon.

This will open a window show below.

Here scroll down to names starting with alphabet O check for anything starting with Oracle.

Highlighted service name is the one which has to be used. If you have installed only one Oracle database on your windows then if your database name is ORCL then you will have to start only one service and that service would be "OracleServiceORCL".

To know how to start/stop the database using SQLPLUS CLICK HERE

To know how to start/stop using services menu CLICK HERE


Bharath Machireddy said…
i have tried this and working fine .

but if we double click that .bat file ,it won't working ,after clicking run as administrator it works fine.

thank you
khawaja asif hameed said…
Sir you are right but after running JAZN.jar file script my isqlplus/dba was not running or in simple word authentication required windows not been successfully done.
Rajiv said…
Alert!: Oracle has announced their marquee event JavaOne and Oracle Develop 2012 being held in Hyderabad on 3-4 May. Registrations have also started (Link: ).
Zoomi786 said…
Hi Mithun,
when i tried to start enterprize manager i got this massege...what should i do?

Error: java.lang.Exception: Exception in sending Request :: null
suresha said…
Hi sir,
I am working in Oracle india pvt ltd .as business operation analyst.i want to go development side ,thats why i want to do Oracle DB course .have you teach oracle db course?Please suugest me

Thank you
Kiran Rao said…
Sir i want to download so called "BIBLE" of SQL/PLSQL which you had shown in your last class i tried but not getting that link.. Now am working for Estuate software since 26-nov-2012 in an ERP domain in mangalore so please help in downloading that i got this job through JSPIDERS actually had other job in banagalore also that is in QSG Technologies but i selected ESTUATE since my native is UDUPI .. Hope you will reply soon since i want to download it badly ..

Popular posts from this blog

SQL Interview Questions on Subqueries

SUB Queries:
1. List the employees working in research department 2. List employees who are located in New York and Chicago
3. Display the department name in which ANALYSTS are working
4. Display employees who are reporting to JONES
5. Display all the employees who are reporting to Jones Manager
6. Display all the managers in SALES and ACCOUNTING department
7. Display all the employee names in Research and Sales Department who are having at least 1 person reporting to them
8. Display all employees who do not have any reportees
9. List employees who are having at least 2 reporting
10. List the department names which are having more than 5 employees
11. List department name having at-least 3 salesman
12. List employees from research and accounting having at-least 2 reporting
13. Display second max salary
14. Display 4th max salary
15. Display 5th max salary  -- Answer for nth Max Salary
Co-Related Subqueries:
16. Write a query to get 4th max salary from EMP table
17. Write a query to get 2nd…

'Linux-x86_64 Error: 28: No space left on device' While trying to start the database -- Error

SQL> startup mount pfile='/tmp/initdlfasp12.ora'
ORA-27102: out of memory
Linux-x86_64 Error: 28: No space left on device

This as you can see is on Linux x86 with 64 bit processor. We got this error after we changed SGA on 10gR2 database. So was sure that this is something to do with the OS.

Parameters to check for this are shmall.

shmall is the total amount of shared memory, in pages, that the system can use at one time.

$cat /proc/sys/kernel/shmmax

$ getconf PAGE_SIZE

As per Oracle SHMALL should be set to the total amount of physical RAM divided by page size.

Our system has 64GB memory, so change kernel.shmall = 1024 * 1024 * 1024 * 64 / 4096 = 16777216

Once this value is calculated you can modify Linux system configuration file directly.

$ su - root
vi /etc/sysctl.conf file:


# sysctl -p

Once this is done the database was started without any problem.

Answers for SUB Queries

1. SQL> select empno, ename from emp where deptno=(select deptno from dept where dname='RESEARCH');

2. SQL> select empno, ename from emp where deptno in (select deptno from dept where loc in ('NEW YORK','CHICAGO'));

3. SQL> select dname from dept where deptno in ( select deptno from emp where job ='ANALYST');

4. SQL> select empno, ename, mgr from emp where mgr = (select empno from emp where ename='JONES');

5. SQL> select empno, ename, mgr from emp where mgr = (select mgr from emp where ename='JONES')

6. SQL> select empno, ename, job from emp where deptno in ( select deptno from dept where dname in ('SALES','ACCOUNTING'))

7. SQL> select empno, ename, job from emp where deptno in ( select deptno from dept where dname in ('SALES','RESEARCH')) and empno in (select mgr from emp)

8. SQL> select empno, ename from emp where empno not in ( select mgr from emp where mgr is not null)

9. select…