0% found this document useful (0 votes)
9 views7 pages

Backup Oracle Home and Inventory - DBA

The document provides a detailed guide on how to backup and restore ORACLE_HOME and Oracle INVENTORY before performing database or OS-level patching. It outlines the steps for shutting down the database and listener, backing up the necessary components, and restoring them in case of binary corruption. Additionally, it includes user feedback expressing appreciation for the clarity of the instructions.

Uploaded by

nabilazougagh
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)
9 views7 pages

Backup Oracle Home and Inventory - DBA

The document provides a detailed guide on how to backup and restore ORACLE_HOME and Oracle INVENTORY before performing database or OS-level patching. It outlines the steps for shutting down the database and listener, backing up the necessary components, and restoring them in case of binary corruption. Additionally, it includes user feedback expressing appreciation for the clarity of the instructions.

Uploaded by

nabilazougagh
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/ 7

Bright DBA

ORACLE DBA – Tips and Techniques

BACKUP ORACLE HOME AND INVENTORY


How to Backup ORACLE_HOME binaries
and Oracle INVENTORY
ORACLE_HOME and INVENTORY need to backup before Database / OS level patching

Table of Contents
__________________________________________________________________________________________
_________

Backup ORACLE_HOME and INVENTORY

1. Shutdown Database (Not mandatory but prefer to shutdown)


2. Stop Listener (Not mandatory but prefer to shutdown)
3. Backup Oracle INVENTORY
4. Backup ORACLE_HOME

Restore ORACLE_HOME (Incase binary corruption then we can restore from backup)

1. Shutdown Database (Mandatory)


2. Stop Listener (Mandatory)
3. Restore Oracle INVENTORY
4. Restore ORACLE_HOME
__________________________________________________________________________________________
_________

1. Shutdown Database (Not mandatory but prefer to shutdown)

[oracle@rac1 ~]$ ps -ef | grep pmon


oracle 13474 1 0 15:29 ? 00:00:00 ora_pmon_DELL
oracle 13583 13414 0 15:30 pts/1 00:00:00 grep pmon
[oracle@rac1 ~]$

SQL> select name,open_mode from v$database;

NAME OPEN_MODE
--------- --------------------
DELL READ WRITE
SQL>

SQL> shut immediate;


Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

2. Stop Listener (Not mandatory but prefer to shutdown)

Stop any other processes running from ORACLE_HOME

[oracle@rac1 ~]$ ps -ef | grep tns


root 15 2 0 08:32 ? 00:00:00 [netns]
oracle 13623 1 0 15:31 ? 00:00:00 /u01/app/
oracle/product/11.2.0.4/bin/tnslsnr LISTENER_11G -inherit
oracle 13631 13414 0 15:32 pts/1 00:00:00 grep tns
[oracle@rac1 ~]$ lsnrctl stop LISTENER_11G

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 09-


DEC-2018 15:32:36

Copyright (c) 1991, 2013, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)
(HOST=rac1.rajasekhar.com)(PORT=1621)))
The command completed successfully
[oracle@rac1 ~]$
[oracle@rac1 ~]$ ps -ef | grep tns
root 15 2 0 08:32 ? 00:00:00 [netns]
oracle 13638 13414 0 15:32 pts/1 00:00:00 grep tns
[oracle@rac1 ~]$

3. Backup Oracle INVENTORY

[oracle@rac1 ~]$ cat /etc/oraInst.loc


inventory_loc=/u01/app/oraInventory
inst_group=dba
[oracle@rac1 app]$ cd /u01/app/
[oracle@rac1 app]$ ls -ltr
total 8
drwxr-xr-x. 10 oracle dba 4096 Nov 7 11:33 oracle
drwxrwx---. 6 oracle dba 4096 Nov 7 20:16 oraInventory
[oracle@rac1 app]$

tar -pcvf /u02/oracle/backup/binary/Backup_OraInv.tar


oraInventory

OR

tar -pczvf /u02/oracle/backup/binary/Backup_OraInv.tar


oraInventory | gzip > /u02/oracle/backup/binary/
Backup_OraInv.tar.gz

4. Backup ORACLE_HOME

[oracle@rac1 product]$ pwd


/u01/app/oracle/product
[oracle@rac1 product]$ ls -ltr
total 12
drwxr-xr-x. 72 oracle dba 4096 Oct 21 2016 12.1.0.2
drwxr-xr-x. 78 oracle dba 4096 Dec 8 15:47 11.2.0.4 <---
drwxr-xr-x. 74 oracle dba 4096 Dec 8 19:38 12.2.0.1
[oracle@rac1 product]$

