Skip to main content

Configuring VMWARE snapshot backups for Oracle databases.

Oracle databases require 'begin backup mode' to freeze datafile headers and consistency of backups.
VEEAM is backup, replication and restore solution for Virtual machines.
We will consider understanding steps involved in running veeam backups for live Oracle database vm machines.



We will start with VMWARE tools installation steps (if not already installed). This will be done on vmware host machine.

Prepare your virtual machine to install VMware Tools.
Choose VM > Install VMware Tools.

Logon to Linux as root -
[root@clone ~]# mount /dev/cdrom /mnt/cdrom
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@clone ~]# cd /tmp
[root@clone tmp]# tar zxpf /mnt/cdrom/VMwareTools-9.0.0-782409.tar.gz
[root@clone tmp]#
[root@clone tmp]#



Install vmware tools on virtual machine -

[root@clone tmp]# cd vmware-tools-distrib
[root@clone vmware-tools-distrib]# ls -ltr
total 272
drwxr-xr-x 14 root root   4096 Jul 14  2012 lib
drwxr-xr-x  2 root root   4096 Jul 14  2012 installer
drwxr-xr-x  2 root root   4096 Jul 14  2012 bin
drwxr-xr-x  4 root root   4096 Jul 14  2012 etc
drwxr-xr-x  2 root root   4096 Jul 14  2012 doc
-rw-r--r--  1 root root 251898 Jul 14  2012 FILES
lrwxrwxrwx  1 root root     31 Oct 29 14:27 vmware-install.pl -> ./bin/vmware-uninstall-tools.pl
lrwxrwxrwx  1 root root     13 Oct 29 14:27 INSTALL -> ./doc/INSTALL
[root@clone vmware-tools-distrib]# ./vmware-install.pl








Creating scripts to run before and after snapshots -
create /usr/sbin/pre-freeze-script
#!/bin/sh
if [ "$(id -u)" -eq "0" ]; then
exec su oraprod -c /home/oraprod/maaz/monitor/scripts/pre-freeze.sql
fi
 

create /usr/sbin/post-thaw-script
#!/bin/sh

if [ "$(id -u)" -eq "0" ]; then
exec su oraprod -c /home/oraprod/maaz/monitor/scripts/post-thaw-script.sql
fi
 




Switch to oraprod/oracle user and create custom shell scripts scripts -

Script 1-
/home/oraprod/maaz/monitor/scripts/pre-freeze.sql

. /data/prod/apps12/db/tech_st/db/12.1.0.2/clone_clone.env

$ORACLE_HOME/bin/sqlplus "sys/sysdcf321@CLONE as sysdba" <<EOF
spool /home/oraprod/maaz/monitor/scripts/pre-freeze.log;
select to_char(sysdate, 'DD-MON-YYYY HH:MI:SS') from dual;
alter database begin backup;
spool off;
EOF







Script 2- 
/home/oraprod/maaz/monitor/scripts/post-thaw-script.sql
. /data/prod/apps12/db/tech_st/db/12.1.0.2/clone_clone.env

$ORACLE_HOME/bin/sqlplus "sys/sysdcf321@CLONE as sysdba" <<EOF
spool /home/oraprod/maaz/monitor/scripts/post-thaw.log;
select to_char(sysdate, 'DD-MON-YYYY HH:MI:SS') from dual;
alter database end backup;
spool off;
EOF




Check permissions for files with root user -


[root@clone vmware-tools-distrib]# ls -ltr /usr/sbin/pre-freeze-script
-rw-r--r-- 1 root root 122 Oct 29 14:24 /usr/sbin/pre-freeze-script
[root@clone vmware-tools-distrib]# chmod 700 /usr/sbin/pre-freeze-script
[root@clone vmware-tools-distrib]# ls -ltr /usr/sbin/pre-freeze-script
-rwx------ 1 root root 122 Oct 29 14:24 /usr/sbin/pre-freeze-script


[root@clone bin]# chown root.root /usr/sbin/post-thaw-script
[root@clone bin]# chmod 700 /usr/sbin/post-thaw-script
[root@clone bin]# ls -ltr /usr/sbin/post-thaw-script
-rwx------ 1 root root 122 Oct 29 14:27 /usr/sbin/post-thaw-script





Files with oraprod user -

