Resolves the "Cat:/etc/oratab: No file or directory" problem encountered while executing an Oracle control script __oracle

Source: Internet
Author: User
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.

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.