Informix Dynamic Server 11.50

Download Report

Transcript Informix Dynamic Server 11.50

Information Management
Informix Dynamic Server 11.50
Continuous Availability Feature (CAF)
Ron Privett
KC IIUG Tech Day - 01/22/2009
© 2009 IBM Corporation
Information Management
Agenda
 Overview of CAF (MACH11)
 Type of CAF Servers
– HDR Secondary
– SDS and RSS
– CLR
 Updatable Secondary Servers (11.50 and above)
 Demo
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
© 2009 IBM Corporation
Information Management
What is CAF?
 CAF = Continuous Availability Feature (Code name = MACH11)
 Multi-Node Active Cluster for High Availability:
– Extends HDR to support multiple secondary instances
– CAF is a cluster of IDS instances working together on a common set of data to
provide 1)High availability, 2) Load balancing and 3) Disaster recovery solutions.
– CAF clusters includes one primary instance and one or more secondary instances
including HDR, SDS and RSS secondary servers.
– New types of secondary servers introduced with a CAF cluster
– Shared Disk Secondary (SDS)
– Remote Standalone Secondary (RSS)
– Continuous Log Restore (CLR) **
– All secondary server instances in a CAF cluster can be configured to support DML
operations.
** not exactly a CAF instance but included for the purposes of discussion
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
© 2009 IBM Corporation
Information Management
Agenda
 Overview of CAF (MACH11)
 Type of CAF Servers
– HDR Secondary
– SDS and RSS
– CLR
 Updatable Secondary Servers (11.50 and above)
 Demo
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
© 2009 IBM Corporation
Information Management
High-Availability Data Replication (HDR)
 Two identical instances on two very similar physical servers:
– Primary instance
– Secondary instance
 Primary physical server:
– Duplicate of Primary instance structure
When primary instance goes down,
secondary instance takes over as
updatable instance
– All database activity – insert/update/deletes, are performed on this instance
– Sends logs to secondary server
 Secondary physical server:
– Read only instance: allows read only operations
– Always in recovery mode
– Receives logs from primary instance and replays them to keep in sync with primary
Primary
HDRSecondary
HDR Traffic
Client Apps
Blade Server A
Blade Server B
Building-A
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
© 2009 IBM Corporation
Information Management
High-Availability Data Replication (HDR) - Review










Requires same Database/Hardware/OS
Synchronous or Asynchronous
Only Logged Databases are replicated
Data in dbspaces and sbspaces supported
Blobspace Data not supported
All built-in and extended data types supported
Ontape or OnBar for Recovery
Automatic or Manual failover
Encrypted communications available
Index Shipping or Index Logging
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
© 2009 IBM Corporation
Information Management
HDR - How it works…
Primary
Secondary
Log Buffers
Read Only
Logged
I/O Activity
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
© 2009 IBM Corporation
Information Management
Agenda
 Overview of CAF (MACH11)
 Type of CAF Servers
– HDR Secondary
– SDS and RSS
– CLR
 Updatable Secondary Servers (11.50 and above)
 Demo
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
© 2009 IBM Corporation
Information Management
Shared Disk Secondary (SDS)
LSN
ACK
LSN
 HDR on top of a shared disk
subsystem
 Primary transmits the current Log
Sequence Number (LSN) as it is
flushing logs
Primary
SDS
SDS
 SDS instances receives the LSN
from the primary and reads the logs
from the shared disks
 SDS instances applies log changes
to its buffer cache
Shared
disk
 SDS instances resynch processed
LSN to primary
Disk
mirror
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
© 2009 IBM Corporation
Information Management
Remote Standalone Server (RSS)
 Similar to HDR:
– Maintains a full disk copy of the database.
– Created by performing a backup/restore of the instance
– Can be used for: Additional Backup, Report processing, Load balancing.
 Distinct from HDR:
– Uses full duplex communication (SMX)– better throughput over slower lines.
– Does not support SYNC mode, not even for checkpoints.
– Can not currently be ‘promoted’ to primary – but can be promoted to HDR secondary (Focus is on
24 X 7 Availability, Scalability, and Disaster Recovery).
– There can be any number of RSS instances.
– Requires Index Page Logging be turned on.
 RSS can be used in combination with HDR secondary:
– RSS can be converted into HDR secondary.
– HDR secondary can be converted into RSS.
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
© 2009 IBM Corporation
Information Management
Agenda
 Overview of CAF (MACH11)
 Type of CAF Servers
– HDR Secondary
– SDS and RSS
– CLR
 Updatable Secondary Servers (11.50 and above)
 Demo
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
© 2009 IBM Corporation
Information Management
Continuous Log Restore (CLR)
 Also known as “Log Shipping”.
 Allows logical recovery to span
multiple ‘ontape/onbar’ commands.
Primary
 Provides a secondary instance with
‘log file granularity’.
 Does not impact the primary server.
 Can co-exist with “the cluster”
(HDR/RSS/SDS) as well as ER.
 Can be automated by scripting the
log backup alarms.
 Useful when backup site is totally
isolated (i.e. no network)
CLR1
CLR3
CLR2
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
© 2009 IBM Corporation
Information Management
Continuous Log Restore (CLR)
 An enhancement to both ontape and OnBar
– When logs are full and backed-up, the log files can be copied to other supporting
instances in CLR mode
 Logs are applied to target instances as needed
– Manually - as part of daily or weekly activities
– Automatically - as set by a TASK, or other processes
– ontape -l -C
– onbar -r -l -C
 Note: A general assumption here is that the source server will
