0% found this document useful (0 votes)
32 views33 pages

Installation Document - JDE-OracleDB-Restore

This document provides instructions for installing Oracle Linux 6.1 and Oracle Database 11g Release 2 on a server. It outlines the steps to install Oracle Linux, including partitioning disks and setting basic configuration. It then describes pre-installation, installation and post-installation steps for Oracle Database 11gR2, including downloading software, running prerequisites checks, and common error resolutions. Finally, it covers restoring and recovering an Oracle 11gR2 database from backups.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views33 pages

Installation Document - JDE-OracleDB-Restore

This document provides instructions for installing Oracle Linux 6.1 and Oracle Database 11g Release 2 on a server. It outlines the steps to install Oracle Linux, including partitioning disks and setting basic configuration. It then describes pre-installation, installation and post-installation steps for Oracle Database 11gR2, including downloading software, running prerequisites checks, and common error resolutions. Finally, it covers restoring and recovering an Oracle 11gR2 database from backups.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 33

Page |1

Installa(on Document
Oracle JDE Database Restore

PT. MASSINDO INTERNATIONAL

21th January 2021 | Document version 1.0

Aswin Hadinata
IT Technical Consultant
Page |2

Contact Detail
Any inquiries regarding this document, its contents, structure, please contact :
Aswin Hadinata, IT Technical Consultant, Mobile phone : +62 812 9860 1245
Or email (✉) to : [email protected]
Page |3

Table of Contents
Contact Detail .................................................................................................................................................2
1. Installing Oracle Linux 6.1.......................................................................................................................4
1.2. Firewall...........................................................................................................................................17
1.3. SELinux ..............................................................................................................................18
2. Installing Oracle Database 11g Release 2 (11.2) Enterprise EdiYon .....................................................18
2.1. Pre-InstallaYon tasks .........................................................................................................19
2.1.1. Download So\ware ......................................................................................................19
2.1.2. Unpack Files .................................................................................................................19
2.1.3. Hosts File ......................................................................................................................20
2.1.4. Oracle InstallaYon Prerequisites ..................................................................................20
2.2. InstallaYon ..................................................................................................................................23
2.3. Post InstallaYon ..........................................................................................................................29
2.3.1. Common Errors ............................................................................................................29
3. Restore and Recovery Oracle Database 11g Release 2 (11.2) Enterprise EdiYon .................................30
3.1. Restore Database Process ........................................................................................................31
Page |4

1. Installing Oracle Linux 6.1

1.1. Basic InstallaYon Task

a. Boot from the DVD. At the boot screen, press the "Enter" key.

Figure 1.1. Boot from DVD

b. Press the "tab" key to move focus to the "Skip" key, then press the "Enter" key to conYnue.

Figure 1.2 Check Media DVD

c. On the "Welcome" screen, click the "Next" budon.


Page |5

Figure 1.3. Welcome Screen

d. Select the appropriate language, then click the "Next" budon.

Figure 1.4. Language Select

e. Select the relevant keyboard seeng, then click the "Next" budon.
Page |6

Figure 1.5. Select Appropriate Keyboard

f. Select the storage opYon necessary for the installaYon, then click the "Next" budon.

Figure 1.6. Select device for installa(on

g. Click the "Re-iniYalize all" budon on the disk iniYalizaYon warning dialog.
Page |7

Figure 1.7. Confirm Re-ini(alize all disk

h. Enter a fully qualified host name, then click the "Configure Network" budon.

Figure 1.8. Configure Hostname

i. Highlight the relevant connecYon and click the "Edit" budon.


Page |8

Figure 1.9. Configure Networking

j. Check the "Connect automaYcally" checkbox. If you are not using DHCP, click on the "IPv4 Seengs" tab, set
the method to "Manual", click the "Add" budon and enter the appropriate network details. When you are
happy with the details, click the "Apply" and "Close" budons to return to the host name screen, then click
the "Forward" budon.

Figure 1.10. Configure IP Address

k. Select the relevant Yme zone by clicking on your nearest city on the map. Click on the "Next" budon to
proceed.
Page |9

Figure 1.11. Select Timezone

l. Enter a root password for the server, then click the "Next" budon to proceed.

Figure 1.12. Se[ng Root Password

m. Check the parYYoning type you require. If you want to amend the default parYYoning layout, check the
"Review and modify parYYoning layout" opYon. Click the "Next" budon.
P a g e | 10

Figure 1.13. Type Installa(on

n. The installer will list the default parYYoning scheme for your size disk. Amend them as required and click
the "Next" budon, then the "Format" and "Write changes to disk" budons on the following dialogs.

Figure 1.14. Create Par((on Scheme

o. Accept the boot loader seengs by clicking the "Next" budon.


P a g e | 11

Figure 1.15. Set Boot Loader

p. Accept the "Basic Server" installaYon and check the "Customize now" opYon, then click the "Next" budon.

Figure 1.16. select installa(on package

q. The "Package Group SelecYon" screen allows you to select the required package groups, and individual
packages within the details secYon. When you've made your selecYon, click the "Next" budon.
P a g e | 12

Figure 1.17. Select Package Group Selec(on

r. Wait for the installaYon to complete.

Figure 1.18. Installa(on Process

s. Click the "Reboot" budon to complete the installaYon.


P a g e | 13

Figure 1.19. Installa(on Complete

t. On the "Welcome" screen, click the "Forward" budon.

Figure 1.20. Welcome Page

u. Accept the license agreement and click the "Forward" budon.


P a g e | 14

Figure 1.21. License Agreement Informa(on

v. Pick the desired ULN RegistraYon opYon, then click the "Forward" budon. In this case we will pick the
register later opYon.

Figure 1.22. So]ware Update

w. Click the "No thanks, I'll connect later." budon.


P a g e | 15

Figure 1.23. So]ware Update

x. Finish the so\ware updates setup by clicking the "Forward" budon.

Figure 1.24. Finished Setup

y. Enter the details for system user, then click the "Forward" budon.
P a g e | 16

Figure 1.25. Create User

z. Adjust the Date and Time seengs if necessary, and click the "Forward" Budon.

Figure 1.26. Set Date and Time

aa. Accept the default seeng on the Kdump screen by clicking the "Finish" budon.
P a g e | 17

Figure 1.27. Set Dump File

bb. Next, you are presented with the login screen. Log in by clicking on the user on the login screen.

Figure 1.28. Login Screen

1.2. Firewall
To turn off the firewall do the following as the "root" user.

# service iptables stop


# chkconfig iptables off
P a g e | 18

AlternaYvely, use the GUI by doing the following.


1. Open the "Firewall ConfiguraYon" dialog (System > AdministraYon > Firewall).
2. Click the "Close" budon on the startup dialog and type in the "root" password if requested.
3. On the resulYng dialog, click the "Disable" budon, followed by the "Apply" budon on the toolbar.

Figure 1.29. Firewall Configura(on on GUI

4. Click the "Yes" budon on the confirmaYon dialog.


5. Quit the "Firewall ConfiguraYon" dialog.
1.3. SELinux
Set SELinux to "permissive" by ediYng the "/etc/selinux/config" file, making sure the SELINUX flag is
set as follows.
SELINUX=permissive
Once the change is complete, either restart the server or run the following command as "root".
# setenforce Permissive

2. Installing Oracle Database 11g Release 2 (11.2)


Enterprise Edi(on
P a g e | 19

2.1. Pre-InstallaYon tasks


This arYcle describes the installaYon of Oracle Database 11g Release 2 (11.2) (64-bit) on Oracle Linux 6
(64-bit). The arYcle is based on a server installaYon with a minimum of 2G swap, with SELinux set to
permissive and the firewall disabled. The following package groups were included for this installaYon.

• Base System > Base


• Base System > Client management tools
• Base System > CompaYbility libraries
• Base System > Hardware monitoring uYliYes
• Base System > Large Systems Performance
• Base System > Network file system client
• Base System > Performance Tools
• Base System > Perl Support
• Servers > Server Plasorm
• Servers > System administraYon tools
• Desktops > Desktop
• Desktops > Desktop Plasorm
• Desktops > Fonts
• Desktops > General Purpose Desktop
• Desktops > Graphical AdministraYon Tools
• Desktops > Input Methods
• Desktops > X Window System
• Development > AddiYonal Development
• Development > Development Tools
• ApplicaYons > Internet Browser
2.1.1. Download So\ware
Download the Oracle so\ware from OTN or MOS depending on your support status.
• OTN: Oracle Database 11g Release 2 (11.2.0.1) So\ware (64-bit) - For unsupported installaYon.
• MOS: Oracle Database 11g Release 2 (11.2.0.3) So\ware (64-bit) - For supported installaYon.
2.1.2. Unpack Files
Unzip the files.
# 11.2.0.1
unzip linux.x64_11gR2_database_1of2.zip
unzip linux.x64_11gR2_database_2of2.zip

#11.2.0.2
unzip p10098816_112020_Linux-x86-64_1of7.zip
unzip p10098816_112020_Linux-x86-64_2of7.zip

#11.2.0.3
unzip p10404530_112030_Linux-x86-64_1of7.zip
unzip p10404530_112030_Linux-x86-64_2of7.zip
P a g e | 20

#11.2.0.4
unzip p13390677_112040_Linux-x86-64_1of7.zip
unzip p13390677_112040_Linux-x86-64_2of7.zip
You should now have a single directory called "database" containing installaYon files.
2.1.3. Hosts File
The "/etc/hosts" file must contain a fully qualified name for the server.
<IP-address> <fully-qualified-machine-name> <machine-name>
For example.
127.0.0.1 localhost.localdomain localhost
172.16.3.8 oradev

2.1.4. Oracle InstallaYon Prerequisites


Perform either the AutomaYc Setup or the Manual Setup to complete the basic prerequisites. The
AddiYonal Setup is required for all installaYons.
2.1.4.1. Automa=c Setup
If you plan to use the "oracle-rdbms-server-11gR2-preinstall" package to perform all your prerequisite
setup, follow the instrucYons at hdp://public-yum.oracle.com to setup the yum repository for OL, then
perform the following command.
# yum install oracle-rdbms-server-11gR2-preinstall
All necessary prerequisites will be performed automaYcally.
It is probably worth doing a full update as well, but this is not strictly speaking necessary.
# yum update

2.1.4.2. Manual Setup


If you have not used the "oracle-rdbms-server-11gR2-preinstall" package to perform all prerequisites, you
will need to manually perform the following setup tasks.
Oracle recommend the following minimum parameter seengs.
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
The current values can be tested using the following command.
/sbin/sysctl -a | grep <param-name>
Add or amend the following lines in the "/etc/sysctl.conf" file.
fs.suid_dumpable = 1
fs.aio-max-nr = 1048576
fs.file-max = 6815744
P a g e | 21

kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
# semaphores: semmsl, semmns, semopm, semmni
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default=262144
net.core.rmem_max=4194304
net.core.wmem_default=262144
net.core.wmem_max=1048586
Run the following command to change the current kernel parameters.
/sbin/sysctl -p
Add the following lines to the "/etc/security/limits.conf" file.
oracle so] nproc 16384
oracle hard nproc 16384
oracle so] nofile 4096
oracle hard nofile 65536
oracle so] stack 10240
Install the following packages if they are not already present.
# From Oracle Linux 6 DVD
cd /media/cdrom/Server/Packages
rpm -Uvh binu(ls-2*x86_64*
rpm -Uvh glibc-2*x86_64* nss-so]okn-freebl-3*x86_64*
rpm -Uvh glibc-2*i686* nss-so]okn-freebl-3*i686*
rpm -Uvh compat-libstdc++-33*x86_64*
rpm -Uvh glibc-common-2*x86_64*
rpm -Uvh glibc-devel-2*x86_64*
rpm -Uvh glibc-devel-2*i686*
rpm -Uvh glibc-headers-2*x86_64*
rpm -Uvh elfu(ls-libelf-0*x86_64*
rpm -Uvh elfu(ls-libelf-devel-0*x86_64*
rpm -Uvh gcc-4*x86_64*
rpm -Uvh gcc-c++-4*x86_64*
rpm -Uvh ksh-*x86_64*
rpm -Uvh libaio-0*x86_64*
rpm -Uvh libaio-devel-0*x86_64*
rpm -Uvh libaio-0*i686*
rpm -Uvh libaio-devel-0*i686*
rpm -Uvh libgcc-4*x86_64*
rpm -Uvh libgcc-4*i686*
rpm -Uvh libstdc++-4*x86_64*
rpm -Uvh libstdc++-4*i686*
rpm -Uvh libstdc++-devel-4*x86_64*
rpm -Uvh make-3.81*x86_64*
rpm -Uvh numactl-devel-2*x86_64*
rpm -Uvh sysstat-9*x86_64*
rpm -Uvh compat-libstdc++-33*i686*
rpm -Uvh compat-libcap*
cd /
eject
P a g e | 22

This will install all the necessary 32-bit packages for 11.2.0.1. From 11.2.0.2 onwards many of these are
unnecessary, but having them present does not cause a problem.
Create the new groups and users.
groupadd -g 501 oinstall
groupadd -g 502 dba
groupadd -g 503 oper
groupadd -g 504 asmadmin
groupadd -g 506 asmdba
groupadd -g 505 asmoper

useradd -u 502 -g oinstall -G dba,asmdba,oper oracle


passwd oracle
We are not going to use the "asm" groups, since this installaYon will not use ASM.
2.1.4.3. Addi=onal Setup
Set the password for the "oracle" user.
passwd oracle
Amend the "/etc/security/limits.d/90-nproc.conf" file as described below.
# Change this
* so] nproc 1024

# To this
* - nproc 16384
Set secure Linux to permissive by ediYng the "/etc/selinux/config" file, making sure the SELINUX flag is set
as follows.
SELINUX=permissive
Once the change is complete, restart the server.
If you have the Linux firewall enabled, you will need to disable or configure it
Create the directories in which the Oracle so\ware will be installed.
mkdir -p /u01/app/oracle/product/11.2.0/db_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01
Login as root and issue the following command.
xhost +<machine-name>
Login as the oracle user and add the following lines at the end of the ".bash_profile" file.
# Oracle Seengs
TMP=/tmp; export TMP
TMPDIR=$TMP; export TMPDIR

ORACLE_HOSTNAME=jdedb; export ORACLE_HOSTNAME


ORACLE_UNQNAME=DB11G; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME
ORACLE_SID=DB11G; export ORACLE_SID

PATH=/usr/sbin:$PATH; export PATH


PATH=$ORACLE_HOME/bin:$PATH; export PATH
P a g e | 23

LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH


CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH

2.2. InstallaYon
Proceed with the installaYon of your choice. The prerequisites checks will fail for the following version-
dependent reasons:
• 11.2.0.1: The installer shows mulYple "missing package" failures because it does not recognize several
of the newer version packages that were installed. These "missing package" failures can be ignored as
the packages are present. The failure for the "pdksh" package can be ignored because we installed the
"ksh" package in its place.
• 11.2.0.2: The installer should only show a single "missing package" failure for the "pdksh" package. It
can be ignored because we installed the "ksh" package in its place.
• 11.2.0.3: The installer shows no failures and conYnues normally.
You can see the type of installaYon I performed by clicking on the links below to see screen shots of
each stage.
1. Configure Security Updates
2. Select Install OpYon
3. System Class
4. Node SelecYon
5. Select Install Type
6. Typical Install ConfiguraYon
7. Create Inventory
8. Perform Prerequisite Checks
9. Summary
10. Install Product
11. Database ConfiguraYon Assistant
12. Database ConfiguraYon Assistant 2
13. Execute ConfiguraYon Scripts
14. Finish
Log into the oracle user. If you are using X emulaYon then set the DISPLAY environmental variable.
DISPLAY=<machine-name>:0.0; export DISPLAY
Start the Oracle Universal Installer (OUI) by issuing the following command in the database directory.
./runInstaller
It will starYng oracle Universal Installer
P a g e | 24

Figure 2.1. Oracle Installer Java Launcher

Next, is fill the email address and Myoracle Support password if any, but you can skip it. And next

Figure 2.2. My Oracle Support Profile

Next, is select install opYons that we want to choose, in this case we can choose install database so\ware
only since we want to Restore ExisYng database to the new Machine,
P a g e | 25

Figure 2.3. Install Op(ons

On Grid OpYons select the database installaYon what we want to perform, in this case we choose for Single
instance database installaYon,

Figure 2.4. Grid Op(ons installa(on


P a g e | 26

Next is Database ediYon that we want to install, choose Enterprise EdiYon,

Figure 2.5. Database Edi(on

Specify Oracle Base for installaYon locaYon,

Figure 2.6. Instalal(on Loca(on

Create Oracle Inventory directory by specify where is the inventory directory,


P a g e | 27

Figure 2.7. Oracle Inventory Loca(on

Set Privileged OperaYng System Groups, choose dba for OSDBA and oinstall for OSOPER,

Figure 2.8. Privileged Opera(ng System Groups

Next is checking Prerequisites that might need for this installaYon, such as Library file or package on OS,
SWAP et. So make sure your SWAP is enough and all library needed is installed.
P a g e | 28

Figure 2.9. Prerequisites Check

Next is summary of the oracle installaYon, click finish

Figure 2.10. Summary Oracle Installa(on

Oracle InstallaYon is running, unYl finished


P a g e | 29

Figure 2.11. Installa(on Process

2.3. Post InstallaYon


Edit the "/etc/oratab" file seeng the restart flag for each instance to 'Y'.
DB11G:/u01/app/oracle/product/11.2.0/db_1:Y

2.3.1. Common Errors


• "error code 35" : The machine name in the "/etc/hosts" file is not correct. It needs an entry for the
loopback adapter (localhost) and the machine name. If you are using DNS for name resoluYon, you
sYll need the loopback adapter reference in this file.
• "error code 37" : The DNS not working properly. You may also get this error is the "/etc/hosts" file is
not configured correctly.
• "sqlplus: error while loading shared libraries: libclntsh.so.11.1" : The prerequisites have not been
met. Work through them again. Specifically, make sure the "gcc" package has been installed.
• Listener fails to start - Typically this is due to incorrect name resoluYon. Make sure the "/etc/hosts"
and/or DNS is configured correctly.
• Linking errors - Almost always due to missing prerequisites. Review the setup secYons.
P a g e | 30

3. Restore and Recovery Oracle Database 11g Release


2 (11.2) Enterprise Edi(on
Restore is an important process in IT operaYonal cycling that occurred a\er DB System is considered
failed, crash or disaster. DramaYcally it happened during the operaYonal Yme that impacts producYon
data and operaYonal in a company.

Oracle Recovery Manager called “Oracle RMAN” allows you to manage any backup and restore also
recovery when your Oracle DB system is failed, and it will restore your data from last backup.

There are some points of the backup and restore Oracle using RMAN that DB Admin / backup admin needs
to take a great care about :

1. Make Sure Backup DesYnaYon is enough to store Database backup on producYon environment,
either its Disk/Storage or Tape Library technology.

2. If you specify RMAN backup script by your own, make sure this component is backed up :

a. Datafile

b. Archivelog

c. Controlfile

d. SPfile (parameter file)

e. DBID on exisYng Database (take a note for record DBID)

f. Pfile / Init<SID>.ora (physical file of parameter file on $ORACLE_HOME/dbs)

3. Make sure there is no Corrupt table or tablespace or offline in Datafile, if any error, corrupt or
offline tablespace, datafile or there is inaccessible datafile state, please fix it first unYl it delete or
solved and accessible eventually or it beder to use syntax “SKIP INACCESSIBLE or SKIP OFFLINE” to
skip this kind of “Problem”.

4. Make sure there is no Obsolate and Expired Status of Datafile, archivelog and controlfile in a
backup piece. You can ensure this by accessing RMAN console and type “List Backup Summary” for
viewing backup summary and you can perform “CROSSCHECK BACKUP”, crosscheck backup
command will check for the records in the RMAN repository to make sure they are accurate. If
there is an record in the RMAN catalog that is not available on the physical filesystem, it will make
that entry with appropriate status. If crosscheck is finished, you can delete obsolete backup using
“DELETE OBSOLETE”. To delete all record on RMAN Catalog that marked with “EXPIRED” we can
use Command “DELETE EXPIRED BACKUP”.

5. Make sure you are doing Full backup First when doing DB MigraYon, Tuning, or any kinds of acYon
that possibly touch configuraYon of your producYon Oracle Database.

6. SomeYmes “parallelism” or mulY stream in backup to disk doesn’t works well when it allocated
manual, so let the chanel allocaYon be automaYc only.

7. It beder to enable automa(c backup of controlfile and SPfile, to perform easy restore process

8. Make sure audit trail folder is created before restore controlfile


P a g e | 31

3.1. Restore Database Process

Here are the steps when doing restore Database on the new machine:

1. Go to RMAN by typing command on

[oracle@db ~]$ rman target /

2. startup instance with opYon force nomount;

RMAN > startup force nomount;

3. Set DBID before we restore parameter spfile, (DBID is based on Source Database Instance)

RMAN > Set DBID 3659801919

4. restore spfile from backup .bak files

RMAN > restore spfile from "/u02/backup_full_20201017/spfile/


spfile_20201018_dJDEDB_p1_uq5vd982v_c1.bak";

5. if restore finished and succeeded then do shutdown immediate;

RMAN > shutdown immediate;

6. a\er that we will startup database using current spfile with nomount;

RMAN > startup nomount;

7. since it new machine, we need to create audit trail folder (look at init<SID>.ora file for the locaYon
of the audit trail – marked with ‘audit_file_dest=’), if you are not prepare the folder that audit trail
needs, Restoring control file would not be easy and smooth. Exit the RMAN and use command
mkdir on root to create audit trail folder.

[oracle@db~]# mkdir -p /u01/oracle/admin/jdedb/adump


P a g e | 32

8. and then we will restore controlfile from backup .bak

RMAN> restore controlfile from "/u02/backup_full_20201017/cfile/


cf_full_20201018_dJDEDB_p1_uplvd92g3_c1.bak";

StarYng restore at 24-OCT-20

using channel ORA_DISK_1

channel ORA_DISK_1: restoring control file

channel ORA_DISK_1: restore complete, elapsed Yme: 00:00:01

output file name=/u01/oracle/oradata/jdedb/control01.ctl

output file name=/u01/oracle/flash_recovery_area/jdedb/control02.ctl

Finished restore at 24-OCT-20

9. a\er finished restore controlfile we will bring up the database into mount state;

RMAN > alter database mount;

10. next we will start to restore database, normally restore database can be done with below
command:

RMAN > restore database;

But, special cases need to conduct when some of tablespace is not restored due to corrupt and
need to skip, so the process of the restore will be a bit difficult. Below is the sample of current
condiYon on the customer that demo and ps900dtai tablespace is offline / corrupt for some
reason.

RMAN > restore database skip tablespace demo,ps900dtai;

11. a\er all database is restored, next we need to restore archivelog for recovery process later;

RMAN > restore Archivelog all;


P a g e | 33

12. a\er all archivelog has been restored, next we need to recover database to bring up on to open
state,

RMAN > recover database un(l cancel using backup controlfile

And type cancel

13. a\er that, we need to bring up this database from mount state to the open state. But since this
recovery is not using latest archivelog or it use last backup of archivelog, so for latest transacYon
that not commided will be reset to have open state,

RMAN > alter database open resetlogs;

You might also like