Showing posts with label servers. Show all posts
Showing posts with label servers. Show all posts

Tuesday, March 27, 2012

BACKUP failed to complete the command sp_prepexec;1

One of my SQL Servers (SQL 2000 SP4) is reporting this error in the Maintenance Plan. But shortly after it shows this error is does successfully backup my Databases (per log history), however the plan is indicating "failure".

I have no idea how to resolve this nor why it is happening.

Rob.

Hi,

it seems, that an t-sql statement is blocking.

Use the profiler and filter by object name = sp_prepexec and SPID.

actual in the KB:

HOW TO: Troubleshoot Application Performance Issues

How to monitor SQL Server 2000 blocking

tosc

BACKUP failed to complete the command sp_prepexec;1

One of my SQL Servers (SQL 2000 SP4) is reporting this error in the Maintenance Plan. But shortly after it shows this error is does successfully backup my Databases (per log history), however the plan is indicating "failure".

I have no idea how to resolve this nor why it is happening.

Rob.

Hi,

it seems, that an t-sql statement is blocking.

Use the profiler and filter by object name = sp_prepexec and SPID.

actual in the KB:

HOW TO: Troubleshoot Application Performance Issues

How to monitor SQL Server 2000 blocking

tosc

Backup Exec/SQL Server

Anyone have any experience with Veritas Backup Exec and backing up your db's?

This past week I noticed one of my servers HD's was almost maxed out 200 gig. The log file for one of the db's was 137 gig. So, I made sure the db was backed up (through Backup Exec) and I ran SHRINKFILE on the Trans-Log. Anyway, I guess what I want to make sure is that since I ran the SHRINKFILE, does anyone know for sure that Backup Exec will be able to completely restore the db? It kinda made me paranoid since I'm relatively new to this, and we're not doing the backups with SQL Server.You should not have a problem restoring. Backup Exec should just restore the backed up transaction log over the top of the current one.

Sunday, March 25, 2012

Backup Error

Each time I run a backup the following error appears in
SQL Server's error log: Error: 4035, Severity: 10, State: 1
Can anyone help in explaining why I keep getting the above
error? Your help will be greatly appreciated.
Hi,
Can you run the backup command from query analyzer an check the status of
backup
Backup database <dbname> to disk='c:\backup\dbname.bak' with init
Which version of SQL Server you are running?
Thanks
Hari
MCDBA
"y_shoge@.yahoo.co.uk" <anonymous@.discussions.microsoft.com> wrote in message
news:24d5401c4601f$c79722c0$a301280a@.phx.gbl...
> Each time I run a backup the following error appears in
> SQL Server's error log: Error: 4035, Severity: 10, State: 1
> Can anyone help in explaining why I keep getting the above
> error? Your help will be greatly appreciated.
|||Hi,
I have run the backup command from query analyser and
still getting the same error.
I am running SQL Server 2000 Enterprise SP3.
Thanks
>--Original Message--
>Hi,
>Can you run the backup command from query analyzer an
check the status of
>backup
>Backup database <dbname> to disk='c:\backup\dbname.bak'
with init
>Which version of SQL Server you are running?
>
>--
>Thanks
>Hari
>MCDBA
>"y_shoge@.yahoo.co.uk"
<anonymous@.discussions.microsoft.com> wrote in message[vbcol=seagreen]
>news:24d5401c4601f$c79722c0$a301280a@.phx.gbl...
State: 1[vbcol=seagreen]
above
>
>.
>
|||Hi,
I feel this is just a informational message.
Can you validate the backup file by restoring it to a diffrent database.
After that run a DBCC CHECKDB on that
new database and confirm things are fine.
Thanks
Hari
MCDBA
"y_shoge@.yahoo.co.uk" <anonymous@.discussions.microsoft.com> wrote in message
news:251cb01c46024$c778ac00$a401280a@.phx.gbl...[vbcol=seagreen]
> Hi,
> I have run the backup command from query analyser and
> still getting the same error.
> I am running SQL Server 2000 Enterprise SP3.
> Thanks
> check the status of
> with init
> <anonymous@.discussions.microsoft.com> wrote in message
> State: 1
> above
|||Thanks Hari,
I have restored the backup file to another database and
ran the DBCC Checkdb against the restored database, it
returned no errors. Everything appears to be fine. I
guess I will have to ignore the error message for now.
Thank you very much for your help.
>--Original Message--
>Hi,
>I feel this is just a informational message.
>Can you validate the backup file by restoring it to a
diffrent database.
>After that run a DBCC CHECKDB on that
>new database and confirm things are fine.
>--
>Thanks
>Hari
>MCDBA
>"y_shoge@.yahoo.co.uk"
<anonymous@.discussions.microsoft.com> wrote in message[vbcol=seagreen]
>news:251cb01c46024$c778ac00$a401280a@.phx.gbl...
in
>
>.
>

Thursday, March 22, 2012

Backup DTS packages

We have a development environment where there are 4 development servers and a single production server.

some of our processes rely of some complex DTS packages.

what is the perferred method to create copies of these DTS packages so that they can be put onto all the development systems ?Check out this article:

http://www.codeproject.com/useritems/DTS_Export.asp|||thanks - thats what i was looking for.

it even has the added bonus of some code to reset all the connections to a different server.sql

Monday, March 19, 2012

backup database on other servers

How to backup database on the other servers in the LANS.I would suggest MSX operations

make one server your MSX (multiserver administration server)
and enlist all the others as targets
create enough jobs on the master server to perform all of the backups as neccessary
(dont forget to backup master model and msdb every night)
schedule the jobs accordingly
and then convert the jobs to multiserver jobs and post them to the other servers

Books Online Multiserver Administration|||I use the next to backup database to the other server

use master
exec sp_addumpdevice 'disk','networkdevice','\\192.168.0.1\share\aa.ext '
backup database verdata to networkdevice

the problem is 'can't open the deviece'|||map a network drive to the path
for example
open command prompt --> net use x: \\192.168.0.1\share
then try your statement as such
exec sp_addumpdevice 'disk','networkdevice','X:\aa.ext'|||Originally posted by xiangmeihong
I use the next to backup database to the other server

use master
exec sp_addumpdevice 'disk','networkdevice','\\192.168.0.1\share\aa.ext '
backup database verdata to networkdevice

the problem is 'can't open the deviece'

Does it fail on step 1 or step 2?

Whatever account you are running this command under needs to have access to this share: \\192.168.0.1\share\|||I'd suggest each serever perform their own backups...and if you want to centralize the dumps, copy them when it's done...

But that's just me...

MOO|||Originally posted by xiangmeihong
I use the next to backup database to the other server

use master
exec sp_addumpdevice 'disk','networkdevice','\\192.168.0.1\share\aa.ext '
backup database verdata to networkdevice

the problem is 'can't open the deviece' Is the service running under a domain account? Also, this account needs to have enough privieges on the target share.|||Originally posted by derrickleggett
Does it fail on step 1 or step 2?

Whatever account you are running this command under needs to have access to this share: \\192.168.0.1\share\
fail in step 2

thanks|||Try this:

BACKUP DATABASE verdata
TO DISK = '\\192.168.0.1\share\aa.bak'

Thursday, March 8, 2012

Backup and Restore using VBScript (ActiveX)

We are trying to setup a central job server that will perform the backups, restores, and other automated tasks for all of our SQL servers. The goal is that we have one place to check the status of all of our jobs. I have a couple of problems, though.

The first is that, to backup a database on a remote server, we are using VBScript as an ActiveX Script type of step. The script uses SQLDMO. The jobs mostly run fine, but there seems to be a problem with concurrent jobs running against the same server. For instance, I have 4 backup jobs that I kick off at 7:00PM. One of them (not always the same one) will fail with:

Error Code: 0 Error Source= Microsoft SQL-DMO Error Description: [SQL-DMO]The application is busy. Error on Line 11. The step failed.

The databses are all quite small (master, msdb, and a couple of utility dbs we have). Are there threading issues in using SQL-DMO such that I can't run jobs concurrently? The remote server is SQL2000, so I don't believe I can use SMO. My script is at the end of this post.

My second problem is trying to remotely kick off a restore. Currently, when using the local scheduler, we use the RESTORE DATABASE command right after an ALTER DATABASE SET SINGLE_USER WITH ROLLBACK IMMEDIATE command. This command is necessary to kill any processes currently using the DB so that a restore will succeed. In DMO I can't find anyway to duplicate this functionality. Any ideas?

Thanks

Steve

-- Backup Script --

Dim sServer, sDatabase, sPath, sDumpFile, oSQLServer, oBackup

sServer = "PRDSQL01"
sDatabase = "master"
sPath = "E:\MSSQL\DUMP\"
sDumpFile = "master.dmp"

Set oSQLServer = CreateObject("SQLDMO.SQLServer")
Set oBackup = CreateObject("SQLDMO.BackUp")

