SlideShare a Scribd company logo
1 of 62
1
Data Guard Implementation
A Project Report
Submitted in partial fulfillment of the requirements
For the degree of
Master in Computer Applications
In
Computer Science & Engineering
By
Kashif
Under the supervision of
(Mrs. Taniya Sharma)
Assistant Professor
(Department of Computer Science Engineering)
Shobhit University, Gangoh
School of Engineering & Technology
Department of Computer Science Engineering
Shobhit University, Gangoh
(2022)
2
SHOBHIT UNIVERSITY, GANGOH
CANDIDATE’S DECLARATION
I hereby declare that the work which is being presented in the dissertation report
entitled “Data Guard Implementation” in partial fulfillment of the requirements for
the award of the Degree of Master in computer application and submitted in the
Department of Computer Science Engineering of the Shobhit University, Gangoh, is
an authentic record of my own work carried out during period from November 2020 to
June 2021 under the supervision of (Mrs. Taniya Sharma).
The matter presented in this internship report has not been submitted by me for
the award of any other degree of this or any other Institute.
Kashif
This is to certify that the above statement made by the candidate is correct to the best of
our knowledge.
Prof (Dr.) MahipalSingh
Dean
School of Engineering & Technology
Shobhit University, Gangoh, Saharanpur
Uttar Pradesh
Date: 9th of July 2022
3
ACKNOWLEDGEMENT
First of all, I owe a deep sense of gratitude to Almighty God who is all sources of
prevailing energy and my progenitors who provided me the perseverance, guidance,
inspiration, faith and strength to carry on even when the going got tough.
I am indebted to express my deep gratitude to all the respected faculty
members, Department of Computer Science Engineering, Shobhit University, Gangoh
for their valuable guidance during each and every phase of this work.
I take this opportunity to express a deep sense of gratitude towards my guide
Mrs. Tanya Sharma (Assistant Professor, Computer Science and Engineering), for
providing excellent guidance, encouragement and inspiration throughout the project
work. I really appreciate their insight into numerous aspects of numerical simulation,
their enthusiasm, wisdom, care and attention. I humbly acknowledge my life time
gratitude to him for managing to find time to have simulated technical discussions and
providing me proficient and expert guidance on the subject area that shaped
dissertation.
I owe thanks to Prof. (Dr.) Ranjit Singh, Vice Chancellor, Shobhit University,
Gangoh for his invaluable direction, encouragement and support and for providing me
all the necessary facilities for carrying out this work till its completion.
My deepest gratitude and sincere thanks to Prof (Dr.) Mahipal Singh, Dean,
School of Engineering and Technology, Registrar, Shobhit University, Gangoh, Prof
(Dr.) Varun Bansal, Head of Department, Computer Science & Engineering, Shobhit
University, Gangoh for their constant encouragement and moral support.
(Kashif)
4
ABSTRACT
Oracle Data Guard ensures high availability, data protection, and disaster recoveryfor
enterprise data. Data Guard provides a comprehensive set of servicesthat create, maintain,
manage, and monitor one or more standby databases to enable productionOracle databases
to survive disasters and data corruptions. DataGuard maintains these standby databases as
transactionallyconsistent copies of the productiondatabase. Then, if the production
database becomes unavailable because of a planned or an unplanned outage, Data Guard can
switch any standby database to the productionrole, minimizingthe downtime associated
with the outage. Data Guard can be used with traditional backup, restoration, andcluster
techniques to provide a high level of data protectionand data availability.
With Data Guard, administrators canoptionallyimprove productiondatabase performance
by offloadingresource-intensive backup and reportingoperations to standby systems.
Oracle Hot Standby, introducedinOracle version7.3, was marketedto the database
communityas a disaster recovery(DR) solution. In Oracle version7.3, many of today’s
automated processes hadto be programmed to deliver successful implementations of
disaster recovery using Oracle Hot Standby. Simple tasks such as transferringarchivelogs
had to be done manually by scriptingthe rcp/rshor ftpprocess. In Oracle 8i, the Hot
Standby product introducednew features suchas the managed recoveryprocess andread-
only mode for standby databases.
5
TABLE OF CONTENTS
Chapter Number Contents Page
Cover Page.........................................................................................................1
CANDIDATE’S DECLARATION...................................................................2
ACKNOWLEDGEMENT……………………………………………………. 3
ABSTRACT.........................................................................................................4
1 Overview of oracle architecture [ 6-12 ]
1.1 Oracle Instance
1.2 Background processes
1.3 Oracle datafiles
1.4Shared pool components
2. Data Guard architecture [13-16]
2.1 Types of standby
2.1.1 Primary process of data guard
3. Oracle Linux Installation [17-41]
3.1 New virtual machine creation
3.2 Name of Virtual Machine .
3.2.1 Create Partition
4. Oracle 19c Installation [42-49]
5. Oracle database creation and Standby configuration [49-60]
6. Output of Data guard configuration [61-62]
6
Overview
Orkacle Database Server Structures
Overview:-
The Oracle Server is an object relational database management system that provides an
open, comprehensive, integratedapproachto informationmanagement. Primary
Components There are several processes, memorystructures, and files inan Oracle Server;
however, not all of them are used when processingaSQL statement. Some are used to
improve the performance of the database, ensure that the database can be recoveredinthe
event of a software or hardware error, or perform other tasks necessaryto maintainthe
database. The Oracle Server consists of anOracle instance and an Oracle database.
Background Process
Memory Structures
7
Oracle Instance :
An Oracle instance is the combinationof the background processes andmemorystructures.
The instance must be startedto access the data in the database. Every time an instan ce is
started, a system global area (SGA) is allocatedand Oracle background processes are
started.The SGA is a memoryarea usedto store database informationthat is shared by
database processes.
System Global Area The SGA is a memoryarea usedto store database informationthat is
shared by database processes. It contains data and control informationfor the Oracle Server.
It is allocatedinthe virtual memoryof the computer where the Oracle server resides. The
SGA consists of several memorystructures:• The shared pool is used to store the most
recentlyexecutedSQL statements and the most recentlyuseddata from the data dictionary.
These SQL statements maybe submittedby a user process or, inthe case of stored
procedures, readfrom the data dictionary.
• The database buffer cache is used to store the most recentlyuse ddata. The data is read
from, and writtento, the data files.
• The redo log buffer is usedto trackchanges made to the database by the server and
background processes.
There are also two optional memorystructuresinthe SGA:
• Java pool: Usedto store Java code
• Large pool: Usedto store large memorystructures not directlyrelatedto SQL statement
processing;for example, data blocks copiedduring backup and restore operations
BackgroundProcesses:
The background processes inan instance perform commonfunctions that are needed to
service requests from concurrent users without compromising the integrity and performance of
the system. They consolidate functions that would otherwise be handled by multiple Oracle
programs running for each user. The background processes perform I/O and monitor other
Oracle processes to provide increased parallelism for better performance and reliability.
Depending on its configuration, an Oracle instance may include several background processes,
but every instance includes these five required background processes:
• Database Writer (DBWO) is responsible for writing changed data from the database buffer
cache to the data files.
• Log Writer (LGWR) writes changes registered in the redo log buffer to the redo log files.
• System Monitor (SMON) checks for consistency of the database and, if necessary, initiates
recovery of the database when the database is opened.
• Process Monitor (PMON) cleans up resources if one of the Oracle processes fails.
8
• The Checkpoint Process (CKPT) is responsible for updating database status information in
the control files and data files whenever changes in the buffer cache are permanently recorded
in the database.
Other Processes :
The user process is the application program that originates SQL statements. The server process
executes the SQL statements sent from the user process.
Database Files :
Database files are operating system files that provide the actual physical storage for database
information. The database files are used to ensure that the data is kept consistent and can be
recovered in the event of a failure of the instance.
Other Files :
Non database files are used to configure the instance, authenticate privileged users, and recover
the database in the event of a disk failure.
SQL Statement Processing :
The user and server processes are the primary processes involved when a SQL statement is
executed; however, other processes may help the server complete the processing of the SQL
statement.
Oracle Database Administrators:
Database administrators are responsible for maintaining the Oracle Server so that the server can
process user requests. An understanding of the Oracle architecture is necessary to maintain it
effectively.
Oracle Database Files :
An Oracle database is a collection of data that is treated as a unit. The general purpose of a
database is to store and retrieve related information. The database has a logical structure and a
physical structure. The physical structure of the database is the set of operating system files in
the database. An Oracle database consists of three file types:
Data files contain the actual data in the database. The data is stored in user-defined tables, but
data files also contain the data dictionary, before-images of modified data, indexes, and other
types of structures. A database has at least one data file. The characteristics of data files are:
A data file can be associated with only one database. Data files can have certain characteristics
set so they can automatically extend when the database runs out of space. One or more data files
form a logical unit of database storage called a table space. Redo logs contain a record of
changes made to the database to enable recovery of the data in case of failures. A database
requires at least two redo log files.
Control files contain information necessary to maintain and yen fy database integrity. For
example, a control file is used to identify the data files and redo log files. A database needs at
least one control file.
9
Other Key Files :
The Oracle Server also uses other files that are not part of the database:
• The parameter file defines the characteristics of an Oracle instance. For example, it parameters
that size some of the memory structures in the SGA.
• The password file authenticates which users are permitted to start up and shut down an Oracle
instance.
• Archived redo log files are offline copies of the redo log files that may be necessary to recover
from media failures.
Components Used to Process SQL:
Not all of the components of an Oracle instance are used to process SQL statements.The user
and server processes are used to connect a user to an Oracle instance. These processes are not
part of the Oracle instance, but are required to process a SQL statement. Some of the
background processes, SGA structures, and database files are used to process SQL statements.
Depending on the type of SQL statement, different components are used:
• Queries require additional processing to return rows to the user.
• Data manipulation language (DML) statements require additional processing to log the
changes made to the data.
• Commit processing ensures that the modified data in a transaction n can be recovered.
Some required background processes do not directly participate in processing a SQL statement
but are used to improve performance and to recover the database. The optional background
process, ARC0, is used to ensure that a production database can be recovered.
Connection :
A connection is a communication pathway between a user processes a and an Oracle Server. A
database user can connect to an Oracle Server in one of three ways:
• The user logs on to the operating system running the Oracle instance and starts an application
or tool that accesses the database on that system. The communication pathway is established
using the interprocess communication mechanisms available on the host operating system.
• The user starts the application or tool on a local computer and connects over a network to the
computer running the Oracle instance. In this configuration, called client-server, network
software is used to communicate between the user and the Oracle Server.
• In a three-tiered connection, the user ’ s computer communicates over the network to an
application or a network server, which is connected through a network to the mach ine running
the Oracle instance. For example, the user runs a browser on a network computer to use an
application residing on an NT server that retrieves data from an Oracle database running on a
UNIX host.
Session:
Session is a specific connection of a user to an Oracle Server. The session starts when the user is
validated by the Oracle Server, and it ends when the user logs out or when the ere is an
10
abnormal termination. For a given database user, many concurrent sessions are possible if the
user logs on from many tools, applications, or terminals at the same time. Except for some
specialized database administration tools, starting a database session requires that the Oracle
Server be available for use.
Shared Pool Components:
During the parse stage, the server process uses the area in the SGA known as the shared pool to
compile the statement. The shared pool has two primary components:
• Library cache
• Data dictionary cache
Library Cache : The library cache stores information about the most recently use d SQL
statements in a memory structure called shared SQL area.
The shared SQL area contains:
• The text of the SQL statement
• The parse tree: A compiled version of the statement
• The execution plan: The steps to be taken when executing the statement
Function of the Database Buffer Cache:
When a query is processed, the server process looks in the database buffer cache for any blocks
it needs. If the block is not found in the database buffer cache, the server process reads the block
from the data file and places a copy in the buffer cache. Because subsequent requests for the sa
me block may find the block in memory, the requests may not require physical reads. The
Oracle Server uses a least recently used algorithm to age out buffers that have not been accessed
recently to make room for new blocks in the buffer cache.
DMLProcessing:
Steps A data manipulation language (DML) statement requires only two phases of processing:
• Parse is the same as the parse phase used for processing a query
• Execute requires additional processing to make data changes DML Execute Phase to execute a
DML statement:
• If the data and rollback blocks are not already in the buffer cache, the server process reads
them from the data files into the buffer cache.
• The server process places locks on the rows that are to be modified.
• In the redo log buffer, the server process records the changes to be made to the rollback and
data.
11
• The rollback block changes record the values of the data before it is modified. The rollback
block is used to store the before image of the data, so that the DML statements can be rolled
back if necessary.
• The data blocks changes record the new values of the data.
Program Global Area Components:
A program global area (PGA) is a memory region that contains data and control information f
or a server process. It is a non shared memory created by Oracle when a server process is
started. Access to it is exclusive to that server process and is read and written only by the Oracle
Server code acting on behalf of it. The PGA memory allocated by each server process attached
to an Oracle instance is referred to as the aggregated PGA memory allocated by the instance.
In a dedicated server configuration, the PGA of the server includes these components:
• Sort area: Used for any sorts that may be required to process the SQL statement
• Session information: Includes user privileges and performance statistics for the session
• Cursor state: Indicates the stage in the processing of the SQL statements that are currently
used by the session.
Redo Log Buffer Characteristics:
The redo log buffer has the following characteristics:
• Its size in bytes is defined by the LOG_BUFFER parameter.
• It records the block that is changed, the location of the change, and the new value in a redo
entry. A redo entry makes no distinction between the type of block that is cha nged; it simply
records which bytes are changed in the block.
• The redo log buffer is used sequentially, and changes made by one transaction may be
interleaved with changes made by other transactions.
• It is a circular buffer that is reused after it is filled, but o nly after all the old redo entries are
recorded in the redo log files.
Rollback Segment:
Before making a change, the server process saves the old data va lue into a rollback segment.
This before image is used to:
• Undo the changes if the transaction is rolled back
• Provide read consistency by ensuring that other transactions do not see uncommitted changes
made by the DML statement
• Recover the database to a consistent state in case of failures.
12
Fast COMMIT:
The Oracle Server uses a fast commit mechanism that guarantees t hat the committed changes
can be recovered in case of instance failure.
LOG Writer:
LGWR performs sequential writes from the redo log buffer to the redo log file under the
following situations:
• When a transaction commits
• When the redo log buffer is one-third full
• When there is more than a megabyte of changes recorded in the redo log buffer
• Before DBW0 writes modified blocks in the database buffer cache to the data files.
13
Oracle Data guard Architecture
Oracle Data Guard ensures high availability, data protection, and disaster recovery for enterprise
data. Data Guard provides a comprehensive set of services that create, maintain, manage, and
monitor one or more standby databases to enable production Oracle databases to survive
disasters and data corruptions.
Dataguard maintains this standby as exact copy of primary database. So if , in any case your
primary database becomes unavailable we can switch standby database role to primary database
and we can minimize time and data loss.
With dataguard , We can even improve performance of primary database by offloading backups
or reporting tasks to standby database which are resource-intensive tasks.
Types of Standby Databases:
There are mainly three types of standby databases available.
1. Physical Standby Database: Physical Standby database is exact physical copy of primary
database; Disk structures are same. Data guard maintains physical standby database by applying
redo to the standby database.
With 11g onward physical standby database stays in open mode with read only access so we can use
it for query and reporting purpose.
14
2. Logical Standby Database : Logical Standby Database is logically identical copy of primary
database. Physical disk structures may differ here. Data guard maintains logical standby database by
applying sql to standby database.
We can use logical standby database for query and reporting purpose along with data protection.
Also you have to facility to upgrade oracle database software and patch sets along with data
protection with help of logical standby database.
3. Snapshot Standby Database : With Oracle 11g release 1 , a new type of standby database
introduced : a snapshot standby where physical standby database will be opened in read-write
mode temporarily. When a physical standby is converted into a snapshot standby , an implicit
guaranteed restore point is created for the standby database. Flashback database is used to facilitate
this functionality. When it is in snapshot standby mode , it still receives all redo data applied to
primary but that will not be applied to standby but it is archived into the archivelogs at the standby
database. And when it is converted back to a physical standby , all changes we have made to
snapshot standby while it was in read-write mode are discarded and all archive logs will applied
from the restore point ,making physical standby database transactionally consistent with primary
database.
How it works with Standby database configured: -
 LNS process of primary database captures redo from redo log buffer.
 Send it to RFS process of standby database through oracle net.
 RFS process then writes that redo information to standby redo log files.
 If LNS process is not fast enough to capture redo information before it goes to online redo
