Forum Discussion

amdcler's avatar
amdcler
Level 4
10 years ago

How restore SQL database to different server?

Hello!
We used Netbackup 7.6.1
With scripts .bch has been configured Full online backup SQL database which succeeds. Recovery with .bch is also successful, but only on the same server. (in mode "recovered" and "not recovered" (.mdb,.ldb))

How to set up a database restore to a different server?
I have tried to make these instructions:

Recovery is initiated on the master server

Redirecting a SQL restore to a different host
Multiple NetBackup database clients can be configured to use a single NetBackup
master server for backing up SQL Server databases. With this configuration, you
can back up SQL Server database objects from one client and restore them to
another. In the following procedure, HostA is the client that was originally backed
up and HostB is the other client to which the restore is redirected.
To redirect a restore to a different host
1 Establish permission settings on the master server.
Do one of the following:
■ Create a install_path\NetBackup\db\altnames\No.Restrictions file
to allow unrestricted redirected restore privileges.
■ Create a install_path\NetBackup\db\altnames\HostB file to allow HostB
to restore HostA's data. The client named HostB can then access HostA's
data on the master as well as any other client's data that was backed up
on the master.
2 Select File > SetSQLServerconnectionproperties.
3 Log onto the target instance on HostB.
4 Select File > SetNetBackupclientpropertiesand select the current master
server to be a master server that is common to both HostA and HostB.
5 Select File > RestoreSQLServerobjects.
6 From the Backup History Options dialog box, select HostA as the SQL host
from which the target objects were backed up.
When the restore window appears it contains a history of objects that were
backed up from HostA. Select those objects and restore them to HostB.

In this scenario, I get an error

ERR - Error in CoCreateInstance: 0x80040154.

 

 

and Recovery is initiated on the client server which was backuped

https://support.symantec.com/en_US/article.TECH35995.html

Here is an example with the option "not recovered"

HostA - source client

HostB - destination client


#  This is a template for the database MOVE command.

OPERATION RESTORE
OBJECTTYPE DATABASE
RESTORETYPE MOVE

#  Replace the database name in the following line with the name of the database that you
#  want to move to. Also remove the hash mark <#> which precedes the keyword <DATABASE>.

DATABASE "123"
#
#  Replace the file path <E:\SQLData\PortalDBs\WSS_videocam.mdf>
#  with a new file path. Also remove the hash mark <#> which precedes the keyword <TO>.
#  The target of the MOVE keyword must be "WSS_videocam".
MOVE  "WSS_videocam"
TO  "E:\123.mdf"
#
#
#  Replace the file path <E:\SQLData\PortalDBs\WSS_videocam_log.LDF>
#  with a new file path. Also remove the hash mark <#> which precedes the keyword <TO>.
#  The target of the MOVE keyword must be "WSS_videocam_log".
MOVE  "WSS_videocam_log"
TO  "E:\123_log.LDF"
#
# The following image is type: Full
NBIMAGE "HostA.MSSQL7.HOSTA.db.WSS_videocam.~.7.001of001.20150430110244..C"
SQLHOST "HostB"
NBSERVER "HostM"
BROWSECLIENT "HostA"
MAXTRANSFERSIZE 6
BLOCKSIZE 7
RESTOREOPTION REPLACE
RECOVEREDSTATE NOTRECOVERED
SQLCOMPRESSION TRUE
NUMBUFS 2
ENDOPER TRUE

INF - RESTORE STARTED USING
Microsoft SQL Server 2008 R2 (SP2) - 10.50.4000.0 (X64)
Jun 28 2012 08:36:30
Copyright (c) Microsoft Corporation
Enterprise Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)
Batch = C:\test.bch, Op# = 1.
INF - Using backup image HostA.MSSQL7.HOSTA.db.WSS_videocam.~.7.001of001.20150430110244..C
INF - restore database "123" from VIRTUAL_DEVICE='VNBU0-6740-6876-1430400456' with  stats = 10, blocksize = 65536, maxtransfersize = 4194304, buffercount = 2, replace , norecovery, move 'WSS_videocam' to 'E:\123.mdf', move 'WSS_videocam_log' to 'E:\123_log.LDF', replace
INF - Number of stripes: 1, Number of buffers per stripe 2.
INF - Created VDI object for SQL Server instance <HostB>. Connection timeout is <300> seconds.
ERR - Error in GetConfiguration: 0x80770003.
    CONTINUATION: - The api was waiting and the timeout interval had elapsed.
