0% found this document useful (0 votes)
113 views9 pages

Starting Up Database Instance

The document discusses Oracle database instance startup and shutdown commands, the contents of the control file, and benefits of using Oracle Enterprise Manager (OEM) to manage databases. It provides details on OEM features like out-of-the-box management, web-based access, real-time monitoring, and application performance monitoring. It also gives a brief overview of logical database structures like data blocks, extents, segments, and tablespaces.

Uploaded by

ambica badana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
113 views9 pages

Starting Up Database Instance

The document discusses Oracle database instance startup and shutdown commands, the contents of the control file, and benefits of using Oracle Enterprise Manager (OEM) to manage databases. It provides details on OEM features like out-of-the-box management, web-based access, real-time monitoring, and application performance monitoring. It also gives a brief overview of logical database structures like data blocks, extents, segments, and tablespaces.

Uploaded by

ambica badana
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Starting up database instance

SQL> STARTUP NOMOUNT ---This state is used for creating new database or creating new
control file. At this state, Oracle allocates SGA and starts background processes.

SQL> STARTUP MOUNT--- This state is used for performing specific maintenance
operations like renaming data files, enabling/disabling archive log
mode,adding/dropping/renaming redo log files,recovering database etc.Control file is read at
this stage but the data files are not open.

SQL> STARTUP OPEN or simply SQL>STARTUP Database is available for normal


operations.

Shutting down database instance

SQL> SHUTDOWN NORMAL or simply SQL> SHUTDOWN Waits for all database users
to disconnect then closes database.

SQL> SHUTDOWN IMMEDIATE Terminates all user connections, rolls back uncommitted
transactions, closes database.

SQL> SHUTDOWN TRANSACTIONAL Waits for all transactions to commit or roll back,
then closes database.

SQL> SHUTDOWN ABORT Immediately closes database leaving it in inconsistent state.


SMON automatically performs instance recovery during next startup.

Control file contains –

• Database name

• Database creation timestamp

• Data files – name, location, on/off line status

• Redo log files – name, location

• Redo log archive information

• Table space names


• Current log sequence number
• Most recent checkpoint information
• Begin and end of undo segments
• RMAN backup information

Oracle backs up control file after any structural changes in database. LGWR updates control
file with current log sequence number. CKPT updates control file with recent checkpoint
information. ARCn updates with archiving information.

Benefits of Using OEM(ORACLE ENTERPRISE MANAGER) to Manage Databases


OEM offers several features that make it an attractive tool for managing Oracle databases.
The complete toolset of OEM allows to monitor databases, manage physical storage and the
various database objects, and analyze database performance.

1.Out-of-the-Box Management:::OEM offers a true out-of-the-box solution for complete


systems monitoring and management.

2.Web-Based Management:::can view the OEM console on workstation or access it through


web server.OEM uses Secure Sockets Layer (SSL), so database security isn’t compromised
when you access databases through the Internet. All tiers of OEM communicate via HTTP, so
they can go through any firewall that HTTP communications are allowed to go through.The
web-based OEM console has all the features of the regular console,user needs a web browser
to access databases from anywhere, at any time.

3.Real-Time Monitoring:::OEM provides excellent real-time monitoring in addition to its


capability to provide reports on the database.Without OEM, you’re forced to use SQL scripts,
and the information isn’t always quick in coming. By using OEM, can immediately see all
the locks in the database.OEM helps to identify the waits in the system and find out what’s
causing them while they’re occurring.

4.Complete Environment Monitoring:::a poorly performing (or unavailable) database could


be the result of a problem anywhere in the application stack—in the database, in the web
servers, or in the server that’s hosting any of the components of the application.OEM
monitors the performance of all the components of

• The entire platform

• End-user experience

• Systems and web application availability

• The extended network components

• Business transactions

• Historical data analysis and change tracking

5.Application Performance Monitoring:::OEM provides Application Performance Monitoring


(APM) tools, which provide with an easy way to diagnose system problems and monitor
database performance. APM tools gather and report of response times of all the databases in
system. This information helps to manage databases and prevent problems.When DBAs use
OEM’s alert systems and notifications, they can quickly inform managers about poorly
performing system components.These alerts thus help to resolve issues before the database
becomes completely unavailable to users.

