Unlike Oracle, MaxDB does not have a CONTROLFILE to store the location of its files.
Instead, all file locations are stored as common parameters.
A quick look at the parameters section of the KNLDIAG reveals this:
-------------------------------------------------------------------------------- Date Time TID(hex) Typ MsgID Label Message-Text -------------------------------------------------------------------------------- 2008-09-10 19:14:17 0x7A4 20234 RTE Dump of all kernel parameters start 2008-09-10 19:14:17 0x7A4 20207 RTE Using mode NORMAL for data volume 1 2008-09-10 19:14:17 0x7A4 20207 RTE Using mode NORMAL for data volume 2 [...] 2008-09-10 19:14:17 0x7A4 20235 RTE DATA_VOLUME_GROUPS=1 2008-09-10 19:14:17 0x7A4 20235 RTE DATA_VOLUME_MODE_0001=NORMAL 2008-09-10 19:14:17 0x7A4 20235 RTE DATA_VOLUME_MODE_0002=NORMAL 2008-09-10 19:14:17 0x7A4 20235 RTE DATA_VOLUME_NAME_0001=C:\sapdb\db760\devspaces\DAT_0001 2008-09-10 19:14:17 0x7A4 20235 RTE DATA_VOLUME_NAME_0002=C:\sapdb\db760\devspaces\DAT_0002 2008-09-10 19:14:17 0x7A4 20235 RTE DATA_VOLUME_SIZE_0001=6400 2008-09-10 19:14:17 0x7A4 20235 RTE DATA_VOLUME_SIZE_0002=6400 2008-09-10 19:14:17 0x7A4 20235 RTE DATA_VOLUME_TYPE_0001=F 2008-09-10 19:14:17 0x7A4 20235 RTE DATA_VOLUME_TYPE_0002=F 2008-09-10 19:14:17 0x7A4 20235 RTE DATE_TIME_FORMAT=INTERNAL [...] 2008-09-10 19:14:17 0x7A4 20235 RTE LOG_BACKUP_TO_PIPE=NO 2008-09-10 19:14:17 0x7A4 20235 RTE LOG_IO_BLOCK_COUNT=4 2008-09-10 19:14:17 0x7A4 20235 RTE LOG_IO_QUEUE=1000 2008-09-10 19:14:17 0x7A4 20235 RTE LOG_MIRRORED=NO 2008-09-10 19:14:17 0x7A4 20235 RTE LOG_QUEUE_COUNT=0 2008-09-10 19:14:17 0x7A4 20235 RTE LOG_SEGMENT_SIZE=246 2008-09-10 19:14:17 0x7A4 20235 RTE LOG_VOLUME_NAME_001=C:\sapdb\db760\devspaces\LOG_001 2008-09-10 19:14:17 0x7A4 20235 RTE LOG_VOLUME_SIZE_001=1280 2008-09-10 19:14:17 0x7A4 20235 RTE LOG_VOLUME_TYPE_001=F 2008-09-10 19:14:17 0x7A4 20235 RTE LRU_FOR_SCAN=NO [...] |
That given, moving a volume is pretty easy.
It’s done in four steps:
- Stop the database (db_offline)
- Copy the volume you want to move to the new location
(DON’T just MOVE it, but COPY it in case something goes wrong!)
- Use the DBMGUI to change the volume parameters:
“Configuration”
-> “Volumes”
-> double click on the volume you want to move
-> when the database is offline the text field “Device/Path” is editable
-> enter the new path.
Repeat this for all volumes you want to move. - Startup the database (db_online)
If the database starts up without any error it’s safe now to delete the files in their old location.
Should anything go wrong after you’ve changed the parameters you can use
dbmcli -U c param_restore 1 |
to get back the settings from before the change and start the database
with the files in the old location.
Of course, this is also possible via the command line tool dbmcli, but as this has no advantages and could lead to more mistakes I just present the DBMGUI procedure here.
best regards,
Lars