cd /u01/app/oracle/product
[oracle@rac1 product]$ nohup tar -pcvf /u02/oracle/backup/
binary/oracle_home_bkup.tar 11.2.0.4 &
[1] 8848
[oracle@rac1 product]$ nohup: ignoring input and appending
output to `nohup.out'

[oracle@rac1 product]$ jobs -l


[1]+ 8848 Running nohup tar -pcvf /u02/
oracle/backup/binary/oracle_home_bkup.tar 11.2.0.4 &
[oracle@rac1 product]$

[oracle@rac1 product]$ ls -ltr


total 2312
drwxr-xr-x. 72 oracle dba 4096 Oct 21 2016 12.1.0.2
drwxr-xr-x. 78 oracle dba 4096 Dec 8 15:47 11.2.0.4
drwxr-xr-x. 74 oracle dba 4096 Dec 8 19:38 12.2.0.1
-rw-------. 1 oracle dba 2354978 Dec 11 17:47 nohup.out
[oracle@rac1 product]$

OR

[oracle@rac1 product]$ nohup tar -pczvf /u02/oracle/backup/


binary/oracle_home_bkup.tar 11.2.0.4 | gzip > /u02/oracle/
backup/binary/oracle_home_bkup.tar.gz &
[1] 10189
[oracle@rac1 product]$ nohup: ignoring input and redirecting
stderr to stdout

[oracle@rac1 product]$ jobs -l


[1]+ 10188 Running nohup tar -pczvf /u02/
oracle/backup/binary/oracle_home_bkup.tar 11.2.0.4
10189 | gzip > /u02/oracle/backup/
binary/oracle_home_bkup.tar.gz &
[oracle@rac1 product]$
[oracle@rac1 binary]$ ls -ltr /u02/oracle/backup/binary/
oracle_home_bkup*
-rw-r--r--. 1 oracle dba 2752787212 Dec 11 18:22 /u02/oracle/
backup/binary/oracle_home_bkup.tar
-rw-r--r--. 1 oracle dba 240299 Dec 11 18:22 /u02/oracle/
backup/binary/oracle_home_bkup.tar.gz
[oracle@rac1 binary]$

Restore ORACLE_HOME (Incase binary corruption then we can restore from backup)

1. Shutdown Database (Mandatory)

SQL> shut immediate;


Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

2. Stop Listener (Mandatory)

Stop any other processes running from ORACLE_HOME


[oracle@rac1 ~]$ ps -ef | grep tns
root 15 2 0 08:32 ? 00:00:00 [netns]
oracle 13623 1 0 15:31 ? 00:00:00 /u01/app/
oracle/product/11.2.0.4/bin/tnslsnr LISTENER_11G -inherit
oracle 13631 13414 0 15:32 pts/1 00:00:00 grep tns
[oracle@rac1 ~]$ lsnrctl stop LISTENER_11G

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 09-


DEC-2018 15:32:36

Copyright (c) 1991, 2013, Oracle. All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)
(HOST=rac1.rajasekhar.com)(PORT=1621)))
The command completed successfully
[oracle@rac1 ~]$
[oracle@rac1 ~]$ ps -ef | grep tns
root 15 2 0 08:32 ? 00:00:00 [netns]
oracle 13638 13414 0 15:32 pts/1 00:00:00 grep tns
[oracle@rac1 ~]$

3. Restore Oracle INVENTORY

[oracle@rac1 app]$ cd /u01/app/


[oracle@rac1 app]$

mv oraInventory oraInventory_bkp

tar -pxvf /u02/oracle/backup/binary/Backup_OraInv.tar

4. Restore ORACLE_HOME

[oracle@rac1 product]$ cd /u01/app/oracle/product

[oracle@rac1 product]$ mv 11.2.0.4 11.2.0.4_bkp

tar -pxvf /u01/app/oracle/backup/oracle_home_bkup.tar


Caution: Your use of any information or materials on this website is entirely at your own risk. It is pro-
vided for educational purposes only. It has been tested internally, however, we do not guarantee that it
will work for you. Ensure that you run it in your test environment before using.

Thank you,
Rajasekhar Amudala
Email: br8dba@gmail.com
WhatsApp : +
Linkedin: https://www.linkedin.com/in/rajasekhar-amudala/

9 thoughts on “BACKUP ORACLE HOME AND


INVENTORY”

September 17, 2019 at 10:52 am

Well explained and very clear steps. I was trying to take backup of ORACLE_HOME and
oraInventory and it helped me. Thanks for sharing.
Oilevia

September 18, 2019 at 4:17 pm

Thank you

admin

September 17, 2019 at 10:53 am

Well explained and very clear steps. I was trying to take backup of ORACLE_HOME and
oraInventory and it helped me. Thanks for sharing.
Andrina

September 18, 2019 at 4:18 pm

Thank you.

admin
December 4, 2019 at 5:58 am

Nice info…Thanks

avinasharig
e

February 6, 2020 at 12:30 pm

this is very clear thank for support..

maxtom great

awesome..

100/100

November 2, 2022 at 8:08 pm

In oracle RAC, did we gather states from all nodes or we just need to gather states
from any one node. Thanks
Altaf

August 1, 2022 at 10:03 am

thnxx mate!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

raj

May 9, 2024 at 12:36 pm

Itʼs very useful, thanks for your information.

Elaiyaraja P

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy