45
Implementing High Availability for SAP Business Objects CMS and Audit Databases An introduction to CMS and Audit database mirroring to achieve high availability during server failover

SAP SQL Anywhere High Availability Tutorial for Business Objects

Embed Size (px)

Citation preview

Page 1: SAP SQL Anywhere High Availability Tutorial for Business Objects

Implementing High Availability for SAP Business Objects CMS and Audit DatabasesAn introduction to CMS and Audit database mirroring to achieve high availability during server failover

Page 2: SAP SQL Anywhere High Availability Tutorial for Business Objects

Table of ContentsIntroduction.................................................................................................................................................3

Software Prerequisites................................................................................................................................3

Default Credentials......................................................................................................................................4

Database Mirroring Architecture.................................................................................................................5

Database Mirroring Setup...........................................................................................................................7

Setting up the Mirror Partners for the CMS Database.............................................................................7

Setting up the Mirror Partners for the Audit Database.........................................................................14

Starting up the Mirror and Arbiter Database Servers............................................................................20

Changing the ODBC DSN Connections.......................................................................................................21

Adding Services to Sybase Central.............................................................................................................25

Comfirming Mirroring Database Servers...................................................................................................39

Summary & Additional Resources.............................................................................................................42

2

Page 3: SAP SQL Anywhere High Availability Tutorial for Business Objects

INTRODUCTIONSAP SQL Anywhere is used as the default database server for the Central Management Server (CMS) and Audit data stores in SAP Business Objects 4.1 (or higher) and 3.1 (SP5 or higher). One of the many advantages of using SQL Anywhere (SQLA) in Business Objects (BOBJ) is its high availability (HA) capability. With the growing need of 24/7 operations and minimal downtime, it is vital for BOBJ administrators to account for high availability during deployment. Key features of a high availability environment include system backups, data storage, and failover processing. This document strictly focuses on implementing failover processing by mirroring the CMS and Audit Databases. There are three components required to have a successful mirroring configuration. A Primary database server, a Mirror database server and an Arbiter database server - they all communicate together to make sure that the CMS and Audit databases are always active. To find more information on general database mirroring, please refer to the documentation here (DocCommentXchange).Please note that it is equally important to safeguard other components of BOBJ such as the In/Out File Repository Systems (FRS) and BOBJ server. More information about other high availability options such as BOBJ server clustering can be found on the SAP Business Objects Deployment and Configuration Guide available at the SAP website. Users interested in learning how to back up the CMS and Audit databases to prevent data loss can take a look at the article (Backing Up the CMS and Audit Databases Using SQL Anywhere Maintenance Plans).

SOFTWARE PREREQUISITES SAP Business Objects 3.1 (SP5 or higher) or 4.1 (or higher). The SQLA 12.0.1 database administration tools Sybase Central and Interactive SQL that are

included in the SQL Anywhere Client software (see this blog post on how to install it:-Database Administration Tools for SQL Anywhere CMS and Audit DBs).

SQL Anywhere database server with high availability option enabled (see important note below). The edition of SQL Anywhere 12.0.1 used in this document is the free Developer Edition as it includes the high availability option. The Developer Edition is perfect for development and testing purposes. You can download a copy of SQL Anywhere 12.0.1 Developer Edition here: http://scn.sap.com/docs/DOC-31795.

3

Important note for implementing high availability in a production BOBJ environment.

The bundled edition of SQLA that is provided with BOBJ does not include the high availability option. You can use the SQLA Developer Edition to test your HA implementation, but you cannot use that edition in production environments. To do so, you must purchase SQL Anywhere 12.0.1 Standard

Edition or SQL Anywhere 12.0.1 Advanced Edition as they include the high availability option.

Please contact your SAP sales representative to obtain that product.

Page 4: SAP SQL Anywhere High Availability Tutorial for Business Objects

DEFAULT CREDENTIALSThroughout this document there are many steps where the user is asked for credentials such as hostname, database user ID & password, CMS cluster name, ODBC data source information, etc. The credentials used are listed below for reference.

Default database server name: BI4

Default database server port: 2638

Default database server password: pASSWORD1

Copy database server name: BI4copy

Copy database server port: 2639

Copy database server password: pASSWORD1

Arbiter database server name: arbiter

Arbiter database server port: 2637

Arbiter database server password: pASSWORD1

CMS cluster name: BaseW2k8r2EnterpriseSeldon:6400

CMS ODBC DSN name: BI4_CMS_DSN

Audit ODBC DSN name: BI4_Audit_DSN