oSQLServer.loginsecure = true
oSQLServer.Connect sServer

oBackup.Database = sDatabase
oBackup.Files = sPath & sDumpFile
oBackUp.BackupSetDescription = "Backup - " & sDatabase
oBackup.Initialize = "TRUE"
oBackup.SQLBackup oSQLServer

oSQLServer.Disconnect

Set sServer = nothing
Set sDatabase = nothing
Set sPath = nothing
Set sDumpFile = nothing
Set oSQLServer = nothing
Set oBackup = nothing

Hi Stev

Vimal , here ,

sir its helpful to take backup ,please tell me script for restore the taken dump file.

Vimal

Backup and Restore using VBScript (ActiveX)

We are trying to setup a central job server that will perform the backups, restores, and other automated tasks for all of our SQL servers. The goal is that we have one place to check the status of all of our jobs. I have a couple of problems, though.

The first is that, to backup a database on a remote server, we are using VBScript as an ActiveX Script type of step. The script uses SQLDMO. The jobs mostly run fine, but there seems to be a problem with concurrent jobs running against the same server. For instance, I have 4 backup jobs that I kick off at 7:00PM. One of them (not always the same one) will fail with:

Error Code: 0 Error Source= Microsoft SQL-DMO Error Description: [SQL-DMO]The application is busy. Error on Line 11. The step failed.

The databses are all quite small (master, msdb, and a couple of utility dbs we have). Are there threading issues in using SQL-DMO such that I can't run jobs concurrently? The remote server is SQL2000, so I don't believe I can use SMO. My script is at the end of this post.

My second problem is trying to remotely kick off a restore. Currently, when using the local scheduler, we use the RESTORE DATABASE command right after an ALTER DATABASE SET SINGLE_USER WITH ROLLBACK IMMEDIATE command. This command is necessary to kill any processes currently using the DB so that a restore will succeed. In DMO I can't find anyway to duplicate this functionality. Any ideas?

Thanks

Steve

-- Backup Script --

Dim sServer, sDatabase, sPath, sDumpFile, oSQLServer, oBackup

sServer = "PRDSQL01"
sDatabase = "master"
sPath = "E:\MSSQL\DUMP\"
sDumpFile = "master.dmp"

Set oSQLServer = CreateObject("SQLDMO.SQLServer")
Set oBackup = CreateObject("SQLDMO.BackUp")

oSQLServer.loginsecure = true
oSQLServer.Connect sServer

oBackup.Database = sDatabase
oBackup.Files = sPath & sDumpFile
oBackUp.BackupSetDescription = "Backup - " & sDatabase
oBackup.Initialize = "TRUE"
oBackup.SQLBackup oSQLServer

oSQLServer.Disconnect

Set sServer = nothing
Set sDatabase = nothing
Set sPath = nothing
Set sDumpFile = nothing
Set oSQLServer = nothing
Set oBackup = nothing

Hi Stev

Vimal , here ,

sir its helpful to take backup ,please tell me script for restore the taken dump file.

Vimal

Wednesday, March 7, 2012

Backup and Restore to Different Database Servers

I need to programmatically (C# w/ smo) backup a database on one SQL server
and restore the backup on a different SQL server. The problem I have is that
I cannot guarantee that either SQL Server is running as a domain user (either
one may be running as Local System). This results in "Access Denied" errors
when attempting to backup to (or restore from) a spot one of the servers
cannot see. In this situation, is there any way to programmatically backup
and restore an entire database from one SQL server to another?
Thanks.The backup file has to "land" somewhere. I.e., produced by one instance and read by the other
instance. And those instance need permissions to write/read the backup file.
Of course, you can have an intermediate party pick up the file written by source instance and
copying it to somewhere else where then the destination instance need permissions. Now the
intermediate party need permissions on both these locations.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"stevep" <stevep@.discussions.microsoft.com> wrote in message
news:5907BBED-870F-4928-9B92-842E2A99DA17@.microsoft.com...
>I need to programmatically (C# w/ smo) backup a database on one SQL server
> and restore the backup on a different SQL server. The problem I have is that
> I cannot guarantee that either SQL Server is running as a domain user (either
> one may be running as Local System). This results in "Access Denied" errors
> when attempting to backup to (or restore from) a spot one of the servers
> cannot see. In this situation, is there any way to programmatically backup
> and restore an entire database from one SQL server to another?
> Thanks.

Backup and Restore to Different Database Servers

I need to programmatically (C# w/ smo) backup a database on one SQL server
and restore the backup on a different SQL server. The problem I have is tha
t
I cannot guarantee that either SQL Server is running as a domain user (eithe
r
one may be running as Local System). This results in "Access Denied" errors
when attempting to backup to (or restore from) a spot one of the servers
cannot see. In this situation, is there any way to programmatically backup
and restore an entire database from one SQL server to another?
Thanks.The backup file has to "land" somewhere. I.e., produced by one instance and
read by the other
instance. And those instance need permissions to write/read the backup file.
Of course, you can have an intermediate party pick up the file written by so
urce instance and
copying it to somewhere else where then the destination instance need permis
sions. Now the
intermediate party need permissions on both these locations.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"stevep" <stevep@.discussions.microsoft.com> wrote in message
news:5907BBED-870F-4928-9B92-842E2A99DA17@.microsoft.com...
>I need to programmatically (C# w/ smo) backup a database on one SQL server
> and restore the backup on a different SQL server. The problem I have is t
hat
> I cannot guarantee that either SQL Server is running as a domain user (eit
her
> one may be running as Local System). This results in "Access Denied" erro
rs
> when attempting to backup to (or restore from) a spot one of the servers
> cannot see. In this situation, is there any way to programmatically backup
> and restore an entire database from one SQL server to another?
> Thanks.

backup and restore MSDE database

Hello,
We are currently migrating from NT to 2K servers and I
have been assigned to port over an MSDE database from the
NT environment to Windows 2000 Server.
Can someone please point me to a tutorial on how to backup
and restore an MSDE database..
Thanks,
niv
Hi ,
There is no syntax difference in backup and restore commands for a regular
sql server installation and msde.
You can use the following sample commands to perform backup and restore
Examples
A. Back up the entire MyNwind database
Note The MyNwind database is shown for illustration only.
This example creates a logical backup device in which a full backup of the
MyNwind database is placed.
-- Create a logical backup device for the full MyNwind backup.
USE master
EXEC sp_addumpdevice 'disk', 'MyNwind_1',
DISK ='c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\MyNwind_1.dat'
-- Back up the full MyNwind database.
BACKUP DATABASE MyNwind TO MyNwind_1
B. Back up the database and log
This example creates both a full database and log backup. The database is
backed up to a logical backup device called MyNwind_2, and then the log is
backed up to a logical backup device called MyNwindLog1.
Note Creating a logical backup device needs to be done only once.
-- Create the backup device for the full MyNwind backup.
USE master
EXEC sp_addumpdevice 'disk', 'MyNwind_2',
'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\MyNwind_2.dat'
--Create the log backup device.
USE master
EXEC sp_addumpdevice 'disk', 'MyNwindLog1',
'c:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\MyNwindLog1.dat'
-- Back up the full MyNwind database.
BACKUP DATABASE MyNwind TO MyNwind_2
-- Update activity has occurred since the full database backup.
-- Back up the log of the MyNwind database.
BACKUP LOG MyNwind
TO MyNwindLog1
http://msdn.microsoft.com/library/de...us/adminsql/ad
_bkprst_8v3n.asp - Detailed informatin about backup and restore operations
along with examples.

Saturday, February 25, 2012

backup and restore database on different servers

SQL SERVER 2000 (8.0.2039 ) on both servers.
I need to copy a database from one server to another server. I have created
a backup of the database on source server. Moved the backup(.bak file) on the
destination server. When I try to restore the database on destination server,
On the Restore screen... In the option to select the .bak files (Show backups
of database) I can see the backups of existing databases of the destination
server but not the backup I want to restore which was taken on the source
server.
What needs to be done?
--
DB
ontario, canadaDB,
You need to select the "Restore from device" radio button, then add the file
that you want to restore from.
Any server only has backup history for itself. It does not look for files
on disk of any particular pattern, it looks at the history in msdb.
RLF
"db" <db@.discussions.microsoft.com> wrote in message
news:E99E95DC-B68D-4325-9E65-35B6548CA6D1@.microsoft.com...
> SQL SERVER 2000 (8.0.2039 ) on both servers.
> I need to copy a database from one server to another server. I have
> created
> a backup of the database on source server. Moved the backup(.bak file) on
> the
> destination server. When I try to restore the database on destination
> server,
> On the Restore screen... In the option to select the .bak files (Show
> backups
> of database) I can see the backups of existing databases of the
> destination
> server but not the backup I want to restore which was taken on the source
> server.
> What needs to be done?
> --
> DB
> ontario, canada|||Have it backup from a device and specify the file there. Also, your build
of SQL Server 2000 has a known bug. Check out the following build chart and
apply the hotfix:
http://aspfaq.com/SQL2000Builds.asp
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau
"db" <db@.discussions.microsoft.com> wrote in message
news:E99E95DC-B68D-4325-9E65-35B6548CA6D1@.microsoft.com...
SQL SERVER 2000 (8.0.2039 ) on both servers.
I need to copy a database from one server to another server. I have created
a backup of the database on source server. Moved the backup(.bak file) on
the
destination server. When I try to restore the database on destination
server,
On the Restore screen... In the option to select the .bak files (Show
backups
of database) I can see the backups of existing databases of the destination
server but not the backup I want to restore which was taken on the source
server.
What needs to be done?
--
DB
ontario, canada|||Hi Russel
Under the options
1. Logical file name: I will keep same logical file names.
2. Move to Physical file name: Can I change it and give the path where I
want to install the .mdf and .ldf files on the destination server.
I know this is a silly question but I do not want to test it as working on
production server.
Thanks
DB
ontario, canada
"Russell Fields" wrote:
> DB,
> You need to select the "Restore from device" radio button, then add the file
> that you want to restore from.
> Any server only has backup history for itself. It does not look for files
> on disk of any particular pattern, it looks at the history in msdb.
> RLF
> "db" <db@.discussions.microsoft.com> wrote in message
> news:E99E95DC-B68D-4325-9E65-35B6548CA6D1@.microsoft.com...
> > SQL SERVER 2000 (8.0.2039 ) on both servers.
> > I need to copy a database from one server to another server. I have
> > created
> > a backup of the database on source server. Moved the backup(.bak file) on
> > the
> > destination server. When I try to restore the database on destination
> > server,
> > On the Restore screen... In the option to select the .bak files (Show
> > backups
> > of database) I can see the backups of existing databases of the
> > destination
> > server but not the backup I want to restore which was taken on the source
> > server.
> > What needs to be done?
> > --
> > DB
> > ontario, canada
>
>|||Yep. Often the path on the destination serer is different from the original
server. Just specify whatever path you want.
--
Tom
----
Thomas A. Moreau, BSc, PhD, MCSE, MCDBA, MCITP, MCTS
SQL Server MVP
Toronto, ON Canada
https://mvp.support.microsoft.com/profile/Tom.Moreau
"db" <db@.discussions.microsoft.com> wrote in message
news:5BAF9FB9-6699-4716-A302-20E39B46ED11@.microsoft.com...
Hi Russel
Under the options
1. Logical file name: I will keep same logical file names.
2. Move to Physical file name: Can I change it and give the path where I
want to install the .mdf and .ldf files on the destination server.
I know this is a silly question but I do not want to test it as working on
production server.
Thanks
DB
ontario, canada
"Russell Fields" wrote:
> DB,
> You need to select the "Restore from device" radio button, then add the
file
> that you want to restore from.
> Any server only has backup history for itself. It does not look for files
> on disk of any particular pattern, it looks at the history in msdb.
> RLF
> "db" <db@.discussions.microsoft.com> wrote in message
> news:E99E95DC-B68D-4325-9E65-35B6548CA6D1@.microsoft.com...
> > SQL SERVER 2000 (8.0.2039 ) on both servers.
> > I need to copy a database from one server to another server. I have
> > created
> > a backup of the database on source server. Moved the backup(.bak file)
on
> > the
> > destination server. When I try to restore the database on destination
> > server,
> > On the Restore screen... In the option to select the .bak files (Show
> > backups
> > of database) I can see the backups of existing databases of the
> > destination
> > server but not the backup I want to restore which was taken on the
source
> > server.
> > What needs to be done?
> > --
> > DB
> > ontario, canada
>
>|||DB,
Yes, you can give it the new paths where you want the .mdf and .ldf files to
reside.
Of course, I recommend always testing new commands on a test server. (I
just tested this on one of my SQL 2000 servers, using both SQL Server
Management Studio 2005 and SQL Server 2000 Enterprise Manager.)
RLF
"db" <db@.discussions.microsoft.com> wrote in message
news:5BAF9FB9-6699-4716-A302-20E39B46ED11@.microsoft.com...
> Hi Russel
> Under the options
> 1. Logical file name: I will keep same logical file names.
> 2. Move to Physical file name: Can I change it and give the path where I
> want to install the .mdf and .ldf files on the destination server.
> I know this is a silly question but I do not want to test it as working on
> production server.
> Thanks
> DB
>
> --
> ontario, canada
>
> "Russell Fields" wrote:
>> DB,
>> You need to select the "Restore from device" radio button, then add the
>> file
>> that you want to restore from.
>> Any server only has backup history for itself. It does not look for
>> files
>> on disk of any particular pattern, it looks at the history in msdb.
>> RLF
>> "db" <db@.discussions.microsoft.com> wrote in message
>> news:E99E95DC-B68D-4325-9E65-35B6548CA6D1@.microsoft.com...
>> > SQL SERVER 2000 (8.0.2039 ) on both servers.
>> > I need to copy a database from one server to another server. I have
>> > created
>> > a backup of the database on source server. Moved the backup(.bak file)
>> > on
>> > the
>> > destination server. When I try to restore the database on destination
>> > server,
>> > On the Restore screen... In the option to select the .bak files (Show
>> > backups
>> > of database) I can see the backups of existing databases of the
>> > destination
>> > server but not the backup I want to restore which was taken on the
>> > source
>> > server.
>> > What needs to be done?
>> > --
>> > DB
>> > ontario, canada
>>

Backup and restore database hourly: how to implement it?

I have two servers, using SQL server 2000.
I was asked for implementing hourly Backup 3 databases in one server
and restore those databases to another server.

Could anyone give me the detailed steps to do that?
Thanks a lot in advance!<danceli@.gmail.comwrote in message
news:1171500668.532022.161870@.l53g2000cwa.googlegr oups.com...

Quote:

Originally Posted by

>I have two servers, using SQL server 2000.
I was asked for implementing hourly Backup 3 databases in one server
and restore those databases to another server.


Google log-shipping.

You really only want to do a ful restore to server B, and then transaction
log backup/restores after that.

Quote:

Originally Posted by

>
Could anyone give me the detailed steps to do that?
Thanks a lot in advance!
>

|||Log shipping is a process that takes transaction logs from a primary
SQL Server and applies them sequentially on a scheduled basis to
another SQL Server.

Does this do same thing for Backup/Restore the database?? Thanks a lot
for any explaination. I do have no idea about that.

Quote:

Originally Posted by

Google log-shipping.
>
You really only want to do a ful restore to server B, and then transaction
logbackup/restores after that.
>
>

|||<danceli@.gmail.comwrote in message
news:1171503793.953050.302190@.q2g2000cwa.googlegro ups.com...

Quote:

Originally Posted by

Log shipping is a process that takes transaction logs from a primary
SQL Server and applies them sequentially on a scheduled basis to
another SQL Server.
>
Does this do same thing for Backup/Restore the database?? Thanks a lot
for any explaination. I do have no idea about that.


Generally you don't want to do a full backup/restore due to the time.

Is there a specific reasony ou want to do a full backup/restore rather than
simply log-shipping?

Quote:

Originally Posted by

>

Quote:

Originally Posted by

>Google log-shipping.
>>
>You really only want to do a ful restore to server B, and then
>transaction
>logbackup/restores after that.
>>
>>


>

|||You mean logshipping could also do backup database and restore the
databases to another server also?

On Feb 14, 7:36 pm, "Greg D. Moore \(Strider\)"
<mooregr_deletet...@.greenms.comwrote:

Quote:

Originally Posted by

Generally you don't want to do a fullbackup/restore due to the time.
>
Is there a specific reasony ou want to do a fullbackup/restore rather than
simply log-shipping?
>

|||<danceli@.gmail.comwrote in message
news:1171561856.821679.57780@.a75g2000cwd.googlegro ups.com...

Quote:

Originally Posted by

You mean logshipping could also do backup database and restore the
databases to another server also?


Generally you have to do the initial backup/restore yourself.

I've written scripts in the past to do a full backup/restore but that was a
specialized case that I replaced with a log-shipping script the first chance
I got.

I'm still unclear why you want to go the full backup/restore route rather
than using log-shipping.

Quote:

Originally Posted by

>
>
On Feb 14, 7:36 pm, "Greg D. Moore \(Strider\)"
<mooregr_deletet...@.greenms.comwrote:
>

Quote:

Originally Posted by

>Generally you don't want to do a fullbackup/restore due to the time.
>>
>Is there a specific reasony ou want to do a fullbackup/restore rather
>than
>simply log-shipping?
>>


>

|||Actually we need replicate 3 databases from server A to server B. But
no idea why replication does not work fine.

So, my boss asked me to do hourly full backup/restore to server B,
which is kind of relication.

Now I still can schedule a job for hourly full backup on server A, but
i have no idea how to schedule a job for hourly full restore dbs to
server B.

How to make those hourly .Bak files in server A to server B, and then
do restore in server B??

BTW, thank you so much to keep helping me out!!

On Feb 15, 10:48 am, "Greg D. Moore \(Strider\)"
<mooregr_deletet...@.greenms.comwrote:

Quote:

Originally Posted by

>
Generally you have to do the initialbackup/restore yourself.
>
I've written scripts in the past to do a fullbackup/restore but that was a
specialized case that I replaced with a log-shipping script the first chance
I got.
>
I'm still unclear why you want to go the fullbackup/restore route rather
than using log-shipping.

|||
--
--
Greg Moore
SQL Server DBA Consulting
sql (at) greenms.com

<danceli@.gmail.comwrote in message
news:1171570480.195547.91540@.v33g2000cwv.googlegro ups.com...

Quote:

Originally Posted by

Actually we need replicate 3 databases from server A to server B. But
no idea why replication does not work fine.
>


I'd focus on fixing that.

Quote:

Originally Posted by

So, my boss asked me to do hourly full backup/restore to server B,
which is kind of relication.


Questions to ask then:
1) What do you do on Server B while the restore is taking place?
2) What do you do if the backup/restore cycle takes more than an hour?

With log-shipping at least you can put the databases on server B into
"read-only" mode between log restores.

Quote:

Originally Posted by

>
Now I still can schedule a job for hourly full backup on server A, but
i have no idea how to schedule a job for hourly full restore dbs to
server B.
>
How to make those hourly .Bak files in server A to server B, and then
do restore in server B??


What I basically did was create a job on Server A that performed the backup
and then called a job on ServerB to start the restore. (ServerB would look
to the MSDB on ServerA to find the most recentlly performed backup and
location and restore that.)

Quote:

Originally Posted by

>
BTW, thank you so much to keep helping me out!!
>
>
On Feb 15, 10:48 am, "Greg D. Moore \(Strider\)"
<mooregr_deletet...@.greenms.comwrote:

Quote:

Originally Posted by

>>
>Generally you have to do the initialbackup/restore yourself.
>>
>I've written scripts in the past to do a fullbackup/restore but that was
>a
>specialized case that I replaced with a log-shipping script the first
>chance
>I got.
>>
>I'm still unclear why you want to go the fullbackup/restore route rather
>than using log-shipping.


>
>
>

|||(danceli@.gmail.com) writes:

Quote:

Originally Posted by

Now I still can schedule a job for hourly full backup on server A, but
i have no idea how to schedule a job for hourly full restore dbs to
server B.


ALTER DATBASE db SET SINGLE_USER WITH ROLLBACK IMMEDIATE
RESTORE DATAHASE dh FROM DISK='locationofbackup'
ALTER DATABASE db SET MULTI_USER

Then use Enterprise Manager or Mgmt Studio to create a job, with this
as the job step and set up a schedule.

Of course, log shipping would be better, but if the databases are small,
less then 1 GB, that's probably not worth the hassle.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||The backup file is located in server A.
how should do restore in Server B to catching backup file from serer
A??

Need I copy the backup.bak file from server A to Server B, then
schedule job to restore at server B?
How to set it automatically?

On Feb 15, 2:47 pm, Erland Sommarskog <esq...@.sommarskog.sewrote:

Quote:

Originally Posted by

Quote:

Originally Posted by

Now I still can schedule a job for hourly full backup on server A, but
i have no idea how to schedule a job for hourly full restore dbs to
server B.


>
ALTER DATBASE db SET SINGLE_USER WITH ROLLBACK IMMEDIATE
RESTORE DATAHASE dh FROM DISK='locationofbackup'
ALTER DATABASE db SET MULTI_USER
>
Then use Enterprise Manager or Mgmt Studio to create a job, with this
as the job step and set up a schedule.

|||<danceli@.gmail.comwrote in message
news:1171584368.655858.325050@.p10g2000cwp.googlegr oups.com...

Quote:

Originally Posted by

The backup file is located in server A.
how should do restore in Server B to catching backup file from serer
A??
>


Use UNCs to refer to the location of the backup.

I'm assuming you're NOT backing up the file to the same local disk on
ServerA.

Quote:

Originally Posted by

Need I copy the backup.bak file from server A to Server B, then
schedule job to restore at server B?
How to set it automatically?
>
>
On Feb 15, 2:47 pm, Erland Sommarskog <esq...@.sommarskog.sewrote:
>

Quote:

Originally Posted by

Quote:

Originally Posted by

Now I still can schedule a job for hourly full backup on server A, but
i have no idea how to schedule a job for hourly full restore dbs to
server B.


>>
>ALTER DATBASE db SET SINGLE_USER WITH ROLLBACK IMMEDIATE
>RESTORE DATAHASE dh FROM DISK='locationofbackup'
>ALTER DATABASE db SET MULTI_USER
>>
>Then use Enterprise Manager or Mgmt Studio to create a job, with this
>as the job step and set up a schedule.


>

|||Greg D. Moore (Strider) wrote:

Quote:

Originally Posted by

Quote:

Originally Posted by

>The backup file is located in server A.
>how should do restore in Server B to catching backup file from serer
>A??
>>


>
Use UNCs to refer to the location of the backup.
>


If the servers' drives are not accessible via UNC, FTP can be scripted
and works pretty well. You can create a batch file to compress the
backup and ftp it to the remote server. Your remote server can then
'look' for new backups at a certain interval, uncompress it and restore
it. I believe you could do all of this in batch files if desired or in
SQL jobs. Use whatever you are most familiar with.|||Greg D. Moore (Strider) wrote:

Quote:

Originally Posted by

I'm still unclear why you want to go the full backup/restore route rather
than using log-shipping.


Greg,

Log shipping requires Enterprise Edition, right?

Jonathan|||
--
--
Greg Moore
SQL Server DBA Consulting
sql (at) greenms.com

"Jonathan Roberts" <gremln007@.diynics.comwrote in message
news:YabBh.12926$JF.1221@.newsfe21.lga...

Quote:

Originally Posted by

Greg D. Moore (Strider) wrote:

Quote:

Originally Posted by

>I'm still unclear why you want to go the full backup/restore route rather
>than using log-shipping.


>
Greg,
>
Log shipping requires Enterprise Edition, right?


If you want to use the built-in scripts yes.

But there's nothing to prevent you from rolling your own. Which I've done
in the past.

Quote:

Originally Posted by

>
Jonathan

Friday, February 24, 2012

Backup a mirrored database

I have a client who is worried about his backup strategy. He has two servers
and has succesfully setup mirroring. He wants to be able to automatically
backup databaseA before and after the mirror server becomes a principal.
What is the proper procedure to ensure that a backup job doesn't fail when
the roles of principal and mirror are reversed?
For example. On the principal, my client is doing a full backup on sun,
diff monday to sat and tlog backup every hour. On the mirror he has not
scheduled a backup. If the database fails on tuesday, the backup that would
normally run on the principal server will fail. The mirror server (which is
now the principal) currently doesn't have a backup scheduled. What is the
best practice?
Thanks for any help.
DanCreate the same job on both servers, both jobs are always enabled, and in the job you use the
sys.database_mirroring catalog view it see if the database is principal or mirror.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Dan Wood" <DanWood@.discussions.microsoft.com> wrote in message
news:F9A439EF-A131-450E-A032-12382AE9C782@.microsoft.com...
>I have a client who is worried about his backup strategy. He has two servers
> and has succesfully setup mirroring. He wants to be able to automatically
> backup databaseA before and after the mirror server becomes a principal.
> What is the proper procedure to ensure that a backup job doesn't fail when
> the roles of principal and mirror are reversed?
> For example. On the principal, my client is doing a full backup on sun,
> diff monday to sat and tlog backup every hour. On the mirror he has not
> scheduled a backup. If the database fails on tuesday, the backup that would
> normally run on the principal server will fail. The mirror server (which is
> now the principal) currently doesn't have a backup scheduled. What is the
> best practice?
> Thanks for any help.
> Dan|||Thanks for you help.
"Tibor Karaszi" wrote:
> Create the same job on both servers, both jobs are always enabled, and in the job you use the
> sys.database_mirroring catalog view it see if the database is principal or mirror.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Dan Wood" <DanWood@.discussions.microsoft.com> wrote in message
> news:F9A439EF-A131-450E-A032-12382AE9C782@.microsoft.com...
> >I have a client who is worried about his backup strategy. He has two servers
> > and has succesfully setup mirroring. He wants to be able to automatically
> > backup databaseA before and after the mirror server becomes a principal.
> > What is the proper procedure to ensure that a backup job doesn't fail when
> > the roles of principal and mirror are reversed?
> >
> > For example. On the principal, my client is doing a full backup on sun,
> > diff monday to sat and tlog backup every hour. On the mirror he has not
> > scheduled a backup. If the database fails on tuesday, the backup that would
> > normally run on the principal server will fail. The mirror server (which is
> > now the principal) currently doesn't have a backup scheduled. What is the
> > best practice?
> >
> > Thanks for any help.
> >
> > Dan
>

Sunday, February 19, 2012

Backup ?

I using the latest and greatest sp on sql2k. I had a failure the other day
on one of our production servers and the guy that used to maintain is gone.
Here is the strategy I am thinking of
Full Recovery Model,
3am - Backup the Db and transaction log
7am - first shift arrives
8am - first differential backup (runs every hour on the hour)
8:30am - first transaction log backup (runs everyhour on the half hour)
This will run all day until 2nd shift leaves at around midnight.
What I want to know is this, I look at the differential backup and see a
name for the last full backup preformed. When this differential backup runs
tomorrow morning will it be hitting the newly created 3am backup or the one
from yesterday when I created the differential backup.
Thanks,
jc
John,
I have some difficulty following you. Especially below part:

> What I want to know is this, I look at the differential backup and see a
> name for the last full backup preformed. When this differential backup runs
> tomorrow morning will it be hitting the newly created 3am backup or the one
> from yesterday when I created the differential backup.
I'm not sure where you "see" the name of the full backup. Also, what do you mean by "hitting the newly created
3am backup". Perhaps you can rephrase or explain a bit further. Or even post some BACKUP and/or RESTORE
commands?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"John Cantley" <kayjohn59@.sbcglobal.net> wrote in message news:uSwuaWvJEHA.3592@.TK2MSFTNGP09.phx.gbl...
> I using the latest and greatest sp on sql2k. I had a failure the other day
> on one of our production servers and the guy that used to maintain is gone.
> Here is the strategy I am thinking of
> Full Recovery Model,
> 3am - Backup the Db and transaction log
> 7am - first shift arrives
> 8am - first differential backup (runs every hour on the hour)
> 8:30am - first transaction log backup (runs everyhour on the half hour)
> This will run all day until 2nd shift leaves at around midnight.
> What I want to know is this, I look at the differential backup and see a
> name for the last full backup preformed. When this differential backup runs
> tomorrow morning will it be hitting the newly created 3am backup or the one
> from yesterday when I created the differential backup.
> Thanks,
> jc
>

Backup ?

I using the latest and greatest sp on sql2k. I had a failure the other day
on one of our production servers and the guy that used to maintain is gone.
Here is the strategy I am thinking of
Full Recovery Model,
3am - Backup the Db and transaction log
7am - first shift arrives
8am - first differential backup (runs every hour on the hour)
8:30am - first transaction log backup (runs everyhour on the half hour)
This will run all day until 2nd shift leaves at around midnight.
What I want to know is this, I look at the differential backup and see a
name for the last full backup preformed. When this differential backup runs
tomorrow morning will it be hitting the newly created 3am backup or the one
from yesterday when I created the differential backup.
Thanks,
jcJohn,
I have some difficulty following you. Especially below part:
> What I want to know is this, I look at the differential backup and see a
> name for the last full backup preformed. When this differential backup runs
> tomorrow morning will it be hitting the newly created 3am backup or the one
> from yesterday when I created the differential backup.
I'm not sure where you "see" the name of the full backup. Also, what do you mean by "hitting the newly created
3am backup". Perhaps you can rephrase or explain a bit further. Or even post some BACKUP and/or RESTORE
commands?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"John Cantley" <kayjohn59@.sbcglobal.net> wrote in message news:uSwuaWvJEHA.3592@.TK2MSFTNGP09.phx.gbl...
> I using the latest and greatest sp on sql2k. I had a failure the other day
> on one of our production servers and the guy that used to maintain is gone.
> Here is the strategy I am thinking of
> Full Recovery Model,
> 3am - Backup the Db and transaction log
> 7am - first shift arrives
> 8am - first differential backup (runs every hour on the hour)
> 8:30am - first transaction log backup (runs everyhour on the half hour)
> This will run all day until 2nd shift leaves at around midnight.
> What I want to know is this, I look at the differential backup and see a
> name for the last full backup preformed. When this differential backup runs
> tomorrow morning will it be hitting the newly created 3am backup or the one
> from yesterday when I created the differential backup.
> Thanks,
> jc
>

Backup ?

I using the latest and greatest sp on sql2k. I had a failure the other day
on one of our production servers and the guy that used to maintain is gone.
Here is the strategy I am thinking of
Full Recovery Model,
3am - Backup the Db and transaction log
7am - first shift arrives
8am - first differential backup (runs every hour on the hour)
8:30am - first transaction log backup (runs everyhour on the half hour)
This will run all day until 2nd shift leaves at around midnight.
What I want to know is this, I look at the differential backup and see a
name for the last full backup preformed. When this differential backup runs
tomorrow morning will it be hitting the newly created 3am backup or the one
from yesterday when I created the differential backup.
Thanks,
jcJohn,
I have some difficulty following you. Especially below part:

> What I want to know is this, I look at the differential backup and see a
> name for the last full backup preformed. When this differential backup run
s
> tomorrow morning will it be hitting the newly created 3am backup or the on
e
> from yesterday when I created the differential backup.
I'm not sure where you "see" the name of the full backup. Also, what do you
mean by "hitting the newly created
3am backup". Perhaps you can rephrase or explain a bit further. Or even post
some BACKUP and/or RESTORE
commands?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
"John Cantley" <kayjohn59@.sbcglobal.net> wrote in message news:uSwuaWvJEHA.3592@.TK2MSFTNGP09
.phx.gbl...
> I using the latest and greatest sp on sql2k. I had a failure the other day
> on one of our production servers and the guy that used to maintain is gone
.
> Here is the strategy I am thinking of
> Full Recovery Model,
> 3am - Backup the Db and transaction log
> 7am - first shift arrives
> 8am - first differential backup (runs every hour on the hour)
> 8:30am - first transaction log backup (runs everyhour on the half hour)
> This will run all day until 2nd shift leaves at around midnight.
> What I want to know is this, I look at the differential backup and see a
> name for the last full backup preformed. When this differential backup run
s
> tomorrow morning will it be hitting the newly created 3am backup or the on
e
> from yesterday when I created the differential backup.
> Thanks,
> jc
>

Tuesday, February 14, 2012

Backup

I've recently taken over our comapnies SQL servers. I'm trying to go throug
h
the way my predecessor had things done. I came across two questions
regarding the maintenance plans he had set up to schedule backups through th
e
enterprise manager.
1) Can you backup all databses in one plan both system and user provided
they are of similar type simple or full
2) When I scheduled the backups how far apart should the BAK and TRN backups
be apart.
They currently have weird scheduled times ex. 11:00 PM for BAK and TRN 1:00
Daily, 1:00 AM for BAK Monday through Saturday, TRN not backed up, BAK 2:00
AM Monday through Saturday, TRN 12:00 AM Monday through Saturday.
Also when these backups run do they interfere with accessing the Database.First, when in process, a backup will have a small but noticeable impact
upon server performance. (It is relative to CPU/Memory, etc.) Under normal
circumstances, user rarely notice.
Backup plans should be carefully considered based upon need: How much data
is new or changed, and how long can you afford to be offline in case of a
system failure and need to restore.
Look in SQL Server Books Online for the topic "Backing Up and Restoring
Databases'. That will get you started down the path of better understanding
how to balance need vs. capability.
System databases: Usually these are not subject to much daily change
activity, and don't require frequent backups. Master is critical and must be
backed up immediately after any changes to database schema, users,
permissions, etc. Never bother with backing up TempDb. MSDB needs to be
backed up when you create or change any scheduled jobs, add 'operators', or
'alerts'. (Maintenance Plans are scheduled 'jobs'.)
User databases: Again, judge the frequency of new and changed data, and
balance with the risk of loss. In some situations, such as databases used
for reporting, the data is relatively static and doesn't require regular
backups. Other needs include high frequency input with little room for
potential loss. A common schedule for high frequency online databases would
be weekly (or nightly) FULL backups, with hourly Transaction Log backups.
After you do some reading and gather your business requirements, you will be
better prepared to make a schedule that works best for your organization.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:A4C1032D-BE35-4F85-A863-EA2DDF856CF6@.microsoft.com...
> I've recently taken over our comapnies SQL servers. I'm trying to go
> through
> the way my predecessor had things done. I came across two questions
> regarding the maintenance plans he had set up to schedule backups through
> the
> enterprise manager.
> 1) Can you backup all databses in one plan both system and user provided
> they are of similar type simple or full
> 2) When I scheduled the backups how far apart should the BAK and TRN
> backups
> be apart.
> They currently have weird scheduled times ex. 11:00 PM for BAK and TRN
> 1:00
> Daily, 1:00 AM for BAK Monday through Saturday, TRN not backed up, BAK
> 2:00
> AM Monday through Saturday, TRN 12:00 AM Monday through Saturday.
> Also when these backups run do they interfere with accessing the Database.|||I think Arnie covered most, but just to add one little thing:

> 1) Can you backup all databses in one plan both system and user provided
> they are of similar type simple or full
You can definitely have the same plan for the db backup part. But not for th
e log backup part, since
you cannot do log backup of the master database. You can do log backup of ms
db, but 2000 has this
weird behavior of setting msdb to simple each time Agent starts (which you c
an handle if you do wish
to log backup msdb).
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:A4C1032D-BE35-4F85-A863-EA2DDF856CF6@.microsoft.com...
> I've recently taken over our comapnies SQL servers. I'm trying to go thro
ugh
> the way my predecessor had things done. I came across two questions
> regarding the maintenance plans he had set up to schedule backups through
the
> enterprise manager.
> 1) Can you backup all databses in one plan both system and user provided
> they are of similar type simple or full
> 2) When I scheduled the backups how far apart should the BAK and TRN backu
ps
> be apart.
> They currently have weird scheduled times ex. 11:00 PM for BAK and TRN 1:
00
> Daily, 1:00 AM for BAK Monday through Saturday, TRN not backed up, BAK 2:0
0
> AM Monday through Saturday, TRN 12:00 AM Monday through Saturday.
> Also when these backups run do they interfere with accessing the Database.|||What I usually do is have a Plan for all the simple db and one for all the
full backups.
We've established its exceptable to just do One backup at a point in time
lets say 3:00 Am every night. How soon after the BAK backup should I have th
e
trn backup run?
"Tibor Karaszi" wrote:

> I think Arnie covered most, but just to add one little thing:
>
> You can definitely have the same plan for the db backup part. But not for
the log backup part, since
> you cannot do log backup of the master database. You can do log backup of
msdb, but 2000 has this
> weird behavior of setting msdb to simple each time Agent starts (which you
can handle if you do wish
> to log backup msdb).
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "George Schneider" <georgedschneider@.news.postalias> wrote in message
> news:A4C1032D-BE35-4F85-A863-EA2DDF856CF6@.microsoft.com...
>
>|||> We've established its exceptable to just do One backup at a point in time
> lets say 3:00 Am every night. How soon after the BAK backup should I have
the
> trn backup run?
I usually consider the frequency for log backups instead. Every 10 minutes?
Every hour? This is of
course not my decision, it is the system owner's decision. Say you only want
to do one log backup
each day (to enable point in time restore, for instance), then it doesn't ma
tter much when you do
it...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:F9E2C858-B650-4588-B1BF-6D88D81D50D9@.microsoft.com...[vbcol=seagreen]
> What I usually do is have a Plan for all the simple db and one for all the
> full backups.
> We've established its exceptable to just do One backup at a point in time
> lets say 3:00 Am every night. How soon after the BAK backup should I have
the
> trn backup run?
> "Tibor Karaszi" wrote:
>|||I guess I'm having a little trouble understanding the purpose of the
transaction log backups. A typically backup schedule for our databse would
be a full at 1:00 AM and the trans backup at 2:00 AM. Would exactly is the
function of trans backups?
"Tibor Karaszi" wrote:

> I usually consider the frequency for log backups instead. Every 10 minutes
? Every hour? This is of
> course not my decision, it is the system owner's decision. Say you only wa
nt to do one log backup
> each day (to enable point in time restore, for instance), then it doesn't
matter much when you do
> it...
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "George Schneider" <georgedschneider@.news.postalias> wrote in message
> news:F9E2C858-B650-4588-B1BF-6D88D81D50D9@.microsoft.com...
>|||George Schneider wrote:
> I guess I'm having a little trouble understanding the purpose of the
> transaction log backups. A typically backup schedule for our databse woul
d
> be a full at 1:00 AM and the trans backup at 2:00 AM. Would exactly is th
e
> function of trans backups?
>
Think of the transaction log as a sort of journal. In that journal is a
record of every change that is made to your database. When you run a
full backup, you're saving a "snapshot" of the database as it exists at
that point in time, at 1:00am. For the next 24 hours, changes are being
made to your database. The transaction log is recording those changes.
If you suffer a drive failure, or some other catastrophic loss, you
likely are going to have to restore from the last full backup, losing
those 24 hours of changes.
If you're taking regular backups of the transaction log, you can restore
the last full backup, THEN restore, or "playback", the entries in your
transaction log, thus reproducing the changes that were made to your
database.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||typically what I've done on other servers is have the db backup run at 3:00
Am and the tyransaction backup at 3:15 Am. Its exceptable for our purposes
to backup at one point in time. I use enterpsrise manager through a
maintenance plan to create a disk based backup and then backup the backup
directory to tape. If we had a failure all I would need to restore would be
the db backup and then the transaction log backup which would contain all th
e
changes since the full backup or is it since the last transaction backup?
Does this sound right?
"Tracy McKibben" wrote:

> George Schneider wrote:
> Think of the transaction log as a sort of journal. In that journal is a
> record of every change that is made to your database. When you run a
> full backup, you're saving a "snapshot" of the database as it exists at
> that point in time, at 1:00am. For the next 24 hours, changes are being
> made to your database. The transaction log is recording those changes.
> If you suffer a drive failure, or some other catastrophic loss, you
> likely are going to have to restore from the last full backup, losing
> those 24 hours of changes.
> If you're taking regular backups of the transaction log, you can restore
> the last full backup, THEN restore, or "playback", the entries in your
> transaction log, thus reproducing the changes that were made to your
> database.
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
>|||What if something disastrous happens at 02:50, in a way so you cannot perfor
m a transaction log
backup at that time. You have now lost one day worth of information. This is
what you have to ask
yourself: Is this acceptable?
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:65BEB0C9-1499-4243-AAB0-580DFEAD3C9E@.microsoft.com...[vbcol=seagreen]
> typically what I've done on other servers is have the db backup run at 3:0
0
> Am and the tyransaction backup at 3:15 Am. Its exceptable for our purpose
s
> to backup at one point in time. I use enterpsrise manager through a
> maintenance plan to create a disk based backup and then backup the backup
> directory to tape. If we had a failure all I would need to restore would
be
> the db backup and then the transaction log backup which would contain all
the
> changes since the full backup or is it since the last transaction backup?
> Does this sound right?
> "Tracy McKibben" wrote:
>|||"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:65BEB0C9-1499-4243-AAB0-580DFEAD3C9E@.microsoft.com...
> typically what I've done on other servers is have the db backup run at
> 3:00
> Am and the tyransaction backup at 3:15 Am. Its exceptable for our
> purposes
> to backup at one point in time. I use enterpsrise manager through a
> maintenance plan to create a disk based backup and then backup the backup
> directory to tape. If we had a failure all I would need to restore would
> be
> the db backup and then the transaction log backup which would contain all
> the
> changes since the full backup or is it since the last transaction backup?
> Does this sound right?
>
Not exactly. You really want to be doing transaction backups throughout the
day.
i.e. schedule transaction backups to run say every 15 minutes throughout the
day.
If you completely lose your server, you can restore the DB to the state it
was 15 minutes previously by restoring the full backup (with NORECOVERY
explicitely used) and then each subsequent transaction backup (also with
NORECOVERY).
At the very end you can either restore with recovery and have a functional
database, or if possibly apply the "tail of the log" from the now dead
(assuming you could at least get the log) server.
In this way it's possible in some cases to recover a database to the moment
of failure.

Backup

