...

Creating a maintenance plan for IBM Cognos Controller Proven Practice

by user

on
Category:

movies and tv

16

views

Report

Comments

Transcript

Creating a maintenance plan for IBM Cognos Controller Proven Practice
Proven Practice
Creating a maintenance plan for
IBM Cognos Controller
Product(s): IBM Cognos Controller
Area of Interest: Infrastructure
Creating a maintenance plan for IBM Cognos Controller
2
Copyright
Copyright © 2008 Cognos ULC (formerly Cognos Incorporated). Cognos ULC
is an IBM Company. While every attempt has been made to ensure that the
information in this document is accurate and complete, some typographical
errors or technical inaccuracies may exist. Cognos does not accept
responsibility for any kind of loss resulting from the use of information
contained in this document. This document shows the publication date. The
information contained in this document is subject to change without notice.
Any improvements or changes to the information contained in this document
will be documented in subsequent editions. This document contains
proprietary information of Cognos. All rights are reserved. No part of this
document may be copied, photocopied, reproduced, stored in a retrieval
system, transmitted in any form or by any means, or translated into another
language without the prior written consent of Cognos. Cognos and the
Cognos logo are trademarks of Cognos ULC (formerly Cognos Incorporated)
in the United States and/or other countries. IBM and the IBM logo are
trademarks of International Business Machines Corporation in the United
States, or other countries, or both. All other names are trademarks or
registered trademarks of their respective companies. Information about
Cognos products can be found at www.cognos.com
This document is maintained by the Best Practices, Product and Technology
team. You can send comments, suggestions, and additions to
[email protected] .
IBM Cognos Confidential Information
Creating a maintenance plan for IBM Cognos Controller
3
Contents
1
INTRODUCTION ............................................................................................ 4
1.1
1.2
1.3
1.4
PURPOSE .............................................................................................................. 4
APPLICABILITY ....................................................................................................... 4
EXCLUSIONS AND EXCEPTIONS .................................................................................... 4
PREREQUISITES ...................................................................................................... 5
2
CREATING A “DAILY BACKUP AND UPDATE STATISTICS” ROUTINE ........... 6
3
CREATING A WEEKLY “FULL DATABASE OPTIMIZATION” ROUTINE ......... 13
4
PERIODIC CHECKING OF MAINTENANCE/BACKUP PLANS ........................ 16
5
IBM COGNOS CONTROLLER OPTIMIZATION.............................................. 16
6
ORACLE DATABASE – BEST PRACTICES...................................................... 17
7
APPENDICES ............................................................................................... 22
IBM Cognos Confidential Information
Creating a maintenance plan for IBM Cognos Controller
4
1 Introduction
1.1
Purpose
This document is intended to demonstrate how to create a simple Microsoft
SQL SERVER 2005 maintenance plan, which would be suitable for a standard
IBM Cognos Controller 8.2 implementation.
1.2
Applicability
• IBM Cognos Controller 8.2 is the first major release that supports
Microsoft SQL SERVER 2005
• There are many different “editions” of the product too (e.g.
“Enterprise”, “Standard”, Workgroup” and “Express” editions etc.).
o This document shall assume that the customer is using the
most popular i.e. “Standard” edition.
• The screenshots are based on Microsoft SQL SERVER 2005 SP2 (a.k.a.
version 9.00.3042.00)
1.3
Exclusions and Exceptions
• This document is provided purely as a “quick guide” to Microsoft SQL
SERVER 2005 maintenance plans.
• Although it demonstrates best practices suitable for most
environments, it is not necessarily perfect for all environments.
o i.e. this documentation should merely be used as a
demonstration of a typical way to perform regular maintenance
o It does not replace the need for customers to have trained MS
Microsoft SQL SERVER 2005 DBA’s who can further optimise
their maintenance plans in a way that suits the customer’s
needs.
• There are also many different ways to install/configure Microsoft SQL
SERVER 2005; therefore the advice in this document may have to be
modified by the customer to fit in with their needs/environment.
• Official Microsoft documentation takes precedence over this document
• customers *must* ensure that they 100% understand the
topic of Microsoft SQL SERVER 2005 maintenance plans, and
understand that they are 100% responsible for its success
IBM Cognos Confidential Information
Creating a maintenance plan for IBM Cognos Controller
1.4
5
Prerequisites
This document shall assume that the Microsoft SQL SERVER 2005 server has
already been installed and configured as per our recommendations/best
practices.
For example:
• Microsoft SQL SERVER 2005 has been installed with the “correct”
default Microsoft SQL SERVER collation
o This is normally MS SQL SERVER_Latin1_General_CP1_CI_AS
(also known as “MS SQL SERVER collation – Dictionary order,
case-insensitive, 1252 character set”)
• This setting is chosen during the Microsoft SQL SERVER server’s
installation:
•
•
•
•
Ensure Microsoft SQL SERVER 2005 is using “mixed-mode”
authentication
Ensure there is a Microsoft SQL SERVER login created with the correct
permissions
o Typically it should be called “fastnet”
o It should *only* have the role “bulkadmin” ticked
No other database roles should be defined!
It should have the roles “public” and “dbowner” ticked under
“database roles”, for the databases “tempdb” and “model”
IBM Cognos Confidential Information
Creating a maintenance plan for IBM Cognos Controller
6
2 Creating a “Daily Backup and Update Statistics”
Routine
In this example, we shall create a routine that automatically backs up all user
databases (including transaction logs), and updates all the statistics on a
nightly basis.
On the Microsoft SQL SERVER server, launch “Microsoft SQL SERVER Server
Management Studio” from the start menu:
Ensure that you logon to the correct server
• Typically, choose “Windows Authentication”
Open “Management” and right-click on “Maintenance Plans” and choose
“Maintenance Plan Wizard”
IBM Cognos Confidential Information
Creating a maintenance plan for IBM Cognos Controller
Call the plan something appropriate like “All User DB Backup and
update statistics MaintenancePlan”
Choose the schedule as appropriate (e.g. every night at 12am), then OK,
Next:
Choose the following 4 maintenance tasks 1
1
For a brief description of each task, see appendix #2 at the end of this document
IBM Cognos Confidential Information
7
Creating a maintenance plan for IBM Cognos Controller
Click Next
Unless you have particular needs, accept the default order, Next
Typically you would choose “all user databases” for each of the tasks:
IBM Cognos Confidential Information
8
Creating a maintenance plan for IBM Cognos Controller
Also, you would typically choose the default options:
IBM Cognos Confidential Information
9
Creating a maintenance plan for IBM Cognos Controller
10
During the backup section of the wizard, typically you would create a new
folder on a disk with a large amount of free disk space, and choose options
similar to the following:
IMPORTANT Question to ask:
Will you have enough disk space in the future to backup all future databases?
GOOD NEWS:
One of the great new things in Microsoft SQL SERVER 2005 (compared with
Microsoft SQL SERVER 2000) is that Microsoft SQL SERVER 2000 used to
often have problems running the “backup Transaction Log” part of the plan.
It was caused if you had your user databases set to different “recovery
models” (e.g. “Full” and “Simple”)?
• In other words, if you have configured the maintenance plan to
backup the transaction log, then you *had to* set the properties of all
databases to “full” otherwise this step will fail
• Alternatively, you could disable the transaction log backup and
configure *all* databases to use the “simple” recovery model
Luckily, Microsoft SQL SERVER 2005 automatically gives the following ‘fix’ for
this problem (where it says “Databases with simple recovery will be excluded”
Typically you would configure the file backups into a location such as:
IBM Cognos Confidential Information
Creating a maintenance plan for IBM Cognos Controller
11
Typically you would configure the file backups into a location such as:
NOTE
how I have NOT ticked the “create a sub-directory…” so that my future
“clear-up” task will work.
VITAL
You *must* remember (of course) to ensure that:
• your Backup (.BAK) files are archived to a long-term secure
storage (e.g. offsite tape backup schedule using ArcServe nightly
file backup agent)
• Ensure that your Microsoft SQL SERVER server’s disk does not get
full (over time) by regularly clearing out old .BAK files
• For example, configure the Maintenance Plan to delete all .BAK
files after 2 days (by which time they should have been archived
to tape via ‘Veritas’ or whatever 3rd party program you use for
backups):
IBM Cognos Confidential Information
Creating a maintenance plan for IBM Cognos Controller
Finish the wizard with Next, Finish.
IBM Cognos Confidential Information
12
Creating a maintenance plan for IBM Cognos Controller
13
3 Creating a Weekly “Full database optimization” Routine
In this example, we shall create a routine that automatically optimises all the
databases on the Microsoft SQL SERVER 2005 server.
Essentially, you should repeat the steps inside #1, but with the following
differences:
• Call the new plan something appropriate (e.g. “All User DB
Weekly Full Optimisation MaintenancePlan”)
• Choose a sensible time (e.g. 2 hours after the backups have started)
to give time for other jobs to finish:
Choose all the options EXCEPT for the ones that are covered by the first
(daily) Database Maintenance Plan
e.g. “Check DB Integrity”, “Shrink Database”, “Reorganize Index”, “Rebuild
Index”:
IBM Cognos Confidential Information
Creating a maintenance plan for IBM Cognos Controller
Typically choose all the default options for the user-configurable settings
• For example:
and:
IBM Cognos Confidential Information
14
Creating a maintenance plan for IBM Cognos Controller
TIP:
• You can test your new routine(s) by right-clicking on the plan(s) and
choosing “Execute”:
IBM Cognos Confidential Information
15
Creating a maintenance plan for IBM Cognos Controller
16
4 Periodic checking of maintenance/backup plans
It is recommended that customers periodically (e.g. weekly) double-check
that their plans are working OK for all databases.
In particular, it is 100% recommended that periodic checks are made that the
backup (.BAK) files are:
• Being created successfully
• Being archived to backup tape successfully
• Can be restored successfully from tape
In other words, customers should periodically check that their not only their
backup routines work, but *also* their *restore* routines are tested!
Finally, it is also a good idea to place “alerts” such as “disk space free” on the
Microsoft SQL SERVER server, to ensure that if the server is running out of
hard drive space, the I.T. administrator is automatically alerts.
5 IBM Cognos Controller Optimization
Optimize the Database
The main reason to run this function is to get faster access to data. The
function is performed in different ways depending on if you run an Microsoft
SQL Server or Oracle Database. To use the advance functions rebuild
indexes, an analyze schema, you have to have administrative rights or be in
single mode.
You can use this function to perform the following database changes:
• Removed Period Zero Values – clears the value 0 from selected
period tables
• Rebuild Structure Tables – which gives quicker access to data
• Rebuild Indexes (advanced option) – Rebuild all indexes in the
database. This will enhance performance and give quicker access to
data.
• Analyze Schema (advanced option) – Reanalyzes the schema for
Oracle database.
Time Duration
The time it takes to perform the processes can vary depending on the size of
the databases and the capacity of the PC. Rebuild indexes can be very time
consuming.
IBM Cognos Confidential Information
Creating a maintenance plan for IBM Cognos Controller
17
-NB- In the code text box, enter the group code you want to view include
users (U) for and click view.
Steps:
• On the Maintain, Click Database/Optimize. The Optimize
Database window opens
• Select the Remove Period Zero Values check box to delete data
fields containing the amount zero. The list box displays the year’s in
the period, for which all zero values will be deleted.
• Select the period tables you want to remove zero values from. To
select one period, click the period. To select several periods, press
CTRL key while clicking the next period. To select a range of periods,
click the first period and then press shift key while clicking the last
period in the range. This will select all the periods in the range. Click
select all to select all the period or click deselect all to deselect all
periods.
• Clear the Rebuild Structure tables check box if you don’t want to
rebuild the structure tables. Leave it selected if you want to rebuild
the structure tables. This results in faster access to data
• Click the run button to perform the optimization. During the
optimization information about the process is shown on the status
now. When the optimization is completed you are notified
Best Practices
• Once-a-week during the ‘development phase’ (when you are
making loads of changes)
• Once-a-month when in ‘production’ (no major structural changes)
-NB- The reason is that this menu does more things (like clear out some
temporary tables, etc.) than a simple Oracle maintenance task could (e.g reindex)
6 Oracle database – best practices
Best practices for Oracle database with IBM Cognos Controller, to get
maximum performance.
Solution:
Each/all of the following can significantly improve the performance of IBM
Cognos Controller when its data repository is stored on an Oracle database
server:
Controller-specific recommendations:
IBM Cognos Confidential Information
Creating a maintenance plan for IBM Cognos Controller
18
1. Allocate a significant amount of memory to Tablespaces
2. Make sure that you have up to date Oracle server hardware – IBM
Cognos Controller creates VERY high CPU load on the Oracle server,
and is generally single-threaded.
3. Run menu item 'Database optimize' (and ensure that you enable the
option 'Analyze schema') regularly.
4. Regularly run/execute the recommended SQL statement (on the Oracle
schema used for IBM Cognos Controller) to update statistics
5. Verify that the network settings (of the LAN connection between the
Oracle server and Application server) are optimal
6. Check if there are any Redo Log Members or Archive Logs set, that are
not necessarily required. Such logs can slow down the performance
significantly.
Further 'general' Oracle tuning recommendations:
Efficient disk I/O to drastically improves overall performance:
For best RAID performance use RAID-10. This level of RAID combines
mirrored disks (as in RAID-0) with striping of data across multiple drives,
which can eliminate any delay while waiting for disk head positioning.
Segregate I/O operations to separate disks wherever possible - Split
tablespaces across multiple disks.
Example:
CREATE TABLESPACE COGNOS DATAFILE
'/u01/oradata/data/VLARGE_TBL_COGNOS.dbf' SIZE xxxxM
AUTOEXTEND ON NEXT xxxxM MAXSIZE xxxxM,
'/u02/oradata/data/VLARGE_TBL_COGNOS.dbf' SIZE xxxxM
AUTOEXTEND ON NEXT xxxxM MAXSIZE xxxxM,
'/u03/oradata/data/VLARGE_TBL_COGNOS.dbf' SIZE xxxxM
AUTOEXTEND ON NEXT xxxxM MAXSIZE xxxxM
Place high-I/O-volume disks on different controllers. Most modern
controllers can handle a limited number of concurrent operations, but
using as many controllers as possible will eliminate any controller waits
and will speed performance.
Place busy files and tablespaces (e.g., log files, rollback segments, some
indexes) on the fastest available disks.
Physical Memory:
Physical memory should be fully utilized, but swapping (in environments
that swap memory) should not occur. Swapping memory to disk is a very
slow process, so if your system needs more memory, buy more memory!
In particular, make certain that you do not create a System Global Area
(SGA) that is too big for physical memory, since swapping of the SGA will
severely degrade Oracle performance.
Sort Areas:
Oracle uses the SORT_AREA_SIZE to allocate memory for use in sorting
data. When a sort cannot be completed in memory, Oracle uses temporary
segments in the database, which is considerably slower. A careful balance
is required for SORT_AREA_SIZE, since large sizes can dramatically
IBM Cognos Confidential Information
Creating a maintenance plan for IBM Cognos Controller
19
increase performance by decreasing I/O, but will also use up memory and
can result in paging.
Temporary Tablespaces:
When insufficient sort memory is allocated to the user process to perform
a required sort, Oracle performs the sort on disk by creating temporary
segments in the tablespace specified by the TEMPORARY TABLESPACE
parameter for the user. In addition, temporary segments are used to
perform complex queries like joins, UNIONs etc.
Create a separate tablespace (usually called TEMP) for temporary
segments, and place the datafile(s) for this tablespace on a separate disk
device
Specify a TEMPORARY TABLESPACE for each user. If one is not specified,
Oracle defaults to SYSTEM, which is almost guaranteed to have a negative
impact on performance.
Steps:
(1) Tablespace
For an example of how to check that the IBM Cognos Controller
tablespaces have plenty of free space, refer to attached
document 'Oracle TableSpace - how to find out size and how
full the Oracle Tablespaces are.pdf'.
(2) Oracle server hardware
<section to be completed soon>
(3) Database Optimise
This is a menu item inside IBM Cognos Controller which the superuser(s)
can run, whilst in 'single-user mode'. Typically, most customers will run
this 1 or 2 times a month.
(4) Script
Tip#1 - Update Statistics (e.g. daily)
You could scedule the following to run each night:
BEGIN
dbms_stats.GATHER_SCHEMA_STATS('<SCHEMA_TO_ANALYZE>'); -The Controller schema.
END;
For example:
begin
dbms_stats.GATHER_SCHEMA_STATS('fastnet'); --The Controller
schema
end;
Tip#2 - Analyse Schema (e.g. weekly)
IBM Cognos 8 Controller provides an SQL procedure that analysis the
schema in the Controller database and gathers the appropriate statistics,
which Oracle requires for optimal performance. The official IBM Cognos
Controller 8.2 documentation recommends using the following to create
a job (e.g.called 'Analyze_Controller_Schema_week') and schedule it
to run automatically on a weekly basis, for example by using the
following script:
IBM Cognos Confidential Information
Creating a maintenance plan for IBM Cognos Controller
20
DECLARE JOB BINARY_INTEGER;
BEGIN
DBMS_SCHEDULER.create_job (
job_name => 'Analyze_Controller_Schema_week',
job_type => 'PLSQL_BLOCK',
job_action => 'BEGIN PRC_ANALYZE_SCHEMA; END;',
start_date => SYSTIMESTAMP,
repeat_interval => 'freq=weekly; byday=sat; byhour=9;
byminute=0;
bysecond=0;',
end_date => NULL,
enabled => TRUE,
comments => 'Analyze schema job to be run Saturdays 9:00
AM');
END;
(5) Network connections
Verify the bandwidth of the LAN Connection between the Oracle Server
and Application Server for both directions: Copy therefore a reasonably
big file from and to the Oracle Server and see if the time meets
expectation.
(6) Redo Logs and NOLOGGING
For best performance, you should configure your Oracle server to
perform only the minimum of logging.
CAUTION: Changing your log strategy may impact on your backup
strategy. Oracle is a 3rd party software vendor, so our advice is merely a
guideline. Please ensure that your Oracle DBA takes appropriate advice
from Oracle themselves, to ensure that your backup strategy is not
compromised.
The following is a description of Redo Logs and NOLOGGING:
Redo Log:
Each Oracle database has a redo log. This redo log records all changes
made in datafiles
The redo log makes it possible to replay SQL statements Before Oracle
changes data in a datafile it writes these changes to the redo log. If
something happens to one of the datafiles, a backed up datafile can be
restored and the redo, that was written since, replied, which brings the
datafile to the state it had before it became unavailable.
NOLOGGING
You can specify a NOLOGGING clause when creating tables, indexes,
partitions and tablespaces which under certain circumstances causes redo
generation to be switched off when the object is loaded.
NOLOGGING does *not* suppress *all* redo. In fact, NOLOGGING
operations generate *minimal* (not zero) redo. The minimal (only a
relatively small amount) redo generated is such that the data dictionary
itself is preserved. Many Oracle professionals use NOLOGGING because
the actions runs fast because the Oracle redo logs are bypassed. However,
this can be quite dangerous if you need to roll-forward through this time
period during a database recovery. It is not possible to roll forward
through a point in time when an NOLOGGING operation has taken place.
IBM Cognos Confidential Information
Creating a maintenance plan for IBM Cognos Controller
This can be a CREATE INDEX NOLOGGING, CREATE TABLE AS SELECT
NOLOGGING, or an NOLOGGING table load.
SUMMARY:
The NOLOGGING clause is a wonderful tool since it often halves run times,
but you need to remember the danger.
Related Documents:
•
KB 1031746
IBM Cognos Confidential Information
21
Creating a maintenance plan for IBM Cognos Controller
22
7 Appendices
#1 - The following error would occur if you did not change the “compatibility
level” setting to Microsoft SQL SERVER 2000:
IBM Cognos Confidential Information
Creating a maintenance plan for IBM Cognos Controller
23
#2 – Descriptions of the Maintenance Tasks
We have chosen almost all of the options in this document. Here is a brief
summary of what they are, and what they achieve:
•
•
•
•
•
•
•
•
•
The Check Database Integrity task performs internal consistency
checks of the data and index pages within the database.
The Shrink Database task reduces the disk space consumed by the
database and log files by removing empty data and log pages.
The Reorganize Index task defragments and compacts clustered and
non-clustered indexes on tables and views. This will improve indexscanning performance.
The Rebuild task reorganizes data on the data and index pages by
rebuilding indexes. This improves performance of index scans and
seeks. This task also optimizes the distribution of data and free space
on the index pages, allowing faster future growth.
The Update Statistics task ensures the query optimizer has up-to-date
information about the distribution of data values in the tables. This
allows the optimizer to make better judgements about data access
strategies.
The History Cleanup task deletes historical data about Backup and
Restore, Microsoft SQL SERVER Server Agent, and Maintenance Plan
operations. This wizard allows you to specify the type and age of the
data to be deleted.
The Back Up Database (Full) task allows you to specify the source
databases, destination files or tapes, and overwrite options for a full
backup.
The Back Up Database (Transaction Log) task allows you to specify
the source databases, destination files or tapes, and overwrite options
for a transaction log backup.
The Maintenance Cleanup task removes files left over from executing
a maintenance plan. Notice how we have skipped the “Execute
Microsoft SQL SERVER Server Agent Job” and Back Up Database
(Differential) tasks.
IBM Cognos Confidential Information
Fly UP