Sei sulla pagina 1di 104

IBM DB2 LUW

ADMINISTRATION
FOR SAP -
HANDS-ON LABS

WW DB2-SAP Technical Sales DB2 SAP CoE


IBM Analytics Platform Client Success
March 2015
Olaf Depper (OD@de.ibm.com)

Page 1/104
Table of Contents

Table of Contents .................................................................................................................................... 2

Information about the VMware Image ................................................................................................... 4

Preparing the Hands-On Labs ................................................................................................................. 6

Basics .................................................................................................................................................. 6

Starting the SAP System (if not already started) ................................................................................ 6

Unit 1 Basics ......................................................................................................................................... 7

Hands-On Lab 1.1 Accessing DB2 .................................................................................................... 7

Hands-On Lab 1.2 Database Objects ............................................................................................. 10

Hands-On Lab 1.3 Security............................................................................................................. 14

Hands-On Lab 1.4 Communication ................................................................................................ 17

Hands-On Lab 1.5 DB2 Process Model .......................................................................................... 21

Hands-On Lab 1.6 Configuration ................................................................................................... 25

Hands-On Lab 1.7 Memory Model ................................................................................................ 29

Unit 2 Storage Management .............................................................................................................. 32

Hands-On Lab 2.1 Get Tablespace Information............................................................................. 32

Hands-On Lab 2.2 Manage Tablespaces and Storage.................................................................... 40

Unit 3 Table and Index Maintenance ................................................................................................. 46

Hands-On Lab 3 Automatic Table Maintenance ............................................................................ 46

Unit 4 Log File Management .............................................................................................................. 52

Hands-On Lab 4.1 Log File Management ....................................................................................... 52

Hands-On Lab 4.2 Enable Archival Logging ................................................................................... 53

Unit 6 Backup and Recovery .............................................................................................................. 62

Hands-On Lab 6.1 Backup and Restore ......................................................................................... 62

Page 2/104
Hands-On Lab 6.2 Redirected Restore........................................................................................... 69

Unit 7 Performance Monitoring and Tuning ...................................................................................... 74

Hands-On Lab 7.1 Health Check .................................................................................................... 74

Hands-On Lab 7.2 SQL Cache Analysis ........................................................................................... 75

Unit 8 Problem Analysis ..................................................................................................................... 79

Hands-On Lab 8.1 db2look, db2top, INSPECT, db2support ........................................................... 79

Hands-On Lab 8.2 Lock-wait Scenario ........................................................................................... 81

Unit 9 BLU Acceleration ..................................................................................................................... 84

Hands-On Lab 9.1 Configuring DB2 for BLU Acceleration ............................................................. 84

Hands-On Lab 9.2 Creating InfoCubes that use Column-Organized Tables .................................. 86

Hands-On Lab 9.3 Use DB6CONV .................................................................................................. 96

Page 3/104
Information about the VMware Image

To run the hands-on labs a VMware image is provided on the classroom computers.

Important note: If the VMware image is not yet started on your machine, please let the instructor
know to assist you. If you start the VMware image, you might be prompted to select Move or Copy. It
is very important that you select Move. Otherwise, the network settings on the VMware image will
not be correct and SAP will not start.

The image contains the following software:

SUSE Linux Enterprise Server 11 SP2 (x86_64)


IBM DB2 for Linux, UNIX, Windows 10.5 Fix Pack 4 (Cancun Release)
SAP NetWeaver 7.3 (SAP Basis SP12)

The host name of the image is n4shost.[sapdemo.com].

On the Linux VMware an SAP system with the name (<SAPSID>) N4S is installed. It is running on a
DB2 LUW database with the database name (<DBSID>) N4S.

The following table lists OS users and passwords for the VMware image:

OS-User Password
root (Linux Administrator) passw0rd
db2n4s (DB2 Instance Owner) passw0rd
n4sadm (SAP System Owner) passw0rd
sapn4s (SAP Connect User) passw0rd

Page 4/104
The following table lists users and passwords to log on to the SAP system N4S (client 001):

SAP-USER Password
bwuser passw0rd
sap* passw0rd

Page 5/104
Preparing the Hands-On Labs

Basics

The objective of each hands-on lab is described in this document. Each lab is aligned with
the topics covered within the boot camp.

Each hands-on lab consists of multiple exercises and each exercise contains at least one
task or question.

The questions are followed by hints that help to solve the exercise.

Commands that you have to enter will be written using the Courier New type.

Starting the SAP System (if not already started)

Logon to the operating system with user root and password passw0rd.
Open a GNOME Terminal window.
Switch to user n4sadm (su n4sadm) and enter startsap.
Wait until the startsap command is completed. Please note, that depending on the speed of
the host server it can take some minutes for the SAP system to fully start.

Page 6/104
Unit 1 Basics

Hands-On Lab 1.1 Accessing DB2

Objective:

Get familiar with the lab environment

Learn to work with the DB2 command line processor (CLP) and SAP transaction DBA Cockpit
to access the DB2 database

Questions:

(1) Which DB2 version and Fix Pack is installed on the system?

(2) How many applications are connected against database N4S? Use both DB2 CLP and
DBA Cockpit to get this information. Are there differences in the output provided by DB2
CLP and SAP?

(3) What is the command syntax for the BACKUP command? And what is the meaning of
SQL code SQL1024?

Hints:

Log on to n4shost as user root and open a terminal window (click on the GNOME
Terminal icon on the Linux desktop). In the Terminal window, switch to user db2n4s
(with command: su db2n4s)

Page 7/104
IMAGE 1 - GNOME TERMINAL

Open the SAP Logon on the Windows host machine.


Do not use the SAPGUI for Java on the Linux image (as there are some issues with the
Java SAPGUI for some screens).
In the SAP Logon select entry N4S. Logon to SAP with user BWUSER in client 001:

IMAGE 2 SAP LOGON

Page 8/104
Open SAP transaction code DBA Cockpit (alternatively, use ST04, DB02) to access the
DBA Cockpit.

IMAGE 3 ENTER SAP TRANSACTION CODE

On the Linux Terminal window, enter the following commands (as user db2n4s):

o To show the DB2 version, release and Fix Pack level of your DB2 instance use the
command db2level.

o To list all the connection applications on the DB2 system, use this CLP command:
db2 list applications
To list all the applications including the internal DB2 engine connections (like the
db2stmm) on the DB2 system, use this CLP command:
db2 list applications show detail

o The CLP online help can be used to see the command syntax for a DB2 command as
well as the description of a SQL message:
db2 \? backup
db2 \? SQL1024

In the DBA Cockpit, select database N4S, then Performance Applications (see
Image 4).

Page 9/104
IMAGE 4 DBA COCKPIT: APPLICATION SNAPSHOT

Hands-On Lab 1.2 Database Objects

Objective:

Understand and access the different DB2 objects on the N4S system: Instance, database,
database directory, SAP schema.

Understand the directory structure of a DB2 SAP installation

Run SQL commands to get information about the tables in the database

Use SAP to find the largest tables in the database

Questions:

(1) What is the name of the DB2 instance?

(2) Where is the DB2 instance home and which user is the DB2 instance owner?

Page 10/104
(3) What is the database name and where is the database directory?

(4) What schema is used by the SAP system?

(5) Whats under the directory /db2/<DBSID>?

(6) How to connect to database? How to disconnect again?

