DBA Hub

📋Steps in this guide1/3

BACKUP ORACLE HOME AND INVENTORY

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

oracle configurationintermediate
by OracleDba
13 views
1

Overview

- ORACLE_HOME and INVENTORY need to backup before Database / OS level patching 1. Shutdown Database (Not mandatory but prefer to shutdown) - Stop any other processes running from ORACLE_HOME 3. Backup Oracle INVENTORY

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
[oracle@node1 ~]$ ps -ef | grep pmon
oracle 487 316 0 12:05 pts/0 00:00:00 grep --color=auto pmon
SQL> select name,open_mode from v$database;
NAME OPEN_MODE
--------- --------------------
PRIM READ WRITE
SQL> shu immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

[oracle@node1 ~]$ ps -ef|grep tns
root 23 2 0 May27 ? 00:00:00 [netns]
oracle 3445 1 0 12:33 ? 00:00:00 /data/app/oracle/product/19C/dbhome_3/bin/tnslsnr LISTENER -inherit
oracle 3493 3357 0 12:34 pts/0 00:00:00 grep --color=auto tns
[oracle@node1 ~]$ lsnrctl stop LISTENER
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 31-MAY-2024 12:35:12

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=node1.learnomate.org)(PORT=1521)))
The command completed successfully
[oracle@node1 ~]$ ps -ef|grep tns
root 23 2 0 May27 ? 00:00:00 [netns]
oracle 3766 3357 0 12:37 pts/0 00:00:00 grep --color=auto tns
2

Section 2

4. Backup ORACLE_HOME 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
27
28
29
30
31
32
33
34
35
36
[oracle@node1 ~]$ cat /etc/oraInst.loc
inventory_loc=/data/app/oraInventory
inst_group=oinstall
[oracle@node1 ~]$ cd /data/app
[oracle@node1 app]$ ls -lrt
total 8
drwxrwxr-x. 9 oracle oinstall 4096 May 13 15:21 oracle
drwxrwx---. 6 oracle oinstall 4096 May 31 12:06 oraInventory
[oracle@node1 app]$
[oracle@node1 app]$ tar -pcvf /u01/oracle/backup/binary/Backup_OraInv.tar oraInventory

OR
[oracle@node1 app]$ tar -pczvf /u01/oracle/backup/binary/Backup_OraInv.tar oraInventory | gzip > /u01/oracle/backup/binary/Backup_OraInv.tar.gz

[oracle@node1 product]$ pwd
/data/app/oracle/product
[oracle@node1 product]$ ll
total 0
drwxrwxr-x. 3 oracle oinstall 22 May 7 16:10 19C
[oracle@node1 product]$ nohup tar -pcvf /u01/oracle/backup/binary/oracle_home_bkup.tar 19C &
[1] 5321
[oracle@node1 product]$ nohup: ignoring input and appending output to ‘nohup.out’
1]+ Exit 2 nohup tar -pcvf /u01/oracle/backup/binary/oracle_home_bkup.tar 19C
[oracle@node1 product]$ jobs -l
[oracle@node1 product]$ 
[oracle@node1 product]$ 
[oracle@node1 product]$
[oracle@node1 product]$ ls -lrt
total 4
drwxrwxr-x. 3 oracle oinstall 22 May 7 16:10 19C
-rw-------. 1 oracle oinstall 270 May 31 12:52 nohup.out

SQL> shu immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
3

Section 3

3. Restore Oracle INVENTORY 4. Restore 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
27
28
29
30
31
32
33
34
35
36
37
38
39
[oracle@node1 ~]$ ps -ef|grep tns
root 23 2 0 May27 ? 00:00:00 [netns]
oracle 3445 1 0 12:33 ? 00:00:00 /data/app/oracle/product/19C/dbhome_3/bin/tnslsnr LISTENER -inherit
oracle 3493 3357 0 12:34 pts/0 00:00:00 grep --color=auto tns
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$ lsnrctl stop LISTENER
LSNRCTL for Linux: Version 19.0.0.0.0 - Production on 31-MAY-2024 12:35:12

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=node1.learnomate.org)(PORT=1521)))
The command completed successfully
[oracle@node1 ~]$
[oracle@node1 ~]$
[oracle@node1 ~]$ ps -ef|grep tns
root 23 2 0 May27 ? 00:00:00 [netns]
oracle 3766 3357 0 12:37 pts/0 00:00:00 grep --color=auto tns

[oracle@node1 app]$ ll
total 8
drwxrwxr-x. 9 oracle oinstall 4096 May 13 15:21 oracle
drwxrwx---. 6 oracle oinstall 4096 May 31 12:06 oraInventory
[oracle@node1 app]$ mv oraInventory oraInventory_bkp
[oracle@node1 app]$ ll
total 8
drwxrwxr-x. 9 oracle oinstall 4096 May 13 15:21 oracle
drwxrwx---. 6 oracle oinstall 4096 May 31 12:06 oraInventory_bkp

[oracle@node1 app]
[oracle@node1 app]
[oracle@node1 app]$ tar -pxvf /u01/oracle/backup/binary/Backup_OraInv.tar

[oracle@node1 product]$ mv 19C 19C_bkp
[oracle@node1 product]$ ll
total 4
drwxrwxr-x. 3 oracle oinstall 22 May 7 16:10 19C_bkp
-rw-------. 1 oracle oinstall 270 May 31 12:52 nohup.out
[oracle@node1 product]$ tar -pxvf /u02/app/oracle/backup/oracle_home_bkup.tar

Comments (0)

Please to add comments

No comments yet. Be the first to comment!