I've recently taken over our comapnies SQL servers. I'm trying to go through
the way my predecessor had things done. I came across two questions
regarding the maintenance plans he had set up to schedule backups through the
enterprise manager.
1) Can you backup all databses in one plan both system and user provided
they are of similar type simple or full
2) When I scheduled the backups how far apart should the BAK and TRN backups
be apart.
They currently have weird scheduled times ex. 11:00 PM for BAK and TRN 1:00
Daily, 1:00 AM for BAK Monday through Saturday, TRN not backed up, BAK 2:00
AM Monday through Saturday, TRN 12:00 AM Monday through Saturday.
Also when these backups run do they interfere with accessing the Database.
First, when in process, a backup will have a small but noticeable impact
upon server performance. (It is relative to CPU/Memory, etc.) Under normal
circumstances, user rarely notice.
Backup plans should be carefully considered based upon need: How much data
is new or changed, and how long can you afford to be offline in case of a
system failure and need to restore.
Look in SQL Server Books Online for the topic "Backing Up and Restoring
Databases'. That will get you started down the path of better understanding
how to balance need vs. capability.
System databases: Usually these are not subject to much daily change
activity, and don't require frequent backups. Master is critical and must be
backed up immediately after any changes to database schema, users,
permissions, etc. Never bother with backing up TempDb. MSDB needs to be
backed up when you create or change any scheduled jobs, add 'operators', or
'alerts'. (Maintenance Plans are scheduled 'jobs'.)
User databases: Again, judge the frequency of new and changed data, and
balance with the risk of loss. In some situations, such as databases used
for reporting, the data is relatively static and doesn't require regular
backups. Other needs include high frequency input with little room for
potential loss. A common schedule for high frequency online databases would
be weekly (or nightly) FULL backups, with hourly Transaction Log backups.
After you do some reading and gather your business requirements, you will be
better prepared to make a schedule that works best for your organization.
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:A4C1032D-BE35-4F85-A863-EA2DDF856CF6@.microsoft.com...
> I've recently taken over our comapnies SQL servers. I'm trying to go
> through
> the way my predecessor had things done. I came across two questions
> regarding the maintenance plans he had set up to schedule backups through
> the
> enterprise manager.
> 1) Can you backup all databses in one plan both system and user provided
> they are of similar type simple or full
> 2) When I scheduled the backups how far apart should the BAK and TRN
> backups
> be apart.
> They currently have weird scheduled times ex. 11:00 PM for BAK and TRN
> 1:00
> Daily, 1:00 AM for BAK Monday through Saturday, TRN not backed up, BAK
> 2:00
> AM Monday through Saturday, TRN 12:00 AM Monday through Saturday.
> Also when these backups run do they interfere with accessing the Database.
|||What I usually do is have a Plan for all the simple db and one for all the
full backups.
We've established its exceptable to just do One backup at a point in time
lets say 3:00 Am every night. How soon after the BAK backup should I have the
trn backup run?
"Tibor Karaszi" wrote:

> I think Arnie covered most, but just to add one little thing:
>
> You can definitely have the same plan for the db backup part. But not for the log backup part, since
> you cannot do log backup of the master database. You can do log backup of msdb, but 2000 has this
> weird behavior of setting msdb to simple each time Agent starts (which you can handle if you do wish
> to log backup msdb).
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "George Schneider" <georgedschneider@.news.postalias> wrote in message
> news:A4C1032D-BE35-4F85-A863-EA2DDF856CF6@.microsoft.com...
>
>
|||I guess I'm having a little trouble understanding the purpose of the
transaction log backups. A typically backup schedule for our databse would
be a full at 1:00 AM and the trans backup at 2:00 AM. Would exactly is the
function of trans backups?
"Tibor Karaszi" wrote:

> I usually consider the frequency for log backups instead. Every 10 minutes? Every hour? This is of
> course not my decision, it is the system owner's decision. Say you only want to do one log backup
> each day (to enable point in time restore, for instance), then it doesn't matter much when you do
> it...
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "George Schneider" <georgedschneider@.news.postalias> wrote in message
> news:F9E2C858-B650-4588-B1BF-6D88D81D50D9@.microsoft.com...
>
|||George Schneider wrote:
> I guess I'm having a little trouble understanding the purpose of the
> transaction log backups. A typically backup schedule for our databse would
> be a full at 1:00 AM and the trans backup at 2:00 AM. Would exactly is the
> function of trans backups?
>
Think of the transaction log as a sort of journal. In that journal is a
record of every change that is made to your database. When you run a
full backup, you're saving a "snapshot" of the database as it exists at
that point in time, at 1:00am. For the next 24 hours, changes are being
made to your database. The transaction log is recording those changes.
If you suffer a drive failure, or some other catastrophic loss, you
likely are going to have to restore from the last full backup, losing
those 24 hours of changes.
If you're taking regular backups of the transaction log, you can restore
the last full backup, THEN restore, or "playback", the entries in your
transaction log, thus reproducing the changes that were made to your
database.
Tracy McKibben
MCDBA
http://www.realsqlguy.com
|||typically what I've done on other servers is have the db backup run at 3:00
Am and the tyransaction backup at 3:15 Am. Its exceptable for our purposes
to backup at one point in time. I use enterpsrise manager through a
maintenance plan to create a disk based backup and then backup the backup
directory to tape. If we had a failure all I would need to restore would be
the db backup and then the transaction log backup which would contain all the
changes since the full backup or is it since the last transaction backup?
Does this sound right?
"Tracy McKibben" wrote:

> George Schneider wrote:
> Think of the transaction log as a sort of journal. In that journal is a
> record of every change that is made to your database. When you run a
> full backup, you're saving a "snapshot" of the database as it exists at
> that point in time, at 1:00am. For the next 24 hours, changes are being
> made to your database. The transaction log is recording those changes.
> If you suffer a drive failure, or some other catastrophic loss, you
> likely are going to have to restore from the last full backup, losing
> those 24 hours of changes.
> If you're taking regular backups of the transaction log, you can restore
> the last full backup, THEN restore, or "playback", the entries in your
> transaction log, thus reproducing the changes that were made to your
> database.
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
>
|||"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:65BEB0C9-1499-4243-AAB0-580DFEAD3C9E@.microsoft.com...
> typically what I've done on other servers is have the db backup run at
> 3:00
> Am and the tyransaction backup at 3:15 Am. Its exceptable for our
> purposes
> to backup at one point in time. I use enterpsrise manager through a
> maintenance plan to create a disk based backup and then backup the backup
> directory to tape. If we had a failure all I would need to restore would
> be
> the db backup and then the transaction log backup which would contain all
> the
> changes since the full backup or is it since the last transaction backup?
> Does this sound right?
>
Not exactly. You really want to be doing transaction backups throughout the
day.
i.e. schedule transaction backups to run say every 15 minutes throughout the
day.
If you completely lose your server, you can restore the DB to the state it
was 15 minutes previously by restoring the full backup (with NORECOVERY
explicitely used) and then each subsequent transaction backup (also with
NORECOVERY).
At the very end you can either restore with recovery and have a functional
database, or if possibly apply the "tail of the log" from the now dead
(assuming you could at least get the log) server.
In this way it's possible in some cases to recover a database to the moment
of failure.

Sunday, February 12, 2012

Backup