DATABASE MIRRORING ARCHITECTUREBelow is an architecture diagram showing how a Business Objects HA deployment would look. The three key components include a clustered BOBJ server setup, CMS/Audit database server mirroring setup and an Active/Passive File Repository Server (FRS) Setup. Once again this document strictly focuses on implementing failover processing by mirroring the CMS and Audit Databases.

Clustering more than one BOBJ server increases the number of available machines working together to maintain a system database. Clustering nodes provides failover support in the case of a BOBJ server going down. The duplicate BOBJ server continues to process requests with no impact to the system.

A deployment can have multiple File Repository Servers to store files, usually on a SAN. The active FRS is the one that first registers to the BOBJ server cluster. In the case that the active FRS fails the passive FRS registered with the cluster is changed to active status. FRS can be replicated for backup purposes using a RAID array.

4

Page 5: SAP SQL Anywhere High Availability Tutorial for Business Objects

5

Page 6: SAP SQL Anywhere High Availability Tutorial for Business Objects

6

Load Server

BOBJ Server/Node 1

FRS (Passive)

FRS (Active)

BOBJ Server/Node 2

BI4_Audit.db

BI4_CMS.db

BI4_Audit.db

Arbiter

Server

Database Server

2 (mirror)

BI4_CMS.db

Database Server 1 (primary)

Pictures from TEC1103.pptx by José Ramos

Page 7: SAP SQL Anywhere High Availability Tutorial for Business Objects

DATABASE MIRRORING SETUPIn a BOBJ deployment there are two important databases (BI4_CMS and BI4_Audit) that always connect to a running database server. If this database server were to ever shutdown or fail, these databases would be inaccessible resulting in data loss. SQLA database mirroring allows the user to create an alternate database server that automatically connects to these databases if this were to occur.

There are some preliminary steps that must be completed before the setup can be started.

1. The BOBJ server needs to be shutdown. It is recommended this is done when he BOBJ server load is low.

2. There should be an existing directory with the SQLA databases and transition log files. The default location for these files are:

Location: C:\Program Files (x86)\SAP Business Objects\sqlanywhere\database. File names: BI4_CMS.db, BI4_CMS.log, BI4_Audit.db, and BI4_Audit.log.

3. The user must create similar directory for the mirror and arbiter servers to hold additional databases. The directories used for this paper are:

C:\arbiter C:\t1

Setting up the Mirror Partners for the CMS DatabasePlease note that this paper assumes the user is comfortable using the Command Prompt and SQL Anywhere commands. The first step to database mirroring is to start up the default database server with its mirroring properties.

1. Open a Command Prompt and start the default database with the following command:dbsrv12 -n BI4 -x tcpip(PORT=2638) -su pASSWORD1 "C:\Program Files (x86)\SAP BusinessObjects\sqlanywhere\database\BI4_CMS.db" -xp on "C:\Program Files (x86)\SAP BusinessObjects\sqlanywhere\database\BI4_Audit.db" -xp onThe “–xp on” switch indicates that the server is able to participate in database mirroring.

**If the High Availability option is not enabled within your edition of SQLA the use of the “–xp” switch in the command above will return an error!**

2. Connect to the default CMS database from Interactive SQL (ISQL) to define the mirroring parameters:dbisql -c "UID=DBA;PWD=pASSWORD1;SERVER=BI4;DBN=BI4_CMS.db"

7

Page 8: SAP SQL Anywhere High Availability Tutorial for Business Objects

An Interactive SQL (ISQL) window opens like the following:

3. Define the default database server “BI4” as a partner server for the “BI4_CMS” database. This statement also creates a state file for the server that keeps track of what state the server is in. Hit the Execute button or F5 to run the SQL statements.

CREATE MIRROR SERVER BI4AS PARTNERconnection_string='SERVER=BI4;host=localhost:2638'state_file='C:\\Program Files (x86)\\SAP BusinessObjects\\sqlanywhere\\database\\BI4.state';

8

Page 9: SAP SQL Anywhere High Availability Tutorial for Business Objects

9

Page 10: SAP SQL Anywhere High Availability Tutorial for Business Objects

4. Create a database server and define it as a partner to the original database server. This will be the database server that will act as a mirror and will become the active database server in the case of a failover. Please make sure this database server starts on a different host port.

CREATE MIRROR SERVER BI4copyAS PARTNERconnection_string='SERVER=BI4copy;host=localhost:2639'state_file='c:\\t1\\BI4copy.state'

10

TROUBLESHOOTING ISQL

A common error that can occur when defining a server as a partner, a primary or mirror is that a server with that attribute might already exist for that database. Error windows that pop up can look like the ones below.

There is a very easy solution to resolve such problems and require two steps.