(7) What is the SAP kernel level?

(8) How many tables are in the entire database? And how many tables belong to the SAP
ABAP stack?

(9) What are the largest tables in the database?

(10) Can you run a SQL command from within SAP DBA Cockpit?

Hints:

On the Terminal window, continue to work as user db2n4s

o To identify the DB2 instance name, run:


echo $DB2INSTANCE

o The DB2 instance home can be seen with:


echo $INSTHOME

o The owner of the current DB2 instance can be queried with:


db2 "values auth_get_instance_authid()"

o List the database directory to identify the catalogued databases:


db2 list db directory

o Find the database directory for database N4S


db2 list db directory on /db2/N4S
List the contents of the directory:
ls l /db2/N4S/db2n4s/NODE0000/SQL00001

o Identify the SAP schema:


echo $dbs_db6_schema

Page 11/104
o List the contents of /db2/N4S
ls l /db2/N4S

o Connect to the database N4S:


db2 connect to N4S
Close both the connection and the background process:
db2 terminate

o Query the SAP table SVERS to see the SAP kernel release of system N4S:
db2 "select * from sapn4s.svers"

o Query the DB2 system catalog to get the total number of tables in the database as
well as the number of tables that belong to the SAP schema:
db2 "select count(*) from syscat.tables where type='T'"
db2 "select count(*) from syscat.tables where tabschema =
'SAPN4S' and type='T'"

Logon to SAP transaction DBA Cockpit (as user BWUSER): In the DBA Cockpit, select
database N4S, then Space Tables and Index Top Space Consumers and find the
largest tables in the database.
Please note: Depending on the uptime of the database, the transaction might not return
any data if the SAP collector did not run already.

Choose another time


frame if necessary

IMAGE 5 DBA COCKPIT: TOP SPACE CONSUMERS

Page 12/104
In the DBA Cockpit, go to Diagnostics SQL Command Line to execute SQL queries
from inside the SAP system

Enter your SQL


statement here

IMAGE 6 DBA COCKPIT: SQL COMMAND LINE

IMAGE 7 DBA COCKPIT: SQL COMMAND LINE EXAMPLE

Page 13/104
Hands-On Lab 1.3 Security

Objective:

Understand the security settings on the N4S system.

Questions:

(1) Where is the password file for SAP ABAP system users? What is the content of the file?

(2) What are the instance level authorities, and which OS groups are assigned to them?
Which OS users have which authorities on DB2 instance level?

(3) What is the authentication type of the database?

(4) Does the user sapn4s hold DBADM authority on the database N4S?

(5) Can you get some of the information from the DBA Cockpit?

Hints:

Work as user n4sadm for this exercise. In the Gnome Terminal, you can go to File
Open Tab to open a second tab. In this tab, change to user n4sadm using the command:
su n4sadm).

Page 14/104
IMAGE 8 TERMINAL: OPEN A NEW TAB

IMAGE 9 TERMINAL: WORK WITH TWO TABS

o The password file dscdb6.conf for the SAP ABAP engine is located in the global
directory of the SAP instance:
ls l /usr/sap/N4S/SYS/global/dscdb6.conf

o The password file contains entries for the two users n4sadm and sapn4s (plus a
timestamp):
cat /usr/sap/N4S/SYS/global/dscdb6.conf

o To see the authorities groups of instance db2n4s, issue:


db2 get dbm cfg | grep GROUP

o To map the DB2 authorities groups with the groups on the operating system, look at
both the /etc/group and /etc/password files:
cat /etc/group
cat /etc/passwd

o The authentication type of the database is set in the database configuration file:
db2 get db cfg for n4s | grep AUTHENTICATION

Page 15/104
o Query the AUTH_LIST_AUTHORITIES_FOR_AUTHID table function to see the
authorities of the sapn4s user.
You can run the SQL script /db2/db2n4s/scripts/admin/auth_list.clp to do so. The
script contains the following SQL:
SELECT varchar(AUTHORITY,25) User, D_USER, D_GROUP,
D_PUBLIC FROM TABLE
(SYSPROC.AUTH_LIST_AUTHORITIES_FOR_AUTHID ('SAPN4S', 'U')
) AS T ORDER BY AUTHORITY;

While you cannot check the OS security configuration settings from within the SAP
transaction, you can use the DBA Cockpit to see the configuration of the database
manager and the database:

IMAGE 9 DBA COCKPIT: DBM CFG

Page 16/104
Hands-On Lab 1.4 Communication

Objective:

Understand the communication settings of the DB2 instance and how the SAP application
connects to DB2.

Questions:

(1) Does the DB2 instance have a node directory?

(2) Is TCP/IP communication enabled on the DB2N4S instance? On which port is the
instance listening?

(3) How does the SAP application connect to the database via TCP/IP or IPC? Where is the
configuration file for the SAP application servers?

(4) Can you get some of the information also through the DBA Cockpit?

Hints:

Work in the Terminal window as user db2n4s. Use the following commands to get the
required information:

o To list the node directory on the instance, issue:


db2 list node directory
This will be empty since all new SAP applications will connect not via a traditional
DB2 client but via the CLI driver (aka thin client)

o To see if the TCP/IP communication is turned on, use:


db2set all | grep DB2COMM

o The TCP/IP port for the communication with the instance is set in the instance
configuration:
db2 get dbm cfg | grep SVCENAME

Page 17/104
The service name sapdb2N4S is translated in the Linux system through the
/etc/services file:
cat /etc/services | grep sapdb2N4S

o Run a db2 list applications again.


The column Application Id will contain an IP address for all SAP connections
signifying that this is a remote connection (local connections will have an entry
starting with *LOCAL).

Switch to user n4sadm in the Terminal window for the next commands:

o To check if the SAP system is using the CLI driver or the traditional DB2 client you
could run
R3trans d
Open the trans.log file created by R3trans in your current directory and search for
the word driver.

o The configuration for the communication between SAP application servers and DB2
database via CLI driver is located in the global SAP directory:
cat /sapmnt/N4S/global/db6/db2cli.ini

You cannot check the OS communication configuration settings from within the SAP
DBA Cockpit transaction. However, you can use the DBA Cockpit to see the CLI (client)
configuration as well as the configuration of the database manager and the DB2
Registry:

Page 18/104
IMAGE 10 DBA COCKPIT: CLIENT CONFIGURATION

IMAGE 11 DBA COCKPIT: SVCENAME SETTING

Page 19/104
IMAGE 12 DBA COCKPIT: REGISTRY SETTINGS

Page 20/104
Hands-On Lab 1.5 DB2 Process Model

Objective:

Understand the DB2 process model and list the different DB2 threads (EDUs)

Learn how different settings in the instance configuration can influence the number of DB2
agents

Questions:

(1) List all threads of the DB2 engine. How many DB2 TCP/IP communication managers do
you see? What is the PID of the db2sysc process?

(2) How many db2agents are on the system?

(3) How many DB2 agents will be created initially and how many DB2 agents will be pooled?

(4) How many threads defined for reading and writing of pages from/to buffer pool? Can
you influence the number of these threads?

(5) In the N4S SAP system, how many work processes are defined? Do you see DB2 threads
corresponding to each SAP work process?

(6) Can you use an application to find the process ID of the SAP disp+work process for a
given DB2 connection?

Hints:

Work in the Terminal window as user db2n4s. Use the following commands to get the
required information:

o To list all threads (EDUs) of the DB2 engine, use the db2pd edus command.

Page 21/104
o The output of db2pd edus will also provide you with the PID of the db2sysc, the
number of DB2 TCP/IP communication managers (search for db2tcpcm) and the
db2agents

o The database manager parameter NUM_INITAGENTS defines the number of initial


db2agents created during db2start. The database manager parameter
NUM_POOLAGENTS defines the number of idle db2agents that will be kept in the
agent pool for future use by an application.

o Look for the db2pclnr (page cleaner) and db2pfchr (prefetcher) EDUs. The number
of cleaners and prefetchers are determined by database configuration parameters
NUM_IOCLEANERS and NUM_IOSERVERS.

Use the SAP system for the next part.

Transaction code SM50 will provide you with a list of SAP work processes. If you are
already in another transaction (like DBA Cockpit), you have to enter /nsm50 in the SAP
GUI (or /osm50 to open a new session).

IMAGE 13 SAP GUI: OPEN NEW SAP GUI SESSION

Back in the DBA Cockpit, go to Performance Applications.

Page 22/104
IMAGE 14 DBA COCKPIT: LIST ALL CONNECTIONS

Page 23/104
Double-click on one of the application handles to access the application snapshot. Then
choose the tab Assigned Agents:

Thread ID (TID) of the PID of the disp+work


db2agent process

IMAGE 15 DBA COCKPIT: APPLICATION SNAPSHOT

You can map the PID using ps ef | grep <PID> and the TID using db2pd
edus |grep <TID>

Page 24/104
Hands-On Lab 1.6 Configuration

Objective:

Learn how to get configuration settings of the DB2 database and instance

Understand how you can change parameters using the DBA Cockpit

Questions:

(1) What are the settings of the DB2 registry? Which parameter influences almost all
settings in the registry?

(2) Using DB2 CLP: What is the current (memory) value of the database configuration
parameter SORTHEAP?

(3) Using DBA Cockpit: What is the path for the DB2 diagnostic information (DIAGPATH)?

(4) Increase the size of the catalog cache of the database using the DBA Cockpit. Is this
change immediately propagated to the database? How about a change of the log buffer
size?

Hints:

Work in the Terminal window as user db2n4s. Use the following commands to get the
required information:

o To list the DB2 registry, use


db2set -all
you will see that almost all settings are influenced by the parameter
DB2_WORKLOAD.

o To see the current value of the database configuration parameter SORTHEAP, issue
the following commands:
db2 connect

Page 25/104
db2 get db cfg for n4s show detail
db2 terminate
Alternatively, you can use db2pd to get the same information without the need to
connect to the database:
db2pd db n4s dbcfg

Use the DBA Cockpit for the next steps.

o The DIAGPATH is set on the database manager configuration:

IMAGE 16 DBA COCKPIT: DIAGPATH

o The size of the catalog cache is determined by database parameter


CATALOGCACHE_SZ:

Page 26/104
Click on "Change

IMAGE 17 DBA COCKPIT: CATALOG CACHE

Enter new value

IMAGE 18 DBA COCKPIT: CHANGING CATALOG CACHE

Page 27/104
Deferred and current
value are both 12800

IMAGE 19 DBA COCKPIT: CATALOG CACHE CHANGED ONLINE

o The size of the log buffer is determined by database parameter LOGBUFSZ. It is one
of the few parameters in the database configuration that cannot be changed online
(i.e. it requires a restart of the DB2 database to activate the change). After the
change in the DBA Cockpit you will notice the new value is listed as Deferred
Value.

IMAGE 20 DBA COCKPIT: DEFERRED CHANGE OF LOGBUFSZ

Page 28/104
Hands-On Lab 1.7 Memory Model

Objective:

Understand the DB2 memory model and which commands to use to see the overall memory
usage of the DB2 instance.

See which parameters are influenced by the self-tuning memory manager (STMM)

Questions:

(1) How much memory is the DB2 instance allowed to use? What is the high-water mark
usage?

(2) Can you increase the memory usage limit for DB2 online?

(3) How much memory is currently used by the DB2 database N4S? Which memory pool is
the largest consumer of database memory?

(4) Using DBA Cockpit: Is STMM enabled on the database?

(5) How many buffer pools does the N4S database have and what is the size?

Hints:

Work in the Terminal window as user db2n4s.

o Use command db2pd dbptnmem to get the required information about the
memory limit as well as the HWM of the DB2 partition.

o Yes, the instance parameter INSTANCE_MEMORY can be changed online, for


example:
db2 attach to db2n4s
db2 update dbm cfg using instance_memory 524288

Page 29/104
db2 terminate
Double-check with db2pd dbmcfg | grep INSTANCE

o The memory usage of the DB2 database can be seen in the output of db2pd
dbptnmem (search for DB-N4S).

o To see which memory sets are using the most memory inside database memory,
you can use the db2pd db n4s mempools command. Alternatively, you can
use db2top m

IMAGE 21 SCREENSHOT OF DB2TOP WITH MEMORY OPTION

Use the DBA Cockpit for the next steps. Using Configuration Database will show
that STMM is enabled on the database.

IMAGE 22 DBA COCKPIT: SELF_TUNING_MEM PARAMETER SET TO ON

Page 30/104
The defined buffer pools can be seen with Configuration Buffer Pools. The
database N4S has only one user buffer pool; the size is tuned by STMM (Size is set to
Automatic):

IMAGE 23 DBA COCKPIT: BUFFER POOLS

The different memory areas of DB2 can be listed in the DBA Cockpit via Performance
Memory:

IMAGE 24 DBA COCKPIT: MEMORY CONSUMERS

Page 31/104
Unit 2 Storage Management

Hands-On Lab 2.1 Get Tablespace Information

Objective:

Learn how to use DB2 CLP and DBA Cockpit to access information about the DB2 tablespaces
and containers.

Use the DBA Cockpit to add a new tablespace to the database.

Questions:

(1) Using CLP: Which SQL can you use list all tablespaces and see the extent size in the N4S
database? Is there an alternative command to access the information?

(2) Using CLP: Which containers are defined for tablespace N4S#FACTD?

(3) Using CLP: Which information is provided in the tablespace snapshot? Can you see the
MAXSIZE of tablespace SYSCATSPACE?

(4) Using DBA Cockpit can you see whether any tablespace in N4S is not using automatic
storage management?

(5) What is the largest tablespace in the database? What is the total size of the database?

(6) How many storage group paths are defined on database N4S?

(7) Can you increase the size of tablespace N4S#FACTD? Create a new tablespace
N4S#MYTS as a DMS tablespace can you increase the size for this tablespace?

Page 32/104
Hints:

Work in the Terminal window as user db2n4s. Use the following commands to get the
required information:

o You can query the MON_TBSP_UTILIZATION view to access information about the
tablespaces of the database. Use the SQL script /db2/db2n4s/scripts/admin/
tbsp_utilization.clp to do so.
The script contains the following SQL:
select substr(tbsp_name,1,16) as tbsp_name, tbsp_type,
substr(tbsp_page_size,1,6) as page_size,
substr(tbsp_extent_size,1,2) as extent_size,
tbsp_utilization_percent from
sysibmadm.mon_tbsp_utilization;
Alternatively, you can use the db2pd db n4s tablespaces command to
retrieve similar information

