October 5, 2010 at 8:30 am
bump, as I wanted to know if kras followed up on the reasoning behind wanting to drop the production database.
Lowell
October 5, 2010 at 8:59 am
Lowell (10/5/2010)
bump, as I wanted to know if kras followed up on the reasoning behind wanting to drop the production database.
Wait, we need "reasons" for this kind of thing now?
Since when?
October 5, 2010 at 9:45 am
Derrick Smith (10/5/2010)
Lowell (10/5/2010)
bump, as I wanted to know if kras followed up on the reasoning behind wanting to drop the production database.Wait, we need "reasons" for this kind of thing now?
Since when?
Hey a whim counts as a reason!
I know i only like to see 8 or so databases when i see a list in object explorer, so trimming the list seems like a good uead, right?
Lowell
October 5, 2010 at 10:05 am
Nice avatar lowell. Interesting change.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
October 5, 2010 at 12:53 pm
Lowell (10/5/2010)
Derrick Smith (10/5/2010)
Lowell (10/5/2010)
bump, as I wanted to know if kras followed up on the reasoning behind wanting to drop the production database.Wait, we need "reasons" for this kind of thing now?
Since when?
Hey a whim counts as a reason!
I know i only like to see 8 or so databases when i see a list in object explorer, so trimming the list seems like a good uead, right?
And do it alphabetically, of course.
-- You can't be late until you show up.
October 5, 2010 at 12:54 pm
Lynn Pettis (10/4/2010)
As alluded to above in one of the posts, BEFORE dropping the database be SURE you take a FULL BACKUP of the database. This way you can recover it later if needed.
Unless you've already got a new job lined up. Then, who cares?? :w00t:
-- You can't be late until you show up.
October 5, 2010 at 12:56 pm
tosscrosby (10/5/2010)
Lowell (10/5/2010)
Derrick Smith (10/5/2010)
Lowell (10/5/2010)
bump, as I wanted to know if kras followed up on the reasoning behind wanting to drop the production database.Wait, we need "reasons" for this kind of thing now?
Since when?
Hey a whim counts as a reason!
I know i only like to see 8 or so databases when i see a list in object explorer, so trimming the list seems like a good uead, right?
And do it alphabetically, of course.
Completely inefficient. If you want to be cost effective, you delete by size desc.
October 5, 2010 at 1:06 pm
And do it alphabetically, of course.
That's how I do it, one a day like a vitamin.
Really, why do you want to delete a production database? Especially when you don't know how???:exclamationmark:
Steve Jimmo
Sr DBA
“If we ever forget that we are One Nation Under God, then we will be a Nation gone under." - Ronald Reagan
October 5, 2010 at 3:16 pm
Derrick Smith (10/5/2010)
Completely inefficient. If you want to be cost effective, you delete by size desc.
That's what I was thinking. You can run this script to identify your biggest databases. Then delete the large ones to free up more disk space.
select
database_name = DB.name
,sum( MF. /131072.) as 'Gig'
frommaster.sys.databasesas DB
inner joinmaster.sys.master_filesas MF on MF.database_id = DB.database_id
group by DB.name
order by DB.name
October 5, 2010 at 4:27 pm
WayneS (10/4/2010)
Lynn Pettis (10/4/2010)
As alluded to above in one of the posts, BEFORE dropping the database be SURE you take a FULL BACKUP of the database. This way you can recover it later if needed.Or, you could always use DBCC TimeWarp!
Aaahh, fond memories. I'd still like to know who timewarped away my points for that thread though. It was some of my finest work.
---------------------------------------------------------------------
October 5, 2010 at 5:06 pm
tosscrosby (10/5/2010)
Lynn Pettis (10/4/2010)
As alluded to above in one of the posts, BEFORE dropping the database be SURE you take a FULL BACKUP of the database. This way you can recover it later if needed.Unless you've already got a new job lined up. Then, who cares?? :w00t:
Yeah but that usually catches up to you - eventually.
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
October 5, 2010 at 5:09 pm
homebrew01 (10/5/2010)
Derrick Smith (10/5/2010)
Completely inefficient. If you want to be cost effective, you delete by size desc.
That's what I was thinking. You can run this script to identify your biggest databases. Then delete the large ones to free up more disk space.
select
database_name = DB.name
,sum( MF. /131072.) as 'Gig'
frommaster.sys.databasesas DB
inner joinmaster.sys.master_filesas MF on MF.database_id = DB.database_id
group by DB.name
order by DB.name
Too inefficient.
select
database_name = DB.name
,sum( MF. /131072.) as 'Gig'
,'Drop database ' + DB.name '; '
from master.sys.databases as DB
inner join master.sys.master_files as MF on MF.database_id = DB.database_id
group by DB.name
order by DB.name
Now you can just copy and paste the drop statement. 😉
Jason...AKA CirqueDeSQLeil
_______________________________________________
I have given a name to my pain...MCM SQL Server, MVP
SQL RNNR
Posting Performance Based Questions - Gail Shaw[/url]
Learn Extended Events
October 5, 2010 at 5:19 pm
CirquedeSQLeil (10/5/2010)
select
database_name = DB.name
,sum( MF. /131072.) as 'Gig'
,'Drop database ' + DB.name '; '
from master.sys.databases as DB
inner join master.sys.master_files as MF on MF.database_id = DB.database_id
group by DB.name
order by DB.name
Now you can just copy and paste the drop statement. 😉
Still too much work:
DECLARE @sql VARCHAR(5000)
while 1=2
BEGIN
select TOP 1
@sql = 'Drop databasse ' + DB.name '; '
from master.sys.databases as DB
inner join master.sys.master_files as MF on MF.database_id = DB.database_id
where db.name not in ( 'master', 'model', 'msdb', 'temdb', 'resource')
group by DB.name
order by ME. DESC
IF @@ROWCOUNT = 0 THEN BREAK
EXEC sp_executesql @sql
END
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
October 5, 2010 at 5:59 pm
Lordy... I sure hope nobody actually tries to run any of the recent code postings on this thread. While it's been fun, I think you'll really should go back and redact those, and the code that has been quoted also.
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
October 5, 2010 at 6:08 pm
WayneS (10/5/2010)
Lordy... I sure hope nobody actually tries to run any of the recent code postings on this thread. While it's been fun, I think you'll really should go back and redact those, and the code that has been quoted also.
I think mine is the only REALLY dangerous one... I'll make it break in some obscure way. 🙂
Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.
For better assistance in answering your questions[/url] | Forum Netiquette
For index/tuning help, follow these directions.[/url] |Tally Tables[/url]
Twitter: @AnyWayDBA
Viewing 15 posts - 16 through 30 (of 36 total)
You must be logged in to reply to this topic. Login to reply