Hi all,
I have a database I maintain that has grown quite large. The part of it
I am interested in, is one paticular table that logs the history of
certain high volume "events". I have events back to 2002, and the
database is almost 3 Gigs. I rarely need to query more than 6 months
worth. Here is what I would like to do.
I'd like to split the database, and create an archive database. I want
to move everything before 2006 to this new database. Now, I know I can
do a complete backup, and then delete the stuff I don't need, but I
wanted to know if there is a way to import just the dates I need from
the current database. Of course, there is a timedate field to key off
of.
I am using the GUI to do this in Enterprise Manager SQL 2000, Windows
2003 Server.
Thanks in advance.Hi there
There are several ways to do this. You can try to use DTS to move the data
over. Or you can use query analyzer. If you can use Query Analyzer, you can
actually use a query something like:
SELECT *
INTO [ArchiveDBName].dbo.[TableName]
FROM dbo.[OriginalDBName]
WHERE [DateStamp] < '1/1/2006'
And to delete the records from the original table:
DELETE FROM dbo.[OriginalDBName]
WHERE [DateStamp] < '1/1/2006'
However, it was not clear from you post if you have access to Query Analyzer
.
Lucas
"mattdaddym@.gmail.com" wrote:
> Hi all,
> I have a database I maintain that has grown quite large. The part of it
> I am interested in, is one paticular table that logs the history of
> certain high volume "events". I have events back to 2002, and the
> database is almost 3 Gigs. I rarely need to query more than 6 months
> worth. Here is what I would like to do.
> I'd like to split the database, and create an archive database. I want
> to move everything before 2006 to this new database. Now, I know I can
> do a complete backup, and then delete the stuff I don't need, but I
> wanted to know if there is a way to import just the dates I need from
> the current database. Of course, there is a timedate field to key off
> of.
> I am using the GUI to do this in Enterprise Manager SQL 2000, Windows
> 2003 Server.
> Thanks in advance.
>|||I do have access to query analyzer. I was hoping for a way to do it in
the GUI since it creats the tables automatically when you do an import.
I don't know for sure, but I will assume if I use your command that I
will need to set the table up first. Not a big deal, though. I guess
I'm just being lazy. Thank you!
Lucas Kartawidjaja wrote:[vbcol=seagreen]
> Hi there
> There are several ways to do this. You can try to use DTS to move the data
> over. Or you can use query analyzer. If you can use Query Analyzer, you ca
n
> actually use a query something like:
> SELECT *
> INTO [ArchiveDBName].dbo.[TableName]
> FROM dbo.[OriginalDBName]
> WHERE [DateStamp] < '1/1/2006'
> And to delete the records from the original table:
> DELETE FROM dbo.[OriginalDBName]
> WHERE [DateStamp] < '1/1/2006'
> However, it was not clear from you post if you have access to Query Analyz
er.
> Lucas
>
> "mattdaddym@.gmail.com" wrote:
>|||Actually with the SELECT INTO statement the beauty of it is that you don't
need to create the table first. SELECT INTO will create it for you the table
structure will be the same as the original table.
Lucas
"mattdaddym@.gmail.com" wrote:
> I do have access to query analyzer. I was hoping for a way to do it in
> the GUI since it creats the tables automatically when you do an import.
> I don't know for sure, but I will assume if I use your command that I
> will need to set the table up first. Not a big deal, though. I guess
> I'm just being lazy. Thank you!
> Lucas Kartawidjaja wrote:
>|||That is great. Thank you!
Lucas Kartawidjaja wrote:[vbcol=seagreen]
> Actually with the SELECT INTO statement the beauty of it is that you don't
> need to create the table first. SELECT INTO will create it for you the tab
le
> structure will be the same as the original table.
> Lucas
> "mattdaddym@.gmail.com" wrote:
>
Showing posts with label logs. Show all posts
Showing posts with label logs. Show all posts
Thursday, March 29, 2012
database import question
Hi all,
I have a database I maintain that has grown quite large. The part of it
I am interested in, is one paticular table that logs the history of
certain high volume "events". I have events back to 2002, and the
database is almost 3 Gigs. I rarely need to query more than 6 months
worth. Here is what I would like to do.
I'd like to split the database, and create an archive database. I want
to move everything before 2006 to this new database. Now, I know I can
do a complete backup, and then delete the stuff I don't need, but I
wanted to know if there is a way to import just the dates I need from
the current database. Of course, there is a timedate field to key off
of.
I am using the GUI to do this in Enterprise Manager SQL 2000, Windows
2003 Server.
Thanks in advance.Hi there
There are several ways to do this. You can try to use DTS to move the data
over. Or you can use query analyzer. If you can use Query Analyzer, you can
actually use a query something like:
SELECT *
INTO [ArchiveDBName].dbo.[TableName]
FROM dbo.[OriginalDBName]
WHERE [DateStamp] < '1/1/2006'
And to delete the records from the original table:
DELETE FROM dbo.[OriginalDBName]
WHERE [DateStamp] < '1/1/2006'
However, it was not clear from you post if you have access to Query Analyzer.
Lucas
"mattdaddym@.gmail.com" wrote:
> Hi all,
> I have a database I maintain that has grown quite large. The part of it
> I am interested in, is one paticular table that logs the history of
> certain high volume "events". I have events back to 2002, and the
> database is almost 3 Gigs. I rarely need to query more than 6 months
> worth. Here is what I would like to do.
> I'd like to split the database, and create an archive database. I want
> to move everything before 2006 to this new database. Now, I know I can
> do a complete backup, and then delete the stuff I don't need, but I
> wanted to know if there is a way to import just the dates I need from
> the current database. Of course, there is a timedate field to key off
> of.
> I am using the GUI to do this in Enterprise Manager SQL 2000, Windows
> 2003 Server.
> Thanks in advance.
>|||I do have access to query analyzer. I was hoping for a way to do it in
the GUI since it creats the tables automatically when you do an import.
I don't know for sure, but I will assume if I use your command that I
will need to set the table up first. Not a big deal, though. I guess
I'm just being lazy. Thank you!
Lucas Kartawidjaja wrote:
> Hi there
> There are several ways to do this. You can try to use DTS to move the data
> over. Or you can use query analyzer. If you can use Query Analyzer, you can
> actually use a query something like:
> SELECT *
> INTO [ArchiveDBName].dbo.[TableName]
> FROM dbo.[OriginalDBName]
> WHERE [DateStamp] < '1/1/2006'
> And to delete the records from the original table:
> DELETE FROM dbo.[OriginalDBName]
> WHERE [DateStamp] < '1/1/2006'
> However, it was not clear from you post if you have access to Query Analyzer.
> Lucas
>
> "mattdaddym@.gmail.com" wrote:
> > Hi all,
> >
> > I have a database I maintain that has grown quite large. The part of it
> > I am interested in, is one paticular table that logs the history of
> > certain high volume "events". I have events back to 2002, and the
> > database is almost 3 Gigs. I rarely need to query more than 6 months
> > worth. Here is what I would like to do.
> >
> > I'd like to split the database, and create an archive database. I want
> > to move everything before 2006 to this new database. Now, I know I can
> > do a complete backup, and then delete the stuff I don't need, but I
> > wanted to know if there is a way to import just the dates I need from
> > the current database. Of course, there is a timedate field to key off
> > of.
> >
> > I am using the GUI to do this in Enterprise Manager SQL 2000, Windows
> > 2003 Server.
> >
> > Thanks in advance.
> >
> >|||Actually with the SELECT INTO statement the beauty of it is that you don't
need to create the table first. SELECT INTO will create it for you the table
structure will be the same as the original table.
Lucas
"mattdaddym@.gmail.com" wrote:
> I do have access to query analyzer. I was hoping for a way to do it in
> the GUI since it creats the tables automatically when you do an import.
> I don't know for sure, but I will assume if I use your command that I
> will need to set the table up first. Not a big deal, though. I guess
> I'm just being lazy. Thank you!
> Lucas Kartawidjaja wrote:
> > Hi there
> >
> > There are several ways to do this. You can try to use DTS to move the data
> > over. Or you can use query analyzer. If you can use Query Analyzer, you can
> > actually use a query something like:
> >
> > SELECT *
> > INTO [ArchiveDBName].dbo.[TableName]
> > FROM dbo.[OriginalDBName]
> > WHERE [DateStamp] < '1/1/2006'
> >
> > And to delete the records from the original table:
> >
> > DELETE FROM dbo.[OriginalDBName]
> > WHERE [DateStamp] < '1/1/2006'
> >
> > However, it was not clear from you post if you have access to Query Analyzer.
> >
> > Lucas
> >
> >
> > "mattdaddym@.gmail.com" wrote:
> >
> > > Hi all,
> > >
> > > I have a database I maintain that has grown quite large. The part of it
> > > I am interested in, is one paticular table that logs the history of
> > > certain high volume "events". I have events back to 2002, and the
> > > database is almost 3 Gigs. I rarely need to query more than 6 months
> > > worth. Here is what I would like to do.
> > >
> > > I'd like to split the database, and create an archive database. I want
> > > to move everything before 2006 to this new database. Now, I know I can
> > > do a complete backup, and then delete the stuff I don't need, but I
> > > wanted to know if there is a way to import just the dates I need from
> > > the current database. Of course, there is a timedate field to key off
> > > of.
> > >
> > > I am using the GUI to do this in Enterprise Manager SQL 2000, Windows
> > > 2003 Server.
> > >
> > > Thanks in advance.
> > >
> > >
>|||That is great. Thank you!
Lucas Kartawidjaja wrote:
> Actually with the SELECT INTO statement the beauty of it is that you don't
> need to create the table first. SELECT INTO will create it for you the table
> structure will be the same as the original table.
> Lucas
> "mattdaddym@.gmail.com" wrote:
> > I do have access to query analyzer. I was hoping for a way to do it in
> > the GUI since it creats the tables automatically when you do an import.
> > I don't know for sure, but I will assume if I use your command that I
> > will need to set the table up first. Not a big deal, though. I guess
> > I'm just being lazy. Thank you!
> > Lucas Kartawidjaja wrote:
> > > Hi there
> > >
> > > There are several ways to do this. You can try to use DTS to move the data
> > > over. Or you can use query analyzer. If you can use Query Analyzer, you can
> > > actually use a query something like:
> > >
> > > SELECT *
> > > INTO [ArchiveDBName].dbo.[TableName]
> > > FROM dbo.[OriginalDBName]
> > > WHERE [DateStamp] < '1/1/2006'
> > >
> > > And to delete the records from the original table:
> > >
> > > DELETE FROM dbo.[OriginalDBName]
> > > WHERE [DateStamp] < '1/1/2006'
> > >
> > > However, it was not clear from you post if you have access to Query Analyzer.
> > >
> > > Lucas
> > >
> > >
> > > "mattdaddym@.gmail.com" wrote:
> > >
> > > > Hi all,
> > > >
> > > > I have a database I maintain that has grown quite large. The part of it
> > > > I am interested in, is one paticular table that logs the history of
> > > > certain high volume "events". I have events back to 2002, and the
> > > > database is almost 3 Gigs. I rarely need to query more than 6 months
> > > > worth. Here is what I would like to do.
> > > >
> > > > I'd like to split the database, and create an archive database. I want
> > > > to move everything before 2006 to this new database. Now, I know I can
> > > > do a complete backup, and then delete the stuff I don't need, but I
> > > > wanted to know if there is a way to import just the dates I need from
> > > > the current database. Of course, there is a timedate field to key off
> > > > of.
> > > >
> > > > I am using the GUI to do this in Enterprise Manager SQL 2000, Windows
> > > > 2003 Server.
> > > >
> > > > Thanks in advance.
> > > >
> > > >
> >
> >
I have a database I maintain that has grown quite large. The part of it
I am interested in, is one paticular table that logs the history of
certain high volume "events". I have events back to 2002, and the
database is almost 3 Gigs. I rarely need to query more than 6 months
worth. Here is what I would like to do.
I'd like to split the database, and create an archive database. I want
to move everything before 2006 to this new database. Now, I know I can
do a complete backup, and then delete the stuff I don't need, but I
wanted to know if there is a way to import just the dates I need from
the current database. Of course, there is a timedate field to key off
of.
I am using the GUI to do this in Enterprise Manager SQL 2000, Windows
2003 Server.
Thanks in advance.Hi there
There are several ways to do this. You can try to use DTS to move the data
over. Or you can use query analyzer. If you can use Query Analyzer, you can
actually use a query something like:
SELECT *
INTO [ArchiveDBName].dbo.[TableName]
FROM dbo.[OriginalDBName]
WHERE [DateStamp] < '1/1/2006'
And to delete the records from the original table:
DELETE FROM dbo.[OriginalDBName]
WHERE [DateStamp] < '1/1/2006'
However, it was not clear from you post if you have access to Query Analyzer.
Lucas
"mattdaddym@.gmail.com" wrote:
> Hi all,
> I have a database I maintain that has grown quite large. The part of it
> I am interested in, is one paticular table that logs the history of
> certain high volume "events". I have events back to 2002, and the
> database is almost 3 Gigs. I rarely need to query more than 6 months
> worth. Here is what I would like to do.
> I'd like to split the database, and create an archive database. I want
> to move everything before 2006 to this new database. Now, I know I can
> do a complete backup, and then delete the stuff I don't need, but I
> wanted to know if there is a way to import just the dates I need from
> the current database. Of course, there is a timedate field to key off
> of.
> I am using the GUI to do this in Enterprise Manager SQL 2000, Windows
> 2003 Server.
> Thanks in advance.
>|||I do have access to query analyzer. I was hoping for a way to do it in
the GUI since it creats the tables automatically when you do an import.
I don't know for sure, but I will assume if I use your command that I
will need to set the table up first. Not a big deal, though. I guess
I'm just being lazy. Thank you!
Lucas Kartawidjaja wrote:
> Hi there
> There are several ways to do this. You can try to use DTS to move the data
> over. Or you can use query analyzer. If you can use Query Analyzer, you can
> actually use a query something like:
> SELECT *
> INTO [ArchiveDBName].dbo.[TableName]
> FROM dbo.[OriginalDBName]
> WHERE [DateStamp] < '1/1/2006'
> And to delete the records from the original table:
> DELETE FROM dbo.[OriginalDBName]
> WHERE [DateStamp] < '1/1/2006'
> However, it was not clear from you post if you have access to Query Analyzer.
> Lucas
>
> "mattdaddym@.gmail.com" wrote:
> > Hi all,
> >
> > I have a database I maintain that has grown quite large. The part of it
> > I am interested in, is one paticular table that logs the history of
> > certain high volume "events". I have events back to 2002, and the
> > database is almost 3 Gigs. I rarely need to query more than 6 months
> > worth. Here is what I would like to do.
> >
> > I'd like to split the database, and create an archive database. I want
> > to move everything before 2006 to this new database. Now, I know I can
> > do a complete backup, and then delete the stuff I don't need, but I
> > wanted to know if there is a way to import just the dates I need from
> > the current database. Of course, there is a timedate field to key off
> > of.
> >
> > I am using the GUI to do this in Enterprise Manager SQL 2000, Windows
> > 2003 Server.
> >
> > Thanks in advance.
> >
> >|||Actually with the SELECT INTO statement the beauty of it is that you don't
need to create the table first. SELECT INTO will create it for you the table
structure will be the same as the original table.
Lucas
"mattdaddym@.gmail.com" wrote:
> I do have access to query analyzer. I was hoping for a way to do it in
> the GUI since it creats the tables automatically when you do an import.
> I don't know for sure, but I will assume if I use your command that I
> will need to set the table up first. Not a big deal, though. I guess
> I'm just being lazy. Thank you!
> Lucas Kartawidjaja wrote:
> > Hi there
> >
> > There are several ways to do this. You can try to use DTS to move the data
> > over. Or you can use query analyzer. If you can use Query Analyzer, you can
> > actually use a query something like:
> >
> > SELECT *
> > INTO [ArchiveDBName].dbo.[TableName]
> > FROM dbo.[OriginalDBName]
> > WHERE [DateStamp] < '1/1/2006'
> >
> > And to delete the records from the original table:
> >
> > DELETE FROM dbo.[OriginalDBName]
> > WHERE [DateStamp] < '1/1/2006'
> >
> > However, it was not clear from you post if you have access to Query Analyzer.
> >
> > Lucas
> >
> >
> > "mattdaddym@.gmail.com" wrote:
> >
> > > Hi all,
> > >
> > > I have a database I maintain that has grown quite large. The part of it
> > > I am interested in, is one paticular table that logs the history of
> > > certain high volume "events". I have events back to 2002, and the
> > > database is almost 3 Gigs. I rarely need to query more than 6 months
> > > worth. Here is what I would like to do.
> > >
> > > I'd like to split the database, and create an archive database. I want
> > > to move everything before 2006 to this new database. Now, I know I can
> > > do a complete backup, and then delete the stuff I don't need, but I
> > > wanted to know if there is a way to import just the dates I need from
> > > the current database. Of course, there is a timedate field to key off
> > > of.
> > >
> > > I am using the GUI to do this in Enterprise Manager SQL 2000, Windows
> > > 2003 Server.
> > >
> > > Thanks in advance.
> > >
> > >
>|||That is great. Thank you!
Lucas Kartawidjaja wrote:
> Actually with the SELECT INTO statement the beauty of it is that you don't
> need to create the table first. SELECT INTO will create it for you the table
> structure will be the same as the original table.
> Lucas
> "mattdaddym@.gmail.com" wrote:
> > I do have access to query analyzer. I was hoping for a way to do it in
> > the GUI since it creats the tables automatically when you do an import.
> > I don't know for sure, but I will assume if I use your command that I
> > will need to set the table up first. Not a big deal, though. I guess
> > I'm just being lazy. Thank you!
> > Lucas Kartawidjaja wrote:
> > > Hi there
> > >
> > > There are several ways to do this. You can try to use DTS to move the data
> > > over. Or you can use query analyzer. If you can use Query Analyzer, you can
> > > actually use a query something like:
> > >
> > > SELECT *
> > > INTO [ArchiveDBName].dbo.[TableName]
> > > FROM dbo.[OriginalDBName]
> > > WHERE [DateStamp] < '1/1/2006'
> > >
> > > And to delete the records from the original table:
> > >
> > > DELETE FROM dbo.[OriginalDBName]
> > > WHERE [DateStamp] < '1/1/2006'
> > >
> > > However, it was not clear from you post if you have access to Query Analyzer.
> > >
> > > Lucas
> > >
> > >
> > > "mattdaddym@.gmail.com" wrote:
> > >
> > > > Hi all,
> > > >
> > > > I have a database I maintain that has grown quite large. The part of it
> > > > I am interested in, is one paticular table that logs the history of
> > > > certain high volume "events". I have events back to 2002, and the
> > > > database is almost 3 Gigs. I rarely need to query more than 6 months
> > > > worth. Here is what I would like to do.
> > > >
> > > > I'd like to split the database, and create an archive database. I want
> > > > to move everything before 2006 to this new database. Now, I know I can
> > > > do a complete backup, and then delete the stuff I don't need, but I
> > > > wanted to know if there is a way to import just the dates I need from
> > > > the current database. Of course, there is a timedate field to key off
> > > > of.
> > > >
> > > > I am using the GUI to do this in Enterprise Manager SQL 2000, Windows
> > > > 2003 Server.
> > > >
> > > > Thanks in advance.
> > > >
> > > >
> >
> >
Thursday, March 22, 2012
Database filegroups
Hi,
I have a server with an external storage with 300GB. I
have 2 logical drives assign to the storage, one for logs
and other to the database files. My develop team says that
in a year the new database will grow to about 200GB. I'm
considering allocate one mdf file of 200GB, what should i
do? create a lot of filegroups and spread the database or
allocate one simple mdf file'
Thanks
PhilIt's really impossible to know without a lot more information.
In general... unless I have a strong reason to do other wise... I simply
have a single filegroup and put one file on each logical drive (especially
if the logical drive is seperate spindles..). An exception might be that I
might consider multiple files on the same drive if the logical drive is a
SAN or something with LOT's of IO capacity.
Unless I'm dealing with very large data sets I normally don't worry about
multiple file groups unless I'm doing it for management or recovery reasons.
--
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"Phil" <anonymous@.discussions.microsoft.com> wrote in message
news:158cc01c41d83$bf076270$a001280a@.phx.gbl...
> Hi,
> I have a server with an external storage with 300GB. I
> have 2 logical drives assign to the storage, one for logs
> and other to the database files. My develop team says that
> in a year the new database will grow to about 200GB. I'm
> considering allocate one mdf file of 200GB, what should i
> do? create a lot of filegroups and spread the database or
> allocate one simple mdf file'
> Thanks
> Phil
I have a server with an external storage with 300GB. I
have 2 logical drives assign to the storage, one for logs
and other to the database files. My develop team says that
in a year the new database will grow to about 200GB. I'm
considering allocate one mdf file of 200GB, what should i
do? create a lot of filegroups and spread the database or
allocate one simple mdf file'
Thanks
PhilIt's really impossible to know without a lot more information.
In general... unless I have a strong reason to do other wise... I simply
have a single filegroup and put one file on each logical drive (especially
if the logical drive is seperate spindles..). An exception might be that I
might consider multiple files on the same drive if the logical drive is a
SAN or something with LOT's of IO capacity.
Unless I'm dealing with very large data sets I normally don't worry about
multiple file groups unless I'm doing it for management or recovery reasons.
--
Brian Moran
Principal Mentor
Solid Quality Learning
SQL Server MVP
http://www.solidqualitylearning.com
"Phil" <anonymous@.discussions.microsoft.com> wrote in message
news:158cc01c41d83$bf076270$a001280a@.phx.gbl...
> Hi,
> I have a server with an external storage with 300GB. I
> have 2 logical drives assign to the storage, one for logs
> and other to the database files. My develop team says that
> in a year the new database will grow to about 200GB. I'm
> considering allocate one mdf file of 200GB, what should i
> do? create a lot of filegroups and spread the database or
> allocate one simple mdf file'
> Thanks
> Phil
Sunday, March 11, 2012
database disappeared from SQL 2005
Hi
One of my database disappeared from SQL 2005.
Maybe my mistake (i dont remember) or some SQL problem... or..
something else.
Is there a way (logs, etc..) to see when database was deleted?
Thank YouJohnZing wrote:
> Hi
> One of my database disappeared from SQL 2005.
> Maybe my mistake (i dont remember) or some SQL problem... or..
> something else.
> Is there a way (logs, etc..) to see when database was deleted?
> Thank You
If the default trace is enabled take a look at the trace file.
Typically it is in the folder \Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\LOG. Search for the Object:Deleted event.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--
One of my database disappeared from SQL 2005.
Maybe my mistake (i dont remember) or some SQL problem... or..
something else.
Is there a way (logs, etc..) to see when database was deleted?
Thank YouJohnZing wrote:
> Hi
> One of my database disappeared from SQL 2005.
> Maybe my mistake (i dont remember) or some SQL problem... or..
> something else.
> Is there a way (logs, etc..) to see when database was deleted?
> Thank You
If the default trace is enabled take a look at the trace file.
Typically it is in the folder \Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\LOG. Search for the Object:Deleted event.
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--
database disappeared from SQL 2005
Hi
One of my database disappeared from SQL 2005.
Maybe my mistake (i dont remember) or some SQL problem... or..
something else.
Is there a way (logs, etc..) to see when database was deleted?
Thank YouJohnZing wrote:
> Hi
> One of my database disappeared from SQL 2005.
> Maybe my mistake (i dont remember) or some SQL problem... or..
> something else.
> Is there a way (logs, etc..) to see when database was deleted?
> Thank You
If the default trace is enabled take a look at the trace file.
Typically it is in the folder \Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\LOG. Search for the Object:Deleted event.
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--
One of my database disappeared from SQL 2005.
Maybe my mistake (i dont remember) or some SQL problem... or..
something else.
Is there a way (logs, etc..) to see when database was deleted?
Thank YouJohnZing wrote:
> Hi
> One of my database disappeared from SQL 2005.
> Maybe my mistake (i dont remember) or some SQL problem... or..
> something else.
> Is there a way (logs, etc..) to see when database was deleted?
> Thank You
If the default trace is enabled take a look at the trace file.
Typically it is in the folder \Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\LOG. Search for the Object:Deleted event.
--
David Portas, SQL Server MVP
Whenever possible please post enough code to reproduce your problem.
Including CREATE TABLE and INSERT statements usually helps.
State what version of SQL Server you are using and specify the content
of any error messages.
SQL Server Books Online:
http://msdn2.microsoft.com/library/ms130214(en-US,SQL.90).aspx
--
Friday, February 17, 2012
Database deleted
We had a database deleted from our SQL Server 2000. We were able to do a
restore and fortunatley did not loose anything. We checked SQL logs and Even
t
logs and find no record of the deletion. Is it possible to log deletion of
databases? Is there somewhere else that we can look to see when and how it
got deleted?
Thank You
TomIf you were not running a profiler trace at the time then the only real
way is to trawl through the transaction log for the master database,
assuming your master DB is not in SIMPLE recovery mode, from the time
the database was dropped. There are 3rd party tools to interpret the
transaction log (like Lumigent Log Explorer for example). There's also
an undocumented system function called ::fn_dblog(<FirstLSN>,<LastLSN> )
that will display the current transaction log (between the LSNs you
specify - use null instead of a LSN to not limit the range) but the
output of the function is not very user friendly and takes a fair bit of
scrutinising to figure out what it means. I'd be looking for
LOP_DELETE_ROWS operations on the dbo.sysdatabases table - you might be
able to figure it out from that. Chances are, however, that you'll
waste hours on a wild goose chase, but good luck.
*mike hodgson*
http://sqlnerd.blogspot.com
TomD wrote:
>We had a database deleted from our SQL Server 2000. We were able to do a
>restore and fortunatley did not loose anything. We checked SQL logs and Eve
nt
>logs and find no record of the deletion. Is it possible to log deletion of
>databases? Is there somewhere else that we can look to see when and how it
>got deleted?
>Thank You
>Tom
>|||If you were not running a profiler trace at the time then the only real
way is to trawl through the transaction log for the master database,
assuming your master DB is not in SIMPLE recovery mode, from the time
the database was dropped. There are 3rd party tools to interpret the
transaction log (like Lumigent Log Explorer for example). There's also
an undocumented system function called ::fn_dblog(<FirstLSN>,<LastLSN> )
that will display the current transaction log (between the LSNs you
specify - use null instead of a LSN to not limit the range) but the
output of the function is not very user friendly and takes a fair bit of
scrutinising to figure out what it means. I'd be looking for
LOP_DELETE_ROWS operations on the dbo.sysdatabases table - you might be
able to figure it out from that. Chances are, however, that you'll
waste hours on a wild goose chase, but good luck.
*mike hodgson*
http://sqlnerd.blogspot.com
TomD wrote:
>We had a database deleted from our SQL Server 2000. We were able to do a
>restore and fortunatley did not loose anything. We checked SQL logs and Eve
nt
>logs and find no record of the deletion. Is it possible to log deletion of
>databases? Is there somewhere else that we can look to see when and how it
>got deleted?
>Thank You
>Tom
>
restore and fortunatley did not loose anything. We checked SQL logs and Even
t
logs and find no record of the deletion. Is it possible to log deletion of
databases? Is there somewhere else that we can look to see when and how it
got deleted?
Thank You
TomIf you were not running a profiler trace at the time then the only real
way is to trawl through the transaction log for the master database,
assuming your master DB is not in SIMPLE recovery mode, from the time
the database was dropped. There are 3rd party tools to interpret the
transaction log (like Lumigent Log Explorer for example). There's also
an undocumented system function called ::fn_dblog(<FirstLSN>,<LastLSN> )
that will display the current transaction log (between the LSNs you
specify - use null instead of a LSN to not limit the range) but the
output of the function is not very user friendly and takes a fair bit of
scrutinising to figure out what it means. I'd be looking for
LOP_DELETE_ROWS operations on the dbo.sysdatabases table - you might be
able to figure it out from that. Chances are, however, that you'll
waste hours on a wild goose chase, but good luck.
*mike hodgson*
http://sqlnerd.blogspot.com
TomD wrote:
>We had a database deleted from our SQL Server 2000. We were able to do a
>restore and fortunatley did not loose anything. We checked SQL logs and Eve
nt
>logs and find no record of the deletion. Is it possible to log deletion of
>databases? Is there somewhere else that we can look to see when and how it
>got deleted?
>Thank You
>Tom
>|||If you were not running a profiler trace at the time then the only real
way is to trawl through the transaction log for the master database,
assuming your master DB is not in SIMPLE recovery mode, from the time
the database was dropped. There are 3rd party tools to interpret the
transaction log (like Lumigent Log Explorer for example). There's also
an undocumented system function called ::fn_dblog(<FirstLSN>,<LastLSN> )
that will display the current transaction log (between the LSNs you
specify - use null instead of a LSN to not limit the range) but the
output of the function is not very user friendly and takes a fair bit of
scrutinising to figure out what it means. I'd be looking for
LOP_DELETE_ROWS operations on the dbo.sysdatabases table - you might be
able to figure it out from that. Chances are, however, that you'll
waste hours on a wild goose chase, but good luck.
*mike hodgson*
http://sqlnerd.blogspot.com
TomD wrote:
>We had a database deleted from our SQL Server 2000. We were able to do a
>restore and fortunatley did not loose anything. We checked SQL logs and Eve
nt
>logs and find no record of the deletion. Is it possible to log deletion of
>databases? Is there somewhere else that we can look to see when and how it
>got deleted?
>Thank You
>Tom
>
Subscribe to:
Posts (Atom)