o To list all containers for a given tablespace you can query the
MON_GET_CONTAINER table function. Use the script /db2/db2n4s/scripts/admin/
mon_get_container.clp.
The script contains the following SQL:
select tbsp_name, container_name, fs_total_size,
fs_used_size from table(mon_get_container('N4S#FACTD',-
1));

o The snapshot for the tablespaces will list the tablespace parameters like MAXSIZE:
db2 get snapshot for tablespaces on n4s | more
and search for Maximum tablespace size

Work in the DBA Cockpit for the next steps.

o Using Space Tablespaces we see that all tablespaces in N4S are using
automatic storage:

Page 33/104
IMAGE 25 DBA COCKPIT: TABLESPACES

o You can find the largest tablespace by sorting the output by KB Total

o Using Space Database you can see the size of the database (and also the
growth rates). Use the time frame Ad-hoc to bypass the data collection
framework and look at the current size:

Choose Time Frame Ad-hoc

IMAGE 26 DBA COCKPIT: DATABASE SIZE

o Using Space Automatic Storage we see that database N4S has one storage
group IBMSTOGROUP with four storage paths:

Page 34/104
IMAGE 27 DBA COCKPIT: STORAGE GROUPS

o Since tablespace N4S#FACTD is managed by automatic storage, you cannot define


the size of the tablespace; you can only change parameters like increase size or
maximum size:

Click on Change

IMAGE 28 DBA COCKPIT: CHANGE A TABLESPACE

Page 35/104
IMAGE 29 DBA COCKPIT - CHANGE TABLESPACE PARAMETERS

o You can use the DBA Cockpit to create a new tablespace N4S#MYTS on the
database. If you choose managed by database you have to provide the name and
size of the tablespace containers. Once created, you can change the size of the
tablespace by adding containers or change the size of the existing one.

IMAGE 30 DBA COCKPIT: CREATING A DMS TABLESPACE (1/3)

Page 36/104
o To add a tablespace, just click on the Add Tablespace button in the tablespace
overview in DBA Cockpit. A popup window similar to the following example will
appear:

Choose DMS

IMAGE 31 DBA COCKPIT: CREATING A DMS TABLESPACE (2/3)

Move to the tab Containers and fill in the necessary information for the size and
location of the container. Then click on Add and hit enter in the next screen.

Enter the necessary


information

IMAGE 32 DBA COCKPIT: CREATING A DMS TABLESPACE (3/3)

Page 37/104
The newly created tablespace will be now listed on the DMS/SMS Tablespaces tab:

IMAGE 33 DBA COCKPIT: DMS/SMS TABLESPACES

When you click on Change for this tablespace you will notice that you have more
options, for example to add another container:

IMAGE 34 DBA COCKPIT: CHANGE ATTRIBUTES OF A DMS TABLESPACE

Once finished, you can drop the tablespace N4S#MYTS again:

Page 38/104
IMAGE 35 DBA COCKPIT: DELETE A TABLESPACE

Page 39/104
Hands-On Lab 2.2 Manage Tablespaces and Storage

Objective:

Learn how to add a storage path to a storage group.

Use the DBA Cockpit to reduce the high-water mark of a tablespace.

Questions:

(1) How do you add a storage path to an existing storage group? Will the new path be used
immediately?

(2) Can you easily reduce the high-water mark of a DB2 tablespace?

Hints:

As user db2n4s make sure the new storage path exists on the database server by
running the following command:
ls /db2/N4S/sapdata5

In the DBA Cockpit go to Space Automatic Storage:

Page 40/104
Click on Change to add a
new storage path

IMAGE 36 DBA COCKPIT: AUTOMATIC STORAGE

o Click on Change on the IBMSTOGROUP storage group. In the new window, click on
Add to add the new storage path /db2/N4S/sapdata5 and then click on Save:

IMAGE 37 TRANSACTION DB02: CHANGE AUTOMATIC STORAGE

o The storage group will now show five storage paths. You will see that the new
storage path is created but Not_in_use:

Page 41/104
IMAGE 38 DB02: AUTOMATIC STORAGE AFTER CHANGE

o A new storage path will only be used by DB2 once needed, i.e. because the other
storage paths are full and DB2 cannot grow containers any further. You can also
force DB2 to use a new storage path by rebalancing a tablespace.

o Go to Space Tablespaces and start a Rebalance Process for a small tablespace


like N4S#CLUI:

IMAGE 39 DBA COCKPIT: START REBALANCE

Click on Yes in the pop-up window:

Page 42/104
IMAGE 40 START REBALANCE OPERATION

o You can monitor the progress on DB2 CLP level by running a db2pd util rep

IMAGE 41 MONITOR REBALANCE OPERATION USING DB2PD

o Alternatively, you can run a tail on the db2diag.log as db2n4s user run
db2diag f. You will see messages like the following example:

Page 43/104
IMAGE 42 DB2DIAG.LOG - ADM6062I MESSAGE

o In the DBA Cockpit you will notice that the N4S#CLUI tablespace has now five
containers; also the storage path will now be listed as In Use:

IMAGE 43 DBA COCKPIT: TABLESPACE WITH 5 CONTAINERS

Page 44/104
IMAGE 44 DBA COCKPIT: STORAGE GROUP WITH 5 PATHS

Page 45/104
Unit 3 Table and Index Maintenance

Hands-On Lab 3 Automatic Table Maintenance

Objective:

Learn how to monitor and influence the automatic maintenance feature of DB2.

See how you can analyze single tables in the DBA Cockpit to get information about statistics,
table structure or compression state.

Use the DBA Cockpit to define a new maintenance policy for REORG.

Questions:

(1) Can you see the queue of the automatic table maintenance of the DB2 database?

(2) Does the N4S SAP database use the virtual table functionality?

(3) When was the last RUNSTATS on table SAPN4S./BIC/AODSBENCH00 performed? Is


compression enabled for this table? How many indexes does the table have?

(4) Does the database N4S have tables marked as VOLATILE? Do they have current
statistics?

(5) Is an automatic REORG policy implemented on database N4S? Can you see the policy on
CLP level?

Hints:

Use the DBA Cockpit for this exercise

Page 46/104
o As of DB2 10 you can see the queue for the automatic maintenance feature of DB2.
Go to Space Automatic Maintenance Queue / RTS Requests to see if there are
any outstanding requests for RUNSTATS or REORG:

IMAGE 45 DBA COCKPIT: ATM QUEUE

o To get information about a specific table, you can go to Space Single Table
Analysis. For example, table SAPN4S./BIC/AODSBENCH00 is row-organized, has
around 2 million rows (cardinality) and is compressed with a compression rate of
73%:

Page 47/104
IMAGE 46 DBA COCKPIT: SINGLE TABLE ANALYSIS

o Database N4S was installed using the virtual table functionality. You can see all
virtual tables with Space Virtual Tables

Page 48/104
IMAGE 47 DBA COCKPIT: VIRTUAL TABLES

o As every SAP DB2 database, N4S has a couple of tables that are marked as
volatile. These tables will not be considered by automatic RUNSTATS. The DBA
Cockpit will list these tables under Configuration Special Tables Regarding
RUNSTATS:

Page 49/104
IMAGE 48 DBA COCKPIT - VOLATILE TABLES

o The automatic maintenance in DB2 is controlled by so-called policies. You can