1. Use this command to see all the database servers running and their server types. “SELECT * FROM SYS.SYSMIRRORSERVER”

2. Identify the server type and server name that currently exist and use the command “DROP MIRROR SERVER {SERVERNAME}” to drop the server.

Page 11: SAP SQL Anywhere High Availability Tutorial for Business Objects

5. Execute the following statement to define “BI4primary1” as the logical Primary Server for BI4’s CMS database. BI4primary1 is the name that clients use to connect to the database server associated with the CMS database that is acting as the Primary Server. Make sure to specify both the ports used for the default and copy database servers.

CREATE MIRROR SERVER BI4primary1AS PRIMARYconnection_string='SERVER=BI4primary1;HOST=localhost:2638,localhost:2639';

11

Page 12: SAP SQL Anywhere High Availability Tutorial for Business Objects

6. The next step is to define “BI4mirror1” as the logical mirror server for BI4’s CMS database. BI4mirror1 is the name that clients use to connect to the database server associated with the CMS database that is acting as the Mirror Server. Make sure to specify both the ports used for the default and copy database servers.

CREATE MIRROR SERVER BI4mirror1AS PRIMARYconnection_string='SERVER=BI4mirror1;HOST=localhost:2638,localhost:2639';

12

Page 13: SAP SQL Anywhere High Availability Tutorial for Business Objects

7. Set a mirror option for the database mirroring system to connect with the Arbiter Server. Once done disconnect and close Interactive SQL windows.

SET MIRROR OPTION authentication_string='abc';

13

Page 14: SAP SQL Anywhere High Availability Tutorial for Business Objects

8. The last step is to make a backup copy of the CMS database and CMS transaction log in the mirror database server directory. Input the following command into the Command Prompt.dbbackup -c "UID=DBA;PWD=pASSWORD1;SERVER=BI4;DBN=BI4_CMS" c:\t1

Setting up the Mirror Partners for the Audit DatabaseSimilar to setting up the mirror database server partners for the CMS database the user must do the same for the Audit database.

1. Connect to the default Audit database from Interactive SQL (ISQL) to define the mirroring parameters:

14

Page 15: SAP SQL Anywhere High Availability Tutorial for Business Objects

dbisql -c "UID=DBA;PWD=pASSWORD1;SERVER=BI4;DBN=BI4_Audit.db

2. Define the default server “BI4” as a partner server for the “BI4_Audit” database. This statement also creates a state file for the server that keeps track of what state the server is in. Hit the Execute button or F5 to run the SQL statements.

CREATE MIRROR SERVER BI4AS PARTNERconnection_string='SERVER=BI4;host=localhost:2638'state_file='C:\\Program Files (x86)\\SAP BusinessObjects\\sqlanywhere\\database\\BI4.state';

15

Page 16: SAP SQL Anywhere High Availability Tutorial for Business Objects

3. Create a database server and define it as a partner to the original database server. This will be the database server that will act as a mirror and will become the active database server in the case of a failover. Please make sure this database server starts on another host port.

CREATE MIRROR SERVER BI4copyAS PARTNERconnection_string='SERVER=BI4copy;host=localhost:2639'state_file='c:\\t1\\BI4copy.state'

16

Page 17: SAP SQL Anywhere High Availability Tutorial for Business Objects

4. Execute the following statement to define “BI4primary2” as the logical Primary Server for BI4’s Audit database. BI4primary2 is the name that clients use to connect to the database server associated with the Audit database that is acting as the Primary Server. Make sure to specify both the ports used for the default and copy database servers.

CREATE MIRROR SERVER BI4primary2AS PRIMARYconnection_string='SERVER=BI4primary2;HOST=localhost:2638,localhost:2639';

17

Page 18: SAP SQL Anywhere High Availability Tutorial for Business Objects

5. The next step is to define “BI4mirror2” as the logical mirror server for BI4’s Audit database. BI4mirror2 is the name that clients use to connect to the database server associated with the CMS database that is acting as the Mirror Server. Make sure to specify both the ports used for the default and copy database servers.

CREATE MIRROR SERVER BI4mirror2AS PRIMARYconnection_string='SERVER=BI4mirror2;HOST=localhost:2638,localhost:2639';

18

Page 19: SAP SQL Anywhere High Availability Tutorial for Business Objects

6. Set a mirror option for the database mirroring system to connect with the Arbiter Server. This should be different from the one defined for the CMS database. Once done disconnect and close Interactive SQL windows.

SET MIRROR OPTION authentication_string='def';

19

Page 20: SAP SQL Anywhere High Availability Tutorial for Business Objects

