Bat starts the oracle local service, and bat starts the oracle service

Source: Internet
Author: User

Bat starts the oracle local service, and bat starts the oracle service

Oracle local services are enabled by default, occupying computer resources, affecting the boot speed. It is cumbersome to enable and disable each time. The following is a one-click bat implementation, right-click, and run as administrator.

@ Echo off for/f "skip = 3 tokens = 4" % I in ('SC query OracleOraDb11g_home1TNSListener') do set "zt = % I" & goto: next: nextif/I "% zt %" = "RUNNING" (echo has found that the service is RUNNING and has stopped RUNNING. net stop OracleOraDb11g_home1TNSListener) else (echo: the service is stopped now, net start OracleOraDb11g_home1TNSListener will be started.) for/f "skip = 3 tokens = 4" % I in ('SC query OracleServiceORCL ') do set "zt = % I" & goto: next: nextif/I "% zt %" = "RUNNING" (echo has found that this service is RUNNING, net stop OracleServiceORCL) else (echo this service is stopped now and will start net start OracleServiceORCL): pause
Here, OracleOraDb11g_home1TNSListener and OracleServiceORCL are the names of the services you want to start (right-click the service-properties-service name)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.