maintain them in the DBA Cockpit via Configuration Automatic Maintenance.
To configure the policy for the automatic REORG go to the proper tab and click on
Display <--> Change:

Page 50/104
IMAGE 49 DBA COCKPIT: CONFIGURE AUTOMATIC REORG

o On DB2 CLP level, you can double-check the reorg policy by running the following
command as user db2n4s:
db2 "call sysproc.automaint_get_policyfile('AUTO_REORG',
'policy.xml')"
This will create a XML file located in /db2/db2n4s/sqllib/tmp. The file created could
then be adapted to your specific needs and implemented as a new policy by using:
db2 "call sysproc.automaint_set_policyfile('AUTO_REORG',
'policy_new.xml')"

Page 51/104
Unit 4 Log File Management

Hands-On Lab 4.1 Log File Management

Objective:

Understand the current settings of logging in the N4S database.

Questions:

(1) How many primary and secondary logs are defined for the N4S database?

(2) Looking at your configuration, would you be able to recover the table at a specific point
in time?

Hints:

You can use either the DB2 CLP or the DBA Cockpit to see the configuration of database
N4S.

o To check the settings for LOGPRIMARY and LOGSECOND on DB2 CLP use:
db2 get db cfg for n4s | grep Number | grep LOG

o To check the settings for the log archiving on database N4S, run:
db2 get db cfg for n4s | grep LOGARCHMETH
Database N4S is running in circular logging, as both parameters are set to OFF;
therefore only offline backups are possible and the database does not support a
point in time recovery

Page 52/104
Hands-On Lab 4.2 Enable Archival Logging

Objective:

Learn how to catalog an additional database in DBA Cockpit.

Turn on archival logging on database SAMPLE.

Tasks:

(1) We will use database SAMPLE for this hands-on lab. Catalog the database on both the
DB2 database directory as well as in the SAP DBA Cockpit

(2) Configure database SAMPLE to archive log files to disk

Hints:

First, on DB2 CLP, check whether the SAMPLE database is already cataloged in the
database directory. The output of db2 list db directory should like this:

Page 53/104
IMAGE 50 OUTPUT OF DB2 LIST DB DIRECTORY

Only if the database SAMPLE is not already catalogued, issue a


db2 catalog db sample on /db2/SAMPLE
db2 terminate

Activate the SAMPLE database and invoke the stored procedure db2sap:
db2 activate db sample
db2 connect to sample
db2 invoke db2sap
db2 terminate

Create a directory for the archived logs:


mkdir /db2/SAMPLE/archive

Now, we have to add the database SAMPLE in the DBA Cockpit. Go to System
Landscape tab and click on Add:

Page 54/104
IMAGE 51 DBA COCKPIT: SYSTEM LANDSCAPE

Enter the necessary information in the Add System Entry window. Use SAMPLE as
the System name; then select Remote Database Connection, enter the database name
SAMPLE and click on the symbol to create a new connection:

IMAGE 52 DBA COCKPIT INTEGRATE A SYSTEM 1

Page 55/104
A new screen Add connection entry will appear.
In this screen, enter exactly this information:

Database Connection name: SAMPLE


User name: db2n4s
Password: passw0rd
Confirm: passw0rd
Database Host: n4shost.sapdemo.com
Database Name: SAMPLE
Port Number: sapdb2N4S
Schema Name: DB2N4S

Click on Test Connection


before saving the connection

IMAGE 53 DBA COCKPIT INTEGRATE A SYSTEM 2

Page 56/104
After saving the new DB connection, you will be back in the System Entry screen.
Select all Collector Options.

IMAGE 54 DBA COCKPIT INTEGRATE A SYSTEM 3

Click on the save symbol (or use CTRL+S).


In the pop-up window, answer the question with yes.

Page 57/104
IMAGE 55 DBA COCKPIT INTEGRATE A SYSTEM 4

Back in the System Landscape you should now see both connections:

IMAGE 56 SYSTEM LANDSCAPE WITH SAMPLE DATABASE

To select the SAMPLE database click on the system name on the left upper corner
and select SAMPLE:

Page 58/104
Image 57 DBA Cockpit - Select SAMPLE

Once connected to SAMPLE, change the configuration parameter ( Configuration


Database) LOGARCHMETH1 to DISK:/db2/SAMPLE/archive

IMAGE 58 DBA COCKPIT: CHANGE OF LOGARCHMETH1 (1/2)

Page 59/104
IMAGE 59 DBA COCKPIT: CHANGE OF LOGARCHMETH1 (2/2)

Alternatively, you can change the configuration using the DB2 CLP:
db2 update db cfg for sample using logarchmeth1
disk:/db2/SAMPLE/archive

Exit the DBA Cockpit by clicking on the yellow arrow (or press Shift+F3)

Go back to the Terminal window and continue as user db2n4s on the DB2 command
line.

o First, make sure no one is connected anymore to SAMPLE:


db2 list applications for db sample

o If there is still a connection, force the connection with:


db2 "force application (<appl. handle>)"

o Now, deactivate the database SAMPLE:


db2 deactivate db sample

Page 60/104
o Try to connect now:
db2 connect to sample
this should fail with a message SQL1116N at this point saying that the database
is in BACKUP PENDING state.

o You need to take a full offline backup to get the database to a normal state. And
you have to do this through CLP:
First, create your backup directory (mkdir /db2/SAMPLE/backup).
Now start the offline backup with
db2 backup db sample to /db2/SAMPLE/backup

o Once the backup has finished successfully you can now activate the database again:
db2 activate db SAMPLE

o Now, force a log switch on the database by running:


db2 archive log for db sample

o Running db2diag f will show that the log file archive operation was successful.

Page 61/104
Unit 6 Backup and Recovery

Hands-On Lab 6.1 Backup and Restore

Objective:

Use the DBA Cockpit to schedule online database backups.

Learn how to use the DB2 RECOVER command to restore and roll-forward a database.

See how a new log chain is created after a restore operation

Tasks:

(1) Use the DBA Cockpit (DB13) to schedule an online backup of the SAMPLE database and
check that the backup finishes successfully.

(2) Connect to database SAMPLE on CLP. Run the script


/db2/db2n4s/scripts/admin/pit_recovery.clp. This will update table EMPLOYEE in
database SAMPLE. Record all timestamps of the updates.

(3) Disconnect from database sample.

(4) Check the archive directory, notice that you have a directory created for your log chains.

(5) Run db2ckbkp on the latest backup image to confirm that it is usable for recovery.

(6) Use the RECOVER command to restore the database to the point of the second update
statement from step 2.

(7) Connect to the database SAMPLE and query the EMPLOYEE table.

(8) Check the archive directory again. Notice that a new log chain directory is created.

Page 62/104
Hints:

Make sure to use the SAMPLE database for this exercise. In the DBA Cockpit, go to the
DBA Planning Calendar ( Jobs DBA Planning Calendar). Make sure, that you have
selected database SAMPLE:

IMAGE 60 DBA PLANNING CALENDAR FOR DATABASE SAMPLE

o In the Action Pad in the right corner, select Database Backup to Device and
double-click on the action. A new window Schedule a New Action will appear:

Page 63/104
IMAGE 61 DB13 - SCHEDULE ONLINE BACKUP

o Enter the directory /db2/SAMPLE/backup and click on Execute Immediately.

