Showing posts with label save. Show all posts
Showing posts with label save. Show all posts

Thursday, March 29, 2012

Deleting records to save DISK Space...

Hi,

In my data archiving process , I would end up deleting hunders records from the production databases but would that help me save some DISK space immediately? Should I run some DBCC command to get some disk space ?

if SO ..!! What should I do after deleting the records..??

Thanks
Cheriyan."Always be sure to backup your records ... before you delete them ... "|||Have a look in SQL Book online to this command


DBCC SHRINKDATABASE
( database_name [ , target_percent ]
[ , { NOTRUNCATE | TRUNCATEONLY } ]
)|||Kim Tripp presented a good session at the PASS conference a couple weeks ago about removing data using filegroups. If you are a PASS member, you can download the presentation here:

http://ew.sqlpass.org/ew/pass/callpapers/attach/TRIPP-Rolling_Range_For_Print.zip

Anyone can also download her scripts here:

http://www.sqlskills.com/pastConferences.asp

Friday, March 9, 2012

Deleted entire DB by accident!

Gentlemen, Can anyone save my life at the moment!
I need to restore a DB that I accidentally erased using
the Delete command in the Enterprise admin. I was on the
wrong server and the DB names are the same.
(No Backups were on this box since it's a dev box.)
Can anyone tell me a way to get my DB back?
Thanks,
BradTake your last production backup and restore it to your dev server.
Or were you fibbing and delete a production database you had no backups for?
"Brad G" <brad.guilbault@.cirquedusoleil.com> wrote in message
news:276e601c38f65$cc22d6d0$a601280a@.phx.gbl...
> Gentlemen, Can anyone save my life at the moment!
> I need to restore a DB that I accidentally erased using
> the Delete command in the Enterprise admin. I was on the
> wrong server and the DB names are the same.
> (No Backups were on this box since it's a dev box.)
> Can anyone tell me a way to get my DB back?
> Thanks,
> Brad|||The concept of Dev in our dept is that it it's Dev before
it goes to production. So, it's never actually seen
production. There is no actual restore .BAK file and
the .MDF file is missing.
Any ideas?
>--Original Message--
>Take your last production backup and restore it to your
dev server.
>Or were you fibbing and delete a production database you
had no backups for?
>"Brad G" <brad.guilbault@.cirquedusoleil.com> wrote in
message
>news:276e601c38f65$cc22d6d0$a601280a@.phx.gbl...
>> Gentlemen, Can anyone save my life at the moment!
>> I need to restore a DB that I accidentally erased using
>> the Delete command in the Enterprise admin. I was on
the
>> wrong server and the DB names are the same.
>> (No Backups were on this box since it's a dev box.)
>> Can anyone tell me a way to get my DB back?
>> Thanks,
>> Brad
>
>.
>|||Turn off the sql server and start searching for a file restore utility (I
don't have one or know of one in particular) that will work on your OS. If
the filespace is overwritten you will lose your data.
Just in case, though, did you select to delete the filegroups? If not they
will still be there as .ndf, .mdf, .ldf files.
"Brad G" <brad.guilbault@.cirquedusoleil.com> wrote in message
news:2774501c38f69$d9323470$a601280a@.phx.gbl...
> The concept of Dev in our dept is that it it's Dev before
> it goes to production. So, it's never actually seen
> production. There is no actual restore .BAK file and
> the .MDF file is missing.
> Any ideas?
>
> >--Original Message--
> >Take your last production backup and restore it to your
> dev server.
> >
> >Or were you fibbing and delete a production database you
> had no backups for?
> >
> >"Brad G" <brad.guilbault@.cirquedusoleil.com> wrote in
> message
> >news:276e601c38f65$cc22d6d0$a601280a@.phx.gbl...
> >> Gentlemen, Can anyone save my life at the moment!
> >> I need to restore a DB that I accidentally erased using
> >> the Delete command in the Enterprise admin. I was on
> the
> >> wrong server and the DB names are the same.
> >> (No Backups were on this box since it's a dev box.)
> >> Can anyone tell me a way to get my DB back?
> >>
> >> Thanks,
> >>
> >> Brad
> >
> >
> >.
> >|||Thanks for the help, unfortunately I've been trying to
recover the MDF files with recovery utilities but so far
I've had no luck. Is it even possible to track down an
MDF file once it's been deleted with Enterprise Manager?
>--Original Message--
>Turn off the sql server and start searching for a file
restore utility (I
>don't have one or know of one in particular) that will
work on your OS. If
>the filespace is overwritten you will lose your data.
>Just in case, though, did you select to delete the
filegroups? If not they
>will still be there as .ndf, .mdf, .ldf files.
>
>
>
>"Brad G" <brad.guilbault@.cirquedusoleil.com> wrote in
message
>news:2774501c38f69$d9323470$a601280a@.phx.gbl...
>> The concept of Dev in our dept is that it it's Dev
before
>> it goes to production. So, it's never actually seen
>> production. There is no actual restore .BAK file and
>> the .MDF file is missing.
>> Any ideas?
>>
>> >--Original Message--
>> >Take your last production backup and restore it to your
>> dev server.
>> >
>> >Or were you fibbing and delete a production database
you
>> had no backups for?
>> >
>> >"Brad G" <brad.guilbault@.cirquedusoleil.com> wrote in
>> message
>> >news:276e601c38f65$cc22d6d0$a601280a@.phx.gbl...
>> >> Gentlemen, Can anyone save my life at the moment!
>> >> I need to restore a DB that I accidentally erased
using
>> >> the Delete command in the Enterprise admin. I was on
>> the
>> >> wrong server and the DB names are the same.
>> >> (No Backups were on this box since it's a dev box.)
>> >> Can anyone tell me a way to get my DB back?
>> >>
>> >> Thanks,
>> >>
>> >> Brad
>> >
>> >
>> >.
>> >
>
>.
>|||Deleting with EM means that EM executes the DROP DATABASE command. For the DROP DATABASE command,
SQL Server will delete the file physically. Working on the OS level is your last resort. And, if
keeping the data from the dev environment is crucial, make sure you have backup for the dev
environment next time. :-)
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as ugroup=microsoft.public.sqlserver
"Brad G" <brad.guilbault@.cirquedusoleil.com> wrote in message
news:036001c38f72$ef2e2b90$a401280a@.phx.gbl...
> Thanks for the help, unfortunately I've been trying to
> recover the MDF files with recovery utilities but so far
> I've had no luck. Is it even possible to track down an
> MDF file once it's been deleted with Enterprise Manager?
> >--Original Message--
> >Turn off the sql server and start searching for a file
> restore utility (I
> >don't have one or know of one in particular) that will
> work on your OS. If
> >the filespace is overwritten you will lose your data.
> >
> >Just in case, though, did you select to delete the
> filegroups? If not they
> >will still be there as .ndf, .mdf, .ldf files.
> >
> >
> >
> >
> >
> >
> >"Brad G" <brad.guilbault@.cirquedusoleil.com> wrote in
> message
> >news:2774501c38f69$d9323470$a601280a@.phx.gbl...
> >> The concept of Dev in our dept is that it it's Dev
> before
> >> it goes to production. So, it's never actually seen
> >> production. There is no actual restore .BAK file and
> >> the .MDF file is missing.
> >>
> >> Any ideas?
> >>
> >>
> >> >--Original Message--
> >> >Take your last production backup and restore it to your
> >> dev server.
> >> >
> >> >Or were you fibbing and delete a production database
> you
> >> had no backups for?
> >> >
> >> >"Brad G" <brad.guilbault@.cirquedusoleil.com> wrote in
> >> message
> >> >news:276e601c38f65$cc22d6d0$a601280a@.phx.gbl...
> >> >> Gentlemen, Can anyone save my life at the moment!
> >> >> I need to restore a DB that I accidentally erased
> using
> >> >> the Delete command in the Enterprise admin. I was on
> >> the
> >> >> wrong server and the DB names are the same.
> >> >> (No Backups were on this box since it's a dev box.)
> >> >> Can anyone tell me a way to get my DB back?
> >> >>
> >> >> Thanks,
> >> >>
> >> >> Brad
> >> >
> >> >
> >> >.
> >> >
> >
> >
> >.
> >