Password Files   «Prev  Next»

Lesson 2 Why password files?
Objective Explain why password files are necessary.

Necessary Password Files

Oracle password files are necessary for authenticating connections over a network to a database that has not been opened because they provide a secure way to verify administrative access, especially when the database itself is not accessible to perform internal authentication. Here’s why they are important:
  1. Authentication Before Database Open
    • When a database is shut down or in a restricted state (such as "MOUNT" mode), the typical database authentication mechanisms, like internal user accounts stored within the database, are not available. This is because the database must be open to access these accounts and perform authentication.
    • A password file enables the database server to authenticate users without needing the database to be fully operational. This is particularly important for administrative tasks such as startup, shutdown, and recovery.
  2. Remote Administrative Access
    • Password files allow administrators to connect remotely to the database with administrative privileges. This is especially useful for environments where direct access to the machine hosting the database is not possible or convenient.
    • By providing the SYSDBA or SYSOPER privileges, password files allow administrators to perform essential maintenance tasks over the network without needing direct access to the operating system.
  3. Security and Role-Based Access
    • Password files allow Oracle to securely manage and restrict high-level database privileges like SYSDBA and SYSOPER. Only users listed in the password file can connect with these elevated privileges, reducing the risk of unauthorized access.
    • It also enables role-based access control for remote administration, ensuring that only authorized users can perform actions such as starting, stopping, or recovering the database.
  4. Consistency Across Instances
    • In environments with multiple Oracle instances (such as Oracle RAC), password files allow consistent authentication across instances. This consistency is necessary for cluster-wide management tasks, where each instance in the cluster may need to recognize and authenticate the same set of administrative users.
  5. Support for High-Availability and Recovery
    • In high-availability environments, administrators might need to connect to a database node that has not yet fully started or one that needs to be recovered. Password files allow them to authenticate and perform the necessary recovery or startup procedures, facilitating a faster and more secure recovery process.

Summary Oracle password files are crucial in scenarios where the database is not fully accessible or open, as they enable secure, remote authentication for administrative tasks. By using password files, Oracle ensures that only authorized users can access and manage the database in critical states, contributing to overall database security and availability.

Oracle Cloud Infrastructure

Connecting to an Oracle instance when the database is not open

Password files are necessary because Oracle needs a way to authenticate you when you are connecting over a network to a database that has not been opened. If you are connecting to an instance over a network, then you have not logged into the database server, and Oracle has no way to verify that you are who you say you are. It can check your password against those stored in the database, but that only works if the database is open. DBAs often need to connect to an instance when a database is not open. A good example is when you need to connect in order to start an instance. To get around this problem, DBA passwords are stored in the password file.
  • What is a password file?
    Password files are not database files. A password file is a small, simple file that just contains the encrypted passwords of the DBAs. Because it is not a database file, Oracle can read it when the database is closed. This gives Oracle a way to authenticate you, and this is what enables you to use tools such as Oracle Enterprise Manager in a secure manner. There are three steps to using a password file:
    1. Create the password file
    2. Configure your database to use the password file
    3. Identify the users that are DBAs

    The rest of this module shows you how to perform these tasks.

Creating and Maintaining Password File

You can create a password file using the password file creation utility, ORAPWD. For some operating systems, you can create this file as part of your standard installation.
  • Using ORAPWD
    The syntax of the ORAPWD command is as follows:
    ORAPWD FILE=filename [ENTRIES=numusers]
    [FORCE={Y|N}] [IGNORECASE={Y|N}] [NOSYSDBA={Y|N}]
    Command arguments are summarized in the following table.
    
    The syntax described above for the `ORAPWD` command is generally correct.
    Here is a breakdown of the main arguments and their purpose:
    Explanation of Arguments:
    • FILE=filename: Specifies the name of the password file.
    • ENTRIES=numusers: Defines the maximum number of distinct database users that can be added to the password file.
    • FORCE={Y|N}: Overwrites the existing password file if Y is specified. If N (default), it will not overwrite.
    • IGNORECASE={Y|N}: Determines whether the passwords are case-sensitive. Y means case will be ignored, while N enforces case sensitivity.
    • NOSYSDBA={Y|N}: If Y, prevents the use of the SYSDBA privilege in this password file.

    This syntax appears correct, assuming your Oracle environment supports these arguments as specified. Make sure to replace `filename` and other parameters with actual values based on your environment.
  • Argument Description
    FILE Name to assign to the password file. See your operating system documentation for name requirements. You must supply a complete path. If you supply only a file name, the file is written to the current directory.
    ENTRIES (Optional) Maximum number of entries (user accounts) to permit in the file.
    FORCE (Optional) If y, permits overwriting an existing password file.
    IGNORECASE (Optional) If y, passwords are treated as case-insensitive.
    NOSYSDBA (Optional) For Data Vault installations. See the Data Vault installation guide for your platform for more information.

    There are no spaces permitted around the equal-to (=) character. The command prompts for the SYS password and stores the password in the created password file.
  • Example:
    The following command creates a password file named orapworcl that allows up to 30 privileged users with different passwords.
    orapwd FILE=orapworcl ENTRIES=30
    

ORAPWD Command Line Argument Descriptions

The following sections describe the ORAPWD command line arguments.
FILE: This argument sets the name of the password file being created. You must specify the full path name for the file. If you supply only a file name, the file is written to the current directory. The contents of this file are encrypted, and the file cannot be read directly. This argument is mandatory.
The types of filenames allowed for the password file are operating system specific. Some operating systems require the password file to adhere to a specific format and be located in a specific directory. Other operating systems allow the use of environment variables to specify the name and location of the password file. For name and location information for the Unix and Linux operating systems, see Administrator's Reference for UNIX-Based Operating Systems. For Windows, see Platform Guide for Microsoft Windows. For other operating systems, see your operating system documentation. If you are running multiple instances of Oracle Database using Oracle Real Application Clusters, the environment variable for each instance should point to the same password file.

SEMrush Software 2SEMrush Software Banner 2