Professional Documents
Culture Documents
MaxDB - Administration
MaxDB Administration
This section again will be fairly large, I will be discussing the following Installation Creating and Configuring a database Adding volumes Configuring log volumes and log mode Database backups Log backups Database recovery Consistency checks Deleting the database Installation SAP MaxDB can be freely downloaded from the SAP website, there are a number of version to cover a wide range of operating systems. First I will discuss how to install MaxDB on a Unix server. Once downloaded you must extract the software either using winzip or SAPCAR, once extracted you should have the following files
to start the installation as root run the SDBINST command and follow the below
here you have a number of options 0: Server + Client - select this option to install the entire M axDB server software 1: Client - installs all software except server utilities, database kernel and APO LiveCache apps 2: Custom - gives you an option on what components you want to install 3: None - don't install anything Select option 2
software components
here you have a number of options available 0: Runtime for SAP AS - install NetWeaver AS on the server 1: DBAnalyzer - only install the DBAnalyzer it also installs Base, M essages, SAP Utilties and DBAnalyzer 2: JDBC - installs Base, SAP Utilities and JDBC 3: Server - only installs the server components 4: Loader - installs components for loading large data volumes via python 5: ODBC - install components that are required for ODBC communications 6: All - all components are installed 7: None - cancel the installation Select option 3
Custom installation
The installation will now ask a series of questions regarding below, you can change any of the above to suit you own requirements
www.datadisk.co.uk/html_docs/maxdb/administration.htm
1/20
5/9/13
group name (default: sdba) Server Installation (preparing phase)
MaxDB - Administration
owner name ( default: sdb) independent data path (default: /var/opt/sdb/data) independent program path (default: /opt/sdb/programs) The installation will go and do some stuff and come back requesting information regarding the database kernel preparing dependent path (default: /opt/sdb/7603)
The installation will now be carried out in the background, the database is automatically started
Thats all there is to it, you can also use a commandline option to install MaxDB
Installation in the background ./SDBINST -component_group Server -indep_data /var/opt/sdb/data -indep_prog /opt/sdb/programs -o sdb -g sdba
There is also a GUI version called the installation manager, this is mainly used on Windows installation. If there were any errors or problems installing the software you can view the installation logs
Unix: <independent_data_path>/wrk/M axDB<profile>_install-<date>-<time>.log Installation logs Windows: <independent_data_path>\wrk\M axDB<profile>_install-<date>-<time>.log
Creating and Initializing Before we can crete a new SAP MaxDB instance we need to know what requirements we need for the following What size should the database be How much load do you expect the database to have Now these type of questions are hard to judge when creating databases, if you really have no ideal then have one eye on how you would increase the the above if the thresholds were meet, for example you know that the data volumes are going to be spread across different disks then try to match the size of the filesystems with the volume sizes,also allow for additional disks to be added, with load try to have options that you can increase memory in your server at a later date. The size of the database is important as depending on the number of data volumes MaxDB configures the number of I/O threads, this is specified by the parameter _IOPROCS_PER_DEV. SAP recommends 2 for unix systems and 1 from windows systems. If you have two many threads per I/O it may cause a performance bottleneck on the operating system. To calculate the number of data volumes SAP recommends the formula below
You basically use the square root of the total volume size, now for some examples 50GB = 7.07, so round up to 8 data volumes (50 / 8 = 6.25GB each) Calculate data volumes 75GB = 8.66, so round up to 9 data volumes (75 / 9 = 8.34GB each) I generally round the size of each volume for eaxample the 6.25GB i would round upto 7GB.
There are a number of restrictions that you must, be made aware of, keep an eye on the latest versions as I suspect these limits will increase with time
Maximum number of data volumes 4095 Maximum number of log volumes Maximum size of data volume Maximum size of log volume Maximum size of entire instance Unrestricted 512GB 32TB 64TB
Now lets move on to creating the database, I will be using the Database Manager GUI, although being a Unix chap, I will still use a GUI that is reliable and I have had no problems with this GUI, for the die hard CLI fans I have also given the commandline options.
www.datadisk.co.uk/html_docs/maxdb/administration.htm 2/20
5/9/13
MaxDB - Administration
Create a Database Instance The M axDB Database M anger GUI when open should look something like below
To create the instance you can either select instance -> create or select the create instance button (as seen in above picture), you will be asked to select one of the templates, have choose custom Desktop/PC - idea for a laptop development database Custom - use this to change default values, memory size, number of cpu's, etc M y Template - you can even create your own custom template
Here we can give the Database Instance a name of our choosing, notice that you can connect to an external M axDB server and create Databases
www.datadisk.co.uk/html_docs/maxdb/administration.htm
3/20
5/9/13
MaxDB - Administration
If you have multiple versions of M axDB installed you can select any version you want
Installation Version
There are a number of advanced options you can configure, I generally use them all
Advanced Options
www.datadisk.co.uk/html_docs/maxdb/administration.htm
4/20
5/9/13
for the defaults
MaxDB - Administration
If you have a specific set of parameters that you wish to use then you have the option to use them here, i am just going
Parameter setup
Again I am going with the default, OLTP database. LiveCache by the way is a objected-oriented model that also uses the memory more
Instance Type
here I tweeked a number of parameters, memory, CPU's and M axlogVolumes. You can change these settings at a later date but the instance will require a reboot
Parameter Adjustment
www.datadisk.co.uk/html_docs/maxdb/administration.htm
5/20
5/9/13
MaxDB - Administration
By default a data volume and a log volume will be created adjust these to what you planned above,
Volume Setup
NOTE: One word of warning if you have selected to install the tutorial you must increase the size of the log volume otherwise the installation hangs, increase it to at least 1,024MB
Creation M ode
Some more advanced settings to adjust, if this is a development database i always like the tutorial data to play around with
Advanced settings
www.datadisk.co.uk/html_docs/maxdb/administration.htm
6/20
5/9/13
MaxDB - Administration
Finally we get to the summary page, check everything then select next to create the database instance
Finally you get the finish page confirming that the installation was successful.
Finish page
www.datadisk.co.uk/html_docs/maxdb/administration.htm
7/20
5/9/13
MaxDB - Administration
Once the installation has finished you should see the below in the database manager
Database M anager
Of course you could just script it up which would like something like below
#Database Creation create_v5_db Automated installation # User creation create_v5_users
Configuring the Database Once you got the database up and running it time to enchance it, the first thing to do is to mirror the log volumes
Start the database manager GUI, and select instance -> configuration -> log settings, you get the log configuration settings menu up
Select log mode, then next, the menu will ask which log file to mirror
www.datadisk.co.uk/html_docs/maxdb/administration.htm
8/20
5/9/13
MaxDB - Administration
Double click on the single log file and notice the bottom of the configuration screen, the mirror part should have been filled in with default values, you can change these if so desired
When you named the mirror file you should see it back in the log settings screen
You will be asked to confirm the creation of the mirror log file
To confirm that the log is mirrored select instance -> configuration -> volumes -> select the log volumes button, you will notice that the "mirrored location" and "mirrored type" are filled in
If automatic backup log mode has not already been configured now is the time to do this,
www.datadisk.co.uk/html_docs/maxdb/administration.htm
9/20
5/9/13
MaxDB - Administration
First you need to create a log backup file select instance -> backup -> backup medium -> right click in the window and select new medium, fill in the details as you see fit
Select instance -> backup -> backup wizard, Select the Activite/Deactivite automatic log backup
Automatic backup log Select the critrea that you need, normally i active a log backup when the log is full
Once the database has been running a while you will be required to either add a data volume or a log volume, here are the steps to do this
Select instance -> configuration -> volumes, select the next volume on the list and right click and select new volume
www.datadisk.co.uk/html_docs/maxdb/administration.htm
10/20
5/9/13
MaxDB - Administration
Adding a Data Volume Select OK to create the additional data volume the commandline option is as follows 7.6: dbmcli> param_addvolume 1 DATA DATA_0002 F 50000 dbmcli> param_getvolsall 7.7: dbmcli> db_addvolume DATA DATA_0002 F 50000 dbmcli> param_getvolsall
Select instance -> configuration -> volumes, click on the log volume button to display the log volumes, select the next volume on the list and right click and select new volume
Adding a Log Volume Note that because we have selected mirror log volumes (see above) the mirror will also be created the commandline option is as follows 7.6: dbmcli> param_addvolume 1 LOG LOG_0002 F 6400 dbmcli> param_getvolsall 7.7: dbmcli> db_addvolume LOG LOG_0002 F 6400 PATITION 1 dbmcli> param_getvolsall
deleting a volume is very simple, select -> instance -> configuration -> volumes, select the volume that you want to delete, right click and select delete.
Backups As with any system you need to take regular backups, MaxDB has a number of types of backups Complete and Incremental backup - standard type of backup that is used in most places Data and log backups - you generally backup the log volumes more than the database volumes (data - once a week, log - everyday) Parallel backup - used for very large databases, you can use multiple tape drives in parallel MaxDB has a very nice backup history which you can access via the database manager GUI
www.datadisk.co.uk/html_docs/maxdb/administration.htm
11/20
5/9/13
MaxDB - Administration
select instance -> backup -> backup history
Backup History
As you can see the backup history page has a lot of information, the action selection may contain the following Save Warm - a backup (data or log) was implemented Restore - a recovery of the database was performed Histlost - an event necessitates a new complete data backup I am only going to mention backup stategies in that you should have one, my personal one is to perform a full offline backup once a week and to backup the log files everyday, but I have small database of about 60GB. Before we can backup the database we need to create a backup medium (a backup device), these can be either File - standard backup file Tape - a tape device Pipe - a third party external backup tool (backint, TSM or NSR)
using the database manager gui select instance -> backup -> backup medium, right click in the main window an select new medium
fill in the details giving a name to the backup and stating the filename, etc create backup meduim
www.datadisk.co.uk/html_docs/maxdb/administration.htm
12/20
5/9/13
MaxDB - Administration
As you can see I have a number of backup mediums, including a log file meduim
Once you have a backup medium you can backup your database
using the database manager GUI select instance -> backup -> backup wizard
Comfirm that you are happy then click on start, the backup will start
Database Backup
www.datadisk.co.uk/html_docs/maxdb/administration.htm
13/20
5/9/13
MaxDB - Administration
you can also use a commandline version dbmcli> medium_getall dbmcli> util_connect control,control dbmcli> backup_start Full_Backup RECOVERY DATA second session monitor the backup dbmcli> backup_state
Log backups are perform using the same procedure, however you must deactive the automatic backup feature before performing a manual log backup.
First deactive the automatic log backup feature select instance -> backup -> backup wizard
Log backup
www.datadisk.co.uk/html_docs/maxdb/administration.htm
14/20
5/9/13
MaxDB - Administration
Then just follow the steps as in the data backup you can also use a commandline version dbmcli> medium_getall dbmcli> util_connect control, control dbmcli> backup_start "LogBackup" LOG
here you can select to check your last backup, a previous backup or select a backup medium, i have select to check the last backup
check backups
M axDb will now go and check the backups, a tick will be displayed against
www.datadisk.co.uk/html_docs/maxdb/administration.htm
15/20
5/9/13
MaxDB - Administration
Recovery Recovery is performed in the admin state, therev are two types of recovery Recovery Recovery with Initialization The difference between them is that with initialization data and log volumes are recreated, without initialization the volumes are left untouched
the instance must be in the admin state, select instance -> recovery
Here you have a number of choices, you can even specify a specific time. You then select the backup that you want to restore
Once the data has been restored you then need to apply the log backups
www.datadisk.co.uk/html_docs/maxdb/administration.htm
16/20
5/9/13
MaxDB - Administration
M axDB will then display a summary screen indicating a successful restore or not
you can of course use the commandline dbmcli> db_admin -f dbmcli> util_connect dbmcli> backup_history_list ## start the first recovery dbmcli> recover_start "CompleteBackup" data ## start a initialization recovery dbmcli> db_active recover "CompleteBackup" data ## import all the incremental backups, one after the other dbmcli> recover_start "IncrementalBackup" pages ## Import the first log backup dbmcli> recover_start "LogBackup" log 002 ## Import any more log backups dbmcli> recover_replace "LogBackup" "M axDB_LOG" 003 dbmcli> db_online
Snapshots From time to time you may wish to performa very large update, snapshots allows you rcover very quickly if the update was unsuccessful. You can save one snapshot per instance, thus old snapshots are overwritten.
First the instance must be in the ADM IN state, then select instance -> backup -> create snapshot
www.datadisk.co.uk/html_docs/maxdb/administration.htm
17/20
5/9/13
MaxDB - Administration
Creating a snapshot
select OK and the snapsjot will be created you can also use the commandline to create a snapshot dbmcli> db_admin dbmcli> db_execute create snapahot dbmcli> db_online
Again the database must be in an admin state, then select instance -> snapshot, select delete snapshot
Deleting a snapahot
you can also use the commandline to delete a snapshot dbmcli> db_admin dbmcli> db_execute drop snapshot dbmcli> db_online
Again the database must be in an admin state, then select instance -> snapshot, select revert to snapshot
Reverting to a snapshot
This may take sometime depending on the number of chanes to the database since the snapshot was taken you can also use the commandline to revert a snapshot dbmcli> db_admin dbmcli> db_execute restore snapshot dbmcli> db_online
www.datadisk.co.uk/html_docs/maxdb/administration.htm
18/20
5/9/13
MaxDB - Administration
To see when the last snapshot was taken see the main database screen, look in the bottom right hand corner you will see a snapshot section
viewing snapshot
Consistency Checks Internal data structures can become corrupted, a consistency check will allow to check the internal structure of the database. You can perform a consistency check either in online mode or admin mode. online mode - system checks which will correct saved schemas, relations and indexes admin mode - all of the above and also renews the converter Depending on the size of the database this may take a while to complete, so it is best to run it during quiet periods.
select instance -> check -> database structure
choose the one you want to run, you can speed things up alittle by not checking the indexes
www.datadisk.co.uk/html_docs/maxdb/administration.htm
19/20
5/9/13
consistency check
MaxDB - Administration
you can also use the commandline, here are some examples to check the consistency ## online checks dbmcli> db_execute check data dbmcli> db_execute check data except index ## offline checks dbmcli> db_execute check data with update ## online check but specified tables dbmcli> db_execute check table schema.table catalog dbmcli> db_execute check table schema.table with long check
Previous
M enu
Next
www.datadisk.co.uk/html_docs/maxdb/administration.htm
20/20