Home arrow Oracle arrow Page 4 - The Database Administrator

Operate Modes of an Oracle Database 10g - Oracle

While learning the job of DBA cannot be done entirely in a few short months, a great place to start learning is this chapter. It provides an overview of the main tasks of a DBA such as the daily operations and how to manage database objects, users and space. (From the book Oracle Database 10g: A Beginner's Guide, by Ian Abramson, Michael Abbey, and Michael Corey, McGraw-Hill/Osborne, 0072230789.)

TABLE OF CONTENTS:
  1. The Database Administrator
  2. Perform Day-to-Day Operations
  3. Understand the Oracle Database 10g Infrastructure
  4. Operate Modes of an Oracle Database 10g
  5. Get Started with Oracle Enterprise Manager
  6. Manage Database Objects
  7. Manage Space
  8. Manager Users
  9. Manage Privileges for Database Users
  10. Project 3-1: Creating Essential Objects
By: McGraw-Hill/Osborne
Rating: starstarstarstarstar / 23
August 03, 2004

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

CRITICAL SKILL 3.5 -- Operate Modes of an Oracle Database 10g

Oracle is a software package like many others that you may have used. However, when you run most programs, they run one and only one way. So when I open my accounting software, I run it the same way all the time. However, you have options with Oracle. This section discusses the many ways that you can run Oracle. Some of these methods will be important to administrators, while others will allow for full use. This feature is important when you need to perform both critical and noncritical activities, and not interfere with your users or your data.

Modes of Operation

Oracle has several modes of operation. In most cases, when you start Oracle, you will simply issue the command:

> Startup;

This command actually takes Oracle through three distinct startup phases automatically, or you could also choose to explicitly step through these phases:

  1. In the nomount phase, the database reads the spfile or the init.ora parameter file and starts up the Oracle memory structures as well as the background processes. The instance is started, but the database is not yet associated with the newly started instance. This is usually used in cases where you need to re-create the controlfile. The command to perform this is

    > startup nomount;

  2. In order to associate a database with the instance, the instance “mounts” the database. This is done in the mount phase. The previously read parameter file is used to find those controlfiles, which contain the name of the data files and redo logs. The database is then mounted to allow some maintenance activities to be performed. Datafiles and redo logs are not opened when the database is in mount mode, so the database is not yet accessible by end users for normal tasks. Commands to mount a database are

    > startup mount;
    > alter database mount;

  3. When Oracle opens the database in the open phase,it opens the data files and redo logs, making the database available for normal operations. Your redo logs must exist in order for the database to open. If they do not, the resetlogs command must be used to create new redo logs in the location specified in the control files.

    > Startup {open} {resetlogs};
    > alter database open;
Other Ways to Open the Database

There are some other options for opening a database. For example, you may want to open it in Read-Only mode so that no database changes (inserts, updates, or deletes) can be performed. There are also the upgrade/downgrade options that allow a database to be opened to perform a downgrade or upgrade to another version of Oracle.

> alter database open read only;

A common option you will use to perform maintenance will be to open the database in restricted mode. When you issue the command startup restrict, only users with both the create session and restricted session privileges will be able to use the database. So, as a DBA this is a helpful way to open the database that only you can use.

> startup restrict;

The database can be placed in a state where only the sys and system users can query the database without stopping the database and performing a subsequent startup restrict. The activities of other users continue until they become inactive. This can be performed using the quiesce option of alter session when the Database Resource Manager option has been set up.

> alter system quiesce restrict;
> alter system unquiesce;

Forcing a Startup

Over time, you will run into situations where Oracle has not shutdown properly and you are unable to restart it. In these rare instances, you will need to use the force option of the startup command. This will first perform a “shutdown abort” that forces the database to shutdown (see the next section for more information on this) followed by a database startup.

> startup force

Database and Instance Shutdown

When shutting down an instance, perform these steps, which are reverse from those you just saw when opening a database:

  1. Close the database, including the data files and redo logs, so that it is no longer usable for normal tasks.

  2. Unmount the database from the instance so that only the instance memory structures and background tasks are left running without a database associated with them.

  3. Shut down the instance to close the control files.

In order to shut down a database, four different approaches can be used: Shutdown Normal, Immediate, Transactional, and Abort.

  • Normal is, in a sense, the “perfect” way to shut down, since this approach will wait for all users to disconnect from the database and all transactions to complete before the shutdown occurs. Once this command has been issued, new users are not allowed into the system. This can be impractical in cases where users remain on the system for long periods of time.

    > shutdown normal;
  • Immediate is a practical shutdown approach that also leaves the database in a consistent state. When the database is put through a “shutdown immediate,” all current transactions are rolled back and users are disconnected. No new transactions are allowed into the system. This will be relatively quick if the rollback operations are small, and is an excellent way to shut down the database before performing a database backup.

    > shutdown immediate;
  • A transactional shutdown is similar to the immediate variety except that running transactions are allowed to complete. So, once transactions have been committed, the user running it is disconnected. This is useful in cases where you do not want to shutdown until currently running transactions have finished or in cases where it will be quicker to complete existing transactions than it will be to roll them back.

    > shutdown transactional
  • Abort is the least graceful shutdown option of the four. When this is used, all transactions are ended immediately without waiting for a rollback or commit and all users are instantly disconnected while the database is brought down. Use this only if you are experiencing problems shutting down the database using one of the three options described previously or in cases where you need to shutdown the database immediately. The database needs to go through recovery procedures the next time it is restarted. After a shutdown abort has been performed, you should try to immediately start up the database so that you can then perform a shutdown (normal, immediate, or transactional) to bring the database down in the proper manner.

    > shutdown abort;

OEM can help with instance and database startup and shutdown, as shown in Figure 3-3. Open OEM. In the left panel, choose the instance you want to work on and select “Instance” under the instance name (in this case, it’s ora10g), then on the right side of the panel, choose View And Edit The Values Of Instance Parameters.


Figure 3-3. Enterprise Manager instance configuration view

This chapter is from Oracle Database 10g: A Beginner's Guide, by Abramson, Abbey and Corey. (McGraw-Hill/Osborne, 2004, ISBN: 0072230789). Check it out at your favorite bookstore today. Buy this book now.



 
 
>>> More Oracle Articles          >>> More By McGraw-Hill/Osborne
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

ORACLE ARTICLES

- Oracle Java Security Woes Continue
- Oracle's New IaaS Cloud Option: There's a Ca...
- Oracle Acquires Eloqua to Boost Cloud Presen...
- Choosing Innovation: Oracle Survey Insights
- Oracle Fixes Privilege Escalation Bug
- Oracle`s Communications Service Availability...
- Oracle Releases Exalytics, Taleo Plans
- Oracle Releases Communications Network Integ...
- Oracle Releases Communications Data Model 11...
- Oracle Releases PeopleSoft PeopleTools 8.52
- Oracle Integrates Cloudera Apache Distro, My...
- Oracle Releases MySQL 5.5.18
- Oracle Announces NoSQL Database Availability
- Sorting Database Columns With the SELECT Sta...
- Retrieving Table Data with the LIKE Operator

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: