This blog post on how to move Oracle DB from NFS Share to Pure Storage iSCSI Volumes is the second part of the previous blog post Add Pure Storage iSCSI to Linux CentOS.
In the previous article, I add Pure Storage Volumes to the Linux CentOS v7, and now I will move all Oracle configurations(Oracle Installation and Oracle Databases) from the NetApp NFS to the new Pure Storage iSCSI Volumes.
As we can check in the previous article, all mount points, volumes, and permissions are already set. Here we will only focus on Oracle.
I will make this move without any Oracle changes, and all the changes will be done in Linux.
What will be done in this process?
Copy from Oracle from NetApp to Pure Storage
- Stop Oracle Database and Listener
- Copy all files from NetApp NFS mount points netapp-Ora01, netapp-Ora02 to Pure Storage iSCSI mount points Pure-Ora01, Pure-Ora02.
- unmount NetApp volumes
- unmount Pure Storage devices
- mount back Pure Storage devices to original /u01 and /u02
- Change the fstab to boot with the new devices in original mount points.
- Reboot
- Start Oracle and Listener and test Oracle and check if DB was ok and data was accessible.
We will start the process by checking Oracle installation and its parameters by running opatch.
Login as Oracle (or the user you have for Oracle install and admin).
1 2 3 |
[oracle@oracle-rh-01-vmwarehome.lab ~]# /netapp-Ora01/app/oracle/product/12.2.0/dbhome_1/OPatch/opatch lsinventory -all |
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 |
Oracle Interim Patch Installer version 12.2.0.1.6 Copyright (c) 2021, Oracle Corporation. All rights reserved. Oracle Home : /netapp-Ora01/app/oracle//product/12.2.0/dbhome_1 Central Inventory : /netapp-Ora01/app/oraInventory from : /netapp-Ora01/app/oracle//product/12.2.0/dbhome_1//oraInst.loc OPatch version : 12.2.0.1.6 OUI version : 12.2.0.1.4 Log file location : /netapp-Ora01/app/oracle//product/12.2.0/dbhome_1/cfgtoollogs/opatch/opatch2021-03-28_19-23-55PM_1.log Lsinventory Output file location : /netapp-Ora01/app/oracle//product/12.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2021-03-28_19-23-55PM.txt -------------------------------------------------------------------------------- Local Machine Information:: Hostname: oracle-rh-01 ARU platform id: 226 ARU platform description:: Linux x86-64 List of Oracle Homes: Name Location OraDB12Home1 /netapp-Ora01/app/oracle/product/12.2.0/dbhome_1 Installed Top-level Products (1): Oracle Database 12c 12.2.0.1.0 There are 1 products installed in this Oracle Home. There are no Interim patches installed in this Oracle Home. -------------------------------------------------------------------------------- OPatch succeeded. |
Now Oracle DB and Listener should be stopped. Check first what is running.
1 2 3 |
[oracle@oracle-rh-01-vmwarehome.lab ~]# ps -fu oracle |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
UID PID PPID C STIME TTY TIME CMD oracle 15564 15563 0 18:17 pts/0 00:00:00 -bash oracle 15613 1 0 18:18 ? 00:00:00 /netapp-Ora01/app/oracle//product/12.2.0/dbhome_1//bin/tnslsnr LISTENER -inherit oracle 16429 15564 0 18:31 pts/0 00:00:00 sqlplus as sysdba oracle 16441 1 0 18:32 ? 00:00:00 ora_pmon_orcl .... oracle 16513 1 0 18:32 ? 00:00:00 ora_tmon_orcl oracle 16525 16429 0 18:32 ? 00:00:01 oracleorcl (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq))) .... oracle 17462 1 0 18:36 ? 00:00:00 ora_w005_orcl oracle 17480 1 67 18:36 ? 00:33:57 oracleorcl (LOCAL=NO) oracle 17538 1 0 18:37 ? 00:00:00 ora_w006_orcl oracle 17817 1 5 18:41 ? 00:02:30 oracleorcl (LOCAL=NO) oracle 18166 1 0 18:46 ? 00:00:03 oracleorcl (LOCAL=NO) oracle 20606 20604 0 19:22 pts/1 00:00:00 -bash oracle 21205 20606 0 19:26 pts/1 00:00:00 ps -fu oracle [oracle@oracle-rh-01-vmwarehome.lab ~]# |
As we can see above, DB and Listener are running (some unrelated records were removed from the list above); stop both.
Listener
1 2 3 |
[oracle@oracle-rh-01-vmwarehome.lab ~]# lsnrctl stop |
1 2 3 4 |
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 08-MAR-2021 15:19:32 Copyright (c) 1991, 2016, Oracle. All rights reserved. Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle-rh-01)(PORT=1521))) The command completed successfully |
Oracle Database
1 2 3 |
[oracle@oracle-rh-01-vmwarehome.lab ~]# sqlplus / as sysdba |
1 2 3 4 5 6 |
SQL> shutdown normal Database closed. Database dismounted. ORACLE instance shut down. |
Recheck the running processes and check if any Oracle is running. If all is stopped, then we can start our copy/move of Oracle to the new mount points.
We will start by moving the app folder.
Return to Root user to perform the next steps.
As we can see in the next commend, all permissions and user/groups on these new volumes were already set in my previous article Linux iSCSI. If you did not set the permissions, do it now.
1 2 3 4 5 |
[root@oracle-rh-01-vmwarehome.lab ~]# ls -ld /Pure-Ora01 /Pure-Ora02 drwxrwsr-x. 3 oracle oinstall 4096 Mar 28 15:17 /Pure-Ora01 drwxrwsr-x. 3 oracle oinstall 4096 Mar 28 15:17 /Pure-Ora02 |
Copy Oracle first.
1 2 3 |
[root@oracle-rh-01-vmwarehome.lab ~]# cp -a /netapp-Ora01/. /Pure-Ora01/ |
Next, copy Oracle Database.
1 2 3 |
[root@oracle-rh-01-vmwarehome.lab ~]# cp -a /netapp-Ora02/. /Pure-Ora02/ |
Note: If you are copying large files and big data, you can use rsync so that if it breaks or you have a timeout, you can start where it stops. Most of the time, cp is more than enough to copy the files.
Double-check if files and permissions(should have Oracle user as owner and oinstall group) were copied and then start to unmount all mount points(old and new).
1 2 3 4 |
[root@oracle-rh-01-vmwarehome.lab ~]# umount 192.168.10.252:/volume2/Oracle-01 /netapp-Ora01/ [root@oracle-rh-01-vmwarehome.lab ~]# umount 192.168.10.252:/volume2/Oracle-02 /netapp-Ora02/ |
1 2 3 4 |
[root@oracle-rh-01-vmwarehome.lab ~]# umount /dev/mapper/3624a93707874518ac7ac4829000130a6 /Pure-Ora01 [root@oracle-rh-01-vmwarehome.lab ~]# umount /dev/mapper/3624a93707874518ac7ac4829000130a7 /Pure-Ora02 |
Then mount the new volumes again but in the original mount points.
1 2 3 4 |
[root@oracle-rh-01-vmwarehome.lab ~]# mount -o discard /dev/mapper/3624a93707874518ac7ac4829000130a6 /netapp-Ora01 [root@oracle-rh-01-vmwarehome.lab ~]# mount -o discard /dev/mapper/3624a93707874518ac7ac4829000130a7 /netapp-Ora02 |
Change the fstab to use the new mount device for Oracle mounts and delete\comment the NetApp NFS mounts.
1 2 3 4 5 |
#192.168.10.252:/volume2/Oracle-01 /netapp-Ora01 nfs defaults 0 0 #192.168.10.252:/volume2/Oracle-02 /netapp-Ora02 nfs defaults 0 0 /dev/mapper/3624a93707874518ac7ac4829000130a6 /netapp-Ora01 ext4 _netdev,rw 0 0 /dev/mapper/3624a93707874518ac7ac4829000130a7 /netapp-Ora02 ext4 _netdev,rw 0 0 |
Now Reboot the server.
After Reboot, login with Oracle and start DB and listener.
1 2 3 |
[root@oracle-rh-01-vmwarehome.lab ~]# lsnrctl start |
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 |
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 28-MAR-2021 23:28:57 Copyright (c) 1991, 2016, Oracle. All rights reserved. Starting /netapp-Ora01/app/oracle//product/12.2.0/dbhome_1//bin/tnslsnr: please wait... TNSLSNR for Linux: Version 12.2.0.1.0 - Production System parameter file is /netapp-Ora01/app/oracle//product/12.2.0/dbhome_1/network/admin/listener.ora Log messages written to /netapp-Ora01/app/oracle/diag/tnslsnr/oracle-rh-01/listener/alert/log.xml Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle-rh-01)(PORT=1521))) Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle-rh-01)(PORT=1521))) STATUS of the LISTENER ------------------------ Alias LISTENER Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production Start Date 28-MAR-2021 23:28:57 Uptime 0 days 0 hr. 0 min. 3 sec Trace Level off Security ON: Local OS Authentication SNMP OFF Listener Parameter File /netapp-Ora01/app/oracle//product/12.2.0/dbhome_1/network/admin/listener.ora Listener Log File /netapp-Ora01/app/oracle/diag/tnslsnr/oracle-rh-01/listener/alert/log.xml Listening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=oracle-rh-01)(PORT=1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) The listener supports no services The command completed successfully |
Start Oracle Database.
1 2 3 |
[root@oracle-rh-01-vmwarehome.lab ~]# sqlplus / as sysdba |
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 |
SQL*Plus: Release 12.2.0.1.0 Production on Sun Mar 28 23:29:10 2021 Copyright (c) 1982, 2016, Oracle. All rights reserved. Connected to an idle instance. SQL> startup ORACLE instance started. Total System Global Area 2466250752 bytes Fixed Size 8623688 bytes Variable Size 671091128 bytes Database Buffers 1778384896 bytes Redo Buffers 8151040 bytes Database mounted. Database opened. SQL> select * from global_name; GLOBAL_NAME -------------------------------------------------------------------------------- ORCL SQL> |
For a final test, I remotely connected to my Oracle DB using Oracle SQL Developer and run some queries, and it runs without any issues. So everything seems ok and running without any problems.
You can now destroy NFS Shares from your previous Storage System(NetApp or other) and delete the folder created for the temporary move to Pure Storage. In my case was /Pure-Ora01 and /Pure-Ora02.
With this final test, we finished the process for how to move Oracle DB from NFS Share to Pure Storage iSCSI Volumes.
I hope these two articles did help you to move your Linux Oracle Database from an NFS Share to an iSCSI Volumes, regardless of Storage System you use. The process is the same for every Storage System, and it could change on some parameters that your Storage vendor could have different.
For the Oracle Installation and Oracle Database move, the process is the same regardless if you are moving from Storage, or local disks, or even new Folders.
Both articles:
Share this article if you think it is worth sharing. If you have any questions or comments, comment here, or contact me on Twitter.
Leave A Comment
You must be logged in to post a comment.