MaxDB Administration and Migration Guide
MaxDB Administration and Migration Guide
Contents:
◼ Overview of additional administrative tasks
◼ Creating system copies using MaxDB
◼ Installing database software and the tools used
◼ High availability solutions with MaxDB
◼ Migrating to MaxDB
© SAP 2008
© SAP 2008
© SAP 2008
© SAP 2008
© SAP 2008
◼ See also SAP Note 940420 ( FAQ: Database structure check (VERIFY)).
EXTENDED
◼ Checks the key sequences in detail
EXCEPT INDEX
◼ Does not check indexes
WITH UPDATE
◼ Can only be executed in the ADMIN operational state
◼ Additional maintenance of converter: deletes page numbers without references
© SAP 2008
◼ Commands:
• CHECK DATA [EXTENDED] [EXCEPT INDEX]
• CHECK TABLE .. [EXTENDED] [WITH LONG CHECK]
• CHECK DATA WITH UPDATE (in the ADMIN operational state only)
◼ The CHECK DATA EXTENDED command allows you to diagnose the data in the volumes in more
detail. This check examines the information on primary key lengths in more detail and how the
primary keys are sorted at all levels of the B* tree. Since this check is relatively complex, it can
increase the runtime.
◼ The WITH LONG CHECK option also checks the BLOBs. During this check, a share lock is set for
the table currently being examined.
◼ To save resources, you can use the EXCEPT INDEX option to exclude the secondary indexes from
the check.
◼ The WITH UPDATE option can only be executed in the ADMIN operational state; it rebuilds the
converter, and in doing so, deletes the non-referenced pages. These non-referenced pages can exist
if you stop the database using the power switch of the database server, which means that the status
of the asynchronous SERVER processes cannot be saved as it would be during a normal shutdown
process, for example, when a DROP TABLE statement is used.
© SAP 2008
© SAP 2008
The CHECK TABLE <OWNER>.<TABLENAME> SQL statement checks all links within
the table tree.
◼ If it returns an error, you have to resolve the hardware problem and import a backup.
Execution
◼ In Database Studio
◼ Using the DBA Cockpit or transaction DB50 (Problem Analysis ? Tables/Views/Synonyms)
◼ Using the Database Manager CLI
© SAP 2008
◼ The CHECK TABLE statement checks all dependencies and links within the table tree.
◼ Each page contains a check number in the header and trailer. These two numbers must be identical.
If the values are different, an error has occurred. The page could not be completely written during
the last read and write operation (I/O).
◼ To perform the check using the Database Manager CLI:
dbmcli –U c –USQL DEFAULT sql_execute ¡°check table <SCHEMA>.<TABLENAME>¡±
◼ To perform the check in Database Studio:
CHECK TABLE <SCHEMA>.<TABLENAME>
© SAP 2008
© SAP 2008
© SAP 2008
◼ In the "Preferences" window of Database Studio (Window Preferences), you can normally
activate a console for outputting commands. You then still have to display this console by choosing
Window Show View Other ...
◼ This can be very useful for automating recurring tasks when you are developing DBMCLI scripts.
◼ With this function, it is easy to create import files that you can subsequently load into DBMCLI and
execute using the "–i" option.
◼ Additional functions are available in the upper right-hand corner of the console window.
© SAP 2008
◼ You open the Wizard by choosing Create Database... from the context menu of the server.
◼ Select Create a new database in advanced mode, which allows you to define all options with no
restrictions.
◼ The Create a new database option gives you only a few options for changing the users, directory
areas, and so on, that are valid for the SAP area.
◼ Important: In the SAP environment, the installation of SAP NetWeaver with MaxDB is
different from the installation with other databases.
• With MaxDB, the database installation is carried out by SAPINST as part of the SAP
NetWeaver installation and not in advance, as is the case with other databases.
• For this reason, a MaxDB database instance does not need to be created in advance.
• This is because MaxDB has now been integrated in many products and can now be installed
with relatively little maintenance.
When working on a
local database server,
leave the login fields
blank.
© SAP 2008
◼ You only need to specify the host name, user name, and password when creating a database instance
on a remote host.
◼ If a remote installation is unavoidable, the user requires special rights:
• Unix: root rights
• Windows: the Log on as a batch job property and administration rights
◼ Select the software version that you want to use to create the database instance.
◼ In the SAP environment, one software instance is always created for each database instance. This
ensures that every SAP system can be upgraded to a new version without other database instances
being affected.
• For this reason, select exactly the same software version that you installed for this database
instance (for test purposes, you can also use a different software instance, taking into account the
relationships explained above).
• It is technically possible to run multiple database instances using one software instance, but this
leads to problems the next time the database is upgraded with the SDBUPD tool. SDBUPD
cannot upgrade the underlying software instance unless there is a 1:1 relationship between the
database instance and software instance. This is because, following an upgrade, stable operation
of the second database instance cannot be ensured.
• The simplest solution is to delete the additional instance using dbmcli ... db_drop or by choosing
Drop Database ... from the context menu of the database instance in Database Studio.
Default: control
Default: control
© SAP 2008
◼ In this next step, you can make other advanced settings. The general purpose of these functions is to
reduce the TCO of very small databases.
• These functions are not yet used in the SAP environment since they take longer to run due to the
size of the database and tables and cannot be configured to only run overnight because they run
automatically.
◼ You then define the administration user of the database. In the SAP environment, this is normally
the CONTROL user with password CONTROL.
◼ When installing SAP NetWeaver, you are normally requested to enter a "master" password at the
start of the process, which is then always used when a password is requested. If this password is also
to be used here, enter it on this screen.
© SAP 2008
© SAP 2008
◼ When creating system copies or restoring the parameters from the parameter set in the backup file,
make sure that you adjust the paths specified in the parameters (such as the RunDirectoryPath, paths
for the volumes, and so on).
◼ Before you perform the last step of the Wizard to create the database instance, you have to create
these changed paths (with the new instance name) in your file system.
◼ You can change the parameter values when creating a database instance.
© SAP 2008
◼ If you want to restore the parameters from a backup which, in most cases, is to be restored later, the
backup file(s) must be available so that you can copy the parameter information.
◼ You can use this template later for the recovery.
◼ Note that if you are using page clustering, you must set the Block Size to a multiple of the cluster
size (for example, a multiple of one or two).
© SAP 2008
◼ When creating system copies or restoring the parameters from the parameter set in the backup file,
make sure that you adjust the paths specified in the parameters (such as the RunDirectoryPath,
DiagnoseHistoryPath, paths for the volumes, and so on).
◼ Before you perform the last step of the Wizard to create the database instance, you have to create
these changed paths (with the new instance name) in your file system.
◼ You can change the parameter values when creating a database instance.
© SAP 2008
◼ When creating system copies or restoring the parameters from the parameter set in the backup file,
make sure that you adjust the paths specified in the parameters (such as the RunDirectoryPath, paths
for the volumes, and so on).
◼ Before you perform the last step of the Wizard to create the database instance, you have to create
these changed paths (with the new instance name) in your file system.
◼ Minimum requirements for a mini database instance:
• 50 MB for data
• 20 MB for log
© SAP 2008
◼ In this example, a blank database is created and so you select the first option. The predefined user
for the SAP NetWeaver environment is SUPERDBA with the usual password, ADMIN. This user
then administrates all additional database users (SQL users).
◼ You do not want to recover a backup afterwards.
◼ The Wizard displays a final summary, and you start the installation process by choosing Start.
◼ The Results tab page displays the different installation steps:
• Starting database... (ADMIN operational state)
• Activating database... (ONLINE operational state)
• Loading system tables... (ONLINE operational state)
◼ These system tables are then the only content of the database.
◼ When these system tables are created, log information is also generated and stored in the log
volumes.
◼ Once the process has been completed, the database is in the ONLINE operational state.
© SAP 2008
◼ Select Create database for recovery if you want to create a database instance based on a backup
(that is, create a system copy).
• If you select the first option (Create and start database) instead, the error message –8003 (Log
and data must be compatible) is displayed when you try to start the copied instance after you
have imported the backup from the source system.
• If this error occurs, you have to initialize the faulty database instance again.
◼ The "Results" tab page shows that the database was created and the database kernel started (in the
ADMIN operational state), but the database instance has not been activated. This means that it is
now possible to recover backups.
◼ Creating volumes for large databases can take a long time, depending on the hardware.
◼ After the initialization, you can start the recovery automatically by choosing Recovery.
◼ The database is in the ADMIN operational state.
© SAP 2008
© SAP 2008
© SAP 2008
◼ If the database instance name already exists, the Wizard prompts you to confirm whether you really
want to reinitialize the instance. All data currently in the database instance will be lost.
© SAP 2008
◼ This step gives you the option of completely changing the parameter and volume configuration.
◼ Typically you want to reduce the number and increase the size of volumes here if there are too many
objects to manage.
◼ These configuration changes may also be recommended for performance reasons.
◼ If you create too small a database in the first place, you receive error –2008 (Data area too small)
when installing the database instance later.
◼ The standard directory structure of MaxDB in the SAP environment is explained in SAP Note
327578.
◼ If you select the option of restoring the parameters from a data backup, you can specify both
individual backup media and groups of parallel backup media.
◼ The parameter set exists both on individual backup media and on every medium of a media group.
◼ For this reason, always select an individual medium and not the media group.
© SAP 2008
◼ Only in this phase of the MaxDB lifecycle the size of existing log volumes can be changed. The
volumes remain this size until this step is reached again during an initialization, at which point they
can be changed again.
◼ When the database is later operated online, you can change the size of data volumes indirectly (by
creating a new volume and deleting the old one) in the "Data Volumes" area .
◼ When you are creating system copies, particularly on the same database server, it is very
important that you enter the correct path to prevent a set of volumes being used later by two
databases. The same applies if remote hard disks are mounted on both servers.
© SAP 2008
◼ Since a recovery is normally performed now, you would select the second option (Create database
for recovery) here.
◼ The initialization process is normally completed very quickly since the actual work of formatting
log volumes and preparing data volumes is not carried out until later, shortly before the actual
recovery is performed. The Results tab page shows only one entry for the database kernel that is
started.
◼ If you now choose Recovery, the normal recovery process is carried out with the options described
in the previous unit.
© SAP 2008
Further No further
backups backups
© SAP 2008
◼ After the complete backup has been recovered successfully, you may fall into a potential trap. It is
very tempting to choose Restart here, but only do so if you do not want to recover any further
incremental or log backups.
◼ If further backups exist, you have to carry out the cycle of steps of » creating a medium and then
recovering the backup « until all backup sources have been provided and processed, as shown
above.
◼ You can end this cycle at any time by choosing "Restart" and then start the database with the state
from the backups recovered so far.
© SAP 2008
◼ After you have defined the log medium using the files of the source system, the log recovery can
begin.
◼ Specify the version number of the version file with which you want to (or have to) start.
◼ If you are not sure which file to start with, specify the first version number you find in the directory.
The database kernel will skip the irrelevant files as shown on the next slide.
Option 1 Option 2
© SAP 2008
◼ In this example, the complete backup DATA3 is used as a starting point, which means that the
incremental backup DEV_INC6 and log backups as of DEV_log.011 are also relevant.
◼ To ensure that all log information for all open transactions and their starting points are available for
the recovery process, it is appropriate for the system to offer one or more older log backups.
◼ In this case, all log backups as of "001" are available in the directory, which means you can start
with log backup DEV_log.001.
◼ The recovery process increases the sequential version number and attempts to find the
corresponding log backup until a read error occurs, that is, the file does not exist or contains errors.
In this example, this occurs with file DEV_log.014, which does not exist in the directory (for more
information, see error message -3004).
◼ Database Studio then gives you the option of specifying another directory containing subsequent log
backups (option 1), or starting the database instance (option 3 on the next slide).
◼ You also have the option of ending the recovery process at this point by choosing Cancel (option 2)
and resuming the log recovery at a later point. The database can also be switched to the OFFLINE
operational state here. As soon as the instance is switched to the ONLINE operational state,
however, it is no longer possible to resume the log recovery. This is a manual log shipping solution.
Option 3
© SAP 2008
◼ This slide shows option 3 (starting the database in the ONLINE operational state).
◼ The Results tab page shows the return values resulting from the individual backup files of the
previous step.
• -7075: log backup was skipped
• -8020: log backup was processed successfully and next log file requested
◼ The manual recovery is complete when the operational state is switched to ONLINE.
◼ Remember that you then have to set a starting point for a new backup history by performing a
complete backup.
◼ It has recently become possible to use external file system snapshots to inform the database that the
instance can be recovered, which means HISTLOST does not have to be entered in the backup
history.
© SAP 2008
◼ See also SAP Note 1020175 (FAQ: MaxDB installation, upgrade or applying a patch).
Service packs normally introduce new functions, while patches merely eliminate
errors.
Patches are only provided within a version (7.7.04, 7.7.06, and so on).
When you import a patch, it always replaces all the software.
You install the patch using the SDBUPD tool.
You use the SDBINST tool only if the database cannot be started, since SDBUPD only
works if the database is functioning.
◼ Note that SDBUPD carries out additional tasks that SDBINST cannot perform (for example,
loading the system tables).
© SAP 2008
◼ Note that SDBINST contains only a subset of the functions of SDBUPD. If you use SDBINST to
install a patch, you then have to manually carry out the tasks that SDBUPD carries out automatically
(such as loading the system tables). For this reason, use SDBUPD to install patches whenever
possible.
© SAP 2008
◼ Certain minimum versions of MaxDB are normally defined, based on which you can perform the
release upgrade.
◼ For more information, see the release upgrade guide on SAP Service Marketplace.
Installation register
◼ Each installation using sdbinst or sdbupd is stored in the installation register.
◼ Important: Installations (such as patches) must be completed correctly before a new
installation can be started.
◼ Uninstallation routine using sdbuninst
◼ Installation verification using sdbverify
◼ View installation registers using sdbregview
© SAP 2008
◼ To call sdbuninst:
sdbuninst –package ¡°<package name (case-sensitive)>¡±
◼ Directories:
◼ Log files for installation: \sapdb\data\wrk
◼ Installation register: \sapdb\data\config\install
© SAP 2008
◼ SDBINST options:
sdbinst –force_extract
◼ SDBUNINST options:
sdbuninst [-h|--help] | [-v|--version] | [-l|--list] | -all | -package <package name> [-package_dir
<package directory>] [-autoresolve]
-h --help show this
-v --version show version
-l --list list installed packages
-package <package name> uninstall a package with such name
-package_dir <package directory> uninstall package <package name>
installed in <package directory>
-all uninstall all registered MaxDB packages
-autoresolve uninstall package <package name> and
all dependent packages
◼ If programs or directories have been deleted, reinstall the same patch in the same place and then
carry out an official uninstallation.
◼ A local SAP system is still connected to a MaxDB instance (local or remote) via dbmrfc:
◼ Attempted downgrade:
© SAP 2008
◼ During an installation or update, you must stop all MaxDB components so that these executable files
can also be replaced.
◼ In Windows, all services relevant to MaxDB (except X Server) have to be stopped:
SAPP DB: <database name>
SAPDBXIE
(SAP DB WWW)
In Unix, X Server also has to be stopped.
◼ Using the –force_extract option for SDBINST and SDBUPD, you can replace programs that are
currently running in most cases, but it can cause these components to crash, for example, if
programs that are still running need to load libraries and cannot find the correct version of these.
◼ The system does not support patch downgrades.
...
© SAP 2008
◼ SDBVERIFY options:
usage: sdbverify [-h|--help] [-v|--version] [-F|--file <file name>][--set_corrupted_invalid]
© SAP 2008
◼ For more information, see SAP Note 822271 (FAQ: SAP MaxDB client software).
Database
/sapdb/QAS/db /sapdb/DEV/db /sapdb/QAS/db
software Missing
Arrangement
Yes Yes
correct?
© SAP 2008
◼ It is technically possible to have multiple database instances on one database software installation;
these function correctly as long as no changes have to be made to the software.
◼ Changing the software, however, causes problems with the installation and update tools. The tools
themselves cannot tell whether all applications on the database instances are released for this version
after the database update.
◼ For this reason, we recommend that you use an individual software installation of the database for
each application, establishing a 1:1 relationship between the database instance and software
installation.
◼ If a 1:n relationship exists after the database software has been updated, you have the following
options:
• Delete the less important database instance to restore the 1:1 relationship.
• Back up the second instance and rebuild it by creating a system copy with an individual software
installation.
• Separate the second database instance from the software installation (db_drop
WITHOUTFILES), then create an individual database software installation specially for this
instance, and reconnect it to the first database instance (db_create).
© SAP 2008
◼ For more up-to-date information about migration, see SAP Note 1007129 (FAQ: DB migration with
MaxDB as target).
General information
◼ Migration service is available
◼ Additional consulting is required (by consultants certified for migration)
◼ MaxDB Migration Safeguarding
◼ Service offered by Active
Global Support
◼ Comprises performance analysis,
optimization, and training
◼ To load the data into clustered tables in MaxDB, you have to adjust the [Link] file and
extend the CREATE TABLE statement in the file to include the CLUSTER PRIMARY KEY
function.
◼ SAP Note 129352 contains an extract of the matrix; you can CPU registry MSB LSB
find the complete matrix at [Link].
Memory layout LSB MSB
Special feature: liveCache Memory address $0 ...... $1 ......
◼ Due to the objects in liveCache, it is not normally possible
to perform a migration using backup and recovery. For more Hexadecimal example
information, see the guides and best practices. of 65534 FE FF
in main memory:
© SAP 2008
◼ For more information about little endian/big endian, see SAP Note 552464.
As of MaxDB 7.7.04 B30 (but also 7.6.05 B11), it is possible to migrate content
servers using SAP MaxDB Loader without time-consuming support from the ABAP
tools:
◼ Directly between ASCII and UNICODE
◼ Between little endian and big endian
© SAP 2008
© SAP 2008
Shadow database:
Primary Recovery
◼ The log entries are transferred
from the production
database instance to
an available
shadow instance.
◼ If errors occur, the log Saved
entries that are still DATA Log DATA
available are provided and LOG LOG
File(s)
the shadow instance
is used productively.
◼ Tools available:
◼ DBShadow by Libelle
([Link])
© SAP 2008
◼ Another name for this solution, used widely in the market, is "log shipping".
◼ Different solutions are possible, depending on the specific application requirements.
◼ For more information about the shadow database, see the Help Portal at [Link]
◼ You can implement this solution using database-internal resources by developing your own scripts.
You can also do this using Database Studio but it involves many steps.
◼ In contrast, ready-made solutions are move convenient since the vendor provides maintenance,
service, and upgrades to newer database versions.
© SAP 2008
Snapshot technology
MaxDB
◼ Datasets are copied from one disk
area to other disk areas/servers at fixed
intervals
(snapshot).
◼ If an error occurs, a second server
can be started based on the last snapshot
or one of the last snapshots.
◼ This recovers log entries created after the time
DATA LOG
of the last snapshot Snapshot 3 Snapshot 3
◼ Many storage systems on the market
offer this technology.
© SAP 2008
◼ For more information about using storage systems with MaxDB, see SAP Note 912905 (FAQ:
Storage systems used with MaxDB).
◼ When multiple data volumes are used, not all storage systems can write data with exact time
consistency on all disks/files if all data volumes are contained in one snapshot group. Ask the
storage system provider to guarantee this for you.
◼ If it is not possible, the database operations would have to be stopped temporarily so that a snapshot
of the operating system can be created in the storage system. You can do this easily by temporarily
stopping the log writer using the command
dbmcli –U c db_execute suspend logwriter
and then reactivating it using the command
dbmli –U c db_execute resume logwriter
Temporarily stopping data being written to the (data and log) volumes has no further impact, for
example, on the backup history. Deactivating the log writer also indirectly prevents the savepoint
being written to the data volumes, meaning the database is in read-only mode. For more
information, see SAP Note 616814.
◼ Based on these snapshots, you can also switch the MaxDB instance to the ADMIN operational state
after recovering a snapshot on the storage system and then use log backups to roll forward to the
point in time required.
◼ In future versions of MaxDB, external file system snapshots can also be added to the backup history.
MaxDB
Split mirror technology:
◼ Datasets are stored using split mirror disks.
DATA LOG
MaxDB
© SAP 2008
◼ This is a user-friendly solution for performing backups and further administrative actions on a split
mirror, which does not restrict productive operation in any way.
◼ Disadvantage: normally requires two or three times more disk space.
◼ EMC
Continous
◼ HP RESTART
(in process)
DATA LOG DATA
Storage System
© SAP 2008
◼ For more information about hot standby solutions, see the Help Portal at [Link] or SAP
Note 952783 (FAQ: MaxDB high availability).
◼ In addition to the library provided by MaxDB development, support is also required from the library
provided by the storage partner. This is used to control the operating system conversion during the
switch process.
◼ The following white paper exists for IBM ESS, operating system AIX:
• White paper: HotStandby for MaxDB/liveCache together with IBM ESS:
[Link]
© SAP 2008
Example:
System name of application 1: SC1 A database instance contains
such as SAP SCM the data for multiple
System name of application 2: LVC applications.
for example, liveCache …
All applications share the
MaxDB Database resources of the database.
SID: SC1
Application example:
Data for ◼ SCM/APO on One DB
Application 1 (available for MaxDB only)
User/Schema:
sapsc1
Data for
Application 2
User/Schema:
saplvc
© SAP 2008
◼ Each installation of an application in the existing database instance generates a new schema
(database user). The data for this application is stored in this schema.
◼ The database instance has the system name of the first application that was installed.
◼ This first application does not need to be MCOD-capable.
◼ All other applications must be MCOD-capable.
© SAP 2008
Unit: 5
Topic: Other Administrative Tasks
Unit: 5
Topic: Other Administrative Tasks