I've recently taken over our comapnies SQL servers. I'm trying to go through
the way my predecessor had things done. I came across two questions
regarding the maintenance plans he had set up to schedule backups through the
enterprise manager.
1) Can you backup all databses in one plan both system and user provided
they are of similar type simple or full
2) When I scheduled the backups how far apart should the BAK and TRN backups
be apart.
They currently have weird scheduled times ex. 11:00 PM for BAK and TRN 1:00
Daily, 1:00 AM for BAK Monday through Saturday, TRN not backed up, BAK 2:00
AM Monday through Saturday, TRN 12:00 AM Monday through Saturday.
Also when these backups run do they interfere with accessing the Database.First, when in process, a backup will have a small but noticeable impact
upon server performance. (It is relative to CPU/Memory, etc.) Under normal
circumstances, user rarely notice.
Backup plans should be carefully considered based upon need: How much data
is new or changed, and how long can you afford to be offline in case of a
system failure and need to restore.
Look in SQL Server Books Online for the topic "Backing Up and Restoring
Databases'. That will get you started down the path of better understanding
how to balance need vs. capability.
System databases: Usually these are not subject to much daily change
activity, and don't require frequent backups. Master is critical and must be
backed up immediately after any changes to database schema, users,
permissions, etc. Never bother with backing up TempDb. MSDB needs to be
backed up when you create or change any scheduled jobs, add 'operators', or
'alerts'. (Maintenance Plans are scheduled 'jobs'.)
User databases: Again, judge the frequency of new and changed data, and
balance with the risk of loss. In some situations, such as databases used
for reporting, the data is relatively static and doesn't require regular
backups. Other needs include high frequency input with little room for
potential loss. A common schedule for high frequency online databases would
be weekly (or nightly) FULL backups, with hourly Transaction Log backups.
After you do some reading and gather your business requirements, you will be
better prepared to make a schedule that works best for your organization.
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
You can't help someone get up a hill without getting a little closer to the
top yourself.
- H. Norman Schwarzkopf
"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:A4C1032D-BE35-4F85-A863-EA2DDF856CF6@.microsoft.com...
> I've recently taken over our comapnies SQL servers. I'm trying to go
> through
> the way my predecessor had things done. I came across two questions
> regarding the maintenance plans he had set up to schedule backups through
> the
> enterprise manager.
> 1) Can you backup all databses in one plan both system and user provided
> they are of similar type simple or full
> 2) When I scheduled the backups how far apart should the BAK and TRN
> backups
> be apart.
> They currently have weird scheduled times ex. 11:00 PM for BAK and TRN
> 1:00
> Daily, 1:00 AM for BAK Monday through Saturday, TRN not backed up, BAK
> 2:00
> AM Monday through Saturday, TRN 12:00 AM Monday through Saturday.
> Also when these backups run do they interfere with accessing the Database.|||I think Arnie covered most, but just to add one little thing:
> 1) Can you backup all databses in one plan both system and user provided
> they are of similar type simple or full
You can definitely have the same plan for the db backup part. But not for the log backup part, since
you cannot do log backup of the master database. You can do log backup of msdb, but 2000 has this
weird behavior of setting msdb to simple each time Agent starts (which you can handle if you do wish
to log backup msdb).
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:A4C1032D-BE35-4F85-A863-EA2DDF856CF6@.microsoft.com...
> I've recently taken over our comapnies SQL servers. I'm trying to go through
> the way my predecessor had things done. I came across two questions
> regarding the maintenance plans he had set up to schedule backups through the
> enterprise manager.
> 1) Can you backup all databses in one plan both system and user provided
> they are of similar type simple or full
> 2) When I scheduled the backups how far apart should the BAK and TRN backups
> be apart.
> They currently have weird scheduled times ex. 11:00 PM for BAK and TRN 1:00
> Daily, 1:00 AM for BAK Monday through Saturday, TRN not backed up, BAK 2:00
> AM Monday through Saturday, TRN 12:00 AM Monday through Saturday.
> Also when these backups run do they interfere with accessing the Database.|||> We've established its exceptable to just do One backup at a point in time
> lets say 3:00 Am every night. How soon after the BAK backup should I have the
> trn backup run?
I usually consider the frequency for log backups instead. Every 10 minutes? Every hour? This is of
course not my decision, it is the system owner's decision. Say you only want to do one log backup
each day (to enable point in time restore, for instance), then it doesn't matter much when you do
it...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:F9E2C858-B650-4588-B1BF-6D88D81D50D9@.microsoft.com...
> What I usually do is have a Plan for all the simple db and one for all the
> full backups.
> We've established its exceptable to just do One backup at a point in time
> lets say 3:00 Am every night. How soon after the BAK backup should I have the
> trn backup run?
> "Tibor Karaszi" wrote:
>> I think Arnie covered most, but just to add one little thing:
>> > 1) Can you backup all databses in one plan both system and user provided
>> > they are of similar type simple or full
>> You can definitely have the same plan for the db backup part. But not for the log backup part,
>> since
>> you cannot do log backup of the master database. You can do log backup of msdb, but 2000 has this
>> weird behavior of setting msdb to simple each time Agent starts (which you can handle if you do
>> wish
>> to log backup msdb).
>> --
>> Tibor Karaszi, SQL Server MVP
>> http://www.karaszi.com/sqlserver/default.asp
>> http://www.solidqualitylearning.com/
>>
>> "George Schneider" <georgedschneider@.news.postalias> wrote in message
>> news:A4C1032D-BE35-4F85-A863-EA2DDF856CF6@.microsoft.com...
>> > I've recently taken over our comapnies SQL servers. I'm trying to go through
>> > the way my predecessor had things done. I came across two questions
>> > regarding the maintenance plans he had set up to schedule backups through the
>> > enterprise manager.
>> >
>> > 1) Can you backup all databses in one plan both system and user provided
>> > they are of similar type simple or full
>> > 2) When I scheduled the backups how far apart should the BAK and TRN backups
>> > be apart.
>> >
>> > They currently have weird scheduled times ex. 11:00 PM for BAK and TRN 1:00
>> > Daily, 1:00 AM for BAK Monday through Saturday, TRN not backed up, BAK 2:00
>> > AM Monday through Saturday, TRN 12:00 AM Monday through Saturday.
>> >
>> > Also when these backups run do they interfere with accessing the Database.
>>|||George Schneider wrote:
> I guess I'm having a little trouble understanding the purpose of the
> transaction log backups. A typically backup schedule for our databse would
> be a full at 1:00 AM and the trans backup at 2:00 AM. Would exactly is the
> function of trans backups?
>
Think of the transaction log as a sort of journal. In that journal is a
record of every change that is made to your database. When you run a
full backup, you're saving a "snapshot" of the database as it exists at
that point in time, at 1:00am. For the next 24 hours, changes are being
made to your database. The transaction log is recording those changes.
If you suffer a drive failure, or some other catastrophic loss, you
likely are going to have to restore from the last full backup, losing
those 24 hours of changes.
If you're taking regular backups of the transaction log, you can restore
the last full backup, THEN restore, or "playback", the entries in your
transaction log, thus reproducing the changes that were made to your
database.
Tracy McKibben
MCDBA
http://www.realsqlguy.com|||typically what I've done on other servers is have the db backup run at 3:00
Am and the tyransaction backup at 3:15 Am. Its exceptable for our purposes
to backup at one point in time. I use enterpsrise manager through a
maintenance plan to create a disk based backup and then backup the backup
directory to tape. If we had a failure all I would need to restore would be
the db backup and then the transaction log backup which would contain all the
changes since the full backup or is it since the last transaction backup?
Does this sound right?
"Tracy McKibben" wrote:
> George Schneider wrote:
> > I guess I'm having a little trouble understanding the purpose of the
> > transaction log backups. A typically backup schedule for our databse would
> > be a full at 1:00 AM and the trans backup at 2:00 AM. Would exactly is the
> > function of trans backups?
> >
> Think of the transaction log as a sort of journal. In that journal is a
> record of every change that is made to your database. When you run a
> full backup, you're saving a "snapshot" of the database as it exists at
> that point in time, at 1:00am. For the next 24 hours, changes are being
> made to your database. The transaction log is recording those changes.
> If you suffer a drive failure, or some other catastrophic loss, you
> likely are going to have to restore from the last full backup, losing
> those 24 hours of changes.
> If you're taking regular backups of the transaction log, you can restore
> the last full backup, THEN restore, or "playback", the entries in your
> transaction log, thus reproducing the changes that were made to your
> database.
>
> --
> Tracy McKibben
> MCDBA
> http://www.realsqlguy.com
>|||What if something disastrous happens at 02:50, in a way so you cannot perform a transaction log
backup at that time. You have now lost one day worth of information. This is what you have to ask
yourself: Is this acceptable?
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:65BEB0C9-1499-4243-AAB0-580DFEAD3C9E@.microsoft.com...
> typically what I've done on other servers is have the db backup run at 3:00
> Am and the tyransaction backup at 3:15 Am. Its exceptable for our purposes
> to backup at one point in time. I use enterpsrise manager through a
> maintenance plan to create a disk based backup and then backup the backup
> directory to tape. If we had a failure all I would need to restore would be
> the db backup and then the transaction log backup which would contain all the
> changes since the full backup or is it since the last transaction backup?
> Does this sound right?
> "Tracy McKibben" wrote:
>> George Schneider wrote:
>> > I guess I'm having a little trouble understanding the purpose of the
>> > transaction log backups. A typically backup schedule for our databse would
>> > be a full at 1:00 AM and the trans backup at 2:00 AM. Would exactly is the
>> > function of trans backups?
>> >
>> Think of the transaction log as a sort of journal. In that journal is a
>> record of every change that is made to your database. When you run a
>> full backup, you're saving a "snapshot" of the database as it exists at
>> that point in time, at 1:00am. For the next 24 hours, changes are being
>> made to your database. The transaction log is recording those changes.
>> If you suffer a drive failure, or some other catastrophic loss, you
>> likely are going to have to restore from the last full backup, losing
>> those 24 hours of changes.
>> If you're taking regular backups of the transaction log, you can restore
>> the last full backup, THEN restore, or "playback", the entries in your
>> transaction log, thus reproducing the changes that were made to your
>> database.
>>
>> --
>> Tracy McKibben
>> MCDBA
>> http://www.realsqlguy.com|||"George Schneider" <georgedschneider@.news.postalias> wrote in message
news:65BEB0C9-1499-4243-AAB0-580DFEAD3C9E@.microsoft.com...
> typically what I've done on other servers is have the db backup run at
> 3:00
> Am and the tyransaction backup at 3:15 Am. Its exceptable for our
> purposes
> to backup at one point in time. I use enterpsrise manager through a
> maintenance plan to create a disk based backup and then backup the backup
> directory to tape. If we had a failure all I would need to restore would
> be
> the db backup and then the transaction log backup which would contain all
> the
> changes since the full backup or is it since the last transaction backup?
> Does this sound right?
>
Not exactly. You really want to be doing transaction backups throughout the
day.
i.e. schedule transaction backups to run say every 15 minutes throughout the
day.
If you completely lose your server, you can restore the DB to the state it
was 15 minutes previously by restoring the full backup (with NORECOVERY
explicitely used) and then each subsequent transaction backup (also with
NORECOVERY).
At the very end you can either restore with recovery and have a functional
database, or if possibly apply the "tail of the log" from the now dead
(assuming you could at least get the log) server.
In this way it's possible in some cases to recover a database to the moment
of failure.