Migration of SAPDB (7.2.X to 7.3.0)
The goal was to replace a 7.2.4 installation (running on a Debian-2.2 Linux Distribution with pthreads-0.8) to 7.3.0, including all the user data. I try to summarize my findings below. I use the demo database names for commandline activity.
Make sure your backup works. If you're not sure, shutdown the database and make a cold backup using tar,cpio or whatever.
Making 7.3.0 run on Debian-2.2
7.2.4 worked like a charm on Debian-2.2, 7.3.0 didn't
When issuing
dbmcli -d TST -u dbm,dbm load_systab -u dba,dba -ud domain
during installation, the db:SID Processes went nuts, utilizing 100% CPU. The installation will never finish. The problem seems to be mmap related. Issuing
param_directput TRACE_PAGES_US 1
will fix this problem. You may add this to the create_demo_db.sh script like this:
[....] param_put MAXDATADEVSPACES 5 param_put MAXDATAPAGES 1024000 param_put TRACE_PAGES_US 1 param_checkall [....]
to create the 7.3.0 instance correctly right away.
Thanx to Hans-Georg Bumes of SAP-DB for this info.
Building a migration backup
To move the data from one instance to another, you'll need a migration backup (that is, a full-backup that won't need any logdata to be consistent.
We need a backup media which will deliver data backups. Using dbmcli, adding one is very simple.
dbmcli -d TST -u dbm,dbm dbmcli on TST>backup_media_put migrate /tmp/backup_file FILE DATA 0 8 YES OK
Now we're ready to start a full backup. You'll need a util session for this:
dbmcli on TST>util_connect dbm,dbm OK
Backup_start will launch the backup process. The MIGRATION flag will make sure that the backup timestamp will be syncronized with a database checkpoint (flush all buffer data to disk).
dbmcli on TST>backup_start migrate MIGRATION DATA OK Returncode 0 Date 20010626 Time 00134934 Server doosh Database TST Kernel Version Kernel 7.3.0 Build 008-000-054-344 Pages Transferred 264 Pages Left 0 Volumes 1 Medianame migrate Location /tmp/backup_file Errortext Label DAT_00002 Is Consistent true First LOG Page 971 Last LOG Page DB Stamp 1 Date 20010626 DB Stamp 1 Time 00134934 DB Stamp 2 Date DB Stamp 2 Time Page Count 242 Devices Used 1 Database ID doosh:DVL_20010621_142508 Max Used Data Page 340
This is a 7.3.0 Backup. I have no 7.2.3 instance left to provide the correct output
You may transfer this file to the new machine, or (if the database should be replaced) wipe all files (including /usr/spool/sql) and jump to the next chapter.
Preparing the new database
Assuming you installed all files needed for a 7.3.0 instance, it's easiest to start from the depend/misc/create_demo_db.sh script. Find the following command sequence:
cat <<EOF | dbmcli -d TST -u dbm,dbm util_connect dbm,dbm util_execute init config util_activate dba,dba quit EOF
and change it like this (you might have to add the TRACE_PAGES_US param also):
cat <<EOF | dbmcli -d TST -u dbm,dbm util_connect dbm,dbm util_execute init config quit EOF # prevent all further actions exit 0
You have to make sure that the data and log-devspace is at least as large as the devspaces from the original database, or the recover will fail with error "-24988,ERR_SQL: sql error, -2008,Message not available" or similar. You can determine the highest number of the data pages contained in your data backup as follows: "dbmcli -d TST -u dbm,dbm -uUTL -c migrate" via the value at "Max Used Data Page".
Launch the script, and wait until it completes.
Start the dbmcli and recover from the migration backup (the database has to be in cold state):
Add the restore medium
dbmcli -d TST -u dbm,dbm dbmcli on TST>backup_media_put migrate /tmp/backup_file FILE DATA 0 8 YES OK
Start the recover process
dbmcli on TST>util_connect dbm,dbm OK dbmcli on TST>recover_start migrate OK Returncode 0 Date 20010626 Time 00141236 Server doosh Database TST Kernel Version Kernel 7.3.0 Build 008-000-054-344 Pages Transferred 264 Pages Left 0 Volumes 1 Medianame migrate Location /tmp/backup_file Errortext Label DAT_00002 Is Consistent true First LOG Page 971 Last LOG Page DB Stamp 1 Date 20010626 DB Stamp 1 Time 00134934 DB Stamp 2 Date DB Stamp 2 Time Page Count 242 Devices Used 1 Database ID doosh:DVL_20010621_142508 Max Used Data Page 340
Start the Database
dbmcli on TST>db_warm OK
You're done. Comments? Write Email to DirkVleugels or add them to the page directly.
MaxDB Wiki