Forum Discussion

Volker_Spies1's avatar
10 years ago

DB2 Alternate Restore option DB2_MEDIA_SERVER

Hello Forum,

we do DB2 alternate restores frequently and we need to swap the media server for that restore.

I'm aware that I can force to take a new media server, but it would be nice if that media server is only for that one alternate restore.

So the Netbackup DB2 Admin Guide mentions the Option:

DB2_MEDIA_SERVER:

"Allows the user to explicitly specify the media server to be used to perform the restore."

Does anyone use this keyword?

My proble is: Where do I define DB2_MEDIA_SERVER? Does it belon in the db2.conf file? Can I specify it in the db2 restore command and how? Does it belong in the OPTIONS part of the Db2 restore command?

Iy anyone uses this keyword it would be nice if I can get some help how to use it. :)

Thanks 

Volker

 

 

 

 

 

 

  • Ok, that was simple. The manual was misleading, the DB2_MEDIA_SERVER belongs to the option part of the command:

    db2 "restore db XXX load /usr/openv/netbackup/bin/nbdb2.sl64 open 4 sessions OPTIONS "DB2_MEDIA_SERVER=XXX" logtarget /db2/XXX/log_dir/NODE0000 parallelism 30"

    Volker

     

3 Replies

  • If we scroll up to the heading for the table, we see the following:

    RESTORE DATABASE command options
    You can restore a DB2 database with either the DB2 RESTORE DATABASE command
    or with its alternative syntax, RESTORE DB. The DB2 RESTORE DATABASE command
    restores a database from NetBackup.
    Table 4-4 provides reference information for the command options when used in a
    NetBackup for DB2 environment.

    My gut-feel is that DB2_MEDIA_SERVER may be the equivalent of bprestore option ' -disk_media_server' where multiple media server is assigned to the same Advanced disk pool.

    I doubt that many forum members are even aware of this option. Why not try it?
    The worst that can happen is that the restore will fail.
    Ensure bprd log folder exists on the master server in case the restore fails.

  • Hello Marianne,

    the problem is that this is a DB2 hosting a SAP database and the SAP admins do not use the "db2 restore" command directly, the SAP system will create a shell script automatically and the SAP admin will simply start that shell script.

    I wondered if anyone does use this option, because i think it will be pretty common to use another media server when doing a restore to an alternate database server.

    But you are right we will test it. I have the opportunity to do a  tomorrow, maybe it will be used when entered in the db2.conf file, that would be great.

    I will keep you updated.

     

     

     

     

     

  • Ok, that was simple. The manual was misleading, the DB2_MEDIA_SERVER belongs to the option part of the command:

    db2 "restore db XXX load /usr/openv/netbackup/bin/nbdb2.sl64 open 4 sessions OPTIONS "DB2_MEDIA_SERVER=XXX" logtarget /db2/XXX/log_dir/NODE0000 parallelism 30"

    Volker