1 Problem Description:
Recently, according to the corresponding script on the Internet, the following problems were encountered when testing the Oracle control script on the virtual machine:
After you have created the Oracle control script, execute the following start command times wrong:
# services Oracle9i Stop
The error message is as follows:
Cat:/etc/oratab: No file or directory 2 error analysis
Do not use the created Service control script to execute the Oracle Database Stop command, but directly execute it directly using Oracle's relevant instructions for an inspection-by-article.
1) Turn off Oracle Monitor
# su-oracle-c "/opt/ora9/product/9.2/bin/lsnrctl Stop"
No problem with execution, normal pass.
2 Close Oracle Database
#su-oracle-c "/opt/ora9/product/9.2/bin/dbshut"
The above error occurred while executing this statement, that is, "Cat:/etc/oratab: no file or directory "
Further, it is determined that an error is caused when the instruction Dbshut is executed.
3 Open the dbshut command View, found the statement that caused the error:
:
#
# $Header: dbshut.sh.pp 03-apr-2001.13:38:20 Jboyce Exp $ dbshut.sh.pp Copyr (c) 1991 Oracle
#
###################################
#
# Usage:dbshut
#
# This script are used to shutdown ORACLE FROM/ETC/RC (. local).
# It should is executed as part of the system boot procedure.
#
#####################################
Oratab=/etc/oratab
4) View the corresponding file
# Find /etc/oratab
Find:/etc/oratab: no file or directory
The file does not exist and is determined to be the cause of the loss of the file.
5 to see if the file is in the other part of the system through the following instructions
# Find/-name "Oratab"
The results were not found.
It is estimated that the legacy of Oracle was initially installed. 3 Solutions
Because the file has been lost, so go to another server with the same version of Oracle to query the corresponding file, and indeed found the corresponding file, as follows:
#
# This file is used by ORACLE utilities. It is created by root.sh
# and updated by the ' Database Configuration Assistant when creating
# a database.
# A Colon, ': ', is used as the field terminator. A New Line terminates
# The entry. Lines beginning with a pound sign, ' # ', are comments.
#
# Entries are of the form:
# $ORACLE _sid: $ORACLE _home::
#
# The second fields are the system identifier and home
# Directory of the database respectively. The third filed indicates
# to the Dbstart utility the database should, ' Y ', or should not,
# "N", is brought up to system boot time.
#
# Multiple entries with the same $ORACLE _sid are not allowed.
#
#
# *:/opt/ora9/product/9.2:n
# *:/opt/ora9/product/9.2:n
*:/opt/ora9/product/9.2:n
oracle:/opt/ora9/product/9.2:n
demo:/opt/ora9/product/9.2:n
The following operation is simple, copy the file on the server to the appropriate directory.
Note: after copying, you must remember to modify the corresponding content.
P.S.
For a description of the Oratab file:
1. Only exist in Linux environment
2. Format::: Example: Oracle:/opt/ora9/product/9.2:n
3. You can set the appropriate options for different databases
4. If you want to use the $oracle_home/bin/dbstart script to start the database, you need to set the entries for the corresponding database in the/etc/oratab file to Y,
Simply put, the Dbstart script determines which databases to start based on the configuration in the Oratab file.
5. If you do not use the Dbstart script to start the database, but instead start with your own script, you don't have to care about oratab files at all.