If you haven't worked with an Oracle database before and need to learn how to use Oracle SQL Developer, this seven-part article series will get you off to a good start. It is excerpted from chapter two of the book Murach's Oracle SQL and PL/SQL, written by Joel Murach (Murach; ISBN: 1890774502).
In the last chapter, you learned about some of the SQL statements that you can use to work with the data in a relational database. Before you learn the details of coding these statements, however, you need to learn how to work with an Oracle database, how to use Oracle SQL Developer to enter and execute SQL statements, and how to use the SQL Reference manual.
How to work with an Oracle database
Since Oracle Database 11g Express Edition has not been released as of press time for this book, this topic uses Oracle Database 10g Express Edition to illustrate the skills for working with the Oracle Database. However, when the Express Edition of 11g becomes available, you should be able to use similar techniques to work with that version of the Oracle Database.
How to start and stop the database service
If you installed the Express Edition of the Oracle Database on your computer as described in appendix A, the database service starts automatically when you start your computer. This piece of software is often referred to as the database server, or the database engine. It receives SQL statements that are passed to it, processes them, and returns the results.
The database listener also starts automatically when you start your computer. This piece of software listens for requests from remote clients and returns the results to them.
From time to time, however, you may want to stop the database. If, for example, you aren’t going to be using the database and you want to free the resources on your computer, you can stop the database. Or, if the port that is being used by the Oracle Database conflicts with another program, you can stop the database. Then, when you want to work with the database again, you can start it.
The easiest way to stop the database service is to use the Stop Database command that’s available from the Windows Start menu as described in figure 2-1. When you select this item on a Windows system, a DOS window will be displayed that indicates that the Oracle service is stopping. Then, the DOS window will display a message when the Oracle service has successfully stopped. Although this doesn’t stop the database listener, the database listener won’t be able to return any results unless the database service is running.
When you’re running the Oracle Database on your own computer for training purposes, you can stop the database whenever you want. However, if a database is running in a production environment, you should make sure that all users are logged off and that no applications are using the database before you stop the database.
The easiest way to start the database service and listener is to use the Start Database command that’s available from the Windows Start menu. When you select this command on a Windows system, a DOS window will be displayed that indicates the status of the Oracle listener and service.
The DOS window that’s displayed when the database is started
Description
After you install the Oracle Database, the database service and database listener will start automatically each time you start your computer. The database service can also be referred to as the database server or the database engine.
To stop or start the database server and listener, you can use the commands that are available from the Windows Start menu.
When Oracle Database 11g Express Edition becomes available, you should be able to use a similar technique to stop and start that version of the Oracle Database.
--------------------------------------------Figure 2-1 How to start and stop the database service