Create the file /Library/StartupItems/Oracle/StartupParameters.plist from the information located within Listing #2. This file has been configured for an Oracle database startup by specifying a "Late" startup sequence to SystemStarter in order to ensure that any other necessary operating system resources are available by the point in time when the database is started. This file has been written in the newer XML format as recommended in the Mac OS X for UNIX Geeks book (p. 40).
Startup scripts may be tested without restarting the server by passing the "
-nd" parameters to the SystemStarter:
This test helps you ensure that you haven't accidentally named the startup script incorrectly or made a serious typo in the writing of the plist file. If SystemStarter can't find the startup script, it will give a continuous list of "Waiting for Oracle 9.2.0 Database Server" error messages.
Listing #2 -- filename: /Library/StartupItems/Oracle/StartupParameters.plist
From this point forward during the install process, you want to be logged into the oracle UNIX account. Copy the oracle installation file macosx_920_dev_rel.tar.gz either from the OTN Web site or from a CD (if you created one) to the location where you are going to place your Oracle Home directory. In this example, this would be the top level of the /Volumes/u01 directory. Uncompress and untar the file.
oracle% cd /Users/oracle
oracle% gunzip macosx_920_dev_rel.tar.gz
oracle% tar xvf macosx_920_dev_rel.tar
The resulting orahome directory will contain the Oracle binary software. In a regular UNIX installation, this step would only have been reached after running the Oracle Universal Installer and waiting for all of the files to be copied and linked.
Rename the orahome directory with the name you want to use for your Oracle Home directory, which will be v920 in this example.
oracle% mv orahome v920
Create the /etc/oratab Oracle startup configuration file. This file provides configuration info for the
dbshut scripts to indicate which database instances should be started/stopped by these scripts. Having a "Y" in the last column permits the
dbshut scripts to start or stop the database. This can be useful if you have multiple database instances installed on the same server, but you only want some instances to be started manually by the DBA. The contents of this file are in the format
$ORACLE_SID:$ORACLE_HOME:<N|Y>. For this installation example, the contents are as follows:
It is not mandatory for you to use the Oracle-supplied
dbshut scripts to start or stop your database. If you don't want to use this mechanism, you can customize the Oracle startup script to simply use SQL/Plus to start up or shut down the database directly. However, this is the method commonly used by Oracle DBAs, so I prefer to use it to make my database installs more familiar for any other DBA who needs to administer the server.
Use the following file listings to create the /Users/oracle/network/admin/tnsnames.ora, /Users/oracle/network/admin/sqlnet.ora, /Users/oracle/network/admin/listener.ora, and /Users/oracle/network/admin/initprod1.ora files. The tnsnames.ora file provides configuration for software to communicate with the database that is being installed. This file should be copied to client computers after installing the Oracle client software CD. Since this CD does not yet exist for Mac OS X, you would need to install the actual database binary files just as was done here on the server itself. This way, remotely-connected client applications will be able to use Oracle's Net8 software or JDBC drivers to connect to the database. Once the database has been installed and created, you can test connectivity to the server with the command
The sqlnet.ora and listener.ora files are used to configure the listener program on the database server. The initprod1.ora file provides the initial configuration for the server when it starts up, unless the server finds an spfile in the same directory.
Listing #3 -- filename: $ORACLE_HOME/network/admin/tnsnames.ora
Listing #4 -- filename: $ORACLE_HOME/network/admin/sqlnet.ora
Listing #5 -- filename: $ORACLE_HOME/network/admin/listener.ora
Listing #6 -- filename: $ORACLE_HOME/dbs/initprod1.ora