Starting Up Database Instance
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> 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.
• Database name
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.
• End-user experience
• Business transactions
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.
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
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:
• 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
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.
• 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
• 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
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.
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:
• 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.
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:
• 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.
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
Manageability monitor light (MMNL) Performs tasks like capturing session history and
metrics
Job queue coordination process (CJQO) Coordinates job queues to expedite job processes