Dataguard - Customer Documentation
Dataguard - Customer Documentation
Customer Documentation
Data Guard Customer Documentation
Copyright
2013 MICROS Systems, Inc. All rights reserved. No part of this publication may be reproduced, photocopied, stored on a
retrieval system, or transmitted without the express prior written consent of the publisher. MICROS Systems, Inc. retains the
right to update or change the contents of this document without prior notice. MICROS Systems, Inc. assumes no responsibility
for the contents of this document.
MICROS Systems, Inc. makes no warranty of any kind with regard to this material, including but not limited to the implied
warranties of marketability and fitness for a particular purpose.
MICROS Systems, Inc. shall not be liable for errors contained herein or for incidental or consequential damages in connection
with the furnishing, performance, or use of this material.
Table of Contents
OPERA utilizes a physical standby database that replicates the exact contents of its primary database across the
Oracle Net network layer. While the relative physical storage locations can differ, the data in the database will be
exactly the same as the primary database. It can function either in managed-recovery mode or in read-only mode,
but not in both modes at the same time.
The log-writer network-server and archiver processes running on the primary database select archived redo logs
and send them to the standby-database host, where the remote file server background process within the Oracle
instance performs the task of receiving archived redo-logs originating from the primary database. In OPERA testing
it has been determined a minimum connection pipe of 40mb would be required bandwidth for shipping these logs
from production to the standby server. Oracle uses port 1521 by default for this communication.
The Difference between a Switchover and a Failover is that after a Failover, the Standby Database becoming a
Primary now, cannot switchback to become a Standby Database again. In Opposition a Switchover exchanges the
Database Roles (The Primary becomes a Standby and the Standby becomes a Primary). Switchovers can be
performed arbitrarily, a Failover only once.
OPERA is a physical data guard implementation using the maximum performance setting having the data file
names and directories the same on the standby database as they are on the primary.
A Data Guard configuration consists of one production database and up to nine standby databases. The databases
in a Data Guard configuration are connected by Oracle Net and may be dispersed geographically.
Primary Database
A Data Guard configuration contains one production database, also referred to as the primary database, which
functions in the primary role. This is the database that is accessed by most of your applications.
Maximum Performance
This protection mode provides the highest level of data protection that is possible without affecting the
performance of a primary database. This is accomplished by allowing transactions to commit as soon as all redo
data generated by those transactions has been written to the online log. Redo data is also written to one or more
standby databases, but this is done asynchronously with respect to transaction commitment, so primary database
performance is unaffected by delays in writing redo data to the standby database(s).
This protection mode offers slightly less data protection than maximum availability mode and has minimal impact
on primary database performance.
2 6 2 6
2 5 8 11 2 5 8 11
83 6 6 4 9 2 12 12 2 9 4 66 38 83 6 6 4 9 2 12 12 2 9 4 66 38
22 ONLINE 1 22 ONLINE 1
AMP
SPARE 1 AMP
SPARE 1
STATUS STATUS
PROC PROC PROC PROC
PROC MIRROR PROC PROC MIRROR PROC
FANS FANS
FANS 3 7 FANS 3 7
6 5 4 3 2 1 6 5 4 3 2 1
6 5 4 3 2 1 6 5 4 3 2 1
4 8 4 8
Roles: Roles:
Primary Application Server Standby Application Server
Primary Database Server Standby Database Server
(Oracle Data Guard)
USERS
D:\scripts
Scripts are located in d:\scripts of the primary and standby servers.
The schedule is controlled via a jobs.txt file in the D:\scripts\tools\OperaBatchRunner directory. Notices from the
service will be written to the Windows application event log.
The directory “d:\scripts” is on both the primary and standby servers. This folder will include the below subfolders
o Standby Failover
o Standby Switchover\Primary
o Standby Switchover\standby
o blat
o logs
o diag
The following scripts are scheduled in the Opera Batch Job Service on the standby server.
d:\scripts\daily_report.bat - scheduled on a daily basis to generate. This is a daily report that needs to be
monitored to verify the standby server is current with applying all logs of production
The following are the logs generated by the Opera Batch Job Service on the standby server.
d:\scripts\logs\del_app_arch.log run by the daily_report.bat to delete archive logs that have been
applied to the standby database.
d:\scripts\logs\sync.log run by the sync.bat script shows the success of the synchronization operation for
the application server files.
To modify the scheduled interval of the tasks that run, modify D:\scripts\tools\OperaBatchRunner\jobs.txt file.
Review the following link for information on syntax for modifying the job schedule:
http://quartz-scheduler.org/documentation/quartz-1.x/tutorials/crontrigger
You must add a logon account on “Opera Batch Runner” service and for it to run and it must be run as a local or
domain user account created.
1. local user
- user must exist on both server with same username and password
- user must be added into ora_dba and Backup Operators group on both server
2. domain user
- user must be added into ora_dba and Backup Operators group on both server
Be sure to verify the service is started on the standby server. Verify the service is logging in with a valid
username/password.
If the database is not running start the standby by running double click on the desktop shortcut:
If you want to stop the standby database cleanly for maintenance you can double click on the desktop shortcut:
Note: if you stop the standby database manually please make sure to start it up after the maintenance period or
reboot the server.
D:\scripts\daily_report.bat is a Daily DG report is set up to run by the OPERA batch runner service to generate
reports on standby server daily that provides information on the status of the primary and standby environments.
This report provides information if the standby server is up and running, if the standby is current with production,
and it deletes archive files that have been applied to the standby server. This report also provides information on
the primary production database, version information, tablespace usage, invalid objects, number of user
connetions and backup information.
The output is written to d:\scripts\logs\daily_report.html and will be emailed to the configured email address
daily. Review this file daily to validate data guard consistency with production.
Standby Database
STAR SYSTE
INST_I DATABAS INSTANC DATABAS PROTECTION
STATUS HOST NAME T M
D E NAME E NAME E ROLE MODE
TIME DATE
27- 29-
MAXIMUM
MOUNTE BJXCYOPRDG PHYSICAL APR- APR-
1 OPERA OPERA PERFORMANC
D 1 STANDBY 2013 2013
E
18:31 06:00
Applied logs:
LOGS TIME
Last Applied : 29-APR-2013 03:07
Last Received : 29-APR-2013 03:07
Archive gaps:
GAPS
0
NOT APPLIED
0
NAME SEQUENCE#
D:\ORACLE\ADMIN\OPERA\ARCHIVE\OPERAT1S0737585868234.ARC 234
D:\ORACLE\ADMIN\OPERA\ARCHIVE\OPERAT1S0737585868233.ARC 233
D:\ORACLE\ADMIN\OPERA\ARCHIVE\OPERAT1S0737585868230.ARC 230
D:\ORACLE\ADMIN\OPERA\ARCHIVE\OPERAT1S0737585868231.ARC 231
D:\ORACLE\ADMIN\OPERA\ARCHIVE\OPERAT1S0737585868232.ARC 232
D:\ORACLE\ADMIN\OPERA\ARCHIVE\OPERAT1S0737585868235.ARC 235
D:\ORACLE\ADMIN\OPERA\ARCHIVE\OPERAT1S0737585868237.ARC 237
D:\ORACLE\ADMIN\OPERA\ARCHIVE\OPERAT1S0737585868236.ARC 236
PROCESS STATUS
ARCH CLOSING
ARCH CLOSING
MRP0 APPLYING_LOG
RFS IDLE
RFS IDLE
Production Database
OPERA VERSION
5.0.03.01 E00032
VERSION
10.2.0.4 Patch 45
PLATFORM_NAME
Microsoft Windows x86 64-bit
Tablespace usage:
Standby Database
Standby Database
STAR SYSTE
INST_I DATABAS INSTANC DATABAS PROTECTION
STATUS HOST NAME T M
D E NAME E NAME E ROLE MODE
TIME DATE
27- 27-
MAXIMUM
MOUNTE BJXCYOPRDG PHYSICAL APR- APR-
1 OPERA OPERA PERFORMANC
D 1 STANDBY 2013 2013
E
14:44 14:45
Applied logs:
LOGS TIME
Last Applied : 27-APR-2013 14:35
Last Received : 27-APR-2013 14:45
Archive gaps:
GAPS
0
NOT APPLIED
34
(Some archive logs are not applied, please
contact OPERA support.)
PROCESS STATUS
ARCH CLOSING
ARCH CLOSING
MRP0 WAIT_FOR_GAP
RFS IDLE
RFS IDLE
Standby Database
STAR SYSTE
INST_I DATABAS INSTANC DATABAS PROTECTION
STATUS HOST NAME T M
D E NAME E NAME E ROLE MODE
TIME DATE
27- 27-
MAXIMUM
MOUNTE BJXCYOPRDG PHYSICAL APR- APR-
1 OPERA OPERA PERFORMANC
D 1 STANDBY 2013 2013
E
15:24 15:27
Applied logs:
LOGS TIME
Last Applied : 27-APR-2013 15:04
Last Received : 27-APR-2013 15:27
Archive gaps:
GAPS
5
(Your databases are not in sync, please
contact OPERA support.)
NOT APPLIED
5
(Some archive logs are not applied, please
contact OPERA support.)
PROCESS STATUS
ARCH CLOSING
ARCH CLOSING
MRP0 WAIT_FOR_GAP
RFS IDLE
RFS IDLE
Production Database
To modify/add/remove email addresses in the daily report distribution list open D:\scripts\setenv.bat and update
the SET TO-ADDRESS line, comma delimited for multiple addresses in “double quotes”.
The daily report script also produces d:\scripts\del_app_arch.log that runs daily to delete archive logs that have
been applied to the standby database. Please review this report to verify archive logs are purging. You are looking
that the validation succeeded for all achieve logs and Recovery Manager complete.
You should also monitor the disk space location of the archive logs on the standby d:\oracle\admin\opera\archive.
Review d:\scripts\sync.log for verification that the application server updates are being copied over to the standby
server.
This scheduled task will copy the following files from primary to the standby server:
D:\MICROS\opera\export\
D:\MICROS\opera\import\
D:\oracle\oradata\attachments\
D:\oracle\oradata\email_attachments\
D:\MICROS\opera\Production\Runtimes\ to D:\MICROS\opera\Production\Runtimes_prod\
D:\MICROS\opera\Production\Customizable_Reports\ to
D:\MICROS\opera\Production\Customizable_Reports_prod\
1. Restarting the standby database if any of the above monitoring has any gaps or errors.
First run the STOP_DG desktop shortcut
Secondly run START_DG desktop shortcut
Login to the primary database as “SYS” user and issue the below commands:
alter system archive log current;
archive log list;
The above screenshot shows that the current online log sequence# is 41.
Login to the standby database as “SYS” user and issue the below SQL commands.
select process, status, sequence# from v$managed_standby;
The above screenshot confirms that the log sequence# 41 is currently being applied to the standby.
select thread#, sequence#, applied from v$archived_log order by sequence#;
1. d:\scripts\logs\daily_report.html – Verify there are no archive gaps and all logs are applied
2. d:\scripts\del_app_arch.log – Verify the archives applied are purging on the standby
3. d:\scripts\sync.log – Verify the application files are current
4. Verify that the archived redo log was applied
SQL > select sequence#, applied from v$archived_log order by sequence#;
If the applied column has a ‘Y’, those are the archives applied
Alternately run
SQL > select sequence#, applied from v$archived_log where applied=’N’ order by sequence#;
This query will show the time of the last log applied:
Primary Server
1. Verify the backups are running and archives are being groomed as expected
2. Verify production is started:
3. Verify standby is started:
SQL > Select controlfile_type, open_mode from v$database;
This command should state that your Controlfile_type is “OPEN” and the database should be “READ
WRITE”
Version Upgrades
NOTE – BE SURE TO NOTIFY OPERA SUPPORT PRIOR TO AN UPGRADE THAT THIS IS A DATA
GUARD ENVIRONMENT TO SHUTDOWN STANDBY PRIOR TO UPGRADES.
Prior to any OPERA or Oracle upgrade shutdown the standby database. This can be used as a pre-upgrade image in
the event of failure and the need to revert to the pre-upgrade standby version. This would require a failover to
take place so the upgrade is not replicated to the standby.
If you want to stop the standby database cleanly for maintenance you can double click on the desktop shortcut:
OPERA upgrades
OPERA upgrades are run on the primary/production database server. Once successful a runtimes only upgrade will
need to be run on the standby database server. Once the OPERA upgrade is completely successful, start the
standby server back up and the database updates will be replicated to the standby database automatically.
***CAUTION*** Monitor the archive log destination on both servers for sufficient free space during all OPERA
upgrades.
Oracle upgrades
The Oracle binary installation upgrade will need to be performed on both the primary and standby servers.
However the database upgrade is only run on the primary/production database. Once the upgrade is successful
start the standby server back up and the database updates will be replicated to the standby database
automatically.
OXI Servers
1. On each OXI server open Windows Services and stop all services that start with “Opera Interface for…”
IFC Servers
1. On each IFC server open Windows Services and stop the service “Opera IFC Controller”
Primary Database
1. Stops the application server and removes the application virtual IP from the server
4. Starts the standby server OPERA batch runner service and starts the service
You can also query the database and verify the mode is standby:
select controlfile_type, open_mode from v$database;
This command should state that your Controlfile_type is “STANDBY” and the database should be “MOUNTED”
D:\scripts\standby_switchover\primary\primary_to_standby.log
Standby Database
On the standby database server navigate to D:\scripts\Standby Switchover\standby as administrator run the
standby_to_primary.bat.
You can also query the database and verify the mode is OPEN:
select controlfile_type, open_mode from v$database;
This command should state that your Controlfile_type is “OPEN” and the database should be “READ WRITE”
At this point, the standby database can be used as the primary database by the application.
D:\scripts\standby_switchover\standby\standby_to_primary.log
Failover
In case of a loss of the Primary Database, the Standby can take over the Primary Role and act as a Primary
Database. A Failover can be performed when all or most of the information until the unavailability of the Primary
Database was propagated to the Standby.
This should be run only from the standby server and only if the primary database is no longer available.
Once the old primary database server is available, it can be built as a standby database server. The configuration
can remain or if desired a scheduled switchover can be performed and the primary role can be put back on the
original primary server. Switching the roles back will require a short downtime.
Standby Database
Navigate to D:\scripts\Standby Failover from a command prompt window and execute the Failover.bat.
You can also query the database and verify the mode is OPEN:
select controlfile_type, open_mode from v$database;
This command should state that your Controlfile_type is “OPEN” and the database should be “READ WRITE”.
D:\scripts\standby_failover\failover.log
Backups
All backup jobs need to be configured to point to the newly appointed Primary server and database.
OXI Servers
1. Go to \oracle\product\10.2.0\client_1\network\admin\tnsnames.ora
2. Update the HOST with the new production server name ON each OXI server
OPERA.WORLD, OPERA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = <PRODUCTION_DB_SERVER_NAME>)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = OPERA)
)
)
3. On each OXI server open Windows Services and start all services that start with “Opera Interface for…”
IFC Servers
3. On each IFC server open Windows Services and start the service “Opera IFC Controller”
The following details how passwords should be changed in a Dataguard environment when you are planning to
change the SYS or SYSTEM password in PRIMARY
Step 3: Update the passwords in any other locations that reference it. Possible location:
1. Backup Exec change agent password on DB server
Start > Programs > Symantec Backup Execc > Backup Exec Remote Agent Utility
2. Change Backup Exec Server SYS password
3. Custom RMAN scripts
4. Windows scheduled tasks
If the password is already changed, and/or you are getting ORA-16191 during log shipping then follow the below
action.
Action: Copy the password file from PRIMARY to STANDBY (OR) recreate the password file in standby with the
same password.
After the password has been modified on the standby server(s), ensure that archive logs are being applied and no
errors seen in the alert log.
Antivirus
Antivirus EXCLUSIONS
Micros Systems, Inc. does not promote, certify or support any specific antivirus software installed on Opera
servers. However Micros Systems, Inc. does not prohibit anti-virus software installed on Opera servers.
If a customer decides to install the anti-virus software on this Opera server, the anti-virus should not lock or
attempt to lock any Opera or Oracle files.
Most anti-virus software has the ability to skip the scanning of certain files. It is required that the anti-virus
software be configured to exclude the scanning of the Oracle data files, Oracle Home folders, Micros folders in the
following locations:
C:\Program Files\Oracle
Make certain that anti-virus software does not have the email scanning option installed. If the email scanning
option is installed, either remove the option entirely (disabling it is not enough), or de-install and re-install the
anti-virus software without the email scanning option on any database server.
If the Anti-Virus software comes with a firewall, the firewall should be disabled.
It is the sole responsibility of the customer to support and configure any anti-virus software installed on Opera
servers. It is also the sole responsibility of the customer to ensure any anti-virus software does not cause any
incompatibility issues or performance problems to the Server, its operating system or the Opera Application. The
customer is also responsible for keeping any anti-virus software updated, to research and resolve any known issues
with any anti-virus software and implement desired bug fixes.
If there are performance issues on the server and it is thought to be related to the anti-virus software due to the
configuration or the way that it scans the system, then Micros will ask that it be disabled until the problem is
resolved. In some circumstances Micros will request that the anti-virus software be completely removed from the
system while troubleshooting an issue. Once the issue is identified and correct changes are made the anti-virus
software can be re-enabled.
rebuild_DG.cmd
D:\scripts\rebuild_DG\rebuild_DG.cmd is run on the STANDBY SERVER and creates a production backup on the
production server as d:\stdby_backup. That backup is then copied to the standby servrer as d:\stdby_backup, and
is then restored to the standby server to get dataguard up and running.
4. On the production database server the backup will be written to d:\stdby_backup directory.
5. Once the backup is complete on production it will use robocopy to copy the backup to the standby
database server written to d:\stdby_backup
6. Once the copy is complete it will perform a restore of the standby database. There is no need to remove
the existing/bad standby database datafile the script will handle replacing them.
7. Log file can be found in d:\scripts\rebuild_DG\logs folder on the standby database server. Please review
rebuild.log for any obvious error.
8. Once the restore is complete it will start the standby database in standby recovery modes
Log files
The following are the logs generated by the Opera Batch Job Service on the standby server.
d:\scripts\logs\del_app_arch.log run by the daily_report.bat to delete archive logs that have been
applied to the standby database.
d:\scripts\logs\sync.log run by the sync.bat script shows the success of the synchronization operation for
the application server files.
The following is the rebuild data guard log on on the standby server:
d:\scripts\rebuild_DG\logs\rebuild.log
The following is the d:\scripts\OS_changes.exe log on the production and standby server:
d:\scripts\logs\OS_Changes.log
d:\scripts\logs\PROD_install.log
d:\scripts\logs\DG_install.log
D:\scripts\standby_switchover\primary\primary_to_standby.log
D:\scripts\standby_switchover\standby\standby_to_primary.log
D:\scripts\standby_failover\failover.log
The following is the OPERA Batch Runner install log on the standby server:
D:\scripts\tools\OperaBatchRunner\OperaBatchRunner.InstallLog
alertOPERA.log
System Files
This will generate a file of the format dgdiag_phystby_&&dbname&×tamp&&suffix in the directory structure you
run it from (in the above example it will generate at the base d:\ drive), attach this file to the case.
This will generate a file of the format dg_prim_diag_&&dbname&×tamp&&suffix in the directory structure you run
it from (in the above example it will generate at the base d:\ drive), attach this file to the case.
Daily Report
From the standby database server provide the d:\scripts\logs\daily_report.html to the case.