Quantcast
Channel: Red Gate forums: SQL Backup 7

RE: SQL Backup 7 on Azure, possible ?

$
0
0
Hi Eddie

first of all, thanks a lot for so detailed reply, I am very satisfy with redgate support as I am with your products, that's a hurray for all of you.

what I mean by
"wouldn't be redgate be VERY INTERESTED to have Microsoft implementing the SQL Backup Server Components on azure ?"
is offering my help by asking (or begging) Microsoft to add this functionality, and I sure plenty of other users will follow.

As said, looking forward be able to use your great products on Azure.
Br,
pGrnd

RE: PowerShell and DB restore exitcode management with sqlcmd

$
0
0
I believe I figured it out, after spending a lot more time with this. I'll post what I came up with here, just in case it helps someone else in the future:

1. Added the -b switch when calling sqlcmd, which forces to terminate the batch if there is an error.

2. Modified the restore script so that if the exitcode and sqlerrorcode are anything but 0, it will go to RAISERROR within the script (exact message does not appear to matter). Fortunately, the RedGate sqlbackup proc does allow for the exitcode and sqlerrorcode to be generated into a declared value, as such:

Quote:
DECLARE @exitcode INT
DECLARE @sqlerrorcode INT
EXECUTE master..sqlbackup '-SQL "RESTORE DATABASE [DB_NAME] FROM DISK = ''BACKUP_FILE_PATH'' WITH RECOVERY, DISCONNECT_EXISTING, REPLACE"', @exitcode OUTPUT, @sqlerrorcode OUTPUT


3. Once sqlcmd processes RAISERROR in a script, with the -b switch, the $LASTEXITCODE in PowerShell appears to go from 0 to 1, which indicates a restore error. I can then have PowerShell stop the process there, or run an alternate process, which is what I needed.

Keep replication settings with SQL Backup

$
0
0
Hi

Is it possible to preserve replication setting when backing up a database using SQL backup?

Currenty when we make a full backup of a Subcriber database, the replication procedures are not restored.

Using SQL Backup version: 7.4.0.23

RE: SQL Backup 7 on Azure, possible ?

RE: Keep replication settings with SQL Backup

$
0
0
Could you please create an empty subscriber database, back it up using SQL Server, restore it, and check if the replication settings exist in the restored database? Repeat the same tasks, but using SQL Backup to back up and restore the database. Do the replication settings exist in the restored database?

RE: Keep replication settings with SQL Backup

$
0
0
Hi

