DBA Hub

📋Steps in this guide1/8

BACKUP ORACLE HOME AND INVENTORY - Bright DBA

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

oracle backupintermediate
by OracleDba
12 views
1

Overview

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

Section 2

Restore ORACLE_HOME (Incase binary corruption then we can restore from backup) 2. Stop Listener (Not mandatory but prefer to shutdown) Stop any other processes running from ORACLE_HOME

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
[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>
3

Section 3

Stop any other processes running from ORACLE_HOME 3. Backup Oracle INVENTORY tar -pcvf /u02/oracle/backup/binary/Backup_OraInv.tar oraInventory OR

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
[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 ~]$

[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

Section 4

tar -pczvf /u02/oracle/backup/binary/Backup_OraInv.tar oraInventory | gzip > /u02/oracle/backup/binary/Backup_OraInv.tar.gz 4. Backup ORACLE_HOME nohup tar -pcvf /u02/oracle/backup/binary/oracle_home_bkup.tar 11.2.0.4 & OR

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
[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]$
5

Section 5

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 & Running ls -ltr /u02/oracle/backup/binary/oracle_home_bkup* Restore ORACLE_HOME (Incase binary corruption then we can restore from backup) 1. Shutdown Database (Mandatory) Restore ORACLE_HOME (Incase binary corruption then we can restore from backup) 1. Shutdown Database (Mandatory)
6

Section 6

2. Stop Listener (Mandatory) Stop any other processes running from ORACLE_HOME

Code/Command (click line numbers to comment):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
SQL>
shut immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

[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 ~]$
7

Section 7

3. Restore Oracle INVENTORY mv oraInventory oraInventory_bkp tar -pxvf /u02/oracle/backup/binary/Backup_OraInv.tar 4. Restore ORACLE_HOME

Code/Command (click line numbers to comment):

1
2
3
4
5
6
[oracle@rac1 app]$
cd /u01/app/
[oracle@rac1 app]$
mv oraInventory
oraInventory_bkp
tar -pxvf /u02/oracle/backup/binary/Backup_OraInv.tar
8

Section 8

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 provided 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. Caution: Your use of any information or materials on this website is entirely at your own risk. It is provided 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.

Code/Command (click line numbers to comment):

1
2
3
4
5
6
[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

Comments (0)

Please to add comments

No comments yet. Be the first to comment!