log files or if redo data are going online redo log files very quickly then LNS process will
read from Online redo log files and send redo to RFS process through Oracle net.
 If some network outage occur and online redo log gets log switch and data goes to archived
redo log files , before its been written to standby redo log files then RFS process will
directly communicate to ARCn process and works for Archive log gap resolution.
 Once with any possible way redo are written to standby redo log files then , MRP [in case of
physical dataguard] or LSP [in case of logical dataguard] process apply that redo or sql to
standby database.
 And as redo data is being applied on standby database , ARCn process of standby database
also generates archive logs.
15
Primary Database Processes for Data guard Environment:
1. LGWR : LGWR collects transaction redo information and updates online redo log files.
2.LNS process [Log writer network server]:LNS process works in two way.
1. SYNC mode : When you have configured your data guard environment in sync
Redo transport Service , LGWR passes redo to LNS process , which transfers data
directly to RFS process on the standby database. LGWR waits for confirmation from
the LNS process and LNS process waits confirmation from RFS process that redo
data are applied to standby database before acknowledging commit.
2. ASYNC : When you have configured async redo transport service, it is independent
of LNS process , whether LNS process have read from redo log buffer or from
online redo log files . Data guard just starts asynchronous LNS process , other than
that LGWR has no interaction with any asynchronous standby destinations. In
simple terms , data guard will not wait for any acknowledgement from standby
database that redo are applied or not and keeps on doing its work. So it is way faster
than sync mode .
3. ARCn Process :As we know ARCn process creates a copy of the online redo log files . ARCn is
also responsible for shipping redo data to an RFS process at a standby database and for pro-actively
detecting and resolving gaps on all standby database.
16
Standby Database Processes :
1. RFS [Remote File Server] : As we have seen above RFS process can get redo data either from
LNS process or from ARCn process of primary and RFS process can writes redo information to
standby redo logs files.
Each LNS and ARCn process that communicates with Standby database has its own RFS process.
2. ARCn [Archiver] : The ARCn process archives standby redo logs.
3. MRP [Managed Recovery Process] :In case of physical dataguard MRP process comes into
play. MRP process applies archived redo log information to the physical standby database. You can
start managed recovery using “ALTER DATABASE RECOVER MANAGED STANDBY
DATABASE” this foreground session performs recovery. And if you want to perform recovery on
background then you can optionally use DISCONNECT FROM SESSION. clause where MRP
background process will start .
If you use DG BROKER to manage your dataguard , it always starts MRP background process.
4. LSP [Logical Standby ]: It comes into play for logical dataguard only. It controls the application
of archived redo log information to the logical standby database. LSP process will transform redo
data into sql statements and then these sql statements will be applied to logical standby database.
17
Oracle Linux 8.3 Installation on VMware Workstation
 We required linux operating for implementing data guard so we will use VMware
workstation to install linux operating system .
 Before beginning i download the Full ISO image of Oracle Linux 8.3 from
yum.oracle.com
 First, open the VMware workstation and you will see a similar window as shown in the
image.
First, you need to click on Create a New Virtual Machine option and it will prompt you a
window to select from where you install. But for now, select the option I will install the
operating systemlater and click on Next.
18
From the second window, you need to select the type of guest you are going to
install and its version. Select Linux under Guest Operating System, its version as
Oracle Linux 8 64-bit, and click on Next.
19
Now you can give a name you prefer for your virtual machine. Here I have given
Oracle Linux. Next, you want to specify the location you are going to install the
VM. I recommend you specify a location except for the C drive if you have enough
storage capacity. I have given my location inside D drive. Then you can click on
Next.
20
In the next screen, you need to specify Disk Capacity. Oracle recommends 20GB
and I have given 100GB, but you can give disk capacity as your need. If you need
more later on you can add it. Next, you need to choose how the VM hard disk is
stored, I prefer the first option Store virtual disk as a single file. You can choose the
option you prefer and then click Next.
21
By clicking on next, you will see a similar window like this
If you need, you can click on Finish and then edit your VM settings. However, I am
not going to click on finish, I click on the Customize Hardware button. It will
prompt a new window as shown in the following figure.
22
Now you need to configure the amount of memory you are going to allocate for this
VM. I adjusted it to 4GB (4096 MB) size of memory. You can choose more memory
but keep in mind that not exceeds the RAM of your host machine.
23
Then click on the New CD/DVD (IDE) label on the left side of your window. Under
Connection on the right side, choose the option Use ISO image file. Then Browse
the location where your downloaded iso image file is located and select the image
file. After the configuration, your window will be similar to the following image.
24
Then click on the Processors label shown on the left side of the window.
Then adjust the Number of processor cores into two, you will see a similar
window as follows.
25
Next, you will be able to see a window as follows. If you can remember, I told you
that you can do the settings with Edit Virtual Machine Settings. Probably you will
see that option on the right bottom of the window. If you need to do some changes
again or clarify something, you can use that option. Since we have configured
everything that is required, we do not go back to it.
26
Instead of that let’s play the virtual machine by clicking on the Play Virtual
Machine option. Just by clicking on it, you cannot play around with VM. So, friend
you can have a small break here until it runs and complete some testing process.
27
28
After 100% completion of checking, it will prompt you a similar window as follows.
There you need to select your preferred language you want to use during installation.
By default it will come as US English, you may choose another one based on your
preference. Then click on Continue and it will go to the next step.
29
By clicking on continue, you will see another window to configure few other
important things. The window you get should be similar to the following image.
30
Let me first go to the Installation Destination under System. First, click on the
Installation Destination and it will display a similar window to the following image.
You are not required to configure anything here. Just click only the Custom option
under Storage Configuration as shown in the image. Because we are going to
customize from our end. Then click Done. Once you click on done it will ask you
what type of disk you want to add. You can choose as for your requirements. What
you select from the dropdown is depend on how you want to partition your disk. My
selection is LVM.
31
Now we can add mount points. Just click on the plus (+) sign on the left side of the
window and the first disk I am giving here for my root. I am giving 20GB size out
of 100GB for my root. Fill the prompted window as follows and click on Add
mount point.
32
33
Then you should be able to see a window like this and you will see the configurations
you did for root on the left side of the window.
34
We will choose another disk for the Oracle directory with 40GB size, which will be used in the
next step during Oracle 19c installation. I will discuss with next blog post. Click on the plus
(+) mark again, fill in the Mount Point and DesiredCapacity as shown in the image, and
click Add mount point.
35
You can see the remaining space on the left upper corner of the window. Until now, you may
have 39GB left. Let’s add 2GB for the /boot. That will be good enough to handle.
36
Now you are done with all the configurations under the Installation Destination. Your
window may be similar to the image shown below. Now you can click on Done.
37
You will be redirected again to the Installation Summary window and now you can
see Custom partitioning selected under Installation Destination. Previously it
was Automatic Partitioning with a warning if you can remember.
You will again come to the Installation Summary window and let’s create another
user with administrative privileges. Click on the User Creation and it will direct you
to another window to create a new user. I have given the user name as admin and you
can choose what you want. Then check on the check box Make this user
administrator, therefore we do not need to use root user always. Also, configure a
password and after the configurations, you can click on Done.
38
Next, you need to configure a password for the root user. Click on Root
Password and it will show you a similar window like this. Configure the root user
password that follows Oracle recommendations and click on Done.
39
40
So congratulations! Finally, you can click on Begin Installation. Once you click on Begin
Installation, it will take a couple of minutes and complete the installation process.
After a couple of minutes/seconds, it will show you a similar window for this with
the username of the administrative account you created. If you want to log in as that
user, click on the name and you will be asked to provide your Password and then
you can click on Sign In.
41
So congratulations friend. You have successfully installed Oracle Linux 8.3 and you
can play around with it
You can click on Activities and open a Terminal for executing your commands.
42
Install Oracle 19c database software
1. Hardware Requirement.
Oracle 19c installation, we have to requiredLinux 8 64 bit.
In my environment, we are using Linux 8
1
2
[root@localhost ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 8
2. Create Directory
Here we are creatingu01 and u02 directoryfor installation,
where /u01/app/oracle/product/19.0.0/dbhome_1 is the oraclehome
and /u02/oradata which used for datafile location(soonwill publish manual creation
of a database on 19c)
1
2
3
[root@localhost Packages]# mkdir -p/u01/app/oracle/product/19.0.0/dbhome_1
[root@localhost Packages]# mkdir -p/u02/oradata
3. Create the new groups and users
Below we are creatinggroups which is requiredat the time of installation
1
2
3
[root@localhost Packages]# groupadd -g 10052 oinstall
[root@localhost Packages]# groupadd -g 10054 dba
4. Change Ownershipandpermissions
we have to change the ownership and permissions of the directories so that oracle user can
read, write, and execute files.
1
2
3
[root@localhost Packages]# chown -R oracle:oinstall /u01 /u02
[root@localhost Packages]# chmod -R 775 /u01 /u02
5. Pre-requisites requiredfor oracleinstallation
Before moving forward toward installation, Belowpre-requisites requiredfor oracle19c.
[root@localhost Packages]# yum install -y oracle-database-preinstall-19c
Loaded plugins: langpacks, ulninfo
43
ol7_UEKR6 | 2.5
kB 00:00:00
ol8_latest | 2.7
kB 00:00:00
(1/3): ol8_latest/x86_64/group | 660
kB 00:00:07
(2/3): ol8_latest/x86_64/updateinfo | 3.1
MB 00:00:07
(3/3): ol8_latest/x86_64/primary_db | 30
MB 00:00:06
Resolving Dependencies
--> Running transaction check
---> Package oracle-database-preinstall-19c.x86_64 0:1.0-2.el8 will be
installed
--> Processing Dependency: ksh for package: oracle-database-preinstall-
19c-1.0-2.el8.x86_64
--> Running transaction check
---> Package ksh.x86_64 0:20120801-142.0.1.el8 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
=========================================================================
==============
Package Arch Version Repos
itory Size
=========================================================================
==============
Installing:
oracle-database-preinstall-19c x86_64 1.0-
2.el7 ol8_latest 19 k
Installing for dependencies:
ksh x86_64 20120801-
142.0.1.el7 ol7_latest 882 k
Installed:
oracle-database-preinstall-19c.x86_64 0:1.0-
2.el7
Dependency Installed:
ksh.x86_64 0:20120801-
142.0.1.el l8
Complete!
6. Unzip software
In the silent installation, you have to unzip the oracle binary directly under the ORACLE
HOME location.
unzip oracle binary under oracle home as below.
44
1
2
3
[oracle@localhost dbhome_1]$ cd /u01/app/oracle/product/19.0.0/dbhome_1/
[oracle@localhost dbhome_1]$ unzip LINUX.X64_193000_db_home.zip
7. Edit response file.
This response file is accustomed provide all the specified information for the installation, so no
additional user input is required.
]$ cat db_install.rsp
####################################################################
## Copyright(c) Oracle Corporation 1998,2019. All rights reserved.##
## ##
## Specify values for the variables listed below to customize ##
## your installation. ##
## ##
## Each variable is associated with a comment. The comment ##
## can help to populate the variables with the appropriate ##
## values. ##
## ##
## IMPORTANT NOTE: This file contains plain text passwords and ##
## should be secured to have read permission only by oracle user ##
## or db administrator who owns this installation. ##
## ##
####################################################################
#------------------------------------------------------------------------
------
# Do not change the following system generated value.
#------------------------------------------------------------------------
------
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_respo
nse_schema_v19.0.0
#------------------------------------------------------------------------
-------
# Specify the installation option.
# It can be one of the following:
# - INSTALL_DB_SWONLY
# - INSTALL_DB_AND_CONFIG
#------------------------------------------------------------------------
-------
oracle.install.option=INSTALL_DB_SWONLY
#------------------------------------------------------------------------
-------
# Specify the Unix group to be set for the inventory directory.
#------------------------------------------------------------------------
-------
45
UNIX_GROUP_NAME=oinstall
#------------------------------------------------------------------------
-------
# Specify the location which holds the inventory files.
# This is an optional parameter if installing on
# Windows based Operating System.
#------------------------------------------------------------------------
-------
INVENTORY_LOCATION=/u01/app/oraInventory
#------------------------------------------------------------------------
-------
# Specify the complete path of the Oracle Home.
#------------------------------------------------------------------------
-------
ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
#------------------------------------------------------------------------
-------
# Specify the complete path of the Oracle Base.
#------------------------------------------------------------------------
-------
ORACLE_BASE=/u01/app/oracle
#------------------------------------------------------------------------
-------
# Specify the installation edition of the component.
#
# The value should contain only one of these choices.
# - EE : Enterprise Edition
# - SE2 : Standard Edition 2
#------------------------------------------------------------------------
-------
oracle.install.db.InstallEdition=EE
#########################################################################
######
#
#
# PRIVILEGED OPERATING SYSTEM
GROUPS #
# ------------------------------------------
#
# Provide values for the OS groups to which SYSDBA and SYSOPER
privileges #
# needs to be granted. If the install is being performed as a member of
the #
# group "dba", then that will be used unless specified otherwise
below. #
46
#
#
# The value to be specified for OSDBA and OSOPER group is only for UNIX
based #
# Operating
System. #
#
#
#########################################################################
######
#------------------------------------------------------------------------
------
# The OSDBA_GROUP is the OS group which is to be granted SYSDBA
privileges.
#------------------------------------------------------------------------
-------
oracle.install.db.OSDBA_GROUP=oinstall
#------------------------------------------------------------------------
------
# The OSOPER_GROUP is the OS group which is to be granted SYSOPER
privileges.
# The value to be specified for OSOPER group is optional.
#------------------------------------------------------------------------
------
oracle.install.db.OSOPER_GROUP=oinstall
#------------------------------------------------------------------------
------
# The OSBACKUPDBA_GROUP is the OS group which is to be granted SYSBACKUP
privileges.
#------------------------------------------------------------------------
------
oracle.install.db.OSBACKUPDBA_GROUP=oinstall
#------------------------------------------------------------------------
------
# The OSDGDBA_GROUP is the OS group which is to be granted SYSDG
privileges.
#------------------------------------------------------------------------
------
oracle.install.db.OSDGDBA_GROUP=oinstall
#------------------------------------------------------------------------
------
# The OSKMDBA_GROUP is the OS group which is to be granted SYSKM
privileges.
#------------------------------------------------------------------------
------
oracle.install.db.OSKMDBA_GROUP=oinstall
47
#------------------------------------------------------------------------
------
# The OSRACDBA_GROUP is the OS group which is to be granted SYSRAC
privileges.
#------------------------------------------------------------------------
------
oracle.install.db.OSRACDBA_GROUP=oinstall
#########################################################################
#######
#
8. Execute pre-installationcommand
This stepwill perform aprerequisite that checks for the requiredcomponent for the
installation, if not, then we need to meet the requirement and move forward for installation.
Below command to verify the response file and dependent requirement.
1
2
3
4
[oracle@localhost dbhome_1]$ ./runInstaller -executePrereqs -silent -responseFile
/u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_install.rsp
Launching Oracle Database Setup Wizard…
Prerequisite checks executed successfully.
9. Install oracle 19cbinaryinsilent installation.
After satisfyingthe prerequisite, Nowwe are goodto go to install oracle 19c.
[oracle@localhost dbhome_1]$ ./runInstaller -silent -responseFile
/u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_install.rsp
Launching Oracle Database Setup Wizard...
The response file for this session can be found at:
/u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_-08-43PM.rsp
You can find the log of this install session at:
/tmp/InstallActions2020-11-07_01-08-43PM-08-43PM.log
As a root user, execute the following script(s):
1. /u01/app/oraInventory/orainstRoot.sh
2. /u01/app/oracle/product/19.0.0/dbhome_1/root.sh
Execute /u01/app/oraInventory/orainstRoot.sh on the following nodes:
[localhost]
48
Execute /u01/app/oracle/product/19.0.0/dbhome_1/root.sh on the following
nodes:
[localhost]
Successfully Setup Software.
10. Run the below script from the rootuser after installation.
1. /u01/app/oraInventory/orainstRoot.sh
2. /u01/app/oracle/product/19.0.0/dbhome_1/root.sh
[root@localhost tmp]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/19.0.0/dbhome_1
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Oracle Trace File Analyzer (TFA) is available at :
/u01/app/oracle/product/19.0.0/dbhome_1/bin/tfactl
12. Verify after installation.
After successful completionof the Oracle 19c installation, Now we are verifying oracle
binary was installedproperlyor not.
Run below command from oracle users.
[oracle@localhost install]$ . oraenv
ORACLE_SID = [test] ?
ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/19.0.0/dbhome_1/
The Oracle base remains unchanged with value /u01/app/oracle
OR
49
[oracle@localhost install]$ export
ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1/
[oracle@localhost install]$ export
PATH=/u01/app/oracle/product/19.0.0/dbhome_1/bin:$PATH
[oracle@localhost install]$ sqlplus -v
SQL*Plus: Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
[oracle@localhost install]$ sqlplus
SQL*Plus: Release 19.0.0.0.0 - Production on Tue June 1 13:33:26 2022
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Enter user-name:
[oracle@localhost install]$ which sqlplus
/u01/app/oracle/product/19.0.0/dbhome_1/bin/sqlplus
Manual database creation of and oracle 19c on Linux 8
Pre-requisite to creating a database:
1. Create require directories
Here we are creating require directories that are required to match exactly as pfile and database
creation command.
mkdir -p /u01/app/oracle/admin/canon/adump
mkdir -p /u02/oradata/canon/
mkdir -p /u01/app/oracle/fast_recovery_area
chmod 655 /u01/app/oracle/admin/canon/adump
chmod 655 /u02/oradata/canon/
chmod 655 /u01/app/oracle/fast_recovery_area
2. Pfile(init.ora) file
50
Whenever we start the instance, It will read the pfile(init.ora)/spfile andset the parameter
value which is mentionedin the file, and thenmount the instance accordingly.
Below are the example of pfile(init.ora) andthe same has beencreatedin default
location $ORACLE_HOME/dbs
*.audit_file_dest='/u01/app/oracle/admin/canon/adump'
*.audit_sys_operations=TRUE
*.audit_trail='db'
*.compatible='19.3.0.0.0'
*.control_files='/u02/oradata/canon/control01.ctl','/u01/app/oracle/contr
ol02.ctl'
*.db_block_size=8192
*.db_domain='localdomain'
*.db_name='CANON'
*.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=4560m
*.diagnostic_dest='/u01/app/oracle'
*.log_archive_format='%t_%s_%r.arc'
*.memory_max_target=754974720
*.memory_target=754974720
*.open_cursors=300
*.os_roles=FALSE
*.processes=300
*.recyclebin='OFF'
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
3. Create a database creationscript
In the database create a script, we are going to specifythe datafile ,redo logfiles, tempfiles,
and undo tablespace.
Below is the database creationscript andmade one SQL file dbcreate.sql.
CREATE DATABASE canon
USER SYS IDENTIFIED BY manager
USER SYSTEM IDENTIFIED BY manager
LOGFILE GROUP 1 ('/u02/oradata/test/redo01.log') SIZE 50M,
GROUP 2 ('/u02/oradata/canon/redo02.log') SIZE 50M,
GROUP 3 ('/u02/oradata/canon/redo03.log') SIZE 50M
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 50
MAXDATAFILES 100
MAXINSTANCES 1
DATAFILE '/u02/oradata/canon/system01.dbf' SIZE 100M autoextend on
SYSAUX DATAFILE '/u02/oradata/canon/sysaux01.dbf' SIZE 100M autoextend on
DEFAULT TABLESPACE users datafile '/u02/oradata/canon/users01.dbf' size
100m autoextend on
51
DEFAULT TEMPORARY TABLESPACE temp
TEMPFILE '/u02/oradata/canon/temp01.dbf' SIZE 50m
UNDO TABLESPACE undotbs1
DATAFILE '/u02/oradata/canon/undotbs01.dbf'
SIZE 200M;
Step-4:- Start database
Here we are startingthe database in the nomount stage from pfile that we createdinpre-
requisite
[oracle@localhost ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Jun 01 02:27:08 2022
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup nomount
ORACLE instance started.
Total System Global Area 754971128 bytes
Fixed Size 8901112 bytes
Variable Size 478150656 bytes
Database Buffers 264241152 bytes
Redo Buffers 3678208 bytes
Step-5:- Create database
After starting the database in nomount mode, Now we run dbcreate.sql to create the database.
SQL> set echo on
SQL> @dbcreate.sql
SQL> CREATE DATABASE test
2 USER SYS IDENTIFIED BY manager
3 USER SYSTEM IDENTIFIED BY manager
4 LOGFILE GROUP 1 ('/u02/oradata/test/redo01.log') SIZE 50M,
5 GROUP 2 ('/u02/oradata/test/redo02.log') SIZE 50M,
6 GROUP 3 ('/u02/oradata/test/redo03.log') SIZE 50M
7 MAXLOGFILES 5
8 MAXLOGMEMBERS 5
9 MAXLOGHISTORY 50
10 MAXDATAFILES 100
11 MAXINSTANCES 1
52
12 DATAFILE '/u02/oradata/test/system01.dbf' SIZE 100M autoextend on
13 SYSAUX DATAFILE '/u02/oradata/test/sysaux01.dbf' SIZE 100M
autoextend on
14 DEFAULT TABLESPACE users datafile '/u02/oradata/test/users01.dbf'
size 100m autoextend on
DEFAULT TEMPORARY TABLESPACE temp 15 TEMPFILE /oradata/test/temp01.dbf'
SIZE 50m
16 UNDO TABLESPACE undotbs1
17 DATAFILE '/u02/oradata/test/undotbs01.dbf'
18 SIZE 200M;
Database created.
Step6:- Verify.
After completion of the database creation script in step3, Now we have to verify the database is
ready for use.
SQL> select name,open_mode from v$database;
NAME OPEN_MODE
--------- --------------------
CANON READ WRITE
SQL> select instance_name,status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
canon OPEN
PostSteps
Step1:- PostScripts.
Below post scripts createdatabase data dictionaryviews which is require 100% database
functional.
catalog.sql
catproc.sql
pupbld.sql
53
SQL> @$ORACLE_HOME/rdbms/admin/catalog.sql
Session altered.
SQL> @$ORACLE_HOME/rdbms/admin/catproc.sql
Session altered.
SQL>$ORACLE_HOME/sqlplus/admin/pupbld.sql
Session altered.
Step2:- Passwordfile (orapwd)
Create a password file under ($ORACLE_HOME/dbs)
oracle@localhost u02]$ cd $ORACLE_HOME/dbs
[oracle@localhost dbs]$ orapwd file=orapwdcanon password=canon123 force=y
entries=10
[oracle@localhost dbs]$ pwd
/u01/app/oracle/product/19.0.0/dbhome_1/dbs
[oracle@localhost dbs]$ ls -lrt orapwdtest
-rw-r-----. 1 oracle oinstall 6144 Jun 01 09:29 orapwdtest
Now database ready for transactions
SQL> select name,open_mode from v$database;
NAME OPEN_MODE
--------- --------------------
CANON READ WRITE
54
Oracle Data Guard Configuration
Data Guard is used for disaster recovery and high availability. Due to any disaster, if our
PRIMARY database got crash so, in that case, our STANDBY may become our PRIMARY
database.
COMPONENTS
PRIMARY
DATABASE
STANDBY
DATABASE
Server IP 182.95.248.179 182.94.96.142
Server Name GCPLINDEL2ORA06 GCPLINDEL2ORA02
DB Unique
Name CANON CANON_STANDBY
Assumptions
 You have two servers (physical or VMs) with an operatingsystem and Oracle
installedon them. In this case I've used Oracle Linux 7.6 and Oracle Database 19c.
 The primary server (ol8-19-dg1.locadomain) has a running instance.
 The standby server (ol8-19-dg2.locadomain) has a software only installation.
 There is nothing blocking communicationbetweenthe machines over the listener
ports. If you are using the default 1521 port, node 1 shouldbe able to communicate
to node 2 on 1521 and node 2 should be able communicate with node 1 on 1521.
Check network and local firewalls are not blockingthe communication.
Primary Server Setup:-
Check that the primary database is in archivelog mode.
select log_mode from v$database;
LOG_MODE
------------
NOARCHIVELOG
SQL>
If it is noarchivelog mode, switch is to archivelog mode.
shutdown immediate;
55
startup mount;
alter database archivelog;
alter database open;
Enabled forced logging by issuing the following command.
alter database force logging;
-- Make sure at least one logfile is present.
alter system switch logfile;
Create standby redo logs onthe primary database (in case of switchovers). The standby redo
logs should be at least as big as the largest online redo logand there shouldbe one extra
group per threadcomparedthe online redo logs. In my case, the followingstandby redo logs
must be createdonbothservers.
alter database add standby logfile thread 1 group 10 size 50m;
alter database add standby logfile thread 1 group 11 size 50m;
alter database add standby logfile thread 1 group 12 size 50m;
alter database add standby logfile thread 1 group 13 size 50m;
alter database add standby logfile thread 1 group 10
('/u01/oradata/cdb1/standby_redo01.log') size 50m;
alter database add standby logfile thread 1 group 11
('/u01/oradata/cdb1/standby_redo02.log') size 50m;
alter database add standby logfile thread 1 group 12
('/u01/oradata/cdb1/standby_redo03.log') size 50m;
alter database add standby logfile thread 1 group 13
('/u01/oradata/cdb1/standby_redo04.log') size 50m;
Initialization Parameters
Check the settingfor the DB_NAME and DB_UNIQUE_NAME parameters. In this case
they are both set to "canon" on the primary database.
SQL> show parameter db_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_name string CANON
SQL> show parameter db_unique_name
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_unique_name string canon
SQL>SQL> alter system set log_archive_config='dg_config=(canon,canon_stanby)';
SQL> alter system set log_archive_dest_2='service=ocp_dr noaffirm async
valid_for=(online_logfiles,primary_role) db_unique_name=canon_stanby';
56
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE; SQL> ALTER SYSTEM SET
FAL_SERVER=canon_stanby;
Make sure the STANDBY_FILE_MANAGEMENT parameter is set.
alter system set standby_file_management=auto;
Network Service Setupfor database communication
Entries for the primary and standby databases are needed in the
"$ORACLE_HOME/network/admin/tnsnames.ora" files onboth servers. You can create
these using the Network ConfigurationUtility(netca) or manually. The followingentries
were usedduring this setup. Notice the use of the SID, rather than the SERVICE_NAME in
the entries. This is important as the broker will needto connect to the databases when they
are down, so the services will not be present.
canon =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 182.95.248.179)(PORT = 1521))
)
(CONNECT_DATA =
(SID = canon)
)
)
Canon_standby =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = 182.94.96.142)(PORT = 1521))
)
(CONNECT_DATA =
(SID = canon)
)
)
ListenerConfiguration
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 182.95.248.179)(PORT = 1521))
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
)
)
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = canon_DGMGRL)
57
(ORACLE_HOME = /u01/app/oracle/product/19.0.0/db_1)
(SID_NAME = canon)
(ENVS="TNS_ADMIN=/u01/app/oracle/product/19.0.0/db_1/network/admin")
)
)
ADR_BASE_LISTENER = /u01/app/oracle
lsnrctl stop
lsnrctl start
58
Standby Server Setup
Create the necessary directories on the standby server.
mkdir -p /u01/app/oracle/oradata/canon/pdbseed
mkdir -p /u01/app/oracle/oradata/canon/pdb1
mkdir -p /u01/app/oracle/fast_recovery_area/canon
mkdir -p /u01/app/oracle/admin/canon/adump
Create a password file, with the SYS password matching that of the primary database.
$ orapwd file=/u01/app/oracle/product/19.0.0/db_1/dbs/orapwcanon
password=Password1 entries=10
Create Standby Using DUPLICATE
Start the auxiliary instance onthe standby server by startingit using the temporary"init.ora"
file.
$ export ORACLE_SID=canon
$ sqlplus / as sysdba
SQL> STARTUP NOMOUNT PFILE='/tmp/initcanon_stby.ora';
Connect to RMAN, specifying a full connect string for both the TARGET and AUXILIARY
instances. Do not attempt to use OS authentication.
$ rman TARGET sys/Password1@canon AUXILIARY sys/Password1@canon_standby
Now issue the following DUPLICATE command.
duplicate target database
for standby
from active database
dorecover
spfile
set db_unique_name='cdb1_stby' COMMENT 'Is standby'
nofilenamecheck;
59
If you need to convert file locations, or alter any initialisation parameters, you can do
this during the DUPLICATE using the SET command.
duplicate target database
for standby
from active database
dorecover
spfile
set db_unique_name='canon_standby' COMMENT 'Is standby'
set
db_file_name_convert='/original/directory/path1/','/new/directory/path1/','/orig
inal/directory/path2/','/new/directory/path2/'
set
log_file_name_convert='/original/directory/path1/','/new/directory/path1/','/ori
ginal/directory/path2/','/new/directory/path2/'
set job_queue_processes='0'
nofilenamecheck;
After completed restorationneed to verify standby database sync or not with
primary database: -
Execute Below Query for verify:-
SELECT ARCH.THREAD# "Thread",ARCH.SEQUENCE# "Last Sequence Received", APPL.SEQUENCE#
"Last Sequence Applied", (ARCH.SEQUENCE# - APPL.SEQUENCE#) "Difference"
FROM
(SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIM E ) IN
(SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH,
(SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN
(SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL
WHERE ARCH.THREAD# = APPL.THREAD# ORDER BY 1;
60
61
Output :-
We are going to create table onPrimarydatabase side: -
CREATE TABLE sales (
customer_id NUMBER,
product_id NUMBER,
order_date DATE NOT NULL,
total NUMBER(9,2) DEFAULT 0 NOT NULL,
PRIMARY KEY(customer_id,
product_id,
order_date)
);
Now we will insert some records insales table
insert into sales values (1,786,sysdate,1000);
62
Now we willverifydata that createdtable replicatedor not onstandby side
We have checkeddata usefullyreplicatedonstandby side it means dataguard
configurationsuccessfullycompleted

More Related Content

Similar to Data Gaurd Final Thesis for University in Progress (2).docx

Phase 1 Documentation (Added System Req)
Phase 1 Documentation (Added System Req)Phase 1 Documentation (Added System Req)
Phase 1 Documentation (Added System Req)Reinier Eiman
 
Towards an Infrastructure for Enabling Systematic Development and Research of...
Towards an Infrastructure for Enabling Systematic Development and Research of...Towards an Infrastructure for Enabling Systematic Development and Research of...
Towards an Infrastructure for Enabling Systematic Development and Research of...Rafael Ferreira da Silva
 
FOISDBA-Ver1.1.pptx
FOISDBA-Ver1.1.pptxFOISDBA-Ver1.1.pptx
FOISDBA-Ver1.1.pptxssuser20fcbe
 
IBM-TGMC e-learning resource locator_project report
IBM-TGMC e-learning resource locator_project reportIBM-TGMC e-learning resource locator_project report
IBM-TGMC e-learning resource locator_project reportVeeru Kallapur
 
An Overview of VIEW
An Overview of VIEWAn Overview of VIEW
An Overview of VIEWShiyong Lu
 
Ogce Workflow Suite
Ogce Workflow SuiteOgce Workflow Suite
Ogce Workflow Suitesmarru
 
Performance tesing coding standards & best practice guidelines v1
Performance tesing coding standards & best practice guidelines v1Performance tesing coding standards & best practice guidelines v1
Performance tesing coding standards & best practice guidelines v1Argos
 
Methodology for Optimizing Storage on Cloud Using Authorized De-Duplication –...
Methodology for Optimizing Storage on Cloud Using Authorized De-Duplication –...Methodology for Optimizing Storage on Cloud Using Authorized De-Duplication –...
Methodology for Optimizing Storage on Cloud Using Authorized De-Duplication –...IRJET Journal
 
Advanced Research Computing at York
Advanced Research Computing at YorkAdvanced Research Computing at York
Advanced Research Computing at YorkMing Li
 
CONSULTANT ANALYSIS FOR MEDICAL FACILITY2CONSULTANT ANALYSIS FO.docx
CONSULTANT ANALYSIS FOR MEDICAL FACILITY2CONSULTANT ANALYSIS FO.docxCONSULTANT ANALYSIS FOR MEDICAL FACILITY2CONSULTANT ANALYSIS FO.docx
CONSULTANT ANALYSIS FOR MEDICAL FACILITY2CONSULTANT ANALYSIS FO.docxdonnajames55
 
Proactive ops for container orchestration environments
Proactive ops for container orchestration environmentsProactive ops for container orchestration environments
Proactive ops for container orchestration environmentsDocker, Inc.
 
High Volume Payments using Mule
High Volume Payments using MuleHigh Volume Payments using Mule
High Volume Payments using MuleAdhish Pendharkar
 
A Comparative Study of Forward and Reverse Engineering
A Comparative Study of Forward and Reverse EngineeringA Comparative Study of Forward and Reverse Engineering
A Comparative Study of Forward and Reverse Engineeringijsrd.com
 

Similar to Data Gaurd Final Thesis for University in Progress (2).docx (20)

Phase 1 Documentation (Added System Req)
Phase 1 Documentation (Added System Req)Phase 1 Documentation (Added System Req)
Phase 1 Documentation (Added System Req)
 
Towards an Infrastructure for Enabling Systematic Development and Research of...
Towards an Infrastructure for Enabling Systematic Development and Research of...Towards an Infrastructure for Enabling Systematic Development and Research of...
Towards an Infrastructure for Enabling Systematic Development and Research of...
 
FOISDBA-Ver1.1.pptx
FOISDBA-Ver1.1.pptxFOISDBA-Ver1.1.pptx
FOISDBA-Ver1.1.pptx
 
Report final
Report finalReport final
Report final
 
IBM-TGMC e-learning resource locator_project report
IBM-TGMC e-learning resource locator_project reportIBM-TGMC e-learning resource locator_project report
IBM-TGMC e-learning resource locator_project report
 
An Overview of VIEW
An Overview of VIEWAn Overview of VIEW
An Overview of VIEW
 
Computers in management
Computers in managementComputers in management
Computers in management
 
Process Basics.ppt
Process Basics.pptProcess Basics.ppt
Process Basics.ppt
 
20120140506012
2012014050601220120140506012
20120140506012
 
20120140506012
2012014050601220120140506012
20120140506012
 
Ogce Workflow Suite
Ogce Workflow SuiteOgce Workflow Suite
Ogce Workflow Suite
 
Patrick_Rebrook_Resume
Patrick_Rebrook_ResumePatrick_Rebrook_Resume
Patrick_Rebrook_Resume
 
Performance tesing coding standards & best practice guidelines v1
Performance tesing coding standards & best practice guidelines v1Performance tesing coding standards & best practice guidelines v1
Performance tesing coding standards & best practice guidelines v1
 
Methodology for Optimizing Storage on Cloud Using Authorized De-Duplication –...
Methodology for Optimizing Storage on Cloud Using Authorized De-Duplication –...Methodology for Optimizing Storage on Cloud Using Authorized De-Duplication –...
Methodology for Optimizing Storage on Cloud Using Authorized De-Duplication –...
 
Introduction
IntroductionIntroduction
Introduction
 
Advanced Research Computing at York
Advanced Research Computing at YorkAdvanced Research Computing at York
Advanced Research Computing at York
 
CONSULTANT ANALYSIS FOR MEDICAL FACILITY2CONSULTANT ANALYSIS FO.docx
CONSULTANT ANALYSIS FOR MEDICAL FACILITY2CONSULTANT ANALYSIS FO.docxCONSULTANT ANALYSIS FOR MEDICAL FACILITY2CONSULTANT ANALYSIS FO.docx
CONSULTANT ANALYSIS FOR MEDICAL FACILITY2CONSULTANT ANALYSIS FO.docx
 
Proactive ops for container orchestration environments
Proactive ops for container orchestration environmentsProactive ops for container orchestration environments
Proactive ops for container orchestration environments
 
High Volume Payments using Mule
High Volume Payments using MuleHigh Volume Payments using Mule
High Volume Payments using Mule
 
A Comparative Study of Forward and Reverse Engineering
A Comparative Study of Forward and Reverse EngineeringA Comparative Study of Forward and Reverse Engineering
A Comparative Study of Forward and Reverse Engineering
 

Recently uploaded

History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxsocialsciencegdgrohi
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 

Recently uploaded (20)

History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptxHistory Class XII Ch. 3 Kinship, Caste and Class (1).pptx
History Class XII Ch. 3 Kinship, Caste and Class (1).pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 

Data Gaurd Final Thesis for University in Progress (2).docx

  • 1. 1 Data Guard Implementation A Project Report Submitted in partial fulfillment of the requirements For the degree of Master in Computer Applications In Computer Science & Engineering By Kashif Under the supervision of (Mrs. Taniya Sharma) Assistant Professor (Department of Computer Science Engineering) Shobhit University, Gangoh School of Engineering & Technology Department of Computer Science Engineering Shobhit University, Gangoh (2022)
  • 2. 2 SHOBHIT UNIVERSITY, GANGOH CANDIDATE’S DECLARATION I hereby declare that the work which is being presented in the dissertation report entitled “Data Guard Implementation” in partial fulfillment of the requirements for the award of the Degree of Master in computer application and submitted in the Department of Computer Science Engineering of the Shobhit University, Gangoh, is an authentic record of my own work carried out during period from November 2020 to June 2021 under the supervision of (Mrs. Taniya Sharma). The matter presented in this internship report has not been submitted by me for the award of any other degree of this or any other Institute. Kashif This is to certify that the above statement made by the candidate is correct to the best of our knowledge. Prof (Dr.) MahipalSingh Dean School of Engineering & Technology Shobhit University, Gangoh, Saharanpur Uttar Pradesh Date: 9th of July 2022
  • 3. 3 ACKNOWLEDGEMENT First of all, I owe a deep sense of gratitude to Almighty God who is all sources of prevailing energy and my progenitors who provided me the perseverance, guidance, inspiration, faith and strength to carry on even when the going got tough. I am indebted to express my deep gratitude to all the respected faculty members, Department of Computer Science Engineering, Shobhit University, Gangoh for their valuable guidance during each and every phase of this work. I take this opportunity to express a deep sense of gratitude towards my guide Mrs. Tanya Sharma (Assistant Professor, Computer Science and Engineering), for providing excellent guidance, encouragement and inspiration throughout the project work. I really appreciate their insight into numerous aspects of numerical simulation, their enthusiasm, wisdom, care and attention. I humbly acknowledge my life time gratitude to him for managing to find time to have simulated technical discussions and providing me proficient and expert guidance on the subject area that shaped dissertation. I owe thanks to Prof. (Dr.) Ranjit Singh, Vice Chancellor, Shobhit University, Gangoh for his invaluable direction, encouragement and support and for providing me all the necessary facilities for carrying out this work till its completion. My deepest gratitude and sincere thanks to Prof (Dr.) Mahipal Singh, Dean, School of Engineering and Technology, Registrar, Shobhit University, Gangoh, Prof (Dr.) Varun Bansal, Head of Department, Computer Science & Engineering, Shobhit University, Gangoh for their constant encouragement and moral support. (Kashif)
  • 4. 4 ABSTRACT Oracle Data Guard ensures high availability, data protection, and disaster recoveryfor enterprise data. Data Guard provides a comprehensive set of servicesthat create, maintain, manage, and monitor one or more standby databases to enable productionOracle databases to survive disasters and data corruptions. DataGuard maintains these standby databases as transactionallyconsistent copies of the productiondatabase. Then, if the production database becomes unavailable because of a planned or an unplanned outage, Data Guard can switch any standby database to the productionrole, minimizingthe downtime associated with the outage. Data Guard can be used with traditional backup, restoration, andcluster techniques to provide a high level of data protectionand data availability. With Data Guard, administrators canoptionallyimprove productiondatabase performance by offloadingresource-intensive backup and reportingoperations to standby systems. Oracle Hot Standby, introducedinOracle version7.3, was marketedto the database communityas a disaster recovery(DR) solution. In Oracle version7.3, many of today’s automated processes hadto be programmed to deliver successful implementations of disaster recovery using Oracle Hot Standby. Simple tasks such as transferringarchivelogs had to be done manually by scriptingthe rcp/rshor ftpprocess. In Oracle 8i, the Hot Standby product introducednew features suchas the managed recoveryprocess andread- only mode for standby databases.
  • 5. 5 TABLE OF CONTENTS Chapter Number Contents Page Cover Page.........................................................................................................1 CANDIDATE’S DECLARATION...................................................................2 ACKNOWLEDGEMENT……………………………………………………. 3 ABSTRACT.........................................................................................................4 1 Overview of oracle architecture [ 6-12 ] 1.1 Oracle Instance 1.2 Background processes 1.3 Oracle datafiles 1.4Shared pool components 2. Data Guard architecture [13-16] 2.1 Types of standby 2.1.1 Primary process of data guard 3. Oracle Linux Installation [17-41] 3.1 New virtual machine creation 3.2 Name of Virtual Machine . 3.2.1 Create Partition 4. Oracle 19c Installation [42-49] 5. Oracle database creation and Standby configuration [49-60] 6. Output of Data guard configuration [61-62]
  • 6. 6 Overview Orkacle Database Server Structures Overview:- The Oracle Server is an object relational database management system that provides an open, comprehensive, integratedapproachto informationmanagement. Primary Components There are several processes, memorystructures, and files inan Oracle Server; however, not all of them are used when processingaSQL statement. Some are used to improve the performance of the database, ensure that the database can be recoveredinthe event of a software or hardware error, or perform other tasks necessaryto maintainthe database. The Oracle Server consists of anOracle instance and an Oracle database. Background Process Memory Structures
  • 7. 7 Oracle Instance : An Oracle instance is the combinationof the background processes andmemorystructures. The instance must be startedto access the data in the database. Every time an instan ce is started, a system global area (SGA) is allocatedand Oracle background processes are started.The SGA is a memoryarea usedto store database informationthat is shared by database processes. System Global Area The SGA is a memoryarea usedto store database informationthat is shared by database processes. It contains data and control informationfor the Oracle Server. It is allocatedinthe virtual memoryof the computer where the Oracle server resides. The SGA consists of several memorystructures:• The shared pool is used to store the most recentlyexecutedSQL statements and the most recentlyuseddata from the data dictionary. These SQL statements maybe submittedby a user process or, inthe case of stored procedures, readfrom the data dictionary. • The database buffer cache is used to store the most recentlyuse ddata. The data is read from, and writtento, the data files. • The redo log buffer is usedto trackchanges made to the database by the server and background processes. There are also two optional memorystructuresinthe SGA: • Java pool: Usedto store Java code • Large pool: Usedto store large memorystructures not directlyrelatedto SQL statement processing;for example, data blocks copiedduring backup and restore operations BackgroundProcesses: The background processes inan instance perform commonfunctions that are needed to service requests from concurrent users without compromising the integrity and performance of the system. They consolidate functions that would otherwise be handled by multiple Oracle programs running for each user. The background processes perform I/O and monitor other Oracle processes to provide increased parallelism for better performance and reliability. Depending on its configuration, an Oracle instance may include several background processes, but every instance includes these five required background processes: • Database Writer (DBWO) is responsible for writing changed data from the database buffer cache to the data files. • Log Writer (LGWR) writes changes registered in the redo log buffer to the redo log files. • System Monitor (SMON) checks for consistency of the database and, if necessary, initiates recovery of the database when the database is opened. • Process Monitor (PMON) cleans up resources if one of the Oracle processes fails.
  • 8. 8 • The Checkpoint Process (CKPT) is responsible for updating database status information in the control files and data files whenever changes in the buffer cache are permanently recorded in the database. Other Processes : The user process is the application program that originates SQL statements. The server process executes the SQL statements sent from the user process. Database Files : Database files are operating system files that provide the actual physical storage for database information. The database files are used to ensure that the data is kept consistent and can be recovered in the event of a failure of the instance. Other Files : Non database files are used to configure the instance, authenticate privileged users, and recover the database in the event of a disk failure. SQL Statement Processing : The user and server processes are the primary processes involved when a SQL statement is executed; however, other processes may help the server complete the processing of the SQL statement. Oracle Database Administrators: Database administrators are responsible for maintaining the Oracle Server so that the server can process user requests. An understanding of the Oracle architecture is necessary to maintain it effectively. Oracle Database Files : An Oracle database is a collection of data that is treated as a unit. The general purpose of a database is to store and retrieve related information. The database has a logical structure and a physical structure. The physical structure of the database is the set of operating system files in the database. An Oracle database consists of three file types: Data files contain the actual data in the database. The data is stored in user-defined tables, but data files also contain the data dictionary, before-images of modified data, indexes, and other types of structures. A database has at least one data file. The characteristics of data files are: A data file can be associated with only one database. Data files can have certain characteristics set so they can automatically extend when the database runs out of space. One or more data files form a logical unit of database storage called a table space. Redo logs contain a record of changes made to the database to enable recovery of the data in case of failures. A database requires at least two redo log files. Control files contain information necessary to maintain and yen fy database integrity. For example, a control file is used to identify the data files and redo log files. A database needs at least one control file.
  • 9. 9 Other Key Files : The Oracle Server also uses other files that are not part of the database: • The parameter file defines the characteristics of an Oracle instance. For example, it parameters that size some of the memory structures in the SGA. • The password file authenticates which users are permitted to start up and shut down an Oracle instance. • Archived redo log files are offline copies of the redo log files that may be necessary to recover from media failures. Components Used to Process SQL: Not all of the components of an Oracle instance are used to process SQL statements.The user and server processes are used to connect a user to an Oracle instance. These processes are not part of the Oracle instance, but are required to process a SQL statement. Some of the background processes, SGA structures, and database files are used to process SQL statements. Depending on the type of SQL statement, different components are used: • Queries require additional processing to return rows to the user. • Data manipulation language (DML) statements require additional processing to log the changes made to the data. • Commit processing ensures that the modified data in a transaction n can be recovered. Some required background processes do not directly participate in processing a SQL statement but are used to improve performance and to recover the database. The optional background process, ARC0, is used to ensure that a production database can be recovered. Connection : A connection is a communication pathway between a user processes a and an Oracle Server. A database user can connect to an Oracle Server in one of three ways: • The user logs on to the operating system running the Oracle instance and starts an application or tool that accesses the database on that system. The communication pathway is established using the interprocess communication mechanisms available on the host operating system. • The user starts the application or tool on a local computer and connects over a network to the computer running the Oracle instance. In this configuration, called client-server, network software is used to communicate between the user and the Oracle Server. • In a three-tiered connection, the user ’ s computer communicates over the network to an application or a network server, which is connected through a network to the mach ine running the Oracle instance. For example, the user runs a browser on a network computer to use an application residing on an NT server that retrieves data from an Oracle database running on a UNIX host. Session: Session is a specific connection of a user to an Oracle Server. The session starts when the user is validated by the Oracle Server, and it ends when the user logs out or when the ere is an
  • 10. 10 abnormal termination. For a given database user, many concurrent sessions are possible if the user logs on from many tools, applications, or terminals at the same time. Except for some specialized database administration tools, starting a database session requires that the Oracle Server be available for use. Shared Pool Components: During the parse stage, the server process uses the area in the SGA known as the shared pool to compile the statement. The shared pool has two primary components: • Library cache • Data dictionary cache Library Cache : The library cache stores information about the most recently use d SQL statements in a memory structure called shared SQL area. The shared SQL area contains: • The text of the SQL statement • The parse tree: A compiled version of the statement • The execution plan: The steps to be taken when executing the statement Function of the Database Buffer Cache: When a query is processed, the server process looks in the database buffer cache for any blocks it needs. If the block is not found in the database buffer cache, the server process reads the block from the data file and places a copy in the buffer cache. Because subsequent requests for the sa me block may find the block in memory, the requests may not require physical reads. The Oracle Server uses a least recently used algorithm to age out buffers that have not been accessed recently to make room for new blocks in the buffer cache. DMLProcessing: Steps A data manipulation language (DML) statement requires only two phases of processing: • Parse is the same as the parse phase used for processing a query • Execute requires additional processing to make data changes DML Execute Phase to execute a DML statement: • If the data and rollback blocks are not already in the buffer cache, the server process reads them from the data files into the buffer cache. • The server process places locks on the rows that are to be modified. • In the redo log buffer, the server process records the changes to be made to the rollback and data.
  • 11. 11 • The rollback block changes record the values of the data before it is modified. The rollback block is used to store the before image of the data, so that the DML statements can be rolled back if necessary. • The data blocks changes record the new values of the data. Program Global Area Components: A program global area (PGA) is a memory region that contains data and control information f or a server process. It is a non shared memory created by Oracle when a server process is started. Access to it is exclusive to that server process and is read and written only by the Oracle Server code acting on behalf of it. The PGA memory allocated by each server process attached to an Oracle instance is referred to as the aggregated PGA memory allocated by the instance. In a dedicated server configuration, the PGA of the server includes these components: • Sort area: Used for any sorts that may be required to process the SQL statement • Session information: Includes user privileges and performance statistics for the session • Cursor state: Indicates the stage in the processing of the SQL statements that are currently used by the session. Redo Log Buffer Characteristics: The redo log buffer has the following characteristics: • Its size in bytes is defined by the LOG_BUFFER parameter. • It records the block that is changed, the location of the change, and the new value in a redo entry. A redo entry makes no distinction between the type of block that is cha nged; it simply records which bytes are changed in the block. • The redo log buffer is used sequentially, and changes made by one transaction may be interleaved with changes made by other transactions. • It is a circular buffer that is reused after it is filled, but o nly after all the old redo entries are recorded in the redo log files. Rollback Segment: Before making a change, the server process saves the old data va lue into a rollback segment. This before image is used to: • Undo the changes if the transaction is rolled back • Provide read consistency by ensuring that other transactions do not see uncommitted changes made by the DML statement • Recover the database to a consistent state in case of failures.
  • 12. 12 Fast COMMIT: The Oracle Server uses a fast commit mechanism that guarantees t hat the committed changes can be recovered in case of instance failure. LOG Writer: LGWR performs sequential writes from the redo log buffer to the redo log file under the following situations: • When a transaction commits • When the redo log buffer is one-third full • When there is more than a megabyte of changes recorded in the redo log buffer • Before DBW0 writes modified blocks in the database buffer cache to the data files.
  • 13. 13 Oracle Data guard Architecture Oracle Data Guard ensures high availability, data protection, and disaster recovery for enterprise data. Data Guard provides a comprehensive set of services that create, maintain, manage, and monitor one or more standby databases to enable production Oracle databases to survive disasters and data corruptions. Dataguard maintains this standby as exact copy of primary database. So if , in any case your primary database becomes unavailable we can switch standby database role to primary database and we can minimize time and data loss. With dataguard , We can even improve performance of primary database by offloading backups or reporting tasks to standby database which are resource-intensive tasks. Types of Standby Databases: There are mainly three types of standby databases available. 1. Physical Standby Database: Physical Standby database is exact physical copy of primary database; Disk structures are same. Data guard maintains physical standby database by applying redo to the standby database. With 11g onward physical standby database stays in open mode with read only access so we can use it for query and reporting purpose.
  • 14. 14 2. Logical Standby Database : Logical Standby Database is logically identical copy of primary database. Physical disk structures may differ here. Data guard maintains logical standby database by applying sql to standby database. We can use logical standby database for query and reporting purpose along with data protection. Also you have to facility to upgrade oracle database software and patch sets along with data protection with help of logical standby database. 3. Snapshot Standby Database : With Oracle 11g release 1 , a new type of standby database introduced : a snapshot standby where physical standby database will be opened in read-write mode temporarily. When a physical standby is converted into a snapshot standby , an implicit guaranteed restore point is created for the standby database. Flashback database is used to facilitate this functionality. When it is in snapshot standby mode , it still receives all redo data applied to primary but that will not be applied to standby but it is archived into the archivelogs at the standby database. And when it is converted back to a physical standby , all changes we have made to snapshot standby while it was in read-write mode are discarded and all archive logs will applied from the restore point ,making physical standby database transactionally consistent with primary database. How it works with Standby database configured: -  LNS process of primary database captures redo from redo log buffer.  Send it to RFS process of standby database through oracle net.  RFS process then writes that redo information to standby redo log files.  If LNS process is not fast enough to capture redo information before it goes to online redo log files or if redo data are going online redo log files very quickly then LNS process will read from Online redo log files and send redo to RFS process through Oracle net.  If some network outage occur and online redo log gets log switch and data goes to archived redo log files , before its been written to standby redo log files then RFS process will directly communicate to ARCn process and works for Archive log gap resolution.  Once with any possible way redo are written to standby redo log files then , MRP [in case of physical dataguard] or LSP [in case of logical dataguard] process apply that redo or sql to standby database.  And as redo data is being applied on standby database , ARCn process of standby database also generates archive logs.
  • 15. 15 Primary Database Processes for Data guard Environment: 1. LGWR : LGWR collects transaction redo information and updates online redo log files. 2.LNS process [Log writer network server]:LNS process works in two way. 1. SYNC mode : When you have configured your data guard environment in sync Redo transport Service , LGWR passes redo to LNS process , which transfers data directly to RFS process on the standby database. LGWR waits for confirmation from the LNS process and LNS process waits confirmation from RFS process that redo data are applied to standby database before acknowledging commit. 2. ASYNC : When you have configured async redo transport service, it is independent of LNS process , whether LNS process have read from redo log buffer or from online redo log files . Data guard just starts asynchronous LNS process , other than that LGWR has no interaction with any asynchronous standby destinations. In simple terms , data guard will not wait for any acknowledgement from standby database that redo are applied or not and keeps on doing its work. So it is way faster than sync mode . 3. ARCn Process :As we know ARCn process creates a copy of the online redo log files . ARCn is also responsible for shipping redo data to an RFS process at a standby database and for pro-actively detecting and resolving gaps on all standby database.
  • 16. 16 Standby Database Processes : 1. RFS [Remote File Server] : As we have seen above RFS process can get redo data either from LNS process or from ARCn process of primary and RFS process can writes redo information to standby redo logs files. Each LNS and ARCn process that communicates with Standby database has its own RFS process. 2. ARCn [Archiver] : The ARCn process archives standby redo logs. 3. MRP [Managed Recovery Process] :In case of physical dataguard MRP process comes into play. MRP process applies archived redo log information to the physical standby database. You can start managed recovery using “ALTER DATABASE RECOVER MANAGED STANDBY DATABASE” this foreground session performs recovery. And if you want to perform recovery on background then you can optionally use DISCONNECT FROM SESSION. clause where MRP background process will start . If you use DG BROKER to manage your dataguard , it always starts MRP background process. 4. LSP [Logical Standby ]: It comes into play for logical dataguard only. It controls the application of archived redo log information to the logical standby database. LSP process will transform redo data into sql statements and then these sql statements will be applied to logical standby database.
  • 17. 17 Oracle Linux 8.3 Installation on VMware Workstation  We required linux operating for implementing data guard so we will use VMware workstation to install linux operating system .  Before beginning i download the Full ISO image of Oracle Linux 8.3 from yum.oracle.com  First, open the VMware workstation and you will see a similar window as shown in the image. First, you need to click on Create a New Virtual Machine option and it will prompt you a window to select from where you install. But for now, select the option I will install the operating systemlater and click on Next.
  • 18. 18 From the second window, you need to select the type of guest you are going to install and its version. Select Linux under Guest Operating System, its version as Oracle Linux 8 64-bit, and click on Next.
  • 19. 19 Now you can give a name you prefer for your virtual machine. Here I have given Oracle Linux. Next, you want to specify the location you are going to install the VM. I recommend you specify a location except for the C drive if you have enough storage capacity. I have given my location inside D drive. Then you can click on Next.
  • 20. 20 In the next screen, you need to specify Disk Capacity. Oracle recommends 20GB and I have given 100GB, but you can give disk capacity as your need. If you need more later on you can add it. Next, you need to choose how the VM hard disk is stored, I prefer the first option Store virtual disk as a single file. You can choose the option you prefer and then click Next.
  • 21. 21 By clicking on next, you will see a similar window like this If you need, you can click on Finish and then edit your VM settings. However, I am not going to click on finish, I click on the Customize Hardware button. It will prompt a new window as shown in the following figure.
  • 22. 22 Now you need to configure the amount of memory you are going to allocate for this VM. I adjusted it to 4GB (4096 MB) size of memory. You can choose more memory but keep in mind that not exceeds the RAM of your host machine.
  • 23. 23 Then click on the New CD/DVD (IDE) label on the left side of your window. Under Connection on the right side, choose the option Use ISO image file. Then Browse the location where your downloaded iso image file is located and select the image file. After the configuration, your window will be similar to the following image.
  • 24. 24 Then click on the Processors label shown on the left side of the window. Then adjust the Number of processor cores into two, you will see a similar window as follows.
  • 25. 25 Next, you will be able to see a window as follows. If you can remember, I told you that you can do the settings with Edit Virtual Machine Settings. Probably you will see that option on the right bottom of the window. If you need to do some changes again or clarify something, you can use that option. Since we have configured everything that is required, we do not go back to it.
  • 26. 26 Instead of that let’s play the virtual machine by clicking on the Play Virtual Machine option. Just by clicking on it, you cannot play around with VM. So, friend you can have a small break here until it runs and complete some testing process.
  • 27. 27
  • 28. 28 After 100% completion of checking, it will prompt you a similar window as follows. There you need to select your preferred language you want to use during installation. By default it will come as US English, you may choose another one based on your preference. Then click on Continue and it will go to the next step.
  • 29. 29 By clicking on continue, you will see another window to configure few other important things. The window you get should be similar to the following image.
  • 30. 30 Let me first go to the Installation Destination under System. First, click on the Installation Destination and it will display a similar window to the following image. You are not required to configure anything here. Just click only the Custom option under Storage Configuration as shown in the image. Because we are going to customize from our end. Then click Done. Once you click on done it will ask you what type of disk you want to add. You can choose as for your requirements. What you select from the dropdown is depend on how you want to partition your disk. My selection is LVM.
  • 31. 31 Now we can add mount points. Just click on the plus (+) sign on the left side of the window and the first disk I am giving here for my root. I am giving 20GB size out of 100GB for my root. Fill the prompted window as follows and click on Add mount point.
  • 32. 32
  • 33. 33 Then you should be able to see a window like this and you will see the configurations you did for root on the left side of the window.
  • 34. 34 We will choose another disk for the Oracle directory with 40GB size, which will be used in the next step during Oracle 19c installation. I will discuss with next blog post. Click on the plus (+) mark again, fill in the Mount Point and DesiredCapacity as shown in the image, and click Add mount point.
  • 35. 35 You can see the remaining space on the left upper corner of the window. Until now, you may have 39GB left. Let’s add 2GB for the /boot. That will be good enough to handle.
  • 36. 36 Now you are done with all the configurations under the Installation Destination. Your window may be similar to the image shown below. Now you can click on Done.
  • 37. 37 You will be redirected again to the Installation Summary window and now you can see Custom partitioning selected under Installation Destination. Previously it was Automatic Partitioning with a warning if you can remember. You will again come to the Installation Summary window and let’s create another user with administrative privileges. Click on the User Creation and it will direct you to another window to create a new user. I have given the user name as admin and you can choose what you want. Then check on the check box Make this user administrator, therefore we do not need to use root user always. Also, configure a password and after the configurations, you can click on Done.
  • 38. 38 Next, you need to configure a password for the root user. Click on Root Password and it will show you a similar window like this. Configure the root user password that follows Oracle recommendations and click on Done.
  • 39. 39
  • 40. 40 So congratulations! Finally, you can click on Begin Installation. Once you click on Begin Installation, it will take a couple of minutes and complete the installation process. After a couple of minutes/seconds, it will show you a similar window for this with the username of the administrative account you created. If you want to log in as that user, click on the name and you will be asked to provide your Password and then you can click on Sign In.
  • 41. 41 So congratulations friend. You have successfully installed Oracle Linux 8.3 and you can play around with it You can click on Activities and open a Terminal for executing your commands.
  • 42. 42 Install Oracle 19c database software 1. Hardware Requirement. Oracle 19c installation, we have to requiredLinux 8 64 bit. In my environment, we are using Linux 8 1 2 [root@localhost ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 8 2. Create Directory Here we are creatingu01 and u02 directoryfor installation, where /u01/app/oracle/product/19.0.0/dbhome_1 is the oraclehome and /u02/oradata which used for datafile location(soonwill publish manual creation of a database on 19c) 1 2 3 [root@localhost Packages]# mkdir -p/u01/app/oracle/product/19.0.0/dbhome_1 [root@localhost Packages]# mkdir -p/u02/oradata 3. Create the new groups and users Below we are creatinggroups which is requiredat the time of installation 1 2 3 [root@localhost Packages]# groupadd -g 10052 oinstall [root@localhost Packages]# groupadd -g 10054 dba 4. Change Ownershipandpermissions we have to change the ownership and permissions of the directories so that oracle user can read, write, and execute files. 1 2 3 [root@localhost Packages]# chown -R oracle:oinstall /u01 /u02 [root@localhost Packages]# chmod -R 775 /u01 /u02 5. Pre-requisites requiredfor oracleinstallation Before moving forward toward installation, Belowpre-requisites requiredfor oracle19c. [root@localhost Packages]# yum install -y oracle-database-preinstall-19c Loaded plugins: langpacks, ulninfo
  • 43. 43 ol7_UEKR6 | 2.5 kB 00:00:00 ol8_latest | 2.7 kB 00:00:00 (1/3): ol8_latest/x86_64/group | 660 kB 00:00:07 (2/3): ol8_latest/x86_64/updateinfo | 3.1 MB 00:00:07 (3/3): ol8_latest/x86_64/primary_db | 30 MB 00:00:06 Resolving Dependencies --> Running transaction check ---> Package oracle-database-preinstall-19c.x86_64 0:1.0-2.el8 will be installed --> Processing Dependency: ksh for package: oracle-database-preinstall- 19c-1.0-2.el8.x86_64 --> Running transaction check ---> Package ksh.x86_64 0:20120801-142.0.1.el8 will be installed --> Finished Dependency Resolution Dependencies Resolved ========================================================================= ============== Package Arch Version Repos itory Size ========================================================================= ============== Installing: oracle-database-preinstall-19c x86_64 1.0- 2.el7 ol8_latest 19 k Installing for dependencies: ksh x86_64 20120801- 142.0.1.el7 ol7_latest 882 k Installed: oracle-database-preinstall-19c.x86_64 0:1.0- 2.el7 Dependency Installed: ksh.x86_64 0:20120801- 142.0.1.el l8 Complete! 6. Unzip software In the silent installation, you have to unzip the oracle binary directly under the ORACLE HOME location. unzip oracle binary under oracle home as below.
  • 44. 44 1 2 3 [oracle@localhost dbhome_1]$ cd /u01/app/oracle/product/19.0.0/dbhome_1/ [oracle@localhost dbhome_1]$ unzip LINUX.X64_193000_db_home.zip 7. Edit response file. This response file is accustomed provide all the specified information for the installation, so no additional user input is required. ]$ cat db_install.rsp #################################################################### ## Copyright(c) Oracle Corporation 1998,2019. All rights reserved.## ## ## ## Specify values for the variables listed below to customize ## ## your installation. ## ## ## ## Each variable is associated with a comment. The comment ## ## can help to populate the variables with the appropriate ## ## values. ## ## ## ## IMPORTANT NOTE: This file contains plain text passwords and ## ## should be secured to have read permission only by oracle user ## ## or db administrator who owns this installation. ## ## ## #################################################################### #------------------------------------------------------------------------ ------ # Do not change the following system generated value. #------------------------------------------------------------------------ ------ oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_respo nse_schema_v19.0.0 #------------------------------------------------------------------------ ------- # Specify the installation option. # It can be one of the following: # - INSTALL_DB_SWONLY # - INSTALL_DB_AND_CONFIG #------------------------------------------------------------------------ ------- oracle.install.option=INSTALL_DB_SWONLY #------------------------------------------------------------------------ ------- # Specify the Unix group to be set for the inventory directory. #------------------------------------------------------------------------ -------
  • 45. 45 UNIX_GROUP_NAME=oinstall #------------------------------------------------------------------------ ------- # Specify the location which holds the inventory files. # This is an optional parameter if installing on # Windows based Operating System. #------------------------------------------------------------------------ ------- INVENTORY_LOCATION=/u01/app/oraInventory #------------------------------------------------------------------------ ------- # Specify the complete path of the Oracle Home. #------------------------------------------------------------------------ ------- ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1 #------------------------------------------------------------------------ ------- # Specify the complete path of the Oracle Base. #------------------------------------------------------------------------ ------- ORACLE_BASE=/u01/app/oracle #------------------------------------------------------------------------ ------- # Specify the installation edition of the component. # # The value should contain only one of these choices. # - EE : Enterprise Edition # - SE2 : Standard Edition 2 #------------------------------------------------------------------------ ------- oracle.install.db.InstallEdition=EE ######################################################################### ###### # # # PRIVILEGED OPERATING SYSTEM GROUPS # # ------------------------------------------ # # Provide values for the OS groups to which SYSDBA and SYSOPER privileges # # needs to be granted. If the install is being performed as a member of the # # group "dba", then that will be used unless specified otherwise below. #
  • 46. 46 # # # The value to be specified for OSDBA and OSOPER group is only for UNIX based # # Operating System. # # # ######################################################################### ###### #------------------------------------------------------------------------ ------ # The OSDBA_GROUP is the OS group which is to be granted SYSDBA privileges. #------------------------------------------------------------------------ ------- oracle.install.db.OSDBA_GROUP=oinstall #------------------------------------------------------------------------ ------ # The OSOPER_GROUP is the OS group which is to be granted SYSOPER privileges. # The value to be specified for OSOPER group is optional. #------------------------------------------------------------------------ ------ oracle.install.db.OSOPER_GROUP=oinstall #------------------------------------------------------------------------ ------ # The OSBACKUPDBA_GROUP is the OS group which is to be granted SYSBACKUP privileges. #------------------------------------------------------------------------ ------ oracle.install.db.OSBACKUPDBA_GROUP=oinstall #------------------------------------------------------------------------ ------ # The OSDGDBA_GROUP is the OS group which is to be granted SYSDG privileges. #------------------------------------------------------------------------ ------ oracle.install.db.OSDGDBA_GROUP=oinstall #------------------------------------------------------------------------ ------ # The OSKMDBA_GROUP is the OS group which is to be granted SYSKM privileges. #------------------------------------------------------------------------ ------ oracle.install.db.OSKMDBA_GROUP=oinstall
  • 47. 47 #------------------------------------------------------------------------ ------ # The OSRACDBA_GROUP is the OS group which is to be granted SYSRAC privileges. #------------------------------------------------------------------------ ------ oracle.install.db.OSRACDBA_GROUP=oinstall ######################################################################### ####### # 8. Execute pre-installationcommand This stepwill perform aprerequisite that checks for the requiredcomponent for the installation, if not, then we need to meet the requirement and move forward for installation. Below command to verify the response file and dependent requirement. 1 2 3 4 [oracle@localhost dbhome_1]$ ./runInstaller -executePrereqs -silent -responseFile /u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_install.rsp Launching Oracle Database Setup Wizard… Prerequisite checks executed successfully. 9. Install oracle 19cbinaryinsilent installation. After satisfyingthe prerequisite, Nowwe are goodto go to install oracle 19c. [oracle@localhost dbhome_1]$ ./runInstaller -silent -responseFile /u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_install.rsp Launching Oracle Database Setup Wizard... The response file for this session can be found at: /u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_-08-43PM.rsp You can find the log of this install session at: /tmp/InstallActions2020-11-07_01-08-43PM-08-43PM.log As a root user, execute the following script(s): 1. /u01/app/oraInventory/orainstRoot.sh 2. /u01/app/oracle/product/19.0.0/dbhome_1/root.sh Execute /u01/app/oraInventory/orainstRoot.sh on the following nodes: [localhost]
  • 48. 48 Execute /u01/app/oracle/product/19.0.0/dbhome_1/root.sh on the following nodes: [localhost] Successfully Setup Software. 10. Run the below script from the rootuser after installation. 1. /u01/app/oraInventory/orainstRoot.sh 2. /u01/app/oracle/product/19.0.0/dbhome_1/root.sh [root@localhost tmp]# /u01/app/oraInventory/orainstRoot.sh Changing permissions of /u01/app/oraInventory. Adding read,write permissions for group. Removing read,write,execute permissions for world. Changing groupname of /u01/app/oraInventory to oinstall. The execution of the script is complete. Performing root user operation. The following environment variables are set as: ORACLE_OWNER= oracle ORACLE_HOME= /u01/app/oracle/product/19.0.0/dbhome_1 Copying dbhome to /usr/local/bin ... Copying oraenv to /usr/local/bin ... Copying coraenv to /usr/local/bin ... Creating /etc/oratab file... Entries will be added to the /etc/oratab file as needed by Database Configuration Assistant when a database is created Finished running generic part of root script. Now product-specific root actions will be performed. Oracle Trace File Analyzer (TFA) is available at : /u01/app/oracle/product/19.0.0/dbhome_1/bin/tfactl 12. Verify after installation. After successful completionof the Oracle 19c installation, Now we are verifying oracle binary was installedproperlyor not. Run below command from oracle users. [oracle@localhost install]$ . oraenv ORACLE_SID = [test] ? ORACLE_HOME = [/home/oracle] ? /u01/app/oracle/product/19.0.0/dbhome_1/ The Oracle base remains unchanged with value /u01/app/oracle OR
  • 49. 49 [oracle@localhost install]$ export ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1/ [oracle@localhost install]$ export PATH=/u01/app/oracle/product/19.0.0/dbhome_1/bin:$PATH [oracle@localhost install]$ sqlplus -v SQL*Plus: Release 19.0.0.0.0 - Production Version 19.3.0.0.0 [oracle@localhost install]$ sqlplus SQL*Plus: Release 19.0.0.0.0 - Production on Tue June 1 13:33:26 2022 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Enter user-name: [oracle@localhost install]$ which sqlplus /u01/app/oracle/product/19.0.0/dbhome_1/bin/sqlplus Manual database creation of and oracle 19c on Linux 8 Pre-requisite to creating a database: 1. Create require directories Here we are creating require directories that are required to match exactly as pfile and database creation command. mkdir -p /u01/app/oracle/admin/canon/adump mkdir -p /u02/oradata/canon/ mkdir -p /u01/app/oracle/fast_recovery_area chmod 655 /u01/app/oracle/admin/canon/adump chmod 655 /u02/oradata/canon/ chmod 655 /u01/app/oracle/fast_recovery_area 2. Pfile(init.ora) file
  • 50. 50 Whenever we start the instance, It will read the pfile(init.ora)/spfile andset the parameter value which is mentionedin the file, and thenmount the instance accordingly. Below are the example of pfile(init.ora) andthe same has beencreatedin default location $ORACLE_HOME/dbs *.audit_file_dest='/u01/app/oracle/admin/canon/adump' *.audit_sys_operations=TRUE *.audit_trail='db' *.compatible='19.3.0.0.0' *.control_files='/u02/oradata/canon/control01.ctl','/u01/app/oracle/contr ol02.ctl' *.db_block_size=8192 *.db_domain='localdomain' *.db_name='CANON' *.db_recovery_file_dest='/u01/app/oracle/fast_recovery_area' *.db_recovery_file_dest_size=4560m *.diagnostic_dest='/u01/app/oracle' *.log_archive_format='%t_%s_%r.arc' *.memory_max_target=754974720 *.memory_target=754974720 *.open_cursors=300 *.os_roles=FALSE *.processes=300 *.recyclebin='OFF' *.remote_login_passwordfile='EXCLUSIVE' *.undo_tablespace='UNDOTBS1' 3. Create a database creationscript In the database create a script, we are going to specifythe datafile ,redo logfiles, tempfiles, and undo tablespace. Below is the database creationscript andmade one SQL file dbcreate.sql. CREATE DATABASE canon USER SYS IDENTIFIED BY manager USER SYSTEM IDENTIFIED BY manager LOGFILE GROUP 1 ('/u02/oradata/test/redo01.log') SIZE 50M, GROUP 2 ('/u02/oradata/canon/redo02.log') SIZE 50M, GROUP 3 ('/u02/oradata/canon/redo03.log') SIZE 50M MAXLOGFILES 5 MAXLOGMEMBERS 5 MAXLOGHISTORY 50 MAXDATAFILES 100 MAXINSTANCES 1 DATAFILE '/u02/oradata/canon/system01.dbf' SIZE 100M autoextend on SYSAUX DATAFILE '/u02/oradata/canon/sysaux01.dbf' SIZE 100M autoextend on DEFAULT TABLESPACE users datafile '/u02/oradata/canon/users01.dbf' size 100m autoextend on
  • 51. 51 DEFAULT TEMPORARY TABLESPACE temp TEMPFILE '/u02/oradata/canon/temp01.dbf' SIZE 50m UNDO TABLESPACE undotbs1 DATAFILE '/u02/oradata/canon/undotbs01.dbf' SIZE 200M; Step-4:- Start database Here we are startingthe database in the nomount stage from pfile that we createdinpre- requisite [oracle@localhost ~]$ sqlplus / as sysdba SQL*Plus: Release 19.0.0.0.0 - Production on Thu Jun 01 02:27:08 2022 Version 19.3.0.0.0 Copyright (c) 1982, 2019, Oracle. All rights reserved. Connected to an idle instance. SQL> startup nomount ORACLE instance started. Total System Global Area 754971128 bytes Fixed Size 8901112 bytes Variable Size 478150656 bytes Database Buffers 264241152 bytes Redo Buffers 3678208 bytes Step-5:- Create database After starting the database in nomount mode, Now we run dbcreate.sql to create the database. SQL> set echo on SQL> @dbcreate.sql SQL> CREATE DATABASE test 2 USER SYS IDENTIFIED BY manager 3 USER SYSTEM IDENTIFIED BY manager 4 LOGFILE GROUP 1 ('/u02/oradata/test/redo01.log') SIZE 50M, 5 GROUP 2 ('/u02/oradata/test/redo02.log') SIZE 50M, 6 GROUP 3 ('/u02/oradata/test/redo03.log') SIZE 50M 7 MAXLOGFILES 5 8 MAXLOGMEMBERS 5 9 MAXLOGHISTORY 50 10 MAXDATAFILES 100 11 MAXINSTANCES 1
  • 52. 52 12 DATAFILE '/u02/oradata/test/system01.dbf' SIZE 100M autoextend on 13 SYSAUX DATAFILE '/u02/oradata/test/sysaux01.dbf' SIZE 100M autoextend on 14 DEFAULT TABLESPACE users datafile '/u02/oradata/test/users01.dbf' size 100m autoextend on DEFAULT TEMPORARY TABLESPACE temp 15 TEMPFILE /oradata/test/temp01.dbf' SIZE 50m 16 UNDO TABLESPACE undotbs1 17 DATAFILE '/u02/oradata/test/undotbs01.dbf' 18 SIZE 200M; Database created. Step6:- Verify. After completion of the database creation script in step3, Now we have to verify the database is ready for use. SQL> select name,open_mode from v$database; NAME OPEN_MODE --------- -------------------- CANON READ WRITE SQL> select instance_name,status from v$instance; INSTANCE_NAME STATUS ---------------- ------------ canon OPEN PostSteps Step1:- PostScripts. Below post scripts createdatabase data dictionaryviews which is require 100% database functional. catalog.sql catproc.sql pupbld.sql
  • 53. 53 SQL> @$ORACLE_HOME/rdbms/admin/catalog.sql Session altered. SQL> @$ORACLE_HOME/rdbms/admin/catproc.sql Session altered. SQL>$ORACLE_HOME/sqlplus/admin/pupbld.sql Session altered. Step2:- Passwordfile (orapwd) Create a password file under ($ORACLE_HOME/dbs) oracle@localhost u02]$ cd $ORACLE_HOME/dbs [oracle@localhost dbs]$ orapwd file=orapwdcanon password=canon123 force=y entries=10 [oracle@localhost dbs]$ pwd /u01/app/oracle/product/19.0.0/dbhome_1/dbs [oracle@localhost dbs]$ ls -lrt orapwdtest -rw-r-----. 1 oracle oinstall 6144 Jun 01 09:29 orapwdtest Now database ready for transactions SQL> select name,open_mode from v$database; NAME OPEN_MODE --------- -------------------- CANON READ WRITE
  • 54. 54 Oracle Data Guard Configuration Data Guard is used for disaster recovery and high availability. Due to any disaster, if our PRIMARY database got crash so, in that case, our STANDBY may become our PRIMARY database. COMPONENTS PRIMARY DATABASE STANDBY DATABASE Server IP 182.95.248.179 182.94.96.142 Server Name GCPLINDEL2ORA06 GCPLINDEL2ORA02 DB Unique Name CANON CANON_STANDBY Assumptions  You have two servers (physical or VMs) with an operatingsystem and Oracle installedon them. In this case I've used Oracle Linux 7.6 and Oracle Database 19c.  The primary server (ol8-19-dg1.locadomain) has a running instance.  The standby server (ol8-19-dg2.locadomain) has a software only installation.  There is nothing blocking communicationbetweenthe machines over the listener ports. If you are using the default 1521 port, node 1 shouldbe able to communicate to node 2 on 1521 and node 2 should be able communicate with node 1 on 1521. Check network and local firewalls are not blockingthe communication. Primary Server Setup:- Check that the primary database is in archivelog mode. select log_mode from v$database; LOG_MODE ------------ NOARCHIVELOG SQL> If it is noarchivelog mode, switch is to archivelog mode. shutdown immediate;
  • 55. 55 startup mount; alter database archivelog; alter database open; Enabled forced logging by issuing the following command. alter database force logging; -- Make sure at least one logfile is present. alter system switch logfile; Create standby redo logs onthe primary database (in case of switchovers). The standby redo logs should be at least as big as the largest online redo logand there shouldbe one extra group per threadcomparedthe online redo logs. In my case, the followingstandby redo logs must be createdonbothservers. alter database add standby logfile thread 1 group 10 size 50m; alter database add standby logfile thread 1 group 11 size 50m; alter database add standby logfile thread 1 group 12 size 50m; alter database add standby logfile thread 1 group 13 size 50m; alter database add standby logfile thread 1 group 10 ('/u01/oradata/cdb1/standby_redo01.log') size 50m; alter database add standby logfile thread 1 group 11 ('/u01/oradata/cdb1/standby_redo02.log') size 50m; alter database add standby logfile thread 1 group 12 ('/u01/oradata/cdb1/standby_redo03.log') size 50m; alter database add standby logfile thread 1 group 13 ('/u01/oradata/cdb1/standby_redo04.log') size 50m; Initialization Parameters Check the settingfor the DB_NAME and DB_UNIQUE_NAME parameters. In this case they are both set to "canon" on the primary database. SQL> show parameter db_name NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_name string CANON SQL> show parameter db_unique_name NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_unique_name string canon SQL>SQL> alter system set log_archive_config='dg_config=(canon,canon_stanby)'; SQL> alter system set log_archive_dest_2='service=ocp_dr noaffirm async valid_for=(online_logfiles,primary_role) db_unique_name=canon_stanby';
  • 56. 56 SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2=ENABLE; SQL> ALTER SYSTEM SET FAL_SERVER=canon_stanby; Make sure the STANDBY_FILE_MANAGEMENT parameter is set. alter system set standby_file_management=auto; Network Service Setupfor database communication Entries for the primary and standby databases are needed in the "$ORACLE_HOME/network/admin/tnsnames.ora" files onboth servers. You can create these using the Network ConfigurationUtility(netca) or manually. The followingentries were usedduring this setup. Notice the use of the SID, rather than the SERVICE_NAME in the entries. This is important as the broker will needto connect to the databases when they are down, so the services will not be present. canon = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 182.95.248.179)(PORT = 1521)) ) (CONNECT_DATA = (SID = canon) ) ) Canon_standby = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = 182.94.96.142)(PORT = 1521)) ) (CONNECT_DATA = (SID = canon) ) ) ListenerConfiguration LISTENER = (DESCRIPTION_LIST = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 182.95.248.179)(PORT = 1521)) (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521)) ) ) SID_LIST_LISTENER = (SID_LIST = (SID_DESC = (GLOBAL_DBNAME = canon_DGMGRL)
  • 57. 57 (ORACLE_HOME = /u01/app/oracle/product/19.0.0/db_1) (SID_NAME = canon) (ENVS="TNS_ADMIN=/u01/app/oracle/product/19.0.0/db_1/network/admin") ) ) ADR_BASE_LISTENER = /u01/app/oracle lsnrctl stop lsnrctl start
  • 58. 58 Standby Server Setup Create the necessary directories on the standby server. mkdir -p /u01/app/oracle/oradata/canon/pdbseed mkdir -p /u01/app/oracle/oradata/canon/pdb1 mkdir -p /u01/app/oracle/fast_recovery_area/canon mkdir -p /u01/app/oracle/admin/canon/adump Create a password file, with the SYS password matching that of the primary database. $ orapwd file=/u01/app/oracle/product/19.0.0/db_1/dbs/orapwcanon password=Password1 entries=10 Create Standby Using DUPLICATE Start the auxiliary instance onthe standby server by startingit using the temporary"init.ora" file. $ export ORACLE_SID=canon $ sqlplus / as sysdba SQL> STARTUP NOMOUNT PFILE='/tmp/initcanon_stby.ora'; Connect to RMAN, specifying a full connect string for both the TARGET and AUXILIARY instances. Do not attempt to use OS authentication. $ rman TARGET sys/Password1@canon AUXILIARY sys/Password1@canon_standby Now issue the following DUPLICATE command. duplicate target database for standby from active database dorecover spfile set db_unique_name='cdb1_stby' COMMENT 'Is standby' nofilenamecheck;
  • 59. 59 If you need to convert file locations, or alter any initialisation parameters, you can do this during the DUPLICATE using the SET command. duplicate target database for standby from active database dorecover spfile set db_unique_name='canon_standby' COMMENT 'Is standby' set db_file_name_convert='/original/directory/path1/','/new/directory/path1/','/orig inal/directory/path2/','/new/directory/path2/' set log_file_name_convert='/original/directory/path1/','/new/directory/path1/','/ori ginal/directory/path2/','/new/directory/path2/' set job_queue_processes='0' nofilenamecheck; After completed restorationneed to verify standby database sync or not with primary database: - Execute Below Query for verify:- SELECT ARCH.THREAD# "Thread",ARCH.SEQUENCE# "Last Sequence Received", APPL.SEQUENCE# "Last Sequence Applied", (ARCH.SEQUENCE# - APPL.SEQUENCE#) "Difference" FROM (SELECT THREAD# ,SEQUENCE# FROM V$ARCHIVED_LOG WHERE (THREAD#,FIRST_TIM E ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$ARCHIVED_LOG GROUP BY THREAD#)) ARCH, (SELECT THREAD# ,SEQUENCE# FROM V$LOG_HISTORY WHERE (THREAD#,FIRST_TIME ) IN (SELECT THREAD#,MAX(FIRST_TIME) FROM V$LOG_HISTORY GROUP BY THREAD#)) APPL WHERE ARCH.THREAD# = APPL.THREAD# ORDER BY 1;
  • 60. 60
  • 61. 61 Output :- We are going to create table onPrimarydatabase side: - CREATE TABLE sales ( customer_id NUMBER, product_id NUMBER, order_date DATE NOT NULL, total NUMBER(9,2) DEFAULT 0 NOT NULL, PRIMARY KEY(customer_id, product_id, order_date) ); Now we will insert some records insales table insert into sales values (1,786,sysdate,1000);
  • 62. 62 Now we willverifydata that createdtable replicatedor not onstandby side We have checkeddata usefullyreplicatedonstandby side it means dataguard configurationsuccessfullycompleted