Novice Learning Database (vi)--easy and quick to open and close Oracle Services

Source: Internet
Author: User

Background:

As a programmer, in daily work, our computers often need to run many programs at the same time, such as Eclipse, browser, Instant messenger, etc., and often need to open several Office documents or PDF documents. At this time your memory estimate has exploded, especially now want to Chrome and Firefox such browser, casually install a few plug-ins, memory footprint is amazing. And we have to install a variety of plug-ins in order to meet the needs, because these two browsers do not install any plug-in case with IE no difference.


As shown, FireFox, Java's two processes, and eclipse steadily occupy the top four of memory usage, and if your computer is still on Oracle's service, then your computer will be stuck in a horrible way.

Upgrade the computer to 8G of memory, at first feel very cool, not too long, and become very slow. Really give it how much memory, it will dare to give you how much memory ah. Unrestricted upgrade hardware is obviously not a practical approach, so we need to use the software to think, this sentence requires us to the usual infrequently used services and background process to turn off.

Browser We do not have to live every day, and shut down the main program will not have a background process, so our goal is not it, Java process and eclipse every day open also inseparable from them, so also can not be a black hand to them; Hey, Oracle, I'm sorry, I can only kill you. Because we have a framework like hibernate, we don't need to know what database we're going to target when we write the code. So there's absolutely no need for us to drive the clunky backend services of Oracle on our machines every day. A little MySQL is perfectly manageable, so all we have to do is turn off its service and open it when it's ready.

But the new problem comes again, every time you need to open the service, you also need to turn on the system of service management, to find the relevant Oracle services, and then right click Click Start, I want to have a similar experience of friends, will feel that this is a very annoying job.

However, as a programmer, we should naturally think that these complex work can certainly be done through the program to automatically help us solve. Yes, and very simple, just a few lines of code to get it done!


Solution:

First, to the service (press "Win" key, enter "service", carriage return) to find the related services of Oracle, I Ann is 11g, related services are as follows:

We do not need to open all the services, basic functions only need to open the following two services:

Oracleserviceorcl
Oracleoradb11g_home1tnslistener


Save the following code as a ". bat" file or a ". cmd" file.

Specific code:


Operating Effect:


After the run is complete, you can see that the status of the two services has become "started":



To stop the service code, simply change "start" to "Stop":

Operating effect:



Well, with these two pieces of code Oracle's services are obedient to us, and the trick is to go. I think it's cool and crooked. Here is a detailed description of each Oracle service:

1. Oracle ORCL VSS Writer service:oracle Volume Mapping copy write service, VSS (Volume Shadow Copy service) enables the creation of high-fidelity point-in-time images for storage infrastructure (such as disks, arrays, etc.) That is, the mapped copy (shadow copy). It can create a mapped copy on multiple volumes or on a single volume without affecting the system's system performance. (must not be started)

2. Oracledbconsoleorcl:oracle Database Console service, ORCL is the instance identity of Oracle, and the default instance is ORCL. You need to start this service when you run Enterprise Manager (Enterprise Management Manager OEM). (must not be started)

3. Oraclejobschedulerorcl:oracle Job scheduling (timer) service, ORCL is the Oracle instance identity. (must not be started)

4. Oraclemtsrecoveryservice: Service-side control. The service allows the database to act as a resource manager for transactions in a Microsoft Transaction Server MTS, com/com+ object, and distributed environment. (must not be started)

5. Oracleoradb11g_home1clragent:oracle part of the database. Net Extension Service. (must not be started)

6. Oracleoradb11g_home1tnslistener: Listener service, service is required only when the database requires remote access. (not required to start, detailed below).

7. ORACLESERVICEORCL: Database service (DB instance), which is the Oracle Core service, is the basis for database startup, and the Oracle database can start only if the service is started. (must be started) so what exactly does it take to start the service at the time of development?

For beginners, if you only use Oracle's own sql*plus, just start ORACLESERVICEORCL, and if you use a third-party tool such as PL/SQL developer, Oracleoradb11g_ Home1tnslistener service is also to be opened. ORACLEDBCONSOLEORCL is a web-based EM must be turned on, and the rest of the service is seldom used.

Note: ORCL is the database instance name, the default database is ORCL, you can create other, that is, the oracleservice+ database name.


Novice Learning Database (vi)--easy and quick to open and close Oracle Services

Related Article

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.