SAP On DB2 Overview - Updated

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 48

Fundamentals of DB2 & SAP on

DB2
By Varun Krishna S
Agenda for fundamentals of DB2

• Introduction to RDBMS , SQL


• Instance : Create instance , instance path
, folder structure , working with instance
• Database : folder structure
• System and database configuration files
Agenda for SAP on DB2

• Introduction
• User management
• Storage structures
• DB2 engine dispatchable engines
• DB2 environment
• DB2 Architecture
• DB2 database partitioning
• All about DB2 statement processing
• Log file management
• DB2 backup Architecture
• Types of backup
• Checking Backup
• Advantages of SAP with DB2
Introduction about RDBMS , SQL

What is RDBMS and SQL ?

RDBMS stands for Relational Database Management System. RDBMS is the


basis for SQL, and for all modern database systems like MS SQL Server, IBM
DB2, Oracle, MySQL, and Microsoft Access

SQL is used to store and retrieve data

All RDBMS concepts are applicable to DB2


also
Introduction about DB2

• DB2 can have multiple instances and multiple DB’s


under each instance
• DB2 available in multiple platforms LUW , Z/OS, I5/OS
• DB2 V9.7 is latest release
• In oracle one DB is allowed under one instance . Here
we can have multiple DB’s and instances .
DB2 system – instance – Database
Instance 1 Inst 2

Database 1
Database 1

Database 2 Database 2

DBMCFG DBMCFG

DBM Program
file
Different configuration files

Database manager configuration file


this is for instance Allow to specify Sharing of resources between
instances ,Number of connections allowed…. etc
DB CFG :
This is for each DB

DBM Program files :


This get creates when DB2 is installed . These are executables
comes with DB2 installation
These files get stored in a folder SQLLIB under the path given.
Simple commands for Administration

List instances :
DB2 ILIST
How to get DBMconfiguration file :
DB2 GET DBMCFG
How to know in which instance we are in :
DB2 GET INSTANCE
How to move from one instance to other instance
$ su – “ intance name”
Windows :
Set db2instance= “ Instance name “
Instance creation

Create user DB2inst1 DB2fenc1 at Oslevel

DB2DIR/INSTNCE/DB2ICRT –U DB2FENC1 DB2INST1


/home/db2inst1 , /home/db2inst1/sqllib

Db2inst1: User and instance name


Db2icrt : it is executable file
Instance Deletion
DB2IDROP “INSTANCE NAME”

DB2 instance PATH

• Physically instances are stored with Complex file structure

•Every instance in unix run under a userid called instance owner

•For installation instance owner home directory is used


DB Creation

Create DATABASE DBNAME

Create DB DBNAME on “Path”

Create DB DBNAME ON <P1>,<P2> DBPATH ON <P3>


Agenda for SAP on DB2

• Introduction
• User management
• Storage structures
• DB2 engine dispatchable engines
• DB2 environment
• DB2 Architecture
• All about DB2 statement processing
• Log file management
• DB2 backup Architecture
• Types of backup
• Checking Backup
• Advantages of SAP with DB2
Introduction
SAP supports below versions of DB2
Model view of SAP on DB2

1. Instance is also referred to as a DB2 database manager.


2. More than one instance can be defined on a server machine and each of them can be managed independently
3. You can create more than one instances on one server, and more than one databaseon one instance.
4. Databases contain bufferpools, tablespaces and temporary tablespaces.
5. Tablespaces contain tables, indexes and views.
Technical overview
User Management

• The operating system user db2<dbsid> is the DB2 instance


owner and the SAP database administrator . This user belongs
to the operating system group db<dbsid>adm.

• The operating system user <sapsid>adm is authorized to start


and stop SAP
<SAPSID>ADM has below Authorizations'
File Structure on unix and Linux
Process bases vs Thread based
Process bases vs Thread based

1. The DB2 implementation on Windows is multi-threaded. they are implemented as


threads. All threads run within the Windows program db2syscs.exe.
2. Use the Windows resource tool kit program qslice to view the threads in a
program.