6.Scalable Management Capability:::OEM is a highly scalable tool, and you don’t need
additional resources to monitor an evergrowing enterprise.Consolidated Database
Management.
OEM helps you quickly identify the root cause of any system problems.OEM also enables
you to efficiently query for the latest code patches for all the Oracle products installed in your
enterprise. If new patches are available, you can download and install them easily with OEM.

7.Integrated Systems Management:::You can easily integrate OEM with a systemwide


monitoring tool such as HP OpenView. This integration of the database and server
management tools lets you view both the database and system events from a single browser.
The two products essentially act like a single integrated management suite. OEM uses the
Smart Plug-In (SPI) to provide the integration of OEM and OpenView operations.

8.Configuring and Using the Database Control:::Database Control can come already
configured for use if the DBCA is used to create a new database. For a database you create
with manual commands, however, you must configure the Database Control using a special
utility.

For example,to access the Database Control using the following URL:

http://localhost:5500/em

A Brief Tour of the Database Control

The Oracle Database Control home page provides a launching point for performance tuning
and other management activities. The Database Control home page allows to do the
following:

• Start up and shut down your database.

• Assess the current health of the database by checking the alerts.

• Drill down into various management tasks via the Performance, Availability, Server,
Schema, Data Movement, and Software and Support tabs

The database refreshes the home page every minute by default, and it contains the following
sections:

• Performance

• Availability

• Server

• Schema

• Data Movement

• Software and Support

Performance: Using the Performance page, you can do the following:

• View instance performance.


• Identify the SQL statements, sessions, and users that are using the most resources in the
database

• Run the Automatic Database Diagnostic Monitor (ADDM).

Availability:The Availability page contains the Backup/Recovery and the Oracle Secure
Backup sections. You can manage RMAN and its recovery catalog from the
Backup/Recovery link.

Server:The Server page is point for several key Oracle database management activities:

• Storage: Lets you manage tablespaces, datafiles, and control files, redo log groups, and
archive logs. You can also migrate to ASM from this section.

• Database Configuration: Lets you access the various memory advisors and view the
database feature usage charts. You can also manage automatic undo management from here.
You can check the current initialization parameters in use and modify them.

Oracle Scheduler: Helps you manage all aspects of the Oracle Scheduler, as well as the auto-
mated maintenance tasks.

• Statistics Management: Lets you manage the Automatic Workload Repository (AWR) and
the AWR baselines.

• Resource Manager: Helps you manage the Oracle Resource Manager.

• Security: Helps manage users, roles, and privileges. You can also configure audit policies,
implement the Transparent Data Encryption (TDE) feature, and create virtual private data-
base policies from this section.

Schema

The Schema page lets manage various database objects such as tables, indexes, views,
synonyms, database links, and materialized views. user can also manage stored code such as
functions, procedures, and packages.Under the Change Management section, there’s an
interesting link to the Dictionary Comparisons page. Here, you can perform a comparison of
database objects in different databases.

Data Movement:The Data Movement page has links that let you perform an export and
import of data and transport tablespaces.

Software and Support:The Software and Support page lets you access several important
database tools and features lke

• Configuration: Lets you clone Oracle homes

• Database Software Patching: Lets you access the Patch Advisor and stage and apply code
patches
• Deployment Procedure Manager: Provides access to the Deployment Procedure Manager
and the Deployment and Provisioning Software Library

• Real Application Testing: Lets you work with the Database Replay feature and the SQL
Performance Analyzer

Oracle Database Structures

Logical Database Structures:Oracle databases use a set of logical database storage structures
in order to manage the physical storage that is allocated in the form of operating system files.
These logical structures, which primarily include tablespaces, segments, extents, and blocks,
allow Oracle to control the use of the physical space allocated to the Oracle database. Taken
together, a set of related logical objects in a database is called a schema.Oracle database
objects, such as tables, indexes, and packaged SQL code, are actually logical entities.
Dividing a database’s objects among various schemas promotes ease of management and a
higher level of security.