o Back in the calendar you can monitor the backup operation (alternatively, you can
go to the DB2 CLP and run db2pd util).

o Once the backup has finished, the Planning Calendar should look similar to this
screenshot:

Page 64/104
IMAGE 62 DB13 - SUCCESSFUL BACKUP

Now logon as user db2n4s and work on the DB2 command line. Connect to the SAMPLE
database
db2 connect to sample

Run the script /db2/db2n4s/scripts/admin/pit_recovery.clp:


db2 -tvf /db2/db2n4s/scripts/admin/pit_recovery.clp
the script will update the EMPLOYEE table in the database. Please note the
timestamp after the second update.

Page 65/104
IMAGE 63 CLP: RUNNING PIT_RECOVERY.CLP SCRIPT

Close your connection and deactivate the SAMPLE database:


db2 terminate

Probably the DBA Cockpit is still connected and needs to be forced off of the database
with the FORCE APPLICATION command:

Page 66/104
IMAGE 64 CLP: FORCE APPLICATION

Check the archive directory that you have configured in lab 4.2. You will notice that a
directory C0000000 was created automatically for log chain 0:
ls /db2/SAMPLE/archive/db2n4s/SAMPLE/NODE0000/LOGSTREAM0000

Run the db2ckbkp command on the latest backup image to confirm that it is usable for
recovery:
ls ltr /db2/SAMPLE/backup/
db2ckbkp /db2/SAMPLE/backup/<most recent backup filename>

IMAGE 65 CLP: DBCKBKP

Now start the RECOVER command. Make sure to roll forward to the point in time
returned after the second update statement from the pit_recovery.clp script (the
timestamp has the format yyyy-mm-dd-hh.mm.ss.nnnnnn).
db2 terminate
db2 deactivate db sample
db2 "recover db sample to <timestamp taken after second
update statement>"

Page 67/104
Once the RECOVER command has finished successfully, activate and connect to the
SAMPLE database:
db2 activate db sample
db2 connect to sample
When you query the EMPLOYEE table, you will notice that only the first two updates
were recovered (as intended by providing the point in time):
db2 select empno, firstnme from employee

Check the archive directory again. Notice that a new log chain directory was created:
ls /db2/SAMPLE/
archive/db2n4s/SAMPLE/NODE0000/LOGSTREAM0000

Page 68/104
Hands-On Lab 6.2 Redirected Restore

Objective:

Learn how to create a redirected restore script in DB2.

Perform a redirected restore to change the layout (location of a container) of a tablespace.

Tasks/ Questions:

(1) Use the DBA Cockpit to create a new DMS tablespace MYTS in the SAMPLE database.

(2) Create a redirected restore script for the SAMPLE database. Which tools can you use to
create this script?

(3) Change the location of the container of MYTS tablespace in the redirected restore script.
Why is MYTS the only tablespace where you can change the container layout?

(4) Perform a redirected restore using the RESTORE and ROLLFORWARD commands.

Hints:

Use the DBA Cockpit to create a new DMS tablespace MYTS in the SAMPLE database (
Space Tablespaces. Select the tab DMS/SMS Tablespaces and click on Add:

Page 69/104
IMAGE 66 DBA COCKPIT ADD TABLESPACE TO SAMPLE

Enter the tablespace name MYTS and Space Management By Database and leave the
other options unchanged.
In the Containers tab, click on the Add Container button and enter the following
information for the tablespace container:
Name: /db2/SAMPLE/db2n4s/NODE0000/SAMPLE/MYTS/C0000000.LRG
Size: 4000 KB

IMAGE 67 DBA COCKPIT DEFINE CONTAINER FOR TABLESPACE MYTS

Page 70/104
Click on Add and answer the question with Yes:

IMAGE 68 DBA COCKPIT CREATE TABLESPACE MYTS

You will now see the new DMS tablespace for database SAMPLE:

IMAGE 69 DBA COCKPIT TABLESPACE MYTS CREATED

Page 71/104
Now, log on as user db2n4s on a Linux Terminal. Deactivate the SAMPLE database and
force off any connections:
db2 deactivate db sample
db2 list applications for db sample
db2 "force application (<application handle>)"

Use the brdb6brt command (part of the SAP kernel) to execute an offline backup of
database SAMPLE. Together with the offline backup the command can create a
redirected restore script (by using the bm BOTH option):
brdb6brt -s SAMPLE -bm BOTH bpt /db2/SAMPLE/backup

o The brdb6brt command will write an output file called SAMPLE_NODE0000.scr in


your current directory.

o Open the SAMPLE_NODE0000.scr file using vi (or any other editor) and look at the
different options. Search for the line containing the information for tablespace
MYTS. Change the container path from
/db2/db2n4s/SAMPLE/db2n4s/NODE0000/SAMPLE/MYTS/C0000000.LRG to
/db2/db2n4s/SAMPLE/db2n4s/NODE0000/SAMPLE/NEWTS/C0000000.LRG

IMAGE 70 EDITING THE REDIRECTED RESTORE SCRIPT

Page 72/104
o After saving the change, start the redirected restore:
db2 tvf SAMPLE_NODE0000.scr

o Once the RESTORE has finished, perform a ROLLFORWARD to end of logs and stop
the rollforward operation afterwards:
db2 rollforward db sample to end of logs and complete

o Now you can activate the database SAMPLE again


db2 activate db sample

o Run the db2pd command to verify the new location of tablespace MYTS:
db2pd d sample tab[lespaces]

Page 73/104
Unit 7 Performance Monitoring and Tuning

Hands-On Lab 7.1 Health Check

Objective:

Learn how to perform a quick health check of your SAP database.

Use the DBA Cockpit to monitor key performance indicators in DB2 SAP environments.

Questions:

(1) How good is the quality of the buffer pool similar values for index and data?

(2) Which I/O times are reported for asynchronous I/O operations?

(3) Are the package cache and catalog cache sized sufficiently?

(4) Is the lock list large enough for the workload?

(5) How about the sort quality?

(6) Does the database have enough log space available? How about logging I/O?

Hints:

Use the DBA Cockpit for this exercise ( Performance Database). Make sure to
choose the database N4S. Choose Ad-hoc as the Time Frame. Go through the
different tabs to check the KPIs of database N4S.

Page 74/104
IMAGE 71 DBA COCKPIT: DATABASE PERFORMANCE

Hands-On Lab 7.2 SQL Cache Analysis

Objective:

Learn how to use the SQL analysis in the DBA Cockpit.

Understand how to use the EXPLAIN facility to see SQL access plans.

See how you can use the index advisor to get recommendations on additional indexes.

Tasks/ Questions:

(1) What is the most expensive statement in the SQL cache of the N4S database in terms of
overall runtime (Coord. Statement Exec. Time)?

(2) Which statement is the most expensive in average (Avg. Coord. Stmt. Exec. Time)? Is
this statement executed often?

Page 75/104
(3) Highlight a query that is not a DB2 system catalog query and explain the statement.

(4) Run the Index Advisor for a single statement.

Hints:

Use the DBA Cockpit ( Performance SQL Cache) for this exercise.

o By default, the statements are sorted by the Coord. Statement Exec. Time (overall
execution time for the statement). By clicking on the column Avg. Coord. Stmt.
Exec. Time) you can find the most expensive statement per execution.

IMAGE 72 DBA COCKPIT: SQL CACHE SNAPSHOT