Did exactly that. Created a empty subscriber database, created replication to that database, backed up with normal SQL, restored and the replication procedures was there. (When restored I checked the option "PRESERVE REPLICATION SETTINGS", I don't see this option when restoring with Redgate.)

Then backup up and restored the same database with Redgate SQL backup and the procedures were not there.

RE: Keep replication settings with SQL Backup

$
0
0
Can you try restoring the database using the SQL Backup extended stored procedure, using the KEEP_REPLICATION option e.g.

Code:
EXEC master..sqlbackup '-sql "RESTORE DATABASE test FROM DISK = [g:\backups\test.sqb] WITH REPLACE, KEEP_REPLICATION" '

RE: Keep replication settings with SQL Backup

$
0
0
I restored using the extended stored procedure with WITH REPLACE, KEEP_REPLICATION' and the procedures were present.

Where is the option in the UI to keep replication settings?

RE: Keep replication settings with SQL Backup

$
0
0
That option isn't available in the GUI. You will need to restore the database using the extended stored procedure manually with the KEEP_REPLICATION option.

i am not able to install server components

$
0
0
I have admin access. sql server server 2005 installed in target machine.
But it says denied administration access. I have all rights on that system . but it throws error and denied administration access

RE: i am not able to install server components

$
0
0
Could you please send me (peter.yeoh@red-gate.com) a screenshot of the error? Thanks.

Unattended install fails silently, inconsistently

$
0
0
Hey RG,

I'm trying to perform an unattended install on a remote computer of the SQL Backup server components, version 7.7.0.7.

The documentation for installing the server components from the command line makes it look easy.

Quote:

To install the server components unattended, call SQBServerSetup.exe from the command line with /VERYSILENT and /SUPPRESSMESSAGEBOXES. For example:

Code:

SQBServerSetup.exe /VERYSILENT /SUPPRESSMSGBOXES


The server components will be installed on the local instance using the default settings unless you specify otherwise using the parameters described below.


I've tried to run this command in four different ways, but they all fail. The error varies depending on the method.

Is it a problem with the installer, or is there something missing from the documentaton?

Here's what I've tried.

1. PowerShell remote session

First I tried the Invoke-Command cmdlet to install over a PowerShell remote session.

Code:

  Write-Verbose "Installing SQL Backup"
  Invoke-Command $TargetServer {
    G:\media\SQBServerSetup.exe /VERYSILENT /SUPPRESSMSGBOXES
    $LASTEXITCODE
  }


I copied the installer to G:\media on the remote computer before running the command.

The variable $TargetServer contains the name of the remote server.

It returns instantly without a value.The $LASTEXITCODE variable is null.

2. psexec

Next I tried psexec.

Code:
psexec \\$TargetServer G:\media\SQBServerSetup.exe /VERYSILENT /SUPPRESSMSGBOXES


It didn't work either, but it at least gave me some output.

Code:

PsExec v1.98 - Execute processes remotely
Copyright (C) 2001-2010 Mark Russinovich
Sysinternals - www.sysinternals.com
Connecting to REMOTESERVER...Starting PsExec service on REMOTESERVER...Connecting with PsExec service on REMOTESERVER...Starting
G:\media\SQBServerSetup.exe on REMOTESERVER...
G:\media\SQBServerSetup.exe exited on REMOTESERVER with error code 6040.


Error code 6040 means "The password for the SQL Backup Agent service user account was invalid."

I haven't specified a user account. SQL Backup is supposed to use the SQL Server service account!

3. PowerShell over RDP

To rule out any weirdness caused by the remote execution, I opened an RDP connection and tried the PowerShell commands again.

Code:

PS G:\media> .\SQBServerSetup.exe /VERYSILENT /SUPPRESSMSGBOXES
PS G:\media> $LASTEXITCODE


Again, the command returned instantly and produced no output or exit code.

4. cmd over RDP

Maybe the installer just doesn't work in PowerShell.

Does it work in plain old cmd?

Code:

G:\media>.\SQBServerSetup.exe /VERYSILENT /SUPPRESSMSGBOXES
G:\media>echo %errorlevel%
9009


No. And error code 9009 is sadly undocumented.

How do I make this work?

Cheers,
Iain

RE: Unattended install fails silently, inconsistently

$
0
0
I can't install it using the GUI tools either.

Any ideas what the root cause could be?

5. Using the UI over RDP

I double click to run the installer.

I accept all the default settings and supply the correct password for the account that SQL Server runs as.

When I click Next at 'Select SQL Server authenticaion mode', I see an error message.

Quote:

Failed to verify that the account (DEV\sqlservice) is a member of the SQL Server sysadmin fixed server role for the selected instance. SQL error: Login failed for user 'DEV\sqlservice'.

This installation may not be able to install the SQL Backup extended stored procedures. User another login.


The SQL Server error log shows no failed login attempts.

6. Using SQL Backup UI on my workstation

I run SQL Backup on my workstatation.

I open the "Add SQL Server" dialog, supply the server name and the correct password for the SQL Server service account, and accept the defaults.

I click finish, SQL Compare validates the options, then the installation starts.

It fails at the first step "Copying and running SQBServerSetup".

Code:

REMOTESERVER: Server Component Installation - Failed
======================================================

Copying and running SQBServerSetup - Failed
-------------------------------------------

Error running installer: exit code 6200
The SQL Backup Agent service failed to connect to the SQL Server instance using the SQL login provided.


Exit code 6200 means "SQL authenticated user name or password is invalid."

Again, the SQL Server error log shows no failed login attempts.

RE: Unattended install fails silently, inconsistently

$
0
0
We resolved the issue this morning.

There were two issues here. One was my mistake; the other looks like a gap in the documentation.

1. The SQL Server service account did not have a login on the server.

For SQL Backup to use the account, it has to be sysadmin on the server.

I added the service account DEV\sqlservice as a sysadmin on the server.

The server did actually log the failed logins, but I was looking in the agent log rather than the server log. D'oh!

The UI installer over RDP gave the clearest indication of this issue. It would be helpful if the error messages were more consistent.

2. The command line installer requires a password for the service account.

For SQL Backup to use the service account, it needs to know the password.

In the end, a command like this worked for me:

Code:

psexec \\$TargetServer G:\media\SQBServerSetup.exe /VERYSILENT /SUPPRESSMSGBOXES /SVCUSER $svcuser /SVCPW $svcpw


It produced a result like this:

Code:

PsExec v1.98 - Execute processes remotely
Copyright (C) 2001-2010 Mark Russinovich
Sysinternals - www.sysinternals.com
Connecting to REMOTESERVER...Starting PsExec service on REMOTESERVER...Connecting with PsExec service on REMOTESERVER...Starting
G:\media\SQBServerSetup.exe on REMOTESERVER...
G:\media\SQBServerSetup.exe exited on REMOTESERVER with error code 0.


The SQL Backup UI now shows a yellow "Trial" icon next to the server. Success!

The command line installer does not force you to provide a password, and the documentation suggests that one is unnecessary to use the server's account.

I imagine this would work if the server is running under one the default Windows accounts, but we use dedicated service accounts with passwords.

It would be helpful if the documentation was clearer on this point.

As a security note, I don't recommend using my solution for a production deployment. psexec does not encrypt its connection to the remote server. Don't allow someone to sniff your production password over the network!

RE: Unattended install fails silently, inconsistently

$
0
0
Thank you for your forum post.

If you do not specify the /SVCUSER /SVCPW parameters SQL Backup server components installer default to the account the SQL Server instance is currently running as is used.

I suspect if you included the /LOG parameter, the log file may have indicated the reason why login attempted failed.

Good news that you were able to identify the cause and remedy the problem. Also thank you for sharing your experiences via the forum. I am sure other users will benefit from steps you have undertaken.

Many Thanks
Eddie





Latest Images