pre_snap.sh | Performs the database backup by calling oracle_backup.sh. There are many ways to trigger DB backup script: cron jobs, third-party scheduler, or application, for example; however, onQ Portal provides a way to trigger this pre_snap.sh script before it backs up the protected volumes (see Step 5). This script can be modified to simply call an existing backup script that you’re currently using in your environment: |
oracle_backup.sh | Coordinates rman backup of the Oracle database.The onQ Service runs this script before the Quorum backup process. Modify this script to specify the details of your Oracle installation: ORACLE_BASE=/opt/oracle ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1 Change the parameters for your database: BACKUP_BASE=/backup01 BACKUP_AREA=${BACKUP_BASE}/rdbms/physical/orcl BACKUP_LOG_DIR=~/oracle_backup Modify for your Oracle SID: db=orcl This script can be replaced with an existing database backup script that you’re currently using in your environment. |
oracle_restore.sh | Coordinates rman restore/recovery of the Oracle database. Use this script to restore and recover the Oracle database if automated crash recovery fails. Modify this script to specify the details of your Oracle installation: ORACLE_BASE=/opt/oracle ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1 Change the parameters for your database: BACKUP_BASE=/backup01 BACKUP_AREA=${BACKUP_BASE}/rdbms/physical/orcl BACKUP_LOG_DIR=~/oracle_backup Modify for your Oracle SID: db=orcl This script can be replaced with an existing database backup script that you’re currently using in your environment. This script should be available in advance of your need to recover: as a best practice, always test a recovery before the need arises. |
armutil.sh armSender vmmonCtl | Communicates pre_snap.sh execution status to onQ, and depends on armSender and vmmonCtl executables in x64 or i386 folder. |
RHEL62x64-19-87: system: 2014-12-30 13:34:19: Pre-snapshot command returned: rman backup succeeded |
RHEL62x64-19-87: system: 2014-12-30 13:11:37: Pre-snapshot command returned: rman backup failed, see ~oracle/oracle_backup/oracle_backup.log |
[root@RHEL62x64-19-87 oracle_backup]# su - oracle [oracle@RHEL62x64-19-87 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Tue Dec 23 09:22:06 2014 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to an idle instance. SQL> startup; ORACLE instance started. Total System Global Area 1603411968 bytes Fixed Size 2213776 bytes Variable Size 1124075632 bytes Database Buffers 469762048 bytes Redo Buffers 7360512 bytes Database mounted. Database opened. SQL> connect SCOTT/<password> Connected. SQL> select count(*) from qa_test; COUNT(*) ---------- 27472 |
[root@RHEL62x64-19-87 oracle_backup]# su - oracle [oracle@RHEL62x64-19-87 ~]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Tue Dec 23 09:22:06 2014 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to an idle instance. SQL> startup; ORACLE instance started. Total System Global Area 1603411968 bytes Fixed Size 2213776 bytes Variable Size 1124075632 bytes Database Buffers 469762048 bytes Redo Buffers 7360512 bytes Database mounted. ORA-03113: en-of-life on communication channel Process ID: 2235 Session ID: 1 Serial number: |
# cd /home/oracle/oracle_backup # ./oracle_restore.sh |
[oracle@RHEL62x64-19-87 ~]$ cd /home/oracle/oracle_backup [oracle@RHEL62x64-19-87 oracle_backup]$ ./oracle_restore.sh Recovery Manager: Release 11.2.0.1.0 - Production on Tue Dec 23 09:32:15 2014 Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved. RMAN> set echo on; 2> connect target *; 3> shutdown immediate; 4> startup mount; 5> restore database; 6> shutdown immediate; 7> startup mount; 8> recover database; 9> alter database open; 10> exit; echo set on connected to target database: ORCL (not mounted) using target database control file instead of recovery catalog Oracle instance shut down connected to target database (not started) Oracle instance started database mounted Total System Global Area 1603411968 bytes Fixed Size 2213776 bytes Variable Size 1124075632 bytes Database Buffers 469762048 bytes Redo Buffers 7360512 bytes ... |
Starting restore at 23-DEC-14 allocated channel: ORA_DISK_1 ... restore from backup set ... channel ORA_DISK_1: restore complete, elapsed time: 00:02:45 Finished restore at 23-DEC-14 database dismounted Oracle instance shut down connected to target database (not started) Oracle instance started database mounted Total System Global Area 1603411968 bytes Fixed Size 2213776 bytes Variable Size 1124075632 bytes Database Buffers 469762048 bytes Redo Buffers 7360512 bytes Starting recover at 23-DEC-14 allocated channel: ORA_DISK_1 channel ORA_DISK_1: SID=18 device type=DISK starting media recovery media recovery complete, elapsed time: 00:00:03 Finished recover at 23-DEC-14 database opened Recovery Manager complete. |
[oracle@RHEL62x64-19-87 oracle_backup]$ sqlplus / as sysdba SQL*Plus: Release 11.2.0.1.0 Production on Tue Dec 23 09:44:55 2014 Copyright (c) 1982, 2009, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> connect SCOTT/<password> ' Able to connect to DB after restore and recovery Connected. SQL> select count(*) from qa_test; COUNT(*) -------- 27472 SQL>EXIT; |