DBMS MSG - ODBC return code <-1>, SQL State <37000>, SQL Message <3201><[Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open backup device 'VNBU0-6740-6876-1430400456'. Operating system error 0x80070002(failed to retrieve text for this error. Reason: 15105).>.
DBMS MSG - SQL Message <3013><[Microsoft][ODBC SQL Server Driver][SQL Server]RESTORE DATABASE is terminating abnormally.>
ERR - Error found executing <restore database "123" from VIRTUAL_DEVICE='VNBU0-6740-6876-1430400456' with  stats = 10, blocksize = 65536, maxtransfersize = 4194304, buffercount = 2, replace , norecovery, move 'WSS_videocam' to 'E:\123.mdf', move 'WSS_videocam_log' to 'E:\123_log.LDF', replace>.
INF - OPERATION #1 of batch C:\test.bch FAILED with STATUS 1 (0 is normal). Elapsed time = 304(304) seconds.
INF - Results of executing <C:\test.bch>:
<0> operations succeeded. <1> operations failed.

 

As now all I fix this? I already read a lot of topics on the forum and admin guide, but nothing happens...

Is it possible to perform a recovery exclusively on the master server in case the server is physically damaged power?

Thanks in advance.

  • You cannot initiate a SQL restore from the master server. You can only start the restore from the destination client. See 'Redirecting a SQL restore to a different host' in NetBackup for Microsoft SQL Server Administrator's Guide : http://www.symantec.com/docs/DOC6479
  • Command is run on a master server (HostM)

    C:\Program Files\Veritas\NetBackup\bin>bpclntcmd.exe -hn HostB
    host HostB: HostB.domen.com at 192.168.130.72
    aliases:     HostB.domen.com     HostB     192.168.130.72
    C:\Program Files\Veritas\NetBackup\bin>bpclntcmd.exe -ip 192.168.130.72
    host 192.168.130.72: HostB.domen.com at 192.168.130.72
    aliases:     HostB.domen.com     192.168.130.72
    C:\Program Files\Veritas\NetBackup\bin>telnet 192.168.130.72 1556
    _ (ok)

    Command is executed on the client server (HostB)

    C:\Program Files\Veritas\NetBackup\bin>bpclntcmd.exe -hn HostA
    host HostA: HostA.domen.com at 192.168.130.156
    aliases:     HostA.domen.com     HostA     192.168.130.156
    C:\Program Files\Veritas\NetBackup\bin>bpclntcmd.exe -ip 192.168.130.156
    host 192.168.130.156: HostA.domen.com at 192.168.130.156
    aliases:     HostA.domen.com     192.168.130.156
    C:\Program Files\Veritas\NetBackup\bin>telnet 192.168.130.156 1556
    _ (ok)

  • Thanks...

    bpcd log in attachments

    This command on hostB:
    bplist -S HostM -C HostA -t 15 -s 05/01/2015 -R /

    display very lot images as:
    1138..C:\HostA.MSSQL7.SDB4.db.WSS_videocam_port8882.~.7.001of001.2015050106
    1138..C:\HostA.MSSQL7.SDB4.db.WSS_videocam_port8882.~.7.001of001.2015050106
    1138..C:\HostA.MSSQL7.SDB4.db.WSS_videocam_port8882.~.7.001of001.2015050106
    1138..C:\

     

    How do I resolve the short name?

  • Did you run bptestbpcd command as per my previous post?

    I am missing the output...

    How do I resolve the short name?

    As per my post above:
    If you are using shortnames in NBU, you need to update DNS reverse lookup to resolve shortname and FQDN.

    bplist shows that you are using shortname. 

    It is important that the master server can resolve client IP address in Restore request to shortname.

    Please remember about dbclient and bprd logs as well. 
    bprd log on the master will show IP address from restore request and show us how it is resolved, followed by checking for restore permissions in client config and altnames.

  • Yes, the results of the command bptestbpcd in attachment previous post (bpcd_log_HostB_051215.txt)

    Another attempt to restore the database

    12345.bch:
    #
    #  This is a template for the database MOVE command.
    #
    OPERATION RESTORE
    OBJECTTYPE DATABASE
    RESTORETYPE MOVE
    #
    #  Replace the database name in the following line with the name of the database that you
    #  want to move to. Also remove the hash mark <#> which precedes the keyword <DATABASE>.
    #
    DATABASE "12345"
    #
    #  Replace the file path <E:\SQLData\PortalDBs\WSS_videocam_port8882.mdf>
    #  with a new file path. Also remove the hash mark <#> which precedes the keyword <TO>.
    #  The target of the MOVE keyword must be "WSS_videocam_port8882".
    MOVE  "WSS_videocam_port8882"
    TO  "E:\Restored\12345.mdf"
    #
    #
    #  Replace the file path <E:\SQLData\PortalDBs\WSS_videocam_port8882_log.LDF>
    #  with a new file path. Also remove the hash mark <#> which precedes the keyword <TO>.
    #  The target of the MOVE keyword must be "WSS_videocam_port8882_log".
    MOVE  "WSS_videocam_port8882_log"
    TO  "E:\Restored\12345_log.LDF"
    #
    # The following image is type: Full
    NBIMAGE "HostA.MSSQL7.HostA.db.WSS_videocam_port8882.~.7.001of001.20150514112056..C"
    SQLHOST "HostB"
    NBSERVER "HostA.DOMEN.COM"
    BROWSECLIENT "HostA"
    MAXTRANSFERSIZE 6
    BLOCKSIZE 7
    RESTOREOPTION REPLACE
    RECOVEREDSTATE RECOVERED
    SQLCOMPRESSION TRUE
    NUMBUFS 2
    ENDOPER TRUE


    bprd_log(HostM):

    MASTERSERVER HostM.DOMEN.COM
    CLIENT HostB
    INSTANCE HostB
    DATABASE 12345
    OPERATION RESTORE
    OBJECTTYPE DATABASE
    STATUS 2850
    INFO Server Status:  Restore error
    INFO Error in VxBSAGetMultipleObjects: 26.
    INFO There is no copy of the requested object.
    ENDOPER TRUE

    17:39:11.711 [5652.5904] <2> vnet_pbxConnect: pbxConnectEx Succeeded
    17:39:11.711 [5652.5904] <2> logconnections: BPCD CONNECT FROM 192.168.130.156.53939 TO 192.168.130.156.1556 fd = 548
    17:39:11.711 [5652.5904] <2> vnet_pbxConnect: pbxConnectEx Succeeded
    17:39:11.742 [5652.5904] <8> do_pbx_service: [vnet_connect.c:2156] via PBX VNETD CONNECT FROM 192.168.130.156.53940 TO 192.168.130.156.1556 fd = 572
    17:39:11.742 [5652.5904] <8> vnet_vnetd_connect_forward_socket_begin: [vnet_vnetd.c:440] VN_REQUEST_CONNECT_FORWARD_SOCKET 10 0xa
    17:39:11.742 [5652.5904] <8> vnet_vnetd_connect_forward_socket_begin: [vnet_vnetd.c:457] ipc_string 53941
    17:39:11.773 [5652.5904] <2> bpcr_get_version_rqst: bpcd version: 07610000
    17:39:11.773 [5652.5904] <2> bpcd_remote_write: INF - bpcd_remote_write status = 0
    17:39:11.773 [5652.5904] <2> process_request: EXIT STATUS 0
    17:39:11.773 [3580.3584] <2> vnet_pbxAcceptSocket: Accepted sock[660] from 192.168.130.72:51233
    17:39:11.773 [3580.3584] <2> bprd: socket fd from accept() is 660
    17:39:11.773 [3580.3584] <2> listen_loop: request complete
    17:39:11.836 [5924.5972] <2> logconnections: BPRD ACCEPT FROM 192.168.130.72.51233 TO 192.168.130.156.1556 fd = 660
    17:39:11.836 [5924.5972] <2> process_request: setsockopt SO_LINGER on 660 succeeded.
    17:39:11.836 [5924.5972] <2> connected_peer: Connection from host HostB.domen.com, 192.168.130.72, on non-reserved port 51233
    17:39:11.836 [5924.5972] <2> process_request: command C_LOG_JOB_INFO (148) received
    17:39:11.836 [5924.5972] <2> process_request: log_job_info request = 329199 148 5061 dbclient 2880 137 INF - OPERATION #1 of batch C:\Users\administrator\Desktop\12345.bch FAILED with STATUS 1 (0 is normal). Elapsed time = 28(28) seconds.

    17:39:11.836 [5924.5972] <2> vnet_pbxConnect: pbxConnectEx Succeeded
    17:39:11.836 [5924.5972] <2> job_connect: SO_KEEPALIVE set on socket 544 for client HostM
    17:39:11.836 [5924.5972] <2> logconnections: BPJOBD CONNECT FROM 192.168.130.156.53943 TO 192.168.130.156.1556 fd = 544
    17:39:11.836 [5924.5972] <2> job_authenticate_connection: ignoring VxSS authentication check for now...
    17:39:11.836 [5924.5972] <2> job_connect: Connected to the host HostM contype 53 jobid <5061> socket <544>
    17:39:11.836 [5924.5972] <2> job_connect: Connected on port 53943
    17:39:11.851 [5924.5972] <2> job_monitoring_exex: ACK disconnect
    17:39:11.851 [5924.5972] <2> job_disconnect: Disconnected
    17:39:11.851 [5924.5972] <2> process_request: EXIT STATUS 0
    17:39:12.242 [7024.6944] <2> job_monitoring_exex: ACK disconnect
    17:39:12.242 [7024.6944] <2> job_disconnect: Disconnected
    17:39:12.633 [7024.6944] <2> terminate_restore: EXIT STATUS 2850
    17:39:12.633 [7024.6944] <2> bprd: C:\Program Files\Veritas\NetBackup\bin\userreq_notify.cmd restore HostB.domen.com root
    17:39:13.851 [5568.1120] <2> vnet_pbxConnect: pbxConnectEx Succeeded
    17:39:13.851 [5568.1120] <2> job_connect: SO_KEEPALIVE set on socket 548 for client HostM
    17:39:13.851 [5568.1120] <2> logconnections: BPJOBD CONNECT FROM 192.168.130.156.53944 TO 192.168.130.156.1556 fd = 548
    17:39:13.851 [5568.1120] <2> job_authenticate_connection: ignoring VxSS authentication check for now...
    17:39:13.851 [5568.1120] <2> job_connect: Connected to the host HostM contype 53 jobid <5061> socket <548>
    17:39:13.851 [5568.1120] <2> job_connect: Connected on port 53944
    17:39:13.867 [5568.1120] <2> job_monitoring_exex: ACK disconnect
    17:39:13.867 [5568.1120] <2> job_disconnect: Disconnected
    17:39:13.867 [5568.1120] <2> process_request: EXIT STATUS 0
    17:39:13.867 [3580.3584] <2> vnet_pbxAcceptSocket: Accepted sock[660] from 192.168.130.72:51234
    17:39:13.867 [3580.3584] <2> bprd: socket fd from accept() is 660
    17:39:13.867 [3580.3584] <2> listen_loop: request complete
    17:39:13.914 [5700.5636] <2> logconnections: BPRD ACCEPT FROM 192.168.130.72.51234 TO 192.168.130.156.1556 fd = 660
    17:39:13.914 [5700.5636] <2> process_request: setsockopt SO_LINGER on 660 succeeded.
    17:39:13.929 [5700.5636] <2> connected_peer: Connection from host HostB.domen.com, 192.168.130.72, on non-reserved port 51234
    17:39:13.929 [5700.5636] <2> process_request: command C_LOG_JOB_INFO (148) received
    17:39:13.929 [5700.5636] <2> process_request: log_job_info request = 329199 148 5061 dbclient 2880 122 INF - Results of executing <C:\Users\administrator\Desktop\12345.bch>:
    <0> operations succeeded. <1> operations failed.

    17:39:13.929 [5700.5636] <2> vnet_pbxConnect: pbxConnectEx Succeeded
    17:39:13.929 [5700.5636] <2> job_connect: SO_KEEPALIVE set on socket 544 for client HostM
    17:39:13.929 [5700.5636] <2> logconnections: BPJOBD CONNECT FROM 192.168.130.156.53945 TO 192.168.130.156.1556 fd = 544
    17:39:13.929 [5700.5636] <2> job_authenticate_connection: ignoring VxSS authentication check for now...
    17:39:13.929 [5700.5636] <2> job_connect: Connected to the host HostM contype 53 jobid <5061> socket <544>
    17:39:13.929 [5700.5636] <2> job_connect: Connected on port 53945
    17:39:13.945 [5700.5636] <2> job_monitoring_exex: ACK disconnect
    17:39:13.945 [5700.5636] <2> job_disconnect: Disconnected
    17:39:13.945 [5700.5636] <2> process_request: EXIT STATUS 0

     

  • 1) i hope you are running everything as  "run as administrator"

    2) Also i am assuming your client version is 7.6.1 so there would be no dbbackex issue

    3) Also the user which you are using have sufficient privileges to on all drives c,e to create or execute

  • Also try adding the name of the alternate host to the list of allowed servers on the Master and Media Servers.  I've found that alternate client restores throw really bad errors unless the alternate client is listed.

     

  • I am about to give up... 2 weeks down the line without making any progress...

    When was bprd log folder created?
    Was NBU on the master restarted after creating the folder?

    The snippet from the log posted above does not contain the info that we are looking for.
    There is no record of HostB trying to browse images for HostA or any record of restore request for HostA's data.

    All I can suggest is to go through this TN to see if anything may have been missed:
     

    How to perform a database move to the same SQLHOST or to an alternate SQLHOST in NetBackup for Microsoft SQL Server 
    http://www.symantec.com/docs/TECH35995

  • On the master server, the client HostB and source HostA is listed (NetBackup\db\altnames\)
    HostB is not a media server and a client only
    Q: A HostA participates in the restoration of the image, despite the fact that the images are stored on the master server? What to do if the HostA physically dead?


    bprd log folder was created 24/04/2015
    Master server was restarted after creating the folder


    This a fragment of yesterday's attempt to restore the log

    14.05.2015 17:38:52 - begin Restore
    14.05.2015 17:38:53 - 1 images required
    14.05.2015 17:38:54 - media 0439L5 required
    14.05.2015 17:38:56 - restoring image HostA_1431591661
    14.05.2015 17:38:58 - Error bpbrm(pid=4828) Request from host HostA.domen.com (192.168.130.60) to host HostB.domen.com (192.168.130.72) is not allowed access. Host HostA.domen.com (192.168.130.60) is not an authorized server for host HostB.domen.com.
    14.05.2015 17:38:59 - Error bpbrm(pid=4828) bpcd on HostB.domen.com exited with status 59: access to the client was not allowed
    14.05.2015 17:38:59 - Info bpbrm(pid=4828) telling media manager to start restore on client    
    14.05.2015 17:39:01 - Warning bptm(pid=4644) failure logging message to client HostB.domen.com in log /C/ProgramА Files/Veritas/NetBackup/Logs/user_ops/mssql/logs/0514115173844-2880-1060-000-000-prg:  server not allowed access (46)
    14.05.2015 17:39:02 - Error bpbrm(pid=5800) Request from host HostA.domen.com (192.168.130.60) to host HostB.domen.com (192.168.130.72) is not allowed access. Host HostA.domen.com (192.168.130.60) is not an authorized server for host HostB.domen.com.
    14.05.2015 17:39:02 - Error bpbrm(pid=5800) bpcd on HostB.domen.com exited with status 59: access to the client was not allowed
    14.05.2015 17:39:02 - requesting resource 0439L5
    14.05.2015 17:39:03 - Info bptm(pid=4644) Waiting for mount of media id 0439L5 (copy 1) on server HostA.domen.com.
    14.05.2015 17:39:03 - started process bptm (4644)
    14.05.2015 17:39:03 - mounting 0439L5
    14.05.2015 17:39:03 - Info bptm(pid=4644) INF - Waiting for mount of media id 0439L5 on server HostA.domen.com for reading.
    14.05.2015 17:39:03 - granted resource 0439L5
    14.05.2015 17:39:03 - granted resource HP.ULTRIUM5-SCSI.000
    14.05.2015 17:39:04 - Error bpbrm(pid=5800) Request from host HostA.domen.com (192.168.130.60) to host HostB.domen.com (192.168.130.72) is not allowed access. Host HostA.domen.com (192.168.130.60) is not an authorized server for host HostB.domen.com.
    14.05.2015 17:39:04 - Error bpbrm(pid=5800) bpcd on HostB.domen.com exited with status 59: access to the client was not allowed
    14.05.2015 17:39:05 - Info bpbrm(pid=4828) child done, status 59        
    14.05.2015 17:39:05 - Info bpbrm(pid=4828) sending message to media manager: STOP RESTORE HostA_1431591661    
    14.05.2015 17:39:06 - Info bpbrm(pid=4828) media manager for backup id HostA_1431591661 exited with status 150: termination requested by administrator
    14.05.2015 17:39:06 - restored image HostA_1431591661 - (access to the client was not allowed(59)); restore time 0:00:10
    14.05.2015 17:39:12 - end Restore; elapsed time: 0:00:20
    Restore error (2850)