• Data blocks: A data block is the smallest building block of the Oracle database and consists
of a specific number of bytes on the disk.

• Extents: An extent is two or more consecutive Oracle data blocks, and this is the unit of
space allocation.

• Segments: A segment is a set of extents that you allocate to a logical structure like a table or
an index (or some other object).

• Tablespaces: A tablespace is a set of one or more datafiles, and usually consists of related
segments. The datafiles contain the data of all the logical structures that are part of a
tablespace, like tables and indexes.

Data Blocks

The Oracle data block is at the foundation of the database storage hierarchy and is the basis
of all database storage in an Oracle database. A data block consists of a specific number of
bytes of disk space in the operating system’s storage system. An Oracle database allocates
free database space in terms of Oracle data blocks. A data block is the smallest logical
component of an Oracle database. For example, you can size an Oracle data block in units of
2KB, 4KB, 8KB, 16KB, or 32KB (or even larger chunks), and it is common to refer to the
data blocks as Oracle blocks. The storage disks on which the Oracle blocks reside are
themselves divided into disk blocks, which are areas of contiguous storage containing a
certain number of bytes—for example, 4,096 or 32,768 bytes (4KB or 32KB; each kilobyte
has 1,024 bytes).

All data blocks can be divided into two main parts: the row data portion and the free space
portion.The row data section of data blocks contains the data stored in the tables or their
indexes. The free space section is the space left in the Oracle block for new data to be
inserted or for existing rows in the block to be extended. Sometimes it may be useful to find
out exactly what data is in a particular block or to find out which block contains a particular
piece of data.

Query to Identify File and Block IDs

SQL> SELECT segment_name,file_id,block_id FROM dba_extents WHERE owner = 'OE'


AND segment_name LIKE 'ORDERS%';

SQL> SELECT header_file,header_block FROM dba_segments WHERE segment_name =


'PERSONS';

Physical Database Structures

Physical database structures refer to the actual Oracle database files at the operating system
level. The Oracle database consists of the following three main types of files:

• Datafiles: These files store the table and index data.

• Control files: These files record changes to all database structures.

• Redo log files: These online files contain the changes made to table data.

Datafiles:Oracle datafiles make up the largest part of the physical storage of your database. A
datafile can belong to only one database, and one or more datafiles constitute the logical
entity called the tablespace.Oracle datafiles constitute most of a database’s total space.

Control File:The control file is a file that the Oracle DBMS maintains to manage the state of
the database, and it is probably the single most important file in the Oracle database. Every
database has one control file, but due to the file’s importance, multiple identical copies are
maintained.

SQL> SELECT status, name, is_recovery_dest_file FROM V$CONTROLFILE;

Redo Log Files:The redo log files record all the changes made to the database, and they are
vital during the recovery of a database. If you need to restore your database from a backup,
you can recover the latest changes made to the database from the redo log files. The set of
redo log files that are currently being used to record the changes to the database are called
online redo log files.

Oracle redo log files contain the following information about database changes made by
transactions:

• Indicators specifying when the transaction started

• The name of the transaction

• The name of the data object that was being updated (e.g., an application table)

• The “before image” of the transaction (the data as it was before the changes were made)
• The “after image” of the transaction (the data as it was after the transaction made the
changes)

• Commit indicators that indicate whether and when the transaction completed

When a database crashes, all transactions, both uncommitted as well as committed, have to be
applied to the datafiles on disk, using the information in the redo log files. All redo log
transactions that have both a begin and a commit entry must be redone, and all transactions
that have a begin entry but no commit entry must be undone. Other Files

The SPFILE:When you create a new database, you specify the initialization parameters for
the Oracle instance in a special configuration file called the server parameter file, or SPFILE.

The Password File:The password file is an optional file in which you can specify the names
of database users who were granted the special SYSDBA or SYSOPER administrative
privileges, which enable them to perform privileged operations, such as starting, stopping,
backing up, and recovering databases.

