Introduction To The Oracle Database: Data Files

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

Introduction to the Oracle Database

An Oracle database is a collection of data treated as a unit. The purpose of a database is to


store and retrieve related information. A database server is the key to solving the problems of
information management. In general, a server reliably manages a large amount of data in a
multiuser environment so that many users can concurrently access the same data. All this is
accomplished while delivering high performance. A database server also prevents unauthorized
access and provides efficient solutions for failure recovery. Oracle Database is the first database
designed for enterprise grid computing, the most flexible and cost-effective way to manage
information and applications.
Connection to oracle

Monitoring Data files, Control files, Redo log


Data files
The data files of database a mass data. Data files are related to a logical component of a
database called Table space. The Table spaces are the logical structures of the database that
keep data in form of segments.

Control Files
Control files are in binary files. They contain information about the database. They are needed to
mount the database.

Redo Log files


The online redo logs files lay up the details of all the changes that are performed against
the database. The changes could be data manipulation, data definition or structural changes to
the database. Every database must have two redo logs. The Redo log files belongs to a group. It
is better to say that every database must have minimum of two redo groups with one number.
The redo log files have the .log extension. The name of a redo log can be redo01.log.

Monitoring Redo log status, sequence


Redolog Status
UNUSED- Online redo log has never been written to. This is the state of a redo log that was just
added, or just after a RESETLOGS, when it is not the current redo log.
CURRENT- Current redo log. This implies that the redo log is active. The redo log could be open
or closed.
ACTIVE- Log is active but is not the current log. It is needed for crash recovery. It may be in use
for block recovery. It may or may not be archived.
CLEARING- Log is being re-created as an empty log after an ALTER DATABASE CLEAR LOGFILE
statement. After the log is cleared, the status changes to UNUSED.
CLEARING CURRENT- Current log is being cleared of a closed thread. The log can stay in this
status if there is some failure in the switch such as an I/O error writing the new log header.
INACTIVE- Log is no longer needed for instance recovery. It may be in use for media recovery. It
might or might not be archived.
Sequence#
The redo log sequence is an ever increasing number that uniquely identifies each redo
log files. The log sequence is increased when a log switch is performed. The current sequence
number is stored in the control file.

Switching logfile
When a log switch occurs, the log writer (LGWR) process stops writing to the current
online redo log group and starts writing to the next available redo log group. After a log switch,
the current online redo log group becomes inactive, and the next available online redo log
group becomes the current online redo log group. You can force a log switch to make the
current redo group inactive and available for redo log maintenance operations. Forcing a log
switch is useful in configurations with large redo log files that take a long time to fill.

User Creation
Once connected as system, simply issue the create user command to generate a new account.

Grant Statement
With our new books admin account created, we can now begin adding privileges to the
account using the grant statement. GRANT is a very powerful statement with many possible
options, but the core functionality is to manage the privileges of both user and roles throughout
the database.

Revoke Statement
The Oracle revoke statement revokes system and object privileges from a user.

Database shutdown and different strategy mode


The shutdown command to shut down the target database without exiting RMAN. This
command is equivalent to the SQL*Plus shutdown statement.
Syntax:
shutdown abort; , shutdown immediate; , shutdown normal; , shutdown transactional;
Abort:- Performs an inconsistent shutdown of the target instance, with the following
consequences:
• All current client SQL statements are immediately terminated.
• Uncommitted transactions are not rolled back until next startup.
• All connected users are disconnected.
• Instance recovery will be performed on the database at next startup.
Immediate:- Performs an immediate, consistent shutdown of the target database, with the
following consequences:

• Current client SQL statements being processed by the database are allowed to complete.
• Uncommitted transactions are rolled back.
• All connected users are disconnected.

Normal:- Performs a consistent shutdown of the target database with normal priority (default
option), which means:
• No new connections are allowed after the statement is issued.
• Before shutting down, the database waits for currently connected users to disconnect
• The next startup of the database will not require instance recovery.

Transactional:- Performs a consistent shutdown of the target database while minimizing


interruption to clients, with the following consequences:

• Clients currently conducting transactions are allowed to complete, that is, either commit
or terminate before shutdown.
• No client can start a new transaction on this instance; any client attempting to start a
new transaction is disconnected.
• After all transactions have either committed or terminated, any client still connected is
disconnected.

Monitoring database status

You might also like