• No results found

Controlling a Database Scope

In document 1Z0-042_StudyGuide(2) (Page 36-41)

• Define how to handle parameter initialization files.

• Identify the steps to start up and shut down an Oracle database.

• Identify the type of information stored in the alert log file.

Focused Explanation

Handling Parameter Initialization Files

Each Oracle instance is configured according to the settings of a configuration file, called the parameter initialization file. This file stores the initialization parameters used when an Oracle database instance starts. Initialization parameter files are of two types:

• Parameter Files (PFILES) – Are text files that store initialization parameters.

• Server Parameter Files (SPFILES) – Are binary files that store initialization parameters.

The default location for PFILES and SPFILES is $ORACLE_HOME\dbs on UNIX, and

%ORACLE_HOME/database on Windows.

You can specify a name for the initialization parameter file to use, when you issue a STARTUP command to start a database. At database startup, Oracle searches for the parameter initialization file to configure the Oracle database instance. If you do not specify the name of a parameter initialization file to use at startup, Oracle first searches for the spfileSID.ora file. The SID is the unique name of the database instance. If Oracle cannot locate this file, it searches for the spfile.ora file. Finally, if the server file is not found, Oracle searches for the initSID.ora parameter file.

You can set the initialization parameters manually or use Enterprise Manager Database Control to modify the parameters.

Startup Modes and Options of Oracle 10g Database

An Oracle database can be started in one of several different modes, depending on the option used with the STARTUP command to start the instance.

The following summarizes the STARTUP commands that can be used to start an Oracle database:

• STARTUP NOMOUNT – Starts a database instance without mounting the database. A database started in this mode reads the parameter file and initiates Oracle background processes and Oracle memory structures. In this mode, the background processes and Oracle memory

structures do not establish communication with the disk structure of the database. If a database is started using the STARTUP NOMOUNT command, you can perform tasks such as running a script that creates a database.

• STARTUP MOUNT – Starts a database instance and establishes communication between background processes and Oracle database memory structures. In this mode, you can perform all the tasks that can be performed if the database was started with the STARTUP NOMOUNT command, as well as some administrative tasks, such as recovery of a database, changing file locations, and enabling the archive log mode.

• STARTUP OPEN – Starts a database instance and makes the database available to all users. This is the default startup mode, if you do not specify a startup mode option with the STARTUP

command.

The following are some special STARTUP commands used to start an Oracle database:

• STARTUP FORCE – Performs a shutdown abort and then restarts the database instance. This STARTUP command is used if normal startup does not work. This startup mode option can be used with the STARTUP command for every database.

• STARTUP RESTRICT – Starts a database instance and mounts the database in a restricted mode to provide access only to users who have the RESTRICTED SESSION privilege. When the database is started in this mode, you can perform various tasks, such as maintaining the

database while the database is open, and importing and exporting the database. You can disable the restriction using the ALTER SYSTEM DISABLE RESTRICTED SESSION statement.

Executing this statement allows every user to connect to the database.

Shutdown Options in Oracle 10g

An Oracle database can be shut down using various methods. The following provides a summary of the SHUTDOWN commands you can use to shut down a database:

• SHUTDOWN NORMAL – Shuts down the database normally. Using this SHUTDOWN command ensures that no new connections are established after the command is issued. The database waits until all user connections are disconnected from the database. This option is the default SHUTDOWN command option.

• SHUTDOWN TRANSACTIONAL – Shuts down the database normally, while allowing active transactions to complete. Using this SHUTDOWN command ensures that no new connections are established after the command is issued. If all active transactions are complete, all client connections are disconnected.

• SHUTDOWN IMMEDIATE – Shuts down the database immediately. Using this SHUTDOWN command ensures that no new connections are established after the command is issued, rollbacks occur for all uncommitted transactions, and the Oracle database does not wait for clients to disconnect.

• SHUTDOWN ABORT – Shuts down the database immediately by aborting the database. Using this SHUTDOWN command ensures that no new connections are established after the command is issued. In addition, all SQL statements are terminated, regardless of their state. With this shutdown mode, the Oracle database does not roll back the uncommitted transactions. This shutdown mode disconnects all the client connections immediately. When you shut down the Oracle database using this command, you would need to perform database recovery when you restart the database.

The shutdown commands SHUTDOWN NORMAL, SHUTDOWN TRANSACTIONAL, and SHUTDOWN IMMEDIATE do not require database recovery when you restart the database. These shutdowns are called clean shutdowns.

Shutting Down Oracle Using Enterprise Manager Database Control

To shut down Oracle 10g using Enterprise Manager Database Control, complete the following steps:

1. Invoke Enterprise Manager Database Control using the Web browser.

2. Type the user name and password in the User Name and Password text boxes and connect as a SYSDBA user. The Database:oracle page is displayed.

3. Click the Shutdown button under the general section of the Database:oracle page. The Startup/Shutdown: Specify Host and Target Database Credentials page is displayed.

You must provide the user name and password of the operating system and target database computer, as shown in Figure 2-5.

Figure 2-5: Startup/Shutdown: Specify Host and Target Database Credentials Page After authentication, the Startup/Shutdown: Confirmation page is displayed. The default shutdown option for the database is SHUTDOWN IMMEDIATE.

Database Alert Log

A database alert log is a file that contains information about certain activities, such as database startup and shutdown and internal Oracle errors.

The following are various events and actions stored in the alert log file:

• Startup and shutdown information

• Information about administrative actions that have occurred, such as issuing ALTER SYSTEM and ALTER DATABASE statements

• Information about Oracle internal errors that have occurred

• Information about each initialization parameter having a different value from its default value The location of the alert log file is specified by the BACKGROUND_DUMP_DEST initialization parameter.

Review Checklist: Creating and Controlling a Database: Oracle 10g

In document 1Z0-042_StudyGuide(2) (Page 36-41)