archive logs to disk files, rather than tapes
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
© 2009 IBM Corporation
Information Management
Example of CLR
Customer has immediate failover (HDR) in local
office but also wants an offsite copy. Network
outages are common, and throughput is too
erratic for RSS.
OR
Customer needs to be able to recover quickly
but doesn’t want / need immediate failover
Continuous Log
Restore Server
HDR Primary
Customer uses O/S utilities to
transfer logs and backups as
needed. CLR instance can be
up or not. Backups and logs
can be applied to instance as
business rules dictate.
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
HDR Secondary
© 2009 IBM Corporation
Information Management
Advantages of using a CLR server
 Verification of Logical Restore
– Archecker verifies the physical restore, a CLR server can verify the logical restore
 Faster Recovery Time
– If you need to restore your entire instance, having a CLR server means you could be back up and
running faster
 Manual or Automatic application of Logical Logs
– If you have ever dropped a production table, which hits the HDR server, or another RSS server
before you can break the connection? With a CLR server, you decide when to apply the logical
log files.
 Another server in case of Disaster
– Can you ever have too many DR servers?
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
© 2009 IBM Corporation
Information Management
CLR Issues to be aware of…
 CLR is designed to assist Disaster Recovery, not designed as a High
Availability solution. However, you can ‘promote’ a CLR server into an HDR
secondary server (details on the next slide).
 There is no Point-In-Time restore with CLR, it’s the whole log or nothing.
More a Point-In-Log restore.
 To aid the process of log movement between source and target servers consider the following:
– Using the environment variable IFX_ONTAPE_FILE_PREFIX to set the filename of ontape
‘backup to directory’ files.
– Using a shared disk to store archive files
– Script the process of removing old ‘applied’ log files to back them up to tape or other archive
media.
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
© 2009 IBM Corporation
Information Management
CLR Promotion into an HDR Secondary
 If needed, you could promote a CLR server into an HDR secondary
server. Here are the steps:
– Break HDR with the current secondary server
– On Primary:
onmode -d primary {secname}
– On Secondary:
onmode -d secondary {priname}
 Primary server sees the secondary needs recovery, and will start
sending logs:
20:32:56
DR: Secondary server needs failure recovery
 Secondary sever recovers the logs and becomes available
20:33:02
DR: HDR secondary server operational
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
© 2009 IBM Corporation
Information Management
Agenda
 Overview of CAF (MACH11)
 Type of CAF Servers
– HDR Secondary
– SDS and RSS
– CLR
 Updatable Secondary Servers (11.50 and above)
 Demo
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
© 2009 IBM Corporation
Information Management
Updatable Secondary Server
 INSERT, UPDATE and DELETE statements are now supported at
SDS, HDR and RSS secondary servers.
 New ONCONFIG Parameter “UPDATABLE_SECONDARY”
introduced in 11.50 to support DML operations at secondary server.
 Default setting is 0 which means that the secondary server doesn’t allow any DML
Statements.
 Any setting greater than 0 enables DML Statements on the local server
acting as a secondary server.
 Restrictions
– DDL Statements like CREATE TABLE, CREATE PROCEDURE are still not
supported
– Update Statistics is not supported.
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
© 2009 IBM Corporation
Information Management
Updatable Secondary Server
 Redirects an attempted DML operation from the secondary by a pool of
proxy threads via SMX interface to the primary database server for
execution.
 Triggers and constraint checking is performed on the primary database
server.
 Uses optimistic concurrency to avoid updating a stale copy of the row.
 Redirected writes work on the basic data types, UDTs, logged smart BLOBs,
and partition BLOBs.
 Supports temp tables- both explicit and implicit.
 Works on HDR secondary, RSS nodes, and SDS nodes.
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
© 2009 IBM Corporation
Information Management
How to configure an Updatable Secondary
 New ONCONFIG Parameter “REDIRECTED_WRITES” in 11.50.xC1.
 From 11.50xC2 onwards “REDIRECTED_WRITES” ONCONFIG parameter
is renamed to “UPDATABLE_SECONDARY”.
– Default setting of the new parameter is 0 which means that the database server doesn’t allow any
DML Statements in case it acts as a RSS, HDR Secondary or SDS.
– Any setting larger than 0 enable DML Statements on the local server acting as a secondary.
Server is then configured as a updatable secondary.
– The setting of the Value bigger than 0 also specify how many SMX network connections to be
used for distributed write operations.
 Parameter setting for the UPDATABLE_SECONDARY is permanent for the
uptime of the database server, means no on demand change of the current
value with onmode –wf/wm is possible.
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
© 2009 IBM Corporation
Information Management
Differences in server behavior
 Local database server acts as an updatable secondary enabled by
UPDATABLE_SECONDARY 1
update customer set fname=“XXXXX” where customer_num=110
1 row(s) updated.
 Default read only behavior by unset UPDATABLE_SECONDARY in
ONCONFIG or a setting to 0
update customer set fname=„XXXX“ where customer_num=110
346: Could not update a row in the table.
140: ISAM error: operation illegal on a DR Secondary
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
© 2009 IBM Corporation
Information Management
New SQL error codes returned by the server
 Using Redirected Writes on a secondary database server can cause new
SQL error codes.
– Error –7350
– An attempt was made to update an invalid version of the current row or the schema of the
table doesn’t match with the schema of the primary database server.
7350: Attempt to update a stale version of a row
Error in line 1
Near character position 29
Database closed.
– Error –7351
– The connection between the updatable secondary and the primary database server are lost
during the execution of the current request or transaction.
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
© 2009 IBM Corporation
Information Management
Agenda
 Overview of CAF (MACH11)
 Type of CAF Servers
– HDR Secondary
– SDS and RSS
– CLR
 Updatable Secondary Servers (11.50 and above)
 Demo
Informix Dynamic Server 11.50 | Continuous Availability Feature (CAF)
© 2009 IBM Corporation