Database Reference
In-Depth Information
You will need to use system administrator privileges. Go to Services and Applications, then to Services
and scroll down to the Oracle services. They are all normally named with the prefix “Oracle,” and are
sorted alphabetically. We are not going to explore creating, starting or stopping processes on Unix or
Linux; the steps are the same, but the commands (Run Command level files) are different.
Because we are not using any Oracle web administrative services for the work covered in this topic,
all the Oracle services can be set to manual; however, do not do that on a production Oracle database
server. Then we can manually start the standard OracleServiceORCL service to start the ORCL instance.
We also start the standard OracleOraDb11g_homeTNSListener service to start the listener. Those 2 Oracle
services are all we need. Typically, clients connect over the network to a listener service that then
connects them to the database instance.
For the following discussions, we will assume you have set your ORACLE_HOME to something like:
SET ORACLE_HOME=D:\app\oracle\product\11.2.0\dbhome_1
Our new Oracle instance will be named apver , so we can use a command like the following to add a
service to start the instance. You need to be working in a Windows command prompt window with
administrative privileges, so right click on Command Prompt in your Start menu and select Run as
administrator.
%ORACLE_HOME%\BIN\oradim -NEW -SID apver -STARTMODE manual
-PFILE "D:\app\oracle\admin\apver\pfile\init.ora"
We also want to set the new service to automatically start the Oracle database process. This is in
addition to starting the Service automatically. It is telling the service to issue a STARTUP command to the
database. We can set the service to MANUAL startup later, and when we manually start the service it will
automatically start the database.
oradim -EDIT -SID apver -STARTMODE AUTO -SRVCSTART SYSTEM
-PFILE "D:\app\oracle\admin\apver\pfile\init.ora"
Note We will get an error here about not being able to start the service. That is okay, because we haven't really
created the database yet, but now the service to get it started is configured.
Write the Create Database Command
We are going to put our database creation command in a script file named ApVerDBCreate.sql . CREATE
DATABASE is a single command, but there are many aspects to it, and we don't want to depend on our
typing skills to enter everything correctly at the SQL*Plus prompt. Also, we want a script file so we can
refer to it if we have any questions about the command we issued.
The first thing I'd like you to notice about our database creation script is that we have not hard-
coded passwords for SYS and SYSTEM (we have commented lines in Listing 11-42, meant to remain
commented and unchanged). Those users will be created with the default passwords,
“change_on_install” and “manager,” respectively. Placing the passwords in this command script is
typical, but less secure. It is essential that you change these passwords from the default, but ask yourself
this question: will you be more likely to issue an ALTER USER command once you log in and continue the
installation steps, of which that is step one, or will you remember to go back and edit the database
creation script, ApVerDBCreate.sql , removing the real passwords from that file? We are going to
 
Search WWH ::




Custom Search