o Highlight a query that is not a DB2 system catalog query and use the Explain to
see the access plan.

Page 76/104
IMAGE 73 DBA COCKPIT: EXPLAIN

o The SAP explain of the access plan is now displayed in the window:

IMAGE 74 EXPLAIN ACCESS PLAN

o Go back to the SQL cache screen (by hitting the green back button or F3). Mark and
copy the SQL statement text.

Page 77/104
IMAGE 75 SELECT STATEMENT FOR INDEX ADVISOR

o Now, go to Diagnostics Index Advisor. Paste the copied SQL text in text box.
Then, click on Recommend Indexes. The DB2 Index Advisor will then propose new
indexes:

IMAGE 76 INDEX ADVISOR

Page 78/104
Unit 8 Problem Analysis

Hands-On Lab 8.1 db2look, db2top, INSPECT, db2support

Objective:

Learn how to run db2look.

Use db2top to monitor the DB2 system.

Run the DB2 INSPECT command to verify the consistency of a single table.

Use the db2support tool to collect diagnostic data.

Tasks/ Questions:

(1) Use db2look to find the page and extent sizes defined for the SAP tablespaces.

(2) Run db2top in interactive mode for the N4S database. Can you see the quality of the
IBMDEFAULTBP buffer pool? Do you see any utility in progress?

(3) Use the DB2 INSPECT command to verify the integrity of table REPOSRC.

(4) Run command db2support to collect diagnostic data for the system. Which file is
created by db2support? Can you open this file? What does it contain?

Hints:

Log on as user db2n4s on a Terminal window.

o The command options for the db2look to get information about the database layout
and write the output to a file are:
db2look d n4s l o db2look.out

Page 79/104
o Start db2top. In db2top, use b (Bufferpools) to get information about the
bufferpools of the database, including the quality. Use u (Utilities) to see if, for
example, RUNSTATS is running.

o Use INSPECT against table REPOSRC. The output file is in binary format and needs to
be transformed by using the db2inspf command:
db2 connect to n4s
db2 inspect check table name reposrc schema sapn4s
results keep inspect.dmp
cddump
db2inspf inspect.dmp inspect.out
vi inspect.out

o To collect diagnostic information, use the db2support command:


db2support . d n4s c f
This will create an archive called db2support.zip in the current directory that can
be transferred to SAP / IBM support.

Page 80/104
Hands-On Lab 8.2 Lock-wait Scenario

Objective:

Learn how to monitor a lock-wait scenario in DB2.

Task/ Question:

(1) Create a lock-wait situation on the database and use the DBA Cockpit to monitor it. Is
there another tool available to get similar information?

Hints:

Open a second SAPGUI window with transaction SA38 (/osa38). Run the report
ZH9_LOCKWAIT.

In the DBA Cockpit, go to Diagnostics Lock Waits and Deadlocks. You will see the
lock wait created by the ABAP report:

Page 81/104
IMAGE 77 DBA COCKPIT - LOCK WAIT EVENTS

Alternatively, you can run db6util sl as user n4sadm in a Terminal window:

Page 82/104
IMAGE 78 DB6UTIL

Page 83/104
Unit 9 BLU Acceleration

Hands-On Lab 9.1 Configuring DB2 for BLU Acceleration

Objective:

Learn how to configure a DB2 database to support BLU Acceleration.

Questions:

(1) Is the DB2 installation of system SAP N4S currently supporting BLU Acceleration?

(2) How do you configure the DB2 instance (setting of intra-parallelism and query degree)
and DB2 database (configuration of sort memory) according to DB2 SAP best practices?

(3) How to activate the changes?

Hints:

Check the setting of instance parameter INTRA_PARALLEL:


o As user db2n4s, issue the command
db2 get dbm cfg | grep INTRA_PARALLEL
you will notice, that intra-parallelism is not enabled on instance DB2N4S.
Enable intra-parallelism and a maximum query degree of ANY in the DB2 instance
configuration:
o As user db2n4s, issue the command
db2 update dbm cfg using INTRA_PARALLEL on
MAX_QUERYDEGREE any
you will receive an SQL1362W warning, because the change of INTRA_PARALLEL
cannot be performed online.

Page 84/104
Take the setting of sort memory out of the self-tuning memory management. Which values
to use is largely depending on the available memory of the VMware image. Ask the lab
instructor whether you can increase the overall memory (and number of CPUs) of the image.
A change requires a reboot of the VMware image.

IMAGE 79 EDIT VMWARE VIRTUAL MACHINE SETTINGS

The overall memory limit of the DB2 instance (DBM CFG parameter INSTANCE_MEMORY) is
depending on the overall memory available on the VMware image. The values for SORTHEAP
and SHEAPTHRES_SHR (for the sort memory of the database) is then depending on the size
of INSTANCE_MEMORY.
The following table provides two different calculations for VMware images with 6 RAM and
12 GB RAM:

DB2 Parameter Image with 6 GB RAM Image with 12 GB RAM


INSTANCE_MEMORY 4 GB (1048576 4KB pages) 8 GB (2097152 4KB pages)
SHEAPTHRES_SHR 1.28 GB (335544 4KB pages) 2.56 GB (671088 4KB pages)
SORTHEAP 256 MB (67108 4KB pages) 512 MB (134216 4KB pages)

As user db2n4s, issue the following commands:


o db2 update dbm cfg using instance_memory <value>
o db2 terminate
o db2 connect to n4s
o db2 update db cfg for n4s using sheapthres_shr <value>
sortheap <value>
As the change of INTRA_PARALLEL requires a shutdown of the DB2 instance, we will now
restart the SAP system. As user n4sadm, issue:
o stopsap && startsap

Page 85/104
Once SAP is available again, we can continue with the hands-on labs.

Hands-On Lab 9.2 Creating InfoCubes that use Column-Organized Tables

Objective:

Learn how to create a new InfoCube that uses column-organized tables.

Use the SAP dictionary to look at the storage parameters of column-organized tables and compare
the information to an InfoCube with row-organized tables.

Use the db2support tool on command line to retrieve DDL statements for InfoCube tables.

Tasks:

Call transaction RSA1 (Data Warehousing Workbench) and open the folder BI
Benchmark.

IMAGE 80 TRANSACTION RSA1

Page 86/104
Activate the context menu (right-click) of Benchmark InfoCube 01 (/BIB/BENCH01)
and choose Copy

IMAGE 81 TRANSACTION RSA1 EDIT INFOCUBE

Page 87/104
In the pop-up window, enter BLUCUBE01 as the InfoCube name and BLU
Benchmark InfoCube 01 as the comment. Leave the other field entries as they are
and continue with the Create button.

IMAGE 82 TRANSACTION RSA1 EDIT INFOCUBE

Page 88/104
Back in the RSA1 main menu, select Extras DB Performance Clustering.

IMAGE 83 TRANSACTION RSA1 DEFINE CLUSTERING

In the Clustering dialog, select Column-Organized.

IMAGE 84 TRANSACTION RSA1 SELECTION OF CLUSTERING

Page 89/104
Save and activate the InfoCube.

IMAGE 85 TRANSACTION RSA1 SELECTION OF CLUSTERING

You can now display the layout of the BLU Benchmark cube inside RSA1. From the
menu, choose Extras Information (logs/status).

IMAGE 86 TRANSACTION RSA1 INFORMATION ON INFOCUBE

