Skip to end of metadata
Go to start of metadata

dbmrelocate

This page describes the DBMRELOCATE executable which has been introduced with SAP MaxDB 7.8.00.18/7.8.01.04

Purpose
Restrictions
Syntax
Log Files
Example


Purpose

Relocate database between different installations

Allows to reassign an existing database from installation A to installation B. All database files previously in data path of installation A will be moved to a valid data path for installation B. DBMRELOCATE only needs the database name and a target installation as mandatory parameters.

Re-Enable a database after the data path for installation A has been changed

The database should remain in installation A, but because of a previous data path change, the database has become invalid. The tool needs the database name and the old data path (default for the source data path may also be the remaining global data path).

Restrictions

  • The tool cannot rename databases.
  • The executable located in the source installation path must be used (if the database changes the installation during the relocation).
  • The tool cannot handle upgrades. Therefore changing the data path for an existing installation within the upgrade is not possible. This must be a post-upgrade step, because part of the needed steps have been implemented in the DBM server. E.g. the DBM command param_checkall has to be executed with the new software but the old data path before changing the data path and running the relocation tool.
  • The tool supports only databases which uses the default as value for the database parameter RunDirectoryPath. The default is <datapath>/wrk/<database_name>.
  • The tool supports only database with volumes outside (this means not in or below) of the RunDirectory path.
  • If any of the target files (only files, not directories) does exist the tool does not execute the relocation. 
  • The tools needs root or SDB user access. This is necessary to set proper file ownership. If the tools runs with root access it will 'su' first to the SDB user to avoid unwanted action with root permissions.

Syntax

 

Usage:
-d <database_name> [-sourcedata <source_data_path>][-target <target_installation_path>] [-v] [-yes] [-simulate][-nocleanup]

-d     <database_name>  - Database to move
-sourcedata <...>       - Source data path for the move
-target     <...>       - Target installation (software) for the move
-v                      - Enables verbose output
-yes                    - Do not ask before execution of move
-simulate               - Simulates the move only (should be used with -v)
-nocleanup              - Do not cleanup after errors
  • -d <database_name>:
    Name of database instance
  • -source <source_data_path>:
    (former) data path of the database files. If no <sourcedatapath> is given, the tool first checks the installation's data path of the database instance and next the "global data path" for any database files.
  • -target <target_installation_path>:
    Allows to specify an existing installation path the database should be assigned to. If the user does not specify a target path the database instance will remain in its original installation.
  • -v:
    Option for verbose output.
  • -yes:
    yes like YES, do not ask the "Are you sure?" question after the preparation phase.
  • -simulate:
    Does only simulate the relocation. Use in combination with -v to write text output to the console.
  • -nocleanup:
    In case of an error the tool does not undo any files copied so far. You may use this feature for problem analysis. However, before the next relocation attempt these files must be (re)moved.

Log Files

The relocation does always write a log file duplicating the verbose output. The name of the file consists of <GlobalDataPath>/wrk/dbmrelocate_<InstanceName>_<YYYYMMDD_hh-mm-ss>.log. For every relocation attempt a new log file is written.

Example

Installation path before relocating database tz78

  • ...xinstinfo tz78
    IndepData : E:\sapdb\indep_data
    IndepPrograms : e:\sapdb\indep_prog
    InstallationPath : E:\Program Files\sdb\tz78
    Kernelversion : KERNEL 7.8.02 BUILD 000-103-221-645
    Rundirectory : E:\sapdb\indep_data\wrk\TZ78

Installation path after relocating database instance tz78

  • ...xinstinfo tz78
    IndepData : E:\sapdb\indep_data
    IndepPrograms : e:\sapdb\indep_prog
    InstallationPath : E:\sapdb\tz78neu
    Kernelversion : KERNEL 7.8.02 BUILD 000-103-221-645
    Rundirectory : E:\sapdb\indep_data\wrk\TZ78

Command used to relocate tz78

  • dbmrelocate -d tz78 -target "E:\sapdb\tz78neu" -v
  • log file dbmrelocate_TZ78_20091127_13-30-32.log

dbmrelocate: Checking database 'TZ78'...
dbmrelocate: Determine source path for database 'TZ78'...
dbmrelocate: Checking source path 'E:\sapdb\indep_data'...
dbmrelocate: File 'E:\sapdb\indep_data\config\TZ78.upc' found!
dbmrelocate: Checking target installation 'E:\sapdb\tz78neu'...
dbmrelocate: Preparing move of 'TZ78'...
dbmrelocate: Checking versions ...
dbmrelocate:

    Moving database 'TZ78'
    from source installation 'E:\Program Files\sdb\tz78'
    and source data path 'E:\sapdb\indep_data'
    to target installation 'E:\sapdb\tz78neu'
    and target data path 'E:\sapdb\indep_data...

dbmrelocate:
Are you sure? (y/N)
dbmrelocate: Unregister database 'TZ78'...
dbmrelocate: Register database 'TZ78' in 'E:\sapdb\tz78neu'...
dbmrelocate:

    Done! Succesfully moved database 'TZ78'
    from source installation 'E:\Program Files\sdb\tz78'
    and source data path 'E:\sapdb\indep_data'
    to target installation 'E:\sapdb\tz78neu'
    and target data path 'E:\sapdb\indep_data...

  • No labels