5 08 Slavitz
5 08 Slavitz
Independent Consultant
Oracle Applications DBA and
Developer
[email protected]
Options
Restore and clone latest backup to a test box.
Or
In 15 minutes youve fully switched Oracle
My Goal Today
Tell you how you can be relaxed, not stressed, in a
What Is Flashback?
Introduced in Oracle 9i
Flashback is part of your Oracle database no
licensing requirement
Provides a rewind button for your data
Flashback Database - return database to a
previous point in time
Flashback Table - return a table to a previous
point in time
Flashback Query see data at a previous
point in time
Jeff Slavitz - NorCal OAUG Training Day
2010 v3
Instant Clone
Activate standby database
Perform testing on standby database
When testing complete, flashback standby
Reporting Database
Scenario:
You want a data warehouse which is a snapshot
of Production as of 9pm the day before. Users
need access via Oracle Applications and
Discoverer
Old School: Daily clone
Data Guard: Use standby database as a
reporting database
Jeff Slavitz - NorCal OAUG Training Day
2010 v3
Reporting Database
Activate standby database
Users login to standby database with Oracle
Hardware Configuration
Primary
(California)
Standby
(Nevada)
Database
Database
45mb of which
8-10mb used by
Data Guard
Application
Application
Software Configuration
Database
10.2.0.4
Data Guard Physical Bundle patch 7936993
Data Guard Logical Bundle patch 7937113
Data Guard Broker Bundle patch 7936793
Applications 11.5.10.2
11i
Substitute APPL_TOP for Instance Top in text
Jeff Slavitz - NorCal OAUG Training Day
2010 v3
Logical vs Physical
Two types of standby databases
Physical
Byte-for-byte duplicate of the primary database
Archived redo logs transferred from primary database are
Logical
Different structure than the primary database
Oracle uses SQL statements to update standby
Standby can be open while it is being updated
Maximum Protection
Three types of protection
Maximum
Mode
Protection is highest level of data security
Primary database changes are not committed
Maximum Performance
Default protectionMode
mode
The commit operation on the primary
Maximum Availability
Second highest level
of data security
Mode
# Flash recovery area. This is the default location for control files,
online
# redo logs, archived redo logs, flashback logs, RMAN backups.
db_recovery_file_dest=/u01/oracle/flash_recovery_area
# First destination for archived redo logs
log_archive_dest_1 =
'LOCATION=USE_DB_RECOVERY_FILE_DEST MANDATORY
# Second destination for archived redo logs
log_archive_dest_2 = 'SERVICE=PROD_LNXDRDB1
valid_for=(online_logfiles,primary_role)
db_unique_name=PROD_LNXDRDB1 LGWR ASYNC=20480
OPTIONAL REOPEN=15 NET_TIMEOUT=30
Jeff Slavitz - NorCal OAUG Training Day
2010 v3
# In minutes, how long you want to keep flashback files. Since using
# guaranteed flashback really don't need this to be too big.
db_flashback_retention_target=120
# On/Off switch for sending logs to standby system
log_archive_dest_state_2 = defer
# Databases in Data Guard configuration using my instance naming
convention
log_archive_config='dg_config=(PROD_CAMELDB1,PROD_LNXDRDB1)
# Log gap detection and resolution when this database is the standby
fal_server = 'PROD_LNXDRDB1
fal_client = 'PROD_CAMELDB1'
Jeff Slavitz - NorCal OAUG Training Day
2010 v3
Flashback
db_recovery_file_dest
defines Flash recovery area disk location
This is the default location for control files, online redo logs,
shutdown;
Recover managed standby database using current logfile
disconnect
Switch existing standby to new primary:
alter database commit to switchover to primary;
alter database open;
alter system set log_archive_dest_state_2=enable;
Confirm logs are shipping to standby by checking alert log, archive
required
Clear application context: exec fnd_conc_clone.setup_clean
Run adautocfg on database and application tiers
Run cmclean.sql (note 134007.1) to avoid Output Post
node name
Update wf_item_attribute_values.text value with new
node name
Check for any other profile values that contain old node
name
Clear Apache cache
Start application and send users new login url
Synchronize APPLCSF log and out files
Use rsync
Faster than scp and only copies changed files
rsync -avz
$APPLCSF/out/${TWO_TASK}*/ applprod@lnxdrapp1:$APPLCSF/out/${TWO_TASK}*
Consider setting cron job to synchornize APPLCSF in
case of system failure
Jeff Slavitz - NorCal OAUG Training Day
2010 v3
Failover
Immediate switch of primary to standby system
Some archive log data may be lost due to network
latency
On standby-soon-to-be-primary:
Cancel database recovery
alter database commit to switchover to primary
On new standby:
Startup mount
flashback database to scn <above #>
alter database convert to physical standby;
recover managed standby database using current logfile
disconnect;
Resume Standby
On Standby: Operation
Shutdown application
Shutdown database
Startup mount
Flashback database to restore point STBY_ON
Alter database convert to physical standby
Lessons Learned
Script as much as possible you will make
Questions?
Want the latest version of this presentation?
www.OracleAppsPro.com
Jeff Slavitz
[email protected]
(415) 388 - 3003
Jeff Slavitz - NorCal OAUG Training Day
2010 v3