7. The last step is to make a backup copy of the Audit database and Audit transaction log in the mirror database server directory. Input the following command into the Command Prompt.dbbackup -c "UID=DBA;PWD=pASSWORD1;SERVER=BI4;DBN=BI4_Audit" c:\t1

Starting up the Mirror and Arbiter Database ServersTo start up these database servers open the Command Prompt and enter the following commands.

Mirror database server: dbsrv12 BI4copy -x tcpip(PORT=2639) -su pASSWORD1 "C:\t1\BI4_CMS" -xp on "C:\t1\BI4_Audit" -xp on

The “-xp on” switch indicates that the server is able to participate in database mirroring.

Arbiter database server: dbsrv12 –n arbiter -su pASSWORD1 -x "tcpip(PORT=2637)" -xf "c:\arbiter\arbiter.state" -xa "AUTH=abc,def;DBN=BI4_CMS,BI4_Audit"

The “-xf” switch specifies the location of the state file for the arbiter. The “-xa” switch identifies the names of the databases being mirrored and the authentication

string for the arbiter.

At this stage the user should have the three database servers running with the default database server “BI4” as the primary server and the alternate server “BI4copy” as the mirror server. To see the current state of a database server or a specific database on a database server use the following commands:

20

Page 21: SAP SQL Anywhere High Availability Tutorial for Business Objects

dbping -c "UID=DBA;PWD=pASSWORD1;SERVER=BI4primary1" -ps ServerName -pd MirrorRole,MirrorState,PartnerState,ArbiterState

or

dbping -c "UID=DBA;PWD=pASSWORD1;SERVER=BI4copy;DBN=BI4_Audit" -ps ServerName -pd MirrorRole,MirrorState,PartnerState,ArbiterState

CHANGING THE ODBC DSN CONNECTIONSOnce the database mirroring of the CMS and Audit databases are complete the ODBC DSN connection must be changed to connect to the Primary server.

21

Page 22: SAP SQL Anywhere High Availability Tutorial for Business Objects

1. Launch ODBC Data Source Administrator (click Start > All Programs > SQL Anywhere 12 > Administration Tools > ODBC Data Source Administrator).

2. Switch to the “System DSN” tab

22

Page 23: SAP SQL Anywhere High Availability Tutorial for Business Objects

3. Click on BI4_CMS_DSN and then click Configure

23

Page 24: SAP SQL Anywhere High Availability Tutorial for Business Objects

4. Switch over to the “Login” tab

5. There are two changes that need to be made. The first is that the Port must be left blank and the second is to change the Server Name to the name given to the Primary server. For this

24

Page 25: SAP SQL Anywhere High Availability Tutorial for Business Objects

paper that is “BI4Primary”.

6. Click “OK” once complete and repeats steps 1-5 for the Audit System DSN (BI4_CMS_DSN). Make sure to input the correct database server name. For this paper that would be “BI4primary2”.

ADDING SERVICES TO SYBASE CENTRALAt this point the database servers have been created though the Command Prompt, but the goal is to have these database servers running as services so that they automatically startup. In Sybase Central users are allowed to create and modify Windows Services necessary to do this.

1. Launch Sybase Central (click Start > All Programs > SQL Anywhere 12 > Administration Tools > Sybase Central). Close the Welcome dialog if it appears.

25

Page 26: SAP SQL Anywhere High Availability Tutorial for Business Objects

2. Switch to “SQL Anywhere 12” tab located under Sybase Central in the Folders view box.

3. Click on the “Services” tab in the right panel.

4. There should be one service that starts up the default database server which is currently stopped indicated by the red square.

26

Page 27: SAP SQL Anywhere High Availability Tutorial for Business Objects

5. Double click on “SQLANY’s_SQLAnywhereForBI” to open up the service properties. The user is able to edit the properties of the service under the different tabs.

6. Switch over to the “Configuration” tab to change the current service startup executable and parameters. Currently the service is running the database server through the dbsrv12 executable located within the Sap Business Object program folder. This need to be changed so that the service runs though the dbsrv12 executable located in the SQL Anywhere client program folder. The parameters need to be changed to the command used in step one of the Setting up the Mirror Partners for the CMS Database section. This will let the database server participate in database mirroring. Below are before and after pictures of what the configurations should look like.

27

Page 28: SAP SQL Anywhere High Availability Tutorial for Business Objects

Before

After

28

Page 29: SAP SQL Anywhere High Availability Tutorial for Business Objects

7. Click apply and close the properties box. The user should be back in Sybase Central under the Services section.

29

Page 30: SAP SQL Anywhere High Availability Tutorial for Business Objects

8. The next step is to add new services for the mirror and arbiter database servers. Right-click on an empty space and select New > Service from the popup menu.