[oraprod@clone scripts]$ ls -ltr /home/oraprod/maaz/monitor/scripts/post-thaw-script.sql
-rw-r--r-- 1 oraprod proddba 282 Oct 29 14:20 /home/oraprod/maaz/monitor/scripts/post-thaw-script.sql
[oraprod@clone scripts]$ chmod 755 /home/oraprod/maaz/monitor/scripts/post-thaw-script.sql
[oraprod@clone scripts]$ ls -ltr /home/oraprod/maaz/monitor/scripts/post-thaw-script.sql
-rwxr-xr-x 1 oraprod proddba 282 Oct 29 14:20 /home/oraprod/maaz/monitor/scripts/post-thaw-script.sql
[oraprod@clone scripts]$ ls -ltr /home/oraprod/maaz/monitor/scripts/pre-freeze.sql
-rw-r--r-- 1 oraprod proddba 283 Oct 29 14:19 /home/oraprod/maaz/monitor/scripts/pre-freeze.sql
[oraprod@clone scripts]$ chmod 755 /home/oraprod/maaz/monitor/scripts/pre-freeze.sql
[oraprod@clone scripts]$ ls -ltr /home/oraprod/maaz/monitor/scripts/pre-freeze.sql
-rwxr-xr-x 1 oraprod proddba 283 Oct 29 14:19 /home/oraprod/maaz/monitor/scripts/pre-freeze.sql
[oraprod@clone scripts]$


Schedule VEEAM BAckup now and check if database was put in begin backup before snapshot.

Make sure you use -quiesce option when scheduling backup in VEEAM.



Comments

Popular posts from this blog

Logfile locations in EBS r12.1 and EBS r12.2

Startup/shutdown Apps tier services are started and stopped frequently and we must know logfiles when troubleshooting startup/shutdown issues. $INST_TOP/logs/appl/admin/log $INST_TOP/logs/appl/admin/log Apache OHS being part of opmn in r12.1 has continued in r12.2. Logfile locations for troubleshooting have been changed $INST_TOP/logs/ora/10.1.3/Apache/error_log[timestamp] $INST_TOP/logs/ora/10.1.3/opmn/HTTP_Server~1.log $IAS_ORACLE_HOME/instances/*/diagnostics/logs/OHS/*/*log*   OPMN Logfile locations for r12.1 and r12.2 have been changed $INST_TOP/logs/ora/10.1.3/opmn/opmn* $IAS_ORACLE_HOME/instances/*/diagnostics/logs/OPMN/opmn/* Oacore oacore in r12.1 is oc4j component and part of 10gAS. However, in r12.2, oacore is now a managed server for weblogic server $LOG_HOME/ora/10.1.3/j2ee/oacore/oacore*/ $LOG_HOME/ora/10.1.3/j2ee/oacore/oacore*/ $LOG_HOME/ora/10.1.3/opmn/oacore*/oacor...
Defragment workflow related tables in r12   References- 1.     How to Reorganize Workflow Tables? (Doc ID 388672.1) 2.     EBS Workflow (WF) Analyzer (Doc ID 1369938.1) Points to Remember –     Some workflow tables are associated to queues so that it is necessary to use the advance queuing instructions to reorganize them. For tables other than queue tables, please refer to different notes created by RDBMS team to reorganize tables. This activity depends on the RDBMS version.       Defragment tables in workflow r12 Verify tables are not associated to queues – SQL> select queue_table from dba_queue_tables   2   where queue_table like '%WF%'; QUEUE_TABLE ------------------------------ WF_CONTROL WF_DEFERRED WF_DEFERRED_TABLE_M WF_ERROR WF_IN WF_INBOUND_TABLE WF_JAVA_DEFERRED WF_JAVA_ERROR WF_JMS_IN WF_JMS_JMS_OUT WF_JMS_OUT WF_NOTIFICATION_IN WF...

Oracle EBS r12 migration to Solaris SPARC ** issues and solutions

Let me share a list of issues I faced when migrating a single node Oracle ebs r12.1.3 environment from Linux x86_64 to multinode Solaris SPARC machines. I have already shared ppt that was point of discussion before migration. Oracle ebs db platform migration Please note that below is set of issues and respective solutions while migration. I have not covered steps for migration in this post. I would also like to share list of references from metalink that were very handy during complete migration process. ·          Export/import process for 12.0 or 12.1 using 11gR1 or 11gR2 (Doc ID 741818.1) -           This document will be primarily used for database migration. ·          Application Tier Platform Migration with Oracle E-Business Suite Release 12 (Doc ID 438086.1) -           Apps tier will b...