Thursday, March 29, 2012
Delete Database Option
saying - "Delete backup and restore history for the
database".
What does this option means ? Should I select it ?
Tha
If you don't care about the database, sure.
http://www.aspfaq.com/
(Reverse address to reply.)
"Peter" <anonymous@.discussions.microsoft.com> wrote in message
news:20b9d01c4597e$661e7540$a401280a@.phx.gbl...
> When I attempt to delete a database, there is a checkbox
> saying - "Delete backup and restore history for the
> database".
> What does this option means ? Should I select it ?
> Tha
|||Hi,
What does this option means ?
When ever you perform a Backup or restore of database or transaction log a
entry will put into
MSDB..backupfile, msdb..backupmediafamily,msdb..backupmediaset
tables,msdb..restorefile,msdb..restorefilegroup,ms db..restorehistory.
These are nothing but history of your backup and restore operation. So when
when you select this option
automatically all the history will be deleted form MSDB database for the
above tables.
Should I select it ?
Since you do not require even the database, you can select this option.
Thanks
Hari
MCDBA
"Peter" <anonymous@.discussions.microsoft.com> wrote in message
news:20b9d01c4597e$661e7540$a401280a@.phx.gbl...
> When I attempt to delete a database, there is a checkbox
> saying - "Delete backup and restore history for the
> database".
> What does this option means ? Should I select it ?
> Tha
Delete Database Option
saying - "Delete backup and restore history for the
database".
What does this option means ? Should I select it ?
ThaIf you don't care about the database, sure.
http://www.aspfaq.com/
(Reverse address to reply.)
"Peter" <anonymous@.discussions.microsoft.com> wrote in message
news:20b9d01c4597e$661e7540$a401280a@.phx
.gbl...
> When I attempt to delete a database, there is a checkbox
> saying - "Delete backup and restore history for the
> database".
> What does this option means ? Should I select it ?
> Tha|||Hi,
What does this option means ?
When ever you perform a Backup or restore of database or transaction log a
entry will put into
MSDB..backupfile, msdb..backupmediafamily,msdb..backupmediaset
tables,msdb..restorefile,msdb..restorefilegroup,msdb..restorehistory.
These are nothing but history of your backup and restore operation. So when
when you select this option
automatically all the history will be deleted form MSDB database for the
above tables.
Should I select it ?
Since you do not require even the database, you can select this option.
Thanks
Hari
MCDBA
"Peter" <anonymous@.discussions.microsoft.com> wrote in message
news:20b9d01c4597e$661e7540$a401280a@.phx
.gbl...
> When I attempt to delete a database, there is a checkbox
> saying - "Delete backup and restore history for the
> database".
> What does this option means ? Should I select it ?
> Tha
Delete data, but file size increase
when I delete a bunch of data from it, it suppose to reduce the
database file size, but weirdly, the file size increase to 8 GB.
Wondering why. Is it suppose to be like that?
Is it the architecture is designed to work like that?
Is there any way for me to reduce the database file size?
Thanks.
Peter CCHIf you take back daily with append data option, the size gets increased
Madhivanan|||What utility are you using to measure the database size?
Are you using sp_spaceused and just noting the "Database Size" column?
This also includes the transaction log, and this will increase when you
delete data from the database, until you either truncate or backup your
transaction log.
You can also get wrong space values from sp_spaceused if you are making
frequent and large changes to data, such as updates and deletes, as the
counters that record the new extent allocations and deallocations don't
get updated dynamically every time.
Try running sp_spaceused in the database, and note the values in all
columns.
Now, repeat this, but execute sp_spaceused @.updateusage='true'
(N.B. This can take a few minutes to run. I have never had a problem
running this on a live database during the day, but be aware that it
runs DBCC UPDATEUSAGE and forces updates to the sysindexes catalog; it
is less-risky to run it out of hours)
Here's a good example from one of my databases:
sp_spaceused
go
database_name, database_size, unallocated space
Roms, 22541.00 MB, -4407.84 MB
reserved, data, index_size, unused
27589472 KB, 16362352 KB, 11146992 KB, 80128 KB
Note the negative Unallocated Space value.
Now I run:
sp_spaceused @.updateusage='true'
database_name, database_size, unallocated space
Roms, 22541.00 MB, 1.43 MB
reserved, data, index_size, unused
23074376 KB, 15558360 KB, 7447464 KB, 68552 KB
You can see that, prior to this, the Reserved, Data and Index_Size
columns were all showing more space being used than the true value. I
suggest you try this after you delete your data in future, and see if
you get the values you expect.sql
Wednesday, March 21, 2012
Delay between CREATE DATABASE and ability to connect to that database
and I've noticed some strange behavior. Once I've created the
database, I am able to immediately create tables and populate lookup
data, provided I remain connected to the server. If, however, I
disconnect and attempt to reconnect immediately, I'll get an error
saying that my login is invalid for the new database.
I can get around this by having my code simply wait 5 seconds before
attempting to reconnect, but I'm curious to see if anybody here can
give an explaination for why this is happening. Here is a bit of
pseudo code to explain what I'm seeing:
open new connection
create database
create tables
populate tables
close connection
// open new connection /* can't do this yet, as it would break */
for (int a=0; a<5; a++)
{
Thread.Sleep(2000)
try
{
open new connection
break;
}
catch
{
Debug("still waiting...");
}
}
Running my version of this code, I'll see that "still waiting..."
message go past 2-3 times before SQL Server wakes up and realizes that
I'm allowed to connect to it. Anybody know why?
Thanks,
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/
This is probably for the simple reason that it takes a while to create the database.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<jasonkester@.gmail.com> wrote in message
news:1160181795.643203.219410@.h48g2000cwc.googlegr oups.com...
>I have an application that creates a new database during installation,
> and I've noticed some strange behavior. Once I've created the
> database, I am able to immediately create tables and populate lookup
> data, provided I remain connected to the server. If, however, I
> disconnect and attempt to reconnect immediately, I'll get an error
> saying that my login is invalid for the new database.
> I can get around this by having my code simply wait 5 seconds before
> attempting to reconnect, but I'm curious to see if anybody here can
> give an explaination for why this is happening. Here is a bit of
> pseudo code to explain what I'm seeing:
>
> open new connection
> create database
> create tables
> populate tables
> close connection
> // open new connection /* can't do this yet, as it would break */
> for (int a=0; a<5; a++)
> {
> Thread.Sleep(2000)
> try
> {
> open new connection
> break;
> }
> catch
> {
> Debug("still waiting...");
> }
> }
>
> Running my version of this code, I'll see that "still waiting..."
> message go past 2-3 times before SQL Server wakes up and realizes that
> I'm allowed to connect to it. Anybody know why?
> Thanks,
> Jason Kester
> Expat Software Consulting Services
> http://www.expatsoftware.com/
> --
> Get your own Travel Blog, with itinerary maps and photos!
> http://www.blogabond.com/
>
|||Tibor Karaszi wrote:
> This is probably for the simple reason that it takes a while to create the database.
>
Ah, but it's not that simple. I'm able to interact with the database
just fine from the moment the CREATE DATABASE command stops blocking.
It's just the user credentials that seem to take longer.
Really, I'm looking for a programatic way to check to see that the
database is really ready to use. The wait/try/waitsomemore/tryagain...
approach that I'm using at the moment just seems like a hack.
Thanks,
Jason
|||I think I understand. You execute the CREATE command, and are blocked. As soon as you aren't blocked
anymore, you try to open a new connection and that fails unless you wait a little while with opening
that new connection.
SQL Server 2005 has been more strict regarding state of a database. Google and you should find some
info, possibly also in Books Online. So it is possible that you can query sys.databases (state_desc
column) to see what state the database is in and based on that connect. Still a polling approach,
though.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
<jasonkester@.gmail.com> wrote in message
news:1160250836.466398.194580@.m73g2000cwd.googlegr oups.com...
> Tibor Karaszi wrote:
> Ah, but it's not that simple. I'm able to interact with the database
> just fine from the moment the CREATE DATABASE command stops blocking.
> It's just the user credentials that seem to take longer.
> Really, I'm looking for a programatic way to check to see that the
> database is really ready to use. The wait/try/waitsomemore/tryagain...
> approach that I'm using at the moment just seems like a hack.
> Thanks,
> Jason
>
|||Tibor Karaszi wrote:
> SQL Server 2005 has been more strict regarding state of a database. Google and you should find some
> info, possibly also in Books Online. So it is possible that you can query sys.databases (state_desc
> column) to see what state the database is in and based on that connect. Still a polling approach,
> though.
Thanks for the suggestions. That sounds like it would at least
resemble polling. What I'm doing now is simply a hack!
Jason
Delay between CREATE DATABASE and ability to connect to that database
and I've noticed some strange behavior. Once I've created the
database, I am able to immediately create tables and populate lookup
data, provided I remain connected to the server. If, however, I
disconnect and attempt to reconnect immediately, I'll get an error
saying that my login is invalid for the new database.
I can get around this by having my code simply wait 5 seconds before
attempting to reconnect, but I'm curious to see if anybody here can
give an explaination for why this is happening. Here is a bit of
pseudo code to explain what I'm seeing:
open new connection
create database
create tables
populate tables
close connection
// open new connection /* can't do this yet, as it would break */
for (int a=0; a<5; a++)
{
Thread.Sleep(2000)
try
{
open new connection
break;
}
catch
{
Debug("still waiting...");
}
}
Running my version of this code, I'll see that "still waiting..."
message go past 2-3 times before SQL Server wakes up and realizes that
I'm allowed to connect to it. Anybody know why?
Thanks,
Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
--
Get your own Travel Blog, with itinerary maps and photos!
http://www.blogabond.com/On 6 Oct 2006 17:36:01 -0700, Jason Kester wrote:
(snip)
Hi Jason,
You posted the same question and youy already received some answers
there.
In the future, please post to a single group only. It prevents people
wasting time on a problm that has already been solved.
--
Hugo Kornelis, SQL Server MVP