30

Page 31: SAP SQL Anywhere High Availability Tutorial for Business Objects

9. The Create Service Wizard appears. Name the new service "SQLANY’s_SQLAnywhereForBIMirror". Click Next to continue.

31

Page 32: SAP SQL Anywhere High Availability Tutorial for Business Objects

10. Select Network Database Server form the list of services and click Next.

32

Page 33: SAP SQL Anywhere High Availability Tutorial for Business Objects

11. Enter the directory path to dbsrv12.exe within the SQL Anywhere 12 program folder. Click Next to continue.

12. The user needs to specify the parameters for the mirror database server. These parameters will be the exact same to the ones used in the section “Starting up the Mirror and Arbiter Servers “.

33

Page 34: SAP SQL Anywhere High Availability Tutorial for Business Objects

Click Finish to complete the Create Service Wizard.

13. The user should be back in Sybase Central and the Services section should now have two services.

14. The next step is to create a service for the Arbiter server. The process is exactly the same as the one above with just a minor change to the service name and parameters. Right-click on an

34

Page 35: SAP SQL Anywhere High Availability Tutorial for Business Objects

empty space and select a New > Service from the popup menu.

35

Page 36: SAP SQL Anywhere High Availability Tutorial for Business Objects

15. The Create Service Wizard appears. Name the new service "SQLANY’s_SQLAnywhereForBIArbiter". Click Next to continue.

36

Page 37: SAP SQL Anywhere High Availability Tutorial for Business Objects

16. Select Network Database Server form the list of services and click Next.

37

Page 38: SAP SQL Anywhere High Availability Tutorial for Business Objects

17. Enter the directory path to dbsrv12.exe within the SQL Anywhere 12 program folder. Click Next to continue.

18. The user needs to specify the parameters for the arbiter database server. These parameters will be the exact same to the ones used in the section “Starting up the Mirror and Arbiter Servers “.

38

Page 39: SAP SQL Anywhere High Availability Tutorial for Business Objects

Click Finish to complete the Create Service Wizard.

19. Now the user is back in Sybase Central and within the Services section there are three sevices. One for each of the database servers.

COMFIRMING MIRRORING DATABASE SERVERSThe last and final steps are to start up the three database servers through their services and check to see if they are working. There are two ways to turn on the services; either manually turning them on through Sybase central or restarting the computer. To start up the service through Sybase Central, right-click on the name of the service and then click Start from the popup menu. The order to follow when

39

Page 40: SAP SQL Anywhere High Availability Tutorial for Business Objects

turning on the services is Arbiter, Default and then Mirror.

Once all of the services have been started the user should make sure that the servers are running and that Business Objects is connected to the primary database server. One way to check is to login either to the Central Management Console (CMC) or the Query Builder (QB).

Central Management Console can be found at the URL: “http://MyServer:Port.BOE/CMC” Query Builder can be found at the following URL: “http://MyServer:Port/AdminTools”

If the user is getting errors like the ones below there could be an indication that the services weren’t setup properly or haven’t been started.

40

Page 41: SAP SQL Anywhere High Availability Tutorial for Business Objects

41

Page 42: SAP SQL Anywhere High Availability Tutorial for Business Objects

To test out the failover procedure of the mirrored database servers, disconnect the default database server “BI4” by disabling its Service and keep the remaining two services running. The alternate database server “BI4copy” should become the primary database server and the user should be able to login to the CMC and the QB. Starting up the Service for “BI4” turns the database server back on and puts it into a mirroring state ready to become the primary database server if “BI4copy” turns off.

SUMMARY & ADDITIONAL RESOURCESImplementing database mirroring for the CMS and Audit databases can be a very helpful tool when considering a high availability environment within Business Objects. It is important to make sure that the Arbiter database server is always running so that the mirroring database servers know which state they are in. Don't forget to test your mirroring system to ensure the procedure executes properly and behaves as expected.

Additional Resources:

SQL Anywhere Database Mirroring Tutorial: http://dcx.sybase.com/index.html#sa160/en/dbadmin/da-highavailability-s-4980336.html

Business Intelligence Help Portal: http://help.sap.com/bobi

SQL Anywhere Community: http://scn.sap.com/community/sybase-sql-anywhere

42

Page 43: SAP SQL Anywhere High Availability Tutorial for Business Objects

© 2014 SAP AG or an SAP affiliate company. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice.

Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors. National product specifications may vary.

These materials are provided by SAP AG and its affiliated companies (“SAP Group”) for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.

SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries.

Please see

http://www.sap.com/corporate-en/legal/copyright/index.epx#trademark

for additional trademark information and notices.