Except for the above mentioned differences,the implementations of DB2 onUNIX and
Windows are very similar

3. On Linux / UNIX with DB2 versions up to 9.1 there is a process-based DB2


implementation.

Processes can be listed using command db2_ps .

As of DB2 Version 9.5 the DB2 implementation is thread-based on all supported


platforms.

Issue db2pd –edus to get a list of all threads of the DB2 instance..
DB2 engine Dispatchable units
DB2 environment
DB2 engine configuration files
DB2 environment
DB2 engine configuration files
DB2 environment
DB2 engine configuration files
DB2 environment
DB2 engine configuration files
Platform-specific environment variables

– DB2 instance-level profile registry


• Variables set at this level apply only to a specific instance.
– DB2 global-level profile registry
• Variables set at this level apply globally to all instances based on
a particular DB2 software copy.
– DB2 instance-node-level profile registry
• Variables at this level apply to a specific partition in a multi-partition
environment.
– DB2 instance profile registry
• Contains a list of all instances based on the same DB2 software copy.
DB2 environment
DB2 engine configuration files
DB2 environment
DB2 engine configuration files
DB2 ARCHITECTURE
Simple commands to check connected applications to DB
DB2 Architecture
DB2 Architecture - startsap

With db2start command which started by startsap the below edu’s will get started :
1.db2wdog – Monitor Edu
2.db2sync - EDU control
3.db2tcpcm – Acts on TCP request
4. db2ipccm – Acts on IPC request
DB2 Architecture - stopsap

When SAP software is shut down in a controlled process, the stopsap script is used to call the script stopdb,
which in turn executes the following DB2 commands:
1 db2 deactivate database <dbsid>
2 db2stop

During the deactivation of the database, the database buffers are copied back toDB2 containers and all files
DB2 Architecture - DB2 Memory Allocation

1. When the DB2 instance is started, the per-instance memory, also known as database-manager shared
memory, is allocated. The maximum size of the memory can be controlled by the DB2 DBM parameter
“instance_memory”.
2 When the DB2 database is activated or started, the per-database memory isallocated. The maximum size
of the per-database memory can be controlled by the DB2 DB parameter “database_memory”.
DB2 – database partitioning
Possible partitioning scenarios :

2. Table spaces in multiple partitions

1. One database may reside on several separate computers.


2. Shared nothing (function shipping): Each Partition accesses only its local data
Types of Partitioning :
1.All tablespaces reside in one partition.
2.Core tablespaces (e.g. BTAB, POOL or CLUST) are located in one partition.
Logical and Physical Partitioning
Logical Partitioning:
Several logical partitions can be on the same machine.
Physical Partitioning:
Several logical partitions can be on different machines.
Each partition has its own Buffer Pools, Sort Areas and Logging.
Physical or logical Partitioning is transparent to the database. It is determined
by the file db2nodes.cfg
How partition works
What is partition key :
DB2 – SQL Statement processing

SQL requsts that are sent from SAP Application servers will be first processed by DBI ( Database interface ).

DBI - SAP's databse independent inteface layer for SQL processing .

DBI sends request to DBSL for DB specific processing (DBSL - Data base support layer)

Via DBI and DBSL SQL requsts are transfrred to DB2 specific calls of the DB2 CLI ( Call level interface).
CLI operates typical commands ( Prepare , execute , fetch , close ) . To work on request
DB2 – Statement processing
DB2 TCP/IP Connection Setup
Log file management ( Logging over view)
Log file management ( Logging over view)
DB2 Backup architecture
Different Backups ( Offline )
Different Backups ( online )
Different Backups (incremental and delta)
Backup from DB13
Checking Backup(DB12)
Advantages of SAP with DB2 -
Partitioning Feature

•Start with small DB server and add CPU and memory resources as
needed
•„start with one DB server and add additional DB servers as needed
•„Better CPU utilization through parallel query execution
•„Reduction of time for maintenance operations
•„Parallel backup of all database partitions reduces backup time
•„Parallel index creation on all partitions where table is located
Thank You

You might also like