0% found this document useful (0 votes)
16 views25 pages

Database 19 June

The document provides an overview of databases, focusing on the structure and management of relational databases (RDBMS) compared to traditional database management systems (DBMS). It discusses the advantages of RDBMS, such as enhanced data security, consistency, and scalability, as well as the architecture of Oracle databases, including instances and control files. Additionally, it covers the concepts of production and standby databases, their synchronization mechanisms, and various commands for database management.

Uploaded by

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

Database 19 June

The document provides an overview of databases, focusing on the structure and management of relational databases (RDBMS) compared to traditional database management systems (DBMS). It discusses the advantages of RDBMS, such as enhanced data security, consistency, and scalability, as well as the architecture of Oracle databases, including instances and control files. Additionally, it covers the concepts of production and standby databases, their synchronization mechanisms, and various commands for database management.

Uploaded by

demo936875
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Database

The database sometimes referred to as an electronic database, is an organized collection of logically


related data that is stored in an efficient manner so that it can be easily accessed managed and
updated. Let's divide the whole definition into parts and understand in an easier way:

Unorganized Organized
Data Data

Logically Related Data


Logically related data means that the data should be relevant in some
context. Example: If we are going to make a database for a customer then the database
may include customer name, contact number, age, past orders, address, email id, etc. All
these information are in the context of the customer. But the information like the
number of siblings of the customer is out of context and logically not related to the
customer database.
RDBMS Database Concept:

Database is a collection of related data and data is a collection of facts and figures that can be
processed to produce information.

Mostly data represents recordable facts. Data aids in producing information, which is based on
facts. For example, if we have data about marks obtained by all students, we can then conclude
about toppers and average marks.
A database management system stores data in such a way that it becomes easier to retrieve,
manipulate, and produce information.
Differences Between RDBMS and DBMS
An RDBMS is an advanced version of a DBMS. Unlike a DBMS that manages databases present on the
computer network and hard disks, an RDBMS helps maintain the relationships between its tables.

The following are some of the main differences between an RDBMS and a DBMS:
 Number of operators: A DBMS allows only a single operator at a time, whereas multiple users can
operate an RDBMS concurrently. This is because an RDBMS uses intricate algorithms that enables several
users to simultaneously access the database while preserving data integrity.
 Hardware and software needs: A DBMS utilizes less resources for data storage and retrieval as
compared to an RDBMS. This is because the latter is more complex due to its multi-table structure and
cross-referencing capability, making it costlier than a DBMS. RDBMSs are also generally used for
enterprise-class applications while DBMSs are more commonly utilized for smaller, purpose-specific
applications.
 Data modification: Altering data in a DBMS is quite difficult, whereas you can easily modify data in an
RDBMS using an SQL query. Thus, programmers can change/access multiple data elements
simultaneously. This is one of the reasons why an RDBMS is more efficient than a DBMS.
 Data volume: A DBMS is more suitable for handling low data volume, whereas an RDBMS can handle
even large data volumes.
 Database structure: A DBMS stores data in a hierarchical structure, while an RDBMS stores data in tables.
 Data fetching speed: In a DBMS, the data fetching process is quite slow especially when data is complex
and the volume is large. This is because each of the data elements must be fetched individually. In an
RDBMS, data is fetched at a faster pace because of the relational approach. Plus, SQL facilitates quicker
data retrieval in an RDBMS.
 Client server architecture: Unlike a DBMS, an RDBMS supports client-server architecture.
Advantages of RDBMS
A relational database management system offers a methodical view of data, which helps businesses improve
their decision-making processes by enhancing different areas, such as:
Enhanced Data Security
The authorization and access control features in an RDBMS support advanced encryption and decryption,
enabling database administrators to manage access to the stored data.
Retain Data Consistency
In an RDBMS, it is easier to add new data or modify existing tables while maintaining data consistency with the
existing format.
Better Flexibility and Scalability
An RDBMS offers more flexibility when it comes to updating data as the modifications only have to be made
once. For instance, updating the details in the main table will automatically update the relevant files and save
you the trouble of changing several files one by one. Plus, each table can be altered independently without
disturbing the others. This makes relational databases scalable for growing data volumes.
Database and Instance:

An Oracle Database consists of a database and at least one instance.


An instance, or database instance, is the combination of memory and processes that are a part of a running
installation and a database is a set of files that store data.

The following picture illustrates the Oracle Database server architecture .

Oracle server: An Oracle server includes an Oracle


Instance (Logical)and an Oracle database(Physical).
Physical storage structure are simply files that store data. When you execute a CREATE
DATABASE statement to create a new database, Oracle creates the following files.

Data files: data files contain real data, e.g., sales order and customer data. The data of logical database
structures such as tables and indexes are physically stored in the data files.

