You are on page 1of 35

Course Duration- (1 Day)

Database Overview

1
Disclaimer

This PPT Deck contains valuable confidential and proprietary information of


ASTRAZENECA. This includes, amongst others, proprietary intellectual property both
internal as well as external third parties, which may be legally protected and
commercialized. The information contained here is furnished only for internal
training purposes. This document or the information contained herein may not be
published, disclosed, or used for any other purpose, except with the prior written
permission of ASTRAZENECA .

2
Document History

• Document Change Records

Date Author Version Change Reference / Remarks

 Document’s Reviewers
Name Designation Business Unit

3
Learning Objectives

To understand the third layer i.e. Database layer and our role in it, first you should be
able to
- Describe the architecture of oracle database.
- Describe users of database created at three level of the system.
- Starting and stopping of database.
- Administration tools of database.

4
Session Agenda
• Architecture of Database
• Directory Structure of database
• Environmental Variables.
• Database Users
• SAP and Database Connection
• Start and stop of database
• Administration tools

5
I.1 Architecture Overview

Data Shared pool


Data
Dictionary
Buffer
Cache
Shared Global Area (SGA)

Library
Redo log
Cache
buffer

Background Processes

PMON SMON DBWR LGWR CKPT

Instance

Physical
Control Parameter file
Data files Files
Files
Redo log files Archive log files
6
Directory Structure
Environment Variables For Oracle

The environment variables ORACLE_SID, ORACLE_HOME, SAPDATA_HOME must be set


on the database server for the user <sapsid>adm (Windows) and ora<DBSID> (Unix).

ORACLE_SID: This is the system id of the oracle


instance (DBSID).

ORACLE_HOME: This is the home directory which contains Bin,


Database and Network directories of Oracle software. It contains all
the executables for oracle software.

SAPDATA_HOME: It holds the path of the directories which


contain data files & online redo log files.

ORA_NLS10: In Unix, it needs to be declared for user


ora<dbsid>. The default path is $ORACLE_HOME/nls/data.
Database users

SAP prefers to maintain users at three different level to protect the


SAP system. The three levels are :

 SAP level
 OS level
 Database level

Why database users are required in SAP environment?


• SAP system requires to connect with Database itself.

• Database administrator connects to database to perform


administration

Users are assigned with roles and privileges to perform specific


functions.
9
Oracle System Privileges

Oracle system is controlled by two types of privileges.


 System privileges
 Object privileges

System privileges put restriction on action performed by database user on


oracle instance.

Object privileges put restriction on object level such as to DML operation.

Special System Privileges for Oracle


sysdba operations authorized : create database, startup, shutdown,
backup, recovery.
sysoper It is not authorized to create database and to look into the user’s
data.

10
Operating system users

Operating system user in an sap system with oracle

Unix users Window users

Ora<DBSID> <SAPSID>adm <SAPSID>adm SAPService<SAPSID>

OPER DBA ora_<DBSID>_DBA ora_<DBSID>_OPER ora_DBA

Full Administration of a instance

Restricted Administration of a instance

Full Administration of all instance

Restricted Administration of all instance

11
Oracle database user

There are two administrative users SYS and SYSTEM which are created
There are two administrative users SYS and SYSTEM which are created
during installation and assigned with DBA role.
during installation and assigned with DBA role.

The default password of SYS user is change_on_install.


The default password of SYS user is change_on_install.
The default password of SYSTEM is manager.
The default password of SYSTEM is manager.

SYS USER SYSTEM USER

• SYS user can access data dictionary • SYSTEM user can access tables of
tables , views. database.
• It can modified all tables and data of • It cannot modified the data
a database. dictionary tables of a database
• It has the privilege of full • It can perform administration of
administration of the database. database

12
Database user created by SAP

Database user created by SAP


Database user created by SAP

UNIX USER WINDOWS USER OS INDEPENDENT

OPS$<SAPSID>adm OPS$<DOMAIN> SAP<SCHEMA-ID>


/<SAPSID>adm
Or
OPS$ORA<SAPSID> OPS$<DOMAIN>/ SAPSR3
SAPService<SAPSID>adm

SAPDBA SAPDBA SAPCONN


privileges privileges privileges
13
Operating System Authentication

How Operating System do Authentication?


How Operating System do Authentication?

At OS level database maintains two parameters in PFILE


and SPFILE. If these two parameters are not mentioned in
profile, then explicitly we have to mention them.

Parameters are:

REMOTE_OS_AUTHENT=TRUE

OS_AUTHENT_PREFIX=OPS$

To connect to oracle database we have to mention


connect OPS$<username> where username is an os user.
Example : OPS$sapsr3 where sapsr3 is a user created by
SAP.
14
How to connect with oracle

Connection Method Description

Connect / [@DBSID] Authentication of user is done by OS itself and it


gets connected to oracle as OPS$ user.

Connect <db_user>/<pw>[@DBSID] Authentication of user is done by oracle itself.


Connect <db_user>/<pw>[@DBSID] as sysdba Authentication is done by os and os user get
or connected to oracle sys schema as sys user with
Connect /[@DBSID] as sysdba sysdba privileges.

Connect <db_user>/<pw>[@DBSID] as sysoper Authentication is done by OS itself and os user


or gets connected to oracle public schema as OPS$
Connect /[@DBSID] as sysoper user with sysoper privileges.

15
SAP and Oracle Connection

Connection of SAP’s work process with Oracle.

Oracle Database
SAP system

Step 1: Log on to database with


OPS$ user with os Step 2: OPS$ user
authentication executes select
Step 3: Work process gets statement to get
password of schema user
Work process disconnected from SAPUSER table.

Step 4 : Work process then Connection is Done


connects with the schema user
and retrieves password from
SAPUSER table.
16
Starting of Database

Starting of oracle database


Starting of oracle database
Oracle database starts in three phases.
 NOMOUNT
 MOUNT
 OPEN

NOMOUNT

MOUNT

OPEN

17
17
How to start Database

Oracle can be started by using sql prompt and sap provided tool
BR*TOOLS.

SQL prompt: In command


prompt type
sqlplus /nolog

Login to database
as sysdba privileges
Enter command
startup

18
18
How to start Database

BRTOOLS:

Oracle will start .

19
19
Stopping a Database

Oracle can be shutdown by entering a command in sql


prompt

SQL>shutdown <MODE>

<MODE> can be

Default mode is
NORMAL ABORT
NORMAL
IMMEDIATE
TRANSACTIONAL

20
SAP Database monitoring

SAP provided transaction code for monitoring the database.

Transaction code are:

1. DB02
2. DB12
3. DB13
4. ST04
5. DB14
6. DB16
7. DB26
8. RZ20

21
DB02

It shows information about space management


It shows information about space management

Database
space, usage
of database.

Tablespace
Tablespace
space used
space used

Missing
Missing
indexes
indexes

22
DBA Cockpit

Data Buffer Quality (%) >= 94


Data Buffer Quality (%) >= 94

User/Recursive Calls>= 2
User/Recursive Calls>= 2

SQL Area pin ratio (%) > 97


SQL Area pin ratio (%) > 97

23
DB12

DB12 is use to see logs of backup operation.

It shows the status


It shows ofItarchive
shows the status
It shows of archive
directory.
information
information directory.
about last
about last
successful
successful
back up
back up

24
DB13

DB13 is a planning calendar from where we can schedule database


administration work.

Action
which is
to be
schedule

25
DB13 continue…

Select
Select the
the
action
action to
to be
be
performed
performed

Start
Start the
the
execution
execution
Start the
execution

26
ST04

ST04 shows the performance of database

Information
about shared
pool buffer

Information
Data dictionary
Data dictionary
about log buffer
cache >=99%
cache >=99%
buffer

User/Recursive Calls>= 2
User/Recursive Calls>= 2

27
St04 continue…

28
DB14

DB14 -display the logs of database operation.


DB14 -display the logs of database operation.

Shows logs of
Shows logs of
space
space
management
management
and
and
connection
connection

Shows logs of
Shows logs of
backup
backup
operations
operations

29
DB26

It shows the parameter values of all database.


It shows the parameter values of all database.

30
RZ20

Database alert monitor can monitors database different area


Database alert monitor can monitors database different area

31
Administrative tools

SAP preferred to perform administration of database by BRTOOLS.


SAP preferred to perform administration of database by BRTOOLS.

BRTOOLS
is a
character
based
interface

BRBACKUP BRCONNECT

BRARCHIVE BRSPACE

BRRESTORE BRRECOVER

32
Summary

You should be able to:


• Architecture of Database
• Directory Structure of database
• Environmental Variables.
• Database Users
• SAP and Database Connection
• Start and stop of database
• Administration tools

33
References

• http://help.sap.com/
• TADM51

34
THANK YOU

Q&A

35

You might also like