The Alert Log File:Every Oracle database has an alert log named alertdb_name.log (where
db_name is the name of the database). The alert log captures major changes and events that
occur during the running of the Oracle instance, including log switches, any Oracle-related
errors, warnings, and other messages. every time user start up the Oracle instance,Oracle will
list all initialization parameters in the alert log, along with the complete sequence of the
startup process.

Backup Files:You can use backup files made either by yourself or by the RMAN backup and
recovery tool to restore database files following a media failure or user error. The media
failure may consist of an erroneously deleted database file or a damaged datafile.the backup
files help to restore the database and recover it to the present time with the help of the
archived redo logs.

Oracle Processes

1. Oracle server processes running under the operating system perform all the database
operations, such as inserting and deleting data.
2. These Oracle processes, together with the memory structures allocated to Oracle by
the operating system, form the working Oracle instance.
3. There is a set of mandatory Oracle processes that need to be up and running for the
database to function at all.
4. Other Oracle processes are necessary only if you are using certain specialized features
of Oracle (such as replicated databases).
5. A process is essentially a connection or thread to the operating system that performs a
task or job. The Oracle processes are continuous, which means that they come up
when the instance starts, and they stay up for the duration of the instance’s life.
Oracle processes are divided into two general types both for efficiency and to keep client
processes separate from the database server’s tasks:
• User processes: These processes are responsible for running the application that connects
the user to the database instance.

• Oracle processes: These processes perform the Oracle server’s tasks, and you can divide
them into two major categories: server processes and background processes. Together, these
processes perform all the actual work of the database, from managing connections to writing
to log files and datafiles to monitoring the user processes.

Interaction Between the User and Oracle Processes:

User processes run application programs and Oracle tools, such as SQL*Plus. The user
processes communicate with the server processes through the user interface and request that
the Oracle server processes perform work on their behalf. Oracle responds by having its
server processes service the user processes’ requests. It’s the job of the server processes to
monitor user connections, accept requests for data, and return the results to the users. All
SELECT requests, for example, involve reading data from the database, and it’s the server
processes that return the output of the SELECT statement back to the users.

two types of Oracle processes—the server processes and the background processes.

The Server Process-When an Oracle tool is run,like the OEM Database Control or the
SQL*Plus interface,

1. An Oracle session is a specific connection of a user to the Oracle instance through the
Oracle user process.
2. The session duration lasts from the time you connect to the data- base by providing a
username/password combination until you log out.
3. The server process is the process that services an individual user process. Each user
connected to the database has a separate server process created for the duration of the
session. The server process is created to service the user’s process and is used by the
user process to communicate with the Oracle database server.
4. When the user submits a request to select data, for example, the server process created
for that user’s application checks the syntax of the code and executes the SQL code. It
then reads the data from the datafiles into the memory blocks.
5. the server process returns the requested data to the user process.
The Background Processes:The background processes are the real workhorses of the Oracle
instance.

1. they enable large numbers of users to concurrently and efficiently use information
stored in database files.
2. Oracle creates these processes automatically when you start an instance, and by being
continuously hooked into the operating system, these processes relieve the Oracle
software from having to repeatedly start numerous, separate processes for the various
tasks that need to be done on the operating system’s server.
3. Each of the Oracle background processes is in charge of a separate task, thus
increasing the efficiency of the database instance.
4. These processes are automatically created by Oracle when you start the data- base
instance, and they terminate when the database is shut down.
Background Process Function:
Database writer (DBWn) Writes modified data from the buffer cache to disk (datafiles)

Log writer (LGWR) Writes redo log buffer contents to the online redo log files

Checkpoint (CKPT) Updates the headers of all datafiles to record the checkpoint details

Process monitor (PMON) Cleans up after finished and failed processes

System monitor (SMON) Performs crash recovery and coalesces extents

Archiver (ARCn) Archives filled online redo log files

Manageability monitor (MMON) Performs database-manageability-related tasks

Manageability monitor light (MMNL) Performs tasks like capturing session history and
metrics

Memory manager (MMAN) Coordinates the sizing of the SGA components

Job queue coordination process (CJQO) Coordinates job queues to expedite job processes

wants to read into the buffer cache.

You might also like