Control files: every database has a control file that contains metadata. The metadata describes the physical
structure of the database including the database name and the locations of data files.

Online redo log files: every database has an online redo log that consists of two or more online redo log files.
An online redo log is made up of redo entries that record all changes made to the data.

Physical storage structure


An Oracle database includes other important files such as

 Parameter files
 Network files
 Backup files
 Archived redo log files for backup and recovery.

The Oracle server also accesses parameter files and password files.

Benefits of these files.

 Enable system users to process SQL statements.


 Improve system performance.
 Database can be recovered if there is a software/hardware failure.
 The database server must manage large amounts of data in a multi-user environment.
 The server must manage concurrent access to the same data.
 The server must deliver high performance. This generally means fast response times.
Oracle Instance
An Oracle Instance consists of two different sets of components:
The first component set is the set of background processes
(PMON, SMON, RECO, DBW0, LGWR, CKPT, D000 and others)
Each background process is a computer program.
These processes perform input/output and monitor other Oracle
processes to provide good performance and database reliability.
The second component set includes the memory structures that
comprise the Oracle instance.
When an instance starts up, a memory structure called the System
Global Area (SGA) is allocated.
At this point the background processes also start.
An Oracle Instance provides access to one and only one Oracle
database.
RAC v/s Standalone DB
What is standalone database concept?
Stand alone database would mean the centralized database where the data and other resources are
centrally available. Any one want to access the data has to request in the central server and access it. It
has many advantages and disadvantages. One important disadvantage is the data availability.
What is RAC?

RAC stand for Real Application cluster. RAC provides cluster solution that ensures high availability of
instance and load balancing.

What is Cluster?

A cluster is a set of 2 or more machine (nodes) that share resource to perform the same task.

What is RAC Database?

A RAC database is 2 or more instance running on a set of clusters nodes with all instances accessing a
shared set of database files.
Different between RAC and Non RAC database

RAC stands for Real Application Clusters. It allows multiple nodes in a clustered system to mount and open
a single database that resides on shared disk storage. Should a single system fail (node), the database
service will still be available on the remaining nodes.

A non-RAC database is only available on a single system. If that system fails, the database service will be
down (single point of failure).

Why use RAC?

We can achieve benefit in the following ways:

 High availability - If some nodes fail, the remainder of the nodes will still be available for processing
requests.
 Speedup (increased transaction response time) - RAC normally adds some overhead.
 Scale-up (increased transaction volume) - RAC can be used to provide increased application scalability
What Is the Advantages of using Oracle Database?

 Centralized control and management system: This allows the data to be controlled completely from a
tabular exchange since it is responsible for assigning, adding, deleting records and modifying them.
 Standardization: Allows standardization between different implementations of SQL
 Grouping of transactions: It allows grouping several transactions and dividing each activity into segment
and thus achieving a better performance in less time possible.
 Performance methods: Applies methods to improve the database through a Cluster application.

What Is the Disadvantages of using Oracle Database?

 Incompatibility and complexity: This is presented as a limitation in the areas of time, data Syntax and
character sensitivity
 Management of the structure: Oracle often tends to be complex or sometimes difficult to manage For
certain activities, so it is recommended to install a basic version and configure with a minimal
Customization.
 The price: Many times there is no price or a specific budget for the Oracle license as it usually Changes
over time depending on the change of policies, patches and updates by the company.
Understanding
Understanding OfOf Production
Production Database
Database and and Standby
Standby Database.
Database. and
and their their
synchronization
synchronization
mechanism mechanism

Production Database
Production database or Primary Database is a database system which uses real-time processing to handle
workloads whose state is constantly changing. This differs from traditional databases containing persistent data,
mostly unaffected by time. For example, a stock market changes very rapidly and is dynamic. The graphs of the
different markets appear to be very unstable and yet a database has to keep track of current values for all of the
markets. Real-time processing means that a transaction is processed fast enough for the result to come back and
be acted on right away. Real-time databases are useful for accounting, banking, law, medical records, multi-media,
process control, Reservation and Allotment systems, and scientific data analysis.

Standby Database
A standby database is a database replica created from a backup of a primary database. By applying archived redo
logs from the primary database to the standby database, you can keep the two databases synchronized.
A standby database has the following main purposes:
1) Disaster protection
2) Protection against data corruption
If the primary database is destroyed or its data becomes corrupted, you can perform a failover to the standby
database, in which case the standby database becomes the new primary database. You can also open a standby
database with the read-only option, thereby allowing it to function as an independent reporting database.
When Primary database is no longer due to Disaster, User can continue the operation on
Standby Database

Standby database is up to date with Primary Database, we have to check Synchronization.


Standby database Synchronization.

