Showing posts with label delete. Show all posts
Showing posts with label delete. Show all posts

Monday, March 12, 2012

Last date of access on a DB

Hi!
I've a many test servers with sql server 2000. On these server i've a lot of
DB for test, development and staging. I want to delete some of these DB, but
i'm not sure what of them are really being accessed. Is there any option
active script or whatever to know when was the last time a BD was accessed o
n
the server?
Any help will be appreciated.
FRivasFrivas wrote:
> Hi!
> I've a many test servers with sql server 2000. On these server i've a
> lot of DB for test, development and staging. I want to delete some of
> these DB, but i'm not sure what of them are really being accessed. Is
> there any option active script or whatever to know when was the last
> time a BD was accessed on the server?
> Any help will be appreciated.
> FRivas
You could try running a Profiler trace and capturing the Connect or
Disconnect events. The database ID is captured. Of course, this is only
the database that was originally connected to and may not be the
database where all the work took place.
Another option is to capture RPC:Completed and SQL:BatchCompleted
events. YOu don't have to bind the TextData to the trace if you want to
save space but you need to create a server-side trace to do this. This
trace captures all executed SQL on the server and you can easily see the
database id. If you were only concerned about specific databases you
could filter them out (once again I think you need to use a T-SQL
server-side trace for this type of filtering of multiple databases).
David Gugick
Imceda Software
www.imceda.com|||Turn on dbo use only or single user mode..and wait to see who complains?
Jeff
"Frivas" <Frivas@.discussions.microsoft.com> wrote in message
news:228FA9DF-7284-48A6-B4E1-FB9F3B50F1DD@.microsoft.com...
> Hi!
> I've a many test servers with sql server 2000. On these server i've a lot
of
> DB for test, development and staging. I want to delete some of these DB,
but
> i'm not sure what of them are really being accessed. Is there any option
> active script or whatever to know when was the last time a BD was accessed
on
> the server?
> Any help will be appreciated.
> FRivas
>

Last date of access on a DB

Hi!
I've a many test servers with sql server 2000. On these server i've a lot of
DB for test, development and staging. I want to delete some of these DB, but
i'm not sure what of them are really being accessed. Is there any option
active script or whatever to know when was the last time a BD was accessed on
the server?
Any help will be appreciated.
FRivas
Frivas wrote:
> Hi!
> I've a many test servers with sql server 2000. On these server i've a
> lot of DB for test, development and staging. I want to delete some of
> these DB, but i'm not sure what of them are really being accessed. Is
> there any option active script or whatever to know when was the last
> time a BD was accessed on the server?
> Any help will be appreciated.
> FRivas
You could try running a Profiler trace and capturing the Connect or
Disconnect events. The database ID is captured. Of course, this is only
the database that was originally connected to and may not be the
database where all the work took place.
Another option is to capture RPC:Completed and SQL:BatchCompleted
events. YOu don't have to bind the TextData to the trace if you want to
save space but you need to create a server-side trace to do this. This
trace captures all executed SQL on the server and you can easily see the
database id. If you were only concerned about specific databases you
could filter them out (once again I think you need to use a T-SQL
server-side trace for this type of filtering of multiple databases).
David Gugick
Imceda Software
www.imceda.com
|||Turn on dbo use only or single user mode..and wait to see who complains?
Jeff
"Frivas" <Frivas@.discussions.microsoft.com> wrote in message
news:228FA9DF-7284-48A6-B4E1-FB9F3B50F1DD@.microsoft.com...
> Hi!
> I've a many test servers with sql server 2000. On these server i've a lot
of
> DB for test, development and staging. I want to delete some of these DB,
but
> i'm not sure what of them are really being accessed. Is there any option
> active script or whatever to know when was the last time a BD was accessed
on
> the server?
> Any help will be appreciated.
> FRivas
>

Last date of access on a DB

Hi!
I've a many test servers with sql server 2000. On these server i've a lot of
DB for test, development and staging. I want to delete some of these DB, but
i'm not sure what of them are really being accessed. Is there any option
active script or whatever to know when was the last time a BD was accessed on
the server?
Any help will be appreciated.
FRivasFrivas wrote:
> Hi!
> I've a many test servers with sql server 2000. On these server i've a
> lot of DB for test, development and staging. I want to delete some of
> these DB, but i'm not sure what of them are really being accessed. Is
> there any option active script or whatever to know when was the last
> time a BD was accessed on the server?
> Any help will be appreciated.
> FRivas
You could try running a Profiler trace and capturing the Connect or
Disconnect events. The database ID is captured. Of course, this is only
the database that was originally connected to and may not be the
database where all the work took place.
Another option is to capture RPC:Completed and SQL:BatchCompleted
events. YOu don't have to bind the TextData to the trace if you want to
save space but you need to create a server-side trace to do this. This
trace captures all executed SQL on the server and you can easily see the
database id. If you were only concerned about specific databases you
could filter them out (once again I think you need to use a T-SQL
server-side trace for this type of filtering of multiple databases).
David Gugick
Imceda Software
www.imceda.com|||Turn on dbo use only or single user mode..and wait to see who complains?
Jeff
"Frivas" <Frivas@.discussions.microsoft.com> wrote in message
news:228FA9DF-7284-48A6-B4E1-FB9F3B50F1DD@.microsoft.com...
> Hi!
> I've a many test servers with sql server 2000. On these server i've a lot
of
> DB for test, development and staging. I want to delete some of these DB,
but
> i'm not sure what of them are really being accessed. Is there any option
> active script or whatever to know when was the last time a BD was accessed
on
> the server?
> Any help will be appreciated.
> FRivas
>

Friday, February 24, 2012

Large Delete & tran log

I have a table that has 110 million records, I will be deleting over 60 million records, but I dont have enough space to hold all the deletes on the trans log file. Is there a way to delete 1 million record then free the trans action then run another delete in one script.Set up simple model for your database and fire your deletes: 1000000 or less records - transaction log will be freed after every delete.

Monday, February 20, 2012

Large delete stmt - 2nd question

Publisher has delete stmt executed against transactionally replicated table.
270K rows deleted in 1 stmt.
1 Subscriber connected with T1
How best to replicate all the 270K simpleton delete calls to
sp_MSdel_tablename at subscriber through distr agent? What parameter
adjustments to make?
Changed -CommitBatchSize to 1000, doesn't seem to increase speed much...
Thanks,
Chris
Set HistoryVerboseLevel to 0, CommitBatchSize to 1000 and
CommitBatchThreshold 10000
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:DED73E09-DA75-444C-8976-96FF475B9567@.microsoft.com...
> Publisher has delete stmt executed against transactionally replicated
table.
> 270K rows deleted in 1 stmt.
> 1 Subscriber connected with T1
> How best to replicate all the 270K simpleton delete calls to
> sp_MSdel_tablename at subscriber through distr agent? What parameter
> adjustments to make?
> Changed -CommitBatchSize to 1000, doesn't seem to increase speed much...
> Thanks,
> Chris