In the pop-up window that is displayed, select Dictionary/DB status:

Page 90/104
IMAGE 87 TRANSACTION RSA1 INFO SELECTION

The InfoCube tables are displayed in a new pop-up window.

Page 91/104
IMAGE 88 TRANSACTION RSA1 STATUS INFORMATION

Double-click table /BIC/FBLUCUBE01. The SAP Data Dictionary is invoked. Examine


the indexes of the table: Column-organized F fact tables have no indexes.

Page 92/104
IMAGE 89 TRANSACTION RSA1 ABAP DICTIONARY
Examine the storage parameters of the table via the Database Utility as shown
below: From the menu go to Utilities Database Object Database Utility.

IMAGE 90 TRANSACTION RSA1 DATABASE UTILITY


In the Database Utility screen display the Storage Parameters:

Page 93/104
IMAGE 91 TRANSACTION RSA1 DATABASE UTILITY DISPLAY STORAGE PARAMETERS

In the Storage parameters screen you will notice, that column-organized tables are
created with the keywords ORGANIZE BY COLUMN. Distribution keys (partitioning
keys) are tolerated but not supported yet in DB2 10.5 BLU acceleration.

Page 94/104
IMAGE 92 TRANSACTION RSA1 DATABASE UTILITY DISPLAY STORAGE PARAMETERS

Go back to the Status Information screen and repeat the steps for the E fact table
/BIC/EBLUCUBE01 and for one of the dimension tables /BIC/DBLUCUBE01*.
On the E fact table, of the many secondary indexes for row-organized InfoCube E
fact tables, only the unique P index remains. In the database, it is implemented as a
unique constraint on the column-organized table.
To compare with an InfoCube on row-organized tables, you can go back to
transaction RSA1. Double-click on InfoCube Benchmark InfoCube 01
(/BIB/BENCH01) and repeat the steps to look at the database tables in the ABAP
dictionary.
You can also retrieve the DDL for the BW tables on DB2 command line. For this,
work as user db2n4s and run the following command:
o db2look -d n4s -a -e -t "/BIC/EBLUCUBE01" "/B49/FBENCH01"
-o db2look.out
the file db2look.out will contain the DDL statements for both tables
Query the DB2 system catalog to see which tables are column-organized (column
TABLEORG of SYSCAT.TABLES):

Page 95/104
o SELECT TABNAME FROM SYSCAT.TABLES WHERE TABLEORG = C

Hands-On Lab 9.3 Use DB6CONV

Objective:

Learn how to use SAP report DB6CONV to convert existing SAP BW tables to column-
organized.

Tasks:

Call transaction SA38, enter DB6CONV in the Program field and execute (F8) the
report:

IMAGE 93 TRANSACTION SA38

In the DB6CONV entry screen, select New Conversion

Page 96/104
IMAGE 94 DB6CONV SELECT NEW CONVERSION

In the new screen, go to tab BW Conversions

IMAGE 95 DB6CONV BW CONVERSIONS

Now select all BW Objects and then click on Conversion Queue. This will generate
a list of tables that will be converted to BLU:

Page 97/104
IMAGE 96 DB6CONV SELECT BW OBJECTS FOR CONVERSION

Click on OK in the conversion queue pop-up screen:

IMAGE 97 DB6CONV DISPLAY CONVERSION QUEUE

Page 98/104
Back in the New Conversion screen click on Save (CTRL+S):

IMAGE 98 DB6CONV SAVE BW CONVERSION QUEUE

You will get an informational screen like the following:

IMAGE 99 DB6CONV INFORMATION ON BW CONVERSION QUEUE

Back in the DB6CONV main screen, you will now see the new BW conversion queue
in status PLANNED:

Page 99/104
IMAGE 100 DB6CONV PLANNED BW CONVERSION

Mark the line with the planned queue and click on Start Conversion:

IMAGE 101 DB6CONV START BW CONVERSION

Start the conversion immediately, with one conversion job (can be changed online
later):

Page 100/104
IMAGE 102 DB6CONV START BW CONVERSION SCREEN

In the DB6CONV main screen you will now see the queue in status RUNNING. In
the lower half of the screen you will see the tables that are part of the queue.

IMAGE 103 DB6CONV RUNNING BW CONVERSION

By selecting one of the tables and clicking on Conversion Log you can retrieve the
conversion log for the table.

Page 101/104
IMAGE 104 DB6CONV BW CONVERSION LOG

Depending on the speed of the VMware image, the DB6CONV can run for a while.

Page 102/104
Copyrights, Trademarks & Disclaimer
Copyright IBM Corporation, 2015 All Rights Reserved.

IBM, the IBM logo, and ibm.com are trademarks or registered trademarks of International
Business Machines Corp., registered in many jurisdictions worldwide. Other product and service
names might be trademarks of IBM or other companies. A current list of IBM trademarks is
available on the Web at Copyright and trademark information at
www.ibm.com/legal/copytrade.shtml.

SAP, mySAP, SAP NetWeaver, SAP NetWeaver BI, SAP NetWeaver BW, SAP BW, SAP R/3,
SAP SCM, SAP SEM and other SAP products and services mentioned herein are trademarks or
registered trademarks of SAP AG in Germany and in several other countries.
More about SAP trademarks at.
http://www.sap.com/company/legal/copyright/trademark.asp

Microsoft, Windows, Windows NT and the Windows logo are registered trademarks of Microsoft
Corporation in the United States and/ or other countries.
UNIX is a registered trademark in the United States and other countries licensed exclusively
through The Open Group.
LINUX is a registered trademark of Linus Torvalds.
Intel and Pentium are registered trademarks and MMX, Itanium, Pentium II Xeon and Pentium III
Xeon are trademarks of Intel Corporation in the United States and/ or other countries.
Java and all Java- based trademarks and logos are trademarks of Sun Microsystems, Inc. in the
United States and/ or other countries.

Other company, product and service names may be trademarks or service marks of others.

REFERENCES IN THIS PUBLICATION TO IBM PRODUCTS, PROGRAMS, OR SERVICES DO


NOT IMPLY THAT IBM INTENDS TO MAKE THESE AVAILABLE IN ALL COUNTRIES IN
WHICH IBM OPERATES.
IBM MAY HAVE PATENTS OR PENDING PATENT APPLICATIONS COVERING SUBJECT
MATTER IN THIS DOCUMENT.
THE FURNISHING OF THIS DOCUMENT DOES NOT IMPLY GIVING LICENSE TO THESE
PATENTS.
INFORMATION IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND.
THE INFORMATION IN THIS DOCUMENT MAY CONCERN NEW PRODUCTS THAT IBM MAY
OR MAY NOT ANNOUNCE.

Any discussion of OEM products is based upon information which has been publicly available and
is subject to change. The specification of some of the features described in this presentation may
change before the General Availability date of these products.
Information concerning non-IBM products was obtained from a supplier of these products,
published announcement material, or other publicly available sources and does not constitute an
endorsement of such products by IBM. Sources for non-IBM list prices and performance numbers
are taken from publicly available information, including vendor announcements and vendor
worldwide homepages.

Page 103/104
IBM has not tested these products and cannot confirm the accuracy of performance, capability, or
any other claims related to non-IBM products. Questions on the capability of non-IBM products
should be addressed to the supplier of those products.

Page 104/104

Potrebbero piacerti anche