Monitor & Extend Tablespaces In SAP
Purpose:
This document describes how to monitor and extend tablespaces in SAP systems with Oracle as database. Oracle DB manages database data in logical units called table spaces. Hardware platform can be any (Unix, Linux, Windows)
Procedure:
- 1. Monitor tablespaces
- a. Open SAPGUI & use t-code DB02. To get the latest data press the refresh button on the top left corner, this will schedule a job REFRESH_SPACE_STATISTICS_SID and we can monitor this job in t-code SM37. Once this job is finished the data will be updated in DB02. Go to Oracle Database administration à Space à Tablespaces à Overview. Generally we need to add space if any tablespace reaches 95% (Total used %).
- b. Monitor tablespaces via BRTOOLS. Check below what to execute :
hostname:orasid > brtools
BR0651I BRTOOLS 7.20 (35)
BR0280I BRTOOLS time stamp: 2015-08-31 21.43.51
BR0656I Choice menu 1 - please make a selection
-------------------------------------------------------------------------------
BR*Tools main menu
1 = Instance management
2 - Space management
3 - Segment management
4 - Backup and database copy
5 - Restore and recovery
6 - Check and verification
7 - Database statistics
8 - Additional functions
9 - Exit program
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
2
BR0280I BRTOOLS time stamp: 2015-08-31 21.43.53
BR0663I Your choice: '2'
BR0280I BRTOOLS time stamp: 2015-08-31 21.43.53
BR0656I Choice menu 5 - please make a selection
-------------------------------------------------------------------------------
Database space management
1 = Extend tablespace
2 - Create tablespace
3 - Drop tablespace
4 - Alter tablespace
5 - Alter data file
6 - Move data file
7 - Additional space functions
8 - Reset program status
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
c
BR0280I BRTOOLS time stamp: 2015-08-31 21.43.57
BR0663I Your choice: 'c'
BR0259I Program execution will be continued...
BR0280I BRTOOLS time stamp: 2015-08-31 21.43.57
BR0657I Input menu 81 - please enter/check input values
-------------------------------------------------------------------------------
BRSPACE options for tablespace extension
1 - BRSPACE profile (profile) ...... [initSID.sap]
2 - Database user/password (user) .. [/]
3 ~ Tablespace name (tablespace) ... []
4 - Confirmation mode (confirm) .... [yes]
5 - Scrolling line count (scroll) .. [20]
6 - Message language (language) .... [E]
7 - BRSPACE command line (command) . [-p initSID.sap -s 20 -l E -f tsextend]
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
c
BR0280I BRTOOLS time stamp: 2015-08-31 21.44.10
BR0663I Your choice: 'c'
BR0259I Program execution will be continued...
BR0291I BRSPACE will be started with options '-p initSID.sap -s 20 -l E -f tsextend'
BR0280I BRTOOLS time stamp: 2015-08-31 21.44.10
BR0670I Enter 'c[ont]' to continue, 'b[ack]' to go back, 's[top]' to abort:
c
BR0280I BRTOOLS time stamp: 2015-08-31 21.44.11
BR0257I Your reply: 'c'
BR0259I Program execution will be continued...
###############################################################################
BR1001I BRSPACE 7.20 (35)
BR1002I Start of BRSPACE processing: abcdefg.tse 2015-08-31 21.44.12
BR0484I BRSPACE log file: /oracle/SID/sapreorg/abcdefg.tse
BR0280I BRSPACE time stamp: 2015-08-31 21.44.12
BR1009I Name of database instance: S9C
BR1010I BRSPACE action ID: abcdefg
BR1011I BRSPACE function ID: tse
BR1012I BRSPACE function: tsextend
BR0280I BRSPACE time stamp: 2015-08-31 21.44.12
BR0656I Choice menu 301 - please make a selection
-------------------------------------------------------------------------------
Tablespace extension main menu
1 = Extend tablespace
2 - Show tablespaces
3 - Show data files
4 - Show disk volumes
5 * Exit program
6 - Reset program status
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
c
BR0280I BRSPACE time stamp: 2015-08-31 21.44.13
BR0663I Your choice: 'c'
BR0259I Program execution will be continued...
BR0280I BRSPACE time stamp: 2015-08-31 21.44.14
BR0658I List menu 302 - please select one entry
-------------------------------------------------------------------------------
List of tablespaces for extension
- Pos. Tablespace Files/AuExt. Total[KB] Used[%] Free[KB] MaxSize[KB]
1 - PSAPSR3 41/0 614431744 89.25 66036288 614431744
2 - PSAPSR3731 8/0 61644800 53.05 28943168 61644800
3 - PSAPSR3USR 1/0 1048576 6.30 982528 1048576
4 - PSAPTEMP 8/0 33062912 0.00 33062912 33062912
5 - PSAPUNDO 2/0 40960000 0.01 40957952 40960000
6 - SYSAUX 1/0 4055040 44.04 2269184 4055040
7 - SYSTEM 2/0 1310720 62.40 492864 1310720
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your selection
- 2. Extend (OR) Increase Table space
We can extend table space by creating new data file (or) resize existing datafile using SAP provided tool BRTOOLS.
Note: Before adding space, need to check enough space in file systems
hostname:orasid> brtools
BR0651I BRTOOLS 7.20 (35)
BR0280I BRTOOLS time stamp: 2015-08-31 21.51.26
BR0656I Choice menu 1 - please make a selection
-------------------------------------------------------------------------------
BR*Tools main menu
1 = Instance management
2 - Space management
3 - Segment management
4 - Backup and database copy
5 - Restore and recovery
6 - Check and verification
7 - Database statistics
8 - Additional functions
9 - Exit program
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
2
BR0280I BRTOOLS time stamp: 2015-08-31 21.51.27
BR0663I Your choice: '2'
BR0280I BRTOOLS time stamp: 2015-08-31 21.51.27
BR0656I Choice menu 5 - please make a selection
-------------------------------------------------------------------------------
Database space management
1 = Extend tablespace
2 - Create tablespace
3 - Drop tablespace
4 - Alter tablespace
5 - Alter data file
6 - Move data file
7 - Additional space functions
8 - Reset program status
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
c
BR0280I BRTOOLS time stamp: 2015-08-31 21.51.30
BR0663I Your choice: 'c'
BR0259I Program execution will be continued...
BR0280I BRTOOLS time stamp: 2015-08-31 21.51.30
BR0657I Input menu 81 - please enter/check input values
-------------------------------------------------------------------------------
BRSPACE options for tablespace extension
1 - BRSPACE profile (profile) ...... [initSID.sap]
2 - Database user/password (user) .. [/]
3 ~ Tablespace name (tablespace) ... []
4 - Confirmation mode (confirm) .... [yes]
5 - Scrolling line count (scroll) .. [20]
6 - Message language (language) .... [E]
7 - BRSPACE command line (command) . [-p initSID.sap -s 20 -l E -f tsextend]
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
c
BR0280I BRTOOLS time stamp: 2015-08-31 21.51.31
BR0663I Your choice: 'c'
BR0259I Program execution will be continued...
BR0291I BRSPACE will be started with options '-p initSID.sap -s 20 -l E -f tsextend'
BR0280I BRTOOLS time stamp: 2015-08-31 21.51.31
BR0670I Enter 'c[ont]' to continue, 'b[ack]' to go back, 's[top]' to abort:
c
BR0280I BRTOOLS time stamp: 2015-08-31 21.51.31
BR0257I Your reply: 'c'
BR0259I Program execution will be continued...
###############################################################################
BR1001I BRSPACE 7.20 (35)
BR1002I Start of BRSPACE processing: abcdefg.tse 2015-08-31 21.51.32
BR0484I BRSPACE log file: /oracle/SID/sapreorg/abcdefg.tse
BR0280I BRSPACE time stamp: 2015-08-31 21.51.32
BR1009I Name of database instance: SID
BR1010I BRSPACE action ID: abcdefg
BR1011I BRSPACE function ID: tse
BR1012I BRSPACE function: tsextend
BR0280I BRSPACE time stamp: 2015-08-31 21.51.32
BR0656I Choice menu 301 - please make a selection
-------------------------------------------------------------------------------
Tablespace extension main menu
1 = Extend tablespace
2 - Show tablespaces
3 - Show data files
4 - Show disk volumes
5 * Exit program
6 - Reset program status
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
c
BR0280I BRSPACE time stamp: 2015-08-31 21.51.33
BR0663I Your choice: 'c'
BR0259I Program execution will be continued...
BR0280I BRSPACE time stamp: 2015-08-31 21.51.34
BR0658I List menu 302 - please select one entry
-------------------------------------------------------------------------------
List of tablespaces for extension
- Pos. Tablespace Files/AuExt. Total[KB] Used[%] Free[KB] MaxSize[KB]
1 - PSAPSR3 41/0 614431744 89.25 66036288 614431744
2 - PSAPSR3731 8/0 61644800 53.05 28943168 61644800
3 - PSAPSR3USR 1/0 1048576 6.30 982528 1048576
4 - PSAPTEMP 8/0 33062912 0.00 33062912 33062912
5 - PSAPUNDO 2/0 40960000 0.01 40957952 40960000
6 - SYSAUX 1/0 4055040 44.04 2269184 4055040
7 - SYSTEM 2/0 1310720 62.40 492864 1310720
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your selection:
1
BR0280I BRSPACE time stamp: 2015-08-31 21.51.39
BR0663I Your selection: '1'
BR0280I BRSPACE time stamp: 2015-08-31 21.51.39
BR0657I Input menu 303 - please enter/check input values
-------------------------------------------------------------------------------
Options for extension of tablespace PSAPSR3 (1. file)
1 * Last added file name (lastfile) ....... [/oracle/SID/sapdata1/sr3_41/sr3.data2]
2 * Last added file size in MB (lastsize) . [20000]
3 - New file to be added (file) ........... [/oracle/SID/sapdata1/sr3_42/sr3.data3]
4 ~ Raw disk / link target (rawlink) ...... []
5 - Size of the new file in MB (size) ..... [10000]
6 - File autoextend mode (autoextend) ..... [no]
7 # Maximum file size in MB (maxsize) ..... []
8 # File increment size in MB (incrsize) .. []
9 - SQL command (command) ................. [alter tablespace PSAPSR3 add datafile '/oracle/SID/sapdata1/sr3_3/sr3.data3' size 10000M autoextend off]
Standard keys: c - cont, b - back, s - stop, r - refr, h - help
-------------------------------------------------------------------------------
BR0662I Enter your choice:
c