Wednesday, March 21, 2012
Help with Restore
I inherited a database that was not maintained correctly. I have learned
that the previous DBA had not created any SQL backup procedures, so they've
been running for at least 6 months with no safety net. Of course, some data
has been deleted by users and I need to find a way to restore the data as
they are screaming bloody murder.
I do, however, have backups of the data and log files which are from the
regular server backup. Can I create a new database of the correct name on
another server, and then restore those files to that database? Or is it
expecting the server to have the same name as before?
Any and all suggestions are appreciated.
Thanks,
George
George
You definitely can restore a database to onother server.
If you don't have the same files path look at WITH MOVE option in the BOL.
"George Hutto" <yougott@.bekidding.com> wrote in message
news:urzyAmZxEHA.908@.TK2MSFTNGP11.phx.gbl...
> Folks,
> I inherited a database that was not maintained correctly. I have learned
> that the previous DBA had not created any SQL backup procedures, so
they've
> been running for at least 6 months with no safety net. Of course, some
data
> has been deleted by users and I need to find a way to restore the data as
> they are screaming bloody murder.
> I do, however, have backups of the data and log files which are from the
> regular server backup. Can I create a new database of the correct name on
> another server, and then restore those files to that database? Or is it
> expecting the server to have the same name as before?
> Any and all suggestions are appreciated.
> Thanks,
> George
>
|||Hi
Just to add, if SQL was shut down at the time of backup, you can use them,
otherwise you don't have anything as the files would have been in use.
Regards
Mike
"George Hutto" wrote:
> Folks,
> I inherited a database that was not maintained correctly. I have learned
> that the previous DBA had not created any SQL backup procedures, so they've
> been running for at least 6 months with no safety net. Of course, some data
> has been deleted by users and I need to find a way to restore the data as
> they are screaming bloody murder.
> I do, however, have backups of the data and log files which are from the
> regular server backup. Can I create a new database of the correct name on
> another server, and then restore those files to that database? Or is it
> expecting the server to have the same name as before?
> Any and all suggestions are appreciated.
> Thanks,
> George
>
>
|||Uri,
I don't have .BAK files, what I have are copies of the .DAT and .LOG files
from a particular date. I don't know if we are both talking about the same
sort of scenario.
George
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%23UXz6pZxEHA.1524@.TK2MSFTNGP09.phx.gbl...[vbcol=seagreen]
> George
> You definitely can restore a database to onother server.
> If you don't have the same files path look at WITH MOVE option in the BOL.
>
>
> "George Hutto" <yougott@.bekidding.com> wrote in message
> news:urzyAmZxEHA.908@.TK2MSFTNGP11.phx.gbl...
learned[vbcol=seagreen]
> they've
> data
as[vbcol=seagreen]
on
>
|||Really Mike? That will make things darned difficult.
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:C563452E-54A2-46F6-9E13-7DFE3332B7E1@.microsoft.com...[vbcol=seagreen]
> Hi
> Just to add, if SQL was shut down at the time of backup, you can use them,
> otherwise you don't have anything as the files would have been in use.
> Regards
> Mike
> "George Hutto" wrote:
learned[vbcol=seagreen]
they've[vbcol=seagreen]
data[vbcol=seagreen]
as[vbcol=seagreen]
on[vbcol=seagreen]
Help with Restore
I inherited a database that was not maintained correctly. I have learned
that the previous DBA had not created any SQL backup procedures, so they've
been running for at least 6 months with no safety net. Of course, some data
has been deleted by users and I need to find a way to restore the data as
they are screaming bloody murder.
I do, however, have backups of the data and log files which are from the
regular server backup. Can I create a new database of the correct name on
another server, and then restore those files to that database? Or is it
expecting the server to have the same name as before?
Any and all suggestions are appreciated.
Thanks,
GeorgeGeorge
You definitely can restore a database to onother server.
If you don't have the same files path look at WITH MOVE option in the BOL.
"George Hutto" <yougott@.bekidding.com> wrote in message
news:urzyAmZxEHA.908@.TK2MSFTNGP11.phx.gbl...
> Folks,
> I inherited a database that was not maintained correctly. I have learned
> that the previous DBA had not created any SQL backup procedures, so
they've
> been running for at least 6 months with no safety net. Of course, some
data
> has been deleted by users and I need to find a way to restore the data as
> they are screaming bloody murder.
> I do, however, have backups of the data and log files which are from the
> regular server backup. Can I create a new database of the correct name on
> another server, and then restore those files to that database? Or is it
> expecting the server to have the same name as before?
> Any and all suggestions are appreciated.
> Thanks,
> George
>|||Hi
Just to add, if SQL was shut down at the time of backup, you can use them,
otherwise you don't have anything as the files would have been in use.
Regards
Mike
"George Hutto" wrote:
> Folks,
> I inherited a database that was not maintained correctly. I have learned
> that the previous DBA had not created any SQL backup procedures, so they've
> been running for at least 6 months with no safety net. Of course, some data
> has been deleted by users and I need to find a way to restore the data as
> they are screaming bloody murder.
> I do, however, have backups of the data and log files which are from the
> regular server backup. Can I create a new database of the correct name on
> another server, and then restore those files to that database? Or is it
> expecting the server to have the same name as before?
> Any and all suggestions are appreciated.
> Thanks,
> George
>
>|||Uri,
I don't have .BAK files, what I have are copies of the .DAT and .LOG files
from a particular date. I don't know if we are both talking about the same
sort of scenario.
George
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%23UXz6pZxEHA.1524@.TK2MSFTNGP09.phx.gbl...
> George
> You definitely can restore a database to onother server.
> If you don't have the same files path look at WITH MOVE option in the BOL.
>
>
> "George Hutto" <yougott@.bekidding.com> wrote in message
> news:urzyAmZxEHA.908@.TK2MSFTNGP11.phx.gbl...
> > Folks,
> >
> > I inherited a database that was not maintained correctly. I have
learned
> > that the previous DBA had not created any SQL backup procedures, so
> they've
> > been running for at least 6 months with no safety net. Of course, some
> data
> > has been deleted by users and I need to find a way to restore the data
as
> > they are screaming bloody murder.
> >
> > I do, however, have backups of the data and log files which are from the
> > regular server backup. Can I create a new database of the correct name
on
> > another server, and then restore those files to that database? Or is it
> > expecting the server to have the same name as before?
> >
> > Any and all suggestions are appreciated.
> >
> > Thanks,
> >
> > George
> >
> >
>|||Really Mike? That will make things darned difficult.
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:C563452E-54A2-46F6-9E13-7DFE3332B7E1@.microsoft.com...
> Hi
> Just to add, if SQL was shut down at the time of backup, you can use them,
> otherwise you don't have anything as the files would have been in use.
> Regards
> Mike
> "George Hutto" wrote:
> > Folks,
> >
> > I inherited a database that was not maintained correctly. I have
learned
> > that the previous DBA had not created any SQL backup procedures, so
they've
> > been running for at least 6 months with no safety net. Of course, some
data
> > has been deleted by users and I need to find a way to restore the data
as
> > they are screaming bloody murder.
> >
> > I do, however, have backups of the data and log files which are from the
> > regular server backup. Can I create a new database of the correct name
on
> > another server, and then restore those files to that database? Or is it
> > expecting the server to have the same name as before?
> >
> > Any and all suggestions are appreciated.
> >
> > Thanks,
> >
> > George
> >
> >
> >
Help with Restore
I inherited a database that was not maintained correctly. I have learned
that the previous DBA had not created any SQL backup procedures, so they've
been running for at least 6 months with no safety net. Of course, some data
has been deleted by users and I need to find a way to restore the data as
they are screaming bloody murder.
I do, however, have backups of the data and log files which are from the
regular server backup. Can I create a new database of the correct name on
another server, and then restore those files to that database? Or is it
expecting the server to have the same name as before?
Any and all suggestions are appreciated.
Thanks,
GeorgeGeorge
You definitely can restore a database to onother server.
If you don't have the same files path look at WITH MOVE option in the BOL.
"George Hutto" <yougott@.bekidding.com> wrote in message
news:urzyAmZxEHA.908@.TK2MSFTNGP11.phx.gbl...
> Folks,
> I inherited a database that was not maintained correctly. I have learned
> that the previous DBA had not created any SQL backup procedures, so
they've
> been running for at least 6 months with no safety net. Of course, some
data
> has been deleted by users and I need to find a way to restore the data as
> they are screaming bloody murder.
> I do, however, have backups of the data and log files which are from the
> regular server backup. Can I create a new database of the correct name on
> another server, and then restore those files to that database? Or is it
> expecting the server to have the same name as before?
> Any and all suggestions are appreciated.
> Thanks,
> George
>|||Hi
Just to add, if SQL was shut down at the time of backup, you can use them,
otherwise you don't have anything as the files would have been in use.
Regards
Mike
"George Hutto" wrote:
> Folks,
> I inherited a database that was not maintained correctly. I have learned
> that the previous DBA had not created any SQL backup procedures, so they'v
e
> been running for at least 6 months with no safety net. Of course, some da
ta
> has been deleted by users and I need to find a way to restore the data as
> they are screaming bloody murder.
> I do, however, have backups of the data and log files which are from the
> regular server backup. Can I create a new database of the correct name on
> another server, and then restore those files to that database? Or is it
> expecting the server to have the same name as before?
> Any and all suggestions are appreciated.
> Thanks,
> George
>
>|||Uri,
I don't have .BAK files, what I have are copies of the .DAT and .LOG files
from a particular date. I don't know if we are both talking about the same
sort of scenario.
George
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%23UXz6pZxEHA.1524@.TK2MSFTNGP09.phx.gbl...
> George
> You definitely can restore a database to onother server.
> If you don't have the same files path look at WITH MOVE option in the BOL.
>
>
> "George Hutto" <yougott@.bekidding.com> wrote in message
> news:urzyAmZxEHA.908@.TK2MSFTNGP11.phx.gbl...
learned[vbcol=seagreen]
> they've
> data
as[vbcol=seagreen]
on[vbcol=seagreen]
>|||Really Mike? That will make things darned difficult.
"Mike Epprecht (SQL MVP)" <mike@.epprecht.net> wrote in message
news:C563452E-54A2-46F6-9E13-7DFE3332B7E1@.microsoft.com...[vbcol=seagreen]
> Hi
> Just to add, if SQL was shut down at the time of backup, you can use them,
> otherwise you don't have anything as the files would have been in use.
> Regards
> Mike
> "George Hutto" wrote:
>
learned[vbcol=seagreen]
they've[vbcol=seagreen]
data[vbcol=seagreen]
as[vbcol=seagreen]
on[vbcol=seagreen]
Friday, February 24, 2012
Help with mail that send mail when database bakcup fails
Hello
I have got a script which gives the mail to the dba mail box when database backup fails.
In the script I want to make a change so that I get the particular database name , on what ever database i implement.
Can you tell me some suggestions.
The script I am using is :
use master
go
alter PROCEDURE dbo.SendMail
@.to VARCHAR(255),
@.subject VARCHAR(255),
@.message VARCHAR(8000)
AS
BEGIN
SET NOCOUNT ON;
DECLARE
@.rv INT,
@.from VARCHAR(64),
@.server VARCHAR(255);
SELECT
@.from = 'testsql2000@.is.depaul.edu',
@.server = 'smtp.depaul.edu';
select @.message = @.message + char(13) + Char(13) + @.@.servername + '-'+ db_name()+ '-' + 'Backup Status Failed' + Char(13)
EXEC @.rv = dbo.xp_smtp_sendmail
@.to = @.to,
@.from = @.from,
@.message = @.message,
@.subject = @.subject,
@.server = @.server;
END
GO
After the above script is run the following should be given in the 2nd step when
the backup jobs are scheduled
exec master.dbo.sendmail
@.to = 'dvaddi@.depaul.edu',
@.subject =' Test sqlserver 2000',
@.message = '' ;
Thanks
Sorry I don′t understand you issue, what do you want to achieve ?HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
|||
I want to get the database name also in the mail I receive along with the server name.
For example if I execute it on Test database in the mail I should get : Test server (servername) - Test (database name ) - Backup status.
and if I execute on Test2000 database in the mail I should get : Testserver(servername ) - Test2000(database name)- bakcupstatus.
I am able to get the servername and the backup status. But for the database name I am getting just 'master'
Thanks
|||When I have to that, I always script up the job which I prepared for a particular database and prepares creation statements for them. So the script which is produced if you script the job from SQL Agent can be tweaked to take a variable which is substituted during the creation of the job, something like:
DECLARE DatabaseName VARCHAR(200)
sp_add_jobstep param1, @.Command = Here goes your command to execute with the appropiate statements including the param to be substitued with the databasename
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
|||There are three different commands in execute sql mail:
exec sys.xp_startmail
exec sys.xp_sendmail {[@.recipients =] 'recipients [;...n]'}
[,[@.message =] 'message']
[,[@.query =] 'query']
[,[@.attachments =] 'attachments [;...n]']
[,[@.copy_recipients =] 'copy_recipients [;...n]'
[,[@.blind_copy_recipients =] 'blind_copy_recipients [;...n]'
[,[@.subject =] 'subject']
[,[@.type =] 'type']
[,[@.attach_results =] 'attach_value']
[,[@.no_output =] 'output_value']
[,[@.no_header =] 'header_value']
[,[@.width =] width]
[,[@.separator =] 'separator']
[,[@.echo_error =] 'echo_value']
[,[@.set_user =] 'user']
[,[@.dbuse =] 'database']
exec sys.xp_stopmail
Help with mail that send mail when database bakcup fails
Hello
I have got a script which gives the mail to the dba mail box when database backup fails.
In the script I want to make a change so that I get the particular database name , on what ever database i implement.
Can you tell me some suggestions.
The script I am using is :
use master
go
alter PROCEDURE dbo.SendMail
@.to VARCHAR(255),
@.subject VARCHAR(255),
@.message VARCHAR(8000)
AS
BEGIN
SET NOCOUNT ON;
DECLARE
@.rv INT,
@.from VARCHAR(64),
@.server VARCHAR(255);
SELECT
@.from = 'testsql2000@.is.depaul.edu',
@.server = 'smtp.depaul.edu';
select @.message = @.message + char(13) + Char(13) + @.@.servername + '-'+ db_name()+ '-' + 'Backup Status Failed' + Char(13)
EXEC @.rv = dbo.xp_smtp_sendmail
@.to = @.to,
@.from = @.from,
@.message = @.message,
@.subject = @.subject,
@.server = @.server;
END
GO
After the above script is run the following should be given in the 2nd step when
the backup jobs are scheduled
exec master.dbo.sendmail
@.to = 'dvaddi@.depaul.edu',
@.subject =' Test sqlserver 2000',
@.message = '' ;
Thanks
Sorry I don′t understand you issue, what do you want to achieve ?HTH, Jens Suessmeyer.
http://www.sqlserver2005.de|||
I want to get the database name also in the mail I receive along with the server name.
For example if I execute it on Test database in the mail I should get : Test server (servername) - Test (database name ) - Backup status.
and if I execute on Test2000 database in the mail I should get : Testserver(servername ) - Test2000(database name)- bakcupstatus.
I am able to get the servername and the backup status. But for the database name I am getting just 'master'
Thanks
|||When I have to that, I always script up the job which I prepared for a particular database and prepares creation statements for them. So the script which is produced if you script the job from SQL Agent can be tweaked to take a variable which is substituted during the creation of the job, something like:
DECLARE DatabaseName VARCHAR(200)
sp_add_jobstep param1, @.Command = Here goes your command to execute with the appropiate statements including the param to be substitued with the databasename
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
|||There are three different commands in execute sql mail:
exec sys.xp_startmail
exec sys.xp_sendmail {[@.recipients =] 'recipients [;...n]'}
[,[@.message =] 'message']
[,[@.query =] 'query']
[,[@.attachments =] 'attachments [;...n]']
[,[@.copy_recipients =] 'copy_recipients [;...n]'
[,[@.blind_copy_recipients =] 'blind_copy_recipients [;...n]'
[,[@.subject =] 'subject']
[,[@.type =] 'type']
[,[@.attach_results =] 'attach_value']
[,[@.no_output =] 'output_value']
[,[@.no_header =] 'header_value']
[,[@.width =] width]
[,[@.separator =] 'separator']
[,[@.echo_error =] 'echo_value']
[,[@.set_user =] 'user']
[,[@.dbuse =] 'database']
exec sys.xp_stopmail
Help with mail that send mail when database bakcup fails
Hello
I have got a script which gives the mail to the dba mail box when database backup fails.
In the script I want to make a change so that I get the particular database name , on what ever database i implement.
Can you tell me some suggestions.
The script I am using is :
use master
go
alter PROCEDURE dbo.SendMail
@.to VARCHAR(255),
@.subject VARCHAR(255),
@.message VARCHAR(8000)
AS
BEGIN
SET NOCOUNT ON;
DECLARE
@.rv INT,
@.from VARCHAR(64),
@.server VARCHAR(255);
SELECT
@.from = 'testsql2000@.is.depaul.edu',
@.server = 'smtp.depaul.edu';
select @.message = @.message + char(13) + Char(13) + @.@.servername + '-'+ db_name()+ '-' + 'Backup Status Failed' + Char(13)
EXEC @.rv = dbo.xp_smtp_sendmail
@.to = @.to,
@.from = @.from,
@.message = @.message,
@.subject = @.subject,
@.server = @.server;
END
GO
After the above script is run the following should be given in the 2nd step when
the backup jobs are scheduled
exec master.dbo.sendmail
@.to = 'dvaddi@.depaul.edu',
@.subject =' Test sqlserver 2000',
@.message = '' ;
Thanks
Sorry I don′t understand you issue, what do you want to achieve ?HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
|||
I want to get the database name also in the mail I receive along with the server name.
For example if I execute it on Test database in the mail I should get : Test server (servername) - Test (database name ) - Backup status.
and if I execute on Test2000 database in the mail I should get : Testserver(servername ) - Test2000(database name)- bakcupstatus.
I am able to get the servername and the backup status. But for the database name I am getting just 'master'
Thanks
|||When I have to that, I always script up the job which I prepared for a particular database and prepares creation statements for them. So the script which is produced if you script the job from SQL Agent can be tweaked to take a variable which is substituted during the creation of the job, something like:
DECLARE DatabaseName VARCHAR(200)
sp_add_jobstep param1, @.Command = Here goes your command to execute with the appropiate statements including the param to be substitued with the databasename
HTH, Jens Suessmeyer.
http://www.sqlserver2005.de
|||There are three different commands in execute sql mail:
exec sys.xp_startmail
exec sys.xp_sendmail {[@.recipients =] 'recipients [;...n]'}
[,[@.message =] 'message']
[,[@.query =] 'query']
[,[@.attachments =] 'attachments [;...n]']
[,[@.copy_recipients =] 'copy_recipients [;...n]'
[,[@.blind_copy_recipients =] 'blind_copy_recipients [;...n]'
[,[@.subject =] 'subject']
[,[@.type =] 'type']
[,[@.attach_results =] 'attach_value']
[,[@.no_output =] 'output_value']
[,[@.no_header =] 'header_value']
[,[@.width =] width]
[,[@.separator =] 'separator']
[,[@.echo_error =] 'echo_value']
[,[@.set_user =] 'user']
[,[@.dbuse =] 'database']
exec sys.xp_stopmail