Database Synching

Primary Database
Understanding Of Production Database and Standby Database. and their
Starting an Instance: Scenarios
synchronization mechanism

Note: It is possible to encounter problems starting up an instance if control files, database files, or redo log files are
not available. If one or more of the files specified by the CONTROL_FILES initialization parameter does not exist or
cannot be opened when you attempt to mount a database, Oracle returns a warning message and does not mount
the database. If one or more of the datafiles or redo log files is not available or cannot be opened when attempting
to open a database, Oracle returns a warning message and does not open the database.

Starting an Instance, and Mounting and Opening a Database:


Normal database operation means that an instance is started and the database is mounted and open. This mode
allows any valid user to connect to the database and perform typical data access operations. Start an instance,
read the initialization parameters from the default server parameter file location, and then mount and open the
database by using the STARTUP command by itself (you can, of course, optionally specify a PFILE or
SPFILE clause):
STARTUP
Starting an Instance Without Mounting a Database
You can start an instance without mounting a database. Typically, you do so only
during database creation. Use the STARTUP command with the NOMOUNT option:
STARTUP NOMOUNT

Starting an Instance and Mounting a Database


You can start an instance and mount a database without opening it, allowing you to perform specific maintenance
operations. For example, the database must be mounted but not open during the following tasks:
The following statement opens a database in read-only mode:
ALTER DATABASE open read only;
Shutting Down with the NORMAL Option
To shut down a database in normal situations, use the SHUTDOWN command with
the NORMAL option:
SHUTDOWN NORMAL

Normal database shutdown proceeds with the following conditions:


■ No new connections are allowed after the statement is issued.
■ Before the database is shut down, Oracle waits for all currently connected users
to disconnect from the database.

The next startup of the database will not require any instance recovery
procedures.
Shutting Down with the IMMEDIATE Option
Use immediate database shutdown only in the following situations:
To initiate an automated and unattended backup
■ When a power shutdown is going to occur soon
■ When the database or one of its applications is functioning irregularly and you
cannot contact users to ask them to log off or they are unable to log off.

To shut down a database immediately, use the SHUTDOWN command with the
IMMEDIATE option:
SHUTDOWN IMMEDIATE
Immediate database shutdown proceeds with the following conditions:
■ No new connections are allowed, nor are new transactions allowed to be
started, after the statement is issued.
■ Any uncommitted transactions are rolled back.
Shutting Down with the TRANSACTIONAL Option:
When you want to perform a planned shutdown of an instance while allowing active transactions to, use the
SHUTDOWN command with the TRANSACTIONAL option:
SHUTDOWN TRANSACTIONAL
Transactional database shutdown proceeds with the following conditions:
■ No new connections are allowed, nor are new transactions allowed to be started, after the statement is issued.
■ After all transactions have completed, any client still connected to the instance icomplete firsts disconnected.
■ At this point, the instance shuts down just as it would when a SHUTDOWN IMMEDIATE statement is submitted.
The next startup of the database will not require any instance recovery procedures. A transactional shutdown
prevents clients from losing work, and at the same time, does not require all users to log off.
Shutting Down with the ABORT Option: You can shut down a database instantaneously by
aborting the database’s instance. If possible, perform this type of shutdown only in the following situations:
■ The database or one of its applications is functioning irregularly and none of the other types of shutdown works.
■ You need to shut down the database instantaneously (for example, if you know a power shutdown is going to
occur in one minute).
■ You experience problems when starting a database instance. When you must do a database shutdown by
aborting transactions and user connections, issue the SHUTDOWN command with the ABORT option:
SHUTDOWN ABORT An aborted database shutdown proceeds with the following conditions: ■ No new
connections are allowed, nor are new transactions allowed to be started, after the statement is issued
What Is a Control File?

Every Oracle database has a control file. A control file is a small binary file that records the physical structure of the
database and includes:

The database name

Names and locations of associated datafiles and online redo log files

The timestamp of the database creation

The current log sequence number

Checkpoint information
The control file must be available for writing by the Oracle database server whenever the database is open. Without
the control file, the database cannot be mounted and recovery is difficult.
The control file of an Oracle database is created at the same time as the database.
By default, at least one copy of the control file is created during database creation.
On some operating systems the default is to create multiple copies. You should create two or more copies of the
control file during database creation.
You might also need to create control files later, if you lose control files or want to change particular settings in the
control files.

show parameter control_files;

select name from V$controlfile;


Some useful commands for DBA.
select name from v$database;
select open_mode from v$database;
select sysdate from dual;
Create user user_name identified by password;
grant CREATE SESSION to user_name;
SELECT username FROM dba_users;

startup nomount;
alter database mount;
alter database open;
shut immediate;

You might also like