Showing posts with label constraints. Show all posts
Showing posts with label constraints. Show all posts

Monday, March 19, 2012

DB restore fails saying it needs more free space

Hi,
I have run into this peculiar issue
* DB was set to 'suspect' status..
* checked for physical disk size constraints
- log file is 50 gigs
* so tried to reset status...failed...by this time...DB
was missing from list in SQL EM
* so tried to restore from backup
* restore says it needs 50 gigs of space
* actual capacity of disk is 32 gigs
* how to restore the db'
appreciate all the help
thanks
vishwasSQL Server need the same amount of space for the db as it took when you did the backup. I am a
bit confused: You say the log was 50 gig, and you say that you now have only 32 gig?
--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sqlserver
"vishwas" <vanbunty@.yahoo.com> wrote in message news:124201c3460e$856a2b80$a101280a@.phx.gbl...
> Hi,
> I have run into this peculiar issue
> * DB was set to 'suspect' status..
> * checked for physical disk size constraints
> - log file is 50 gigs
> * so tried to reset status...failed...by this time...DB
> was missing from list in SQL EM
> * so tried to restore from backup
> * restore says it needs 50 gigs of space
> * actual capacity of disk is 32 gigs
> * how to restore the db'
> appreciate all the help
> thanks
> vishwas
>

Saturday, February 25, 2012

Db Migration with Identity constraints and their Fkey records

Hi,
we have to migrate data from three tables in 3 different servers into one
table on fourth servers.. and the scenariou is as below
ServerA/Database : One table named as Access with Pkey and identity field.
This identity field is Fkey in another table.
ServerB/Database : One table named as Access with Pkey and identity field.
This identity field is Fkey in another table.
ServerC/Database : One table named as Access with Pkey and identity field.
This identity field is Fkey in another table.
We have to merge data/table of all the above three servers into one
database. We have to merge all records from all three servers into one tabl
e
which will be in another server.
How should we take care of identity issues and fkey constraints as table has
different identity in all three servers and they are related to some other
tables as Fkey Constraints. table structure is same in all servers.
Thanks in advance ,
SunnySunny
> We have to merge data/table of all the above three servers into one
> database. We have to merge all records from all three servers into one
> table
> which will be in another server.
Perhsps by using DTS Package to move the data but you will have to decide
how to store the data because what if these table have the same identity
value. It is up to you to decide. Ome option is to create a group of these
values (i mean identities) from three table and generate a PK to each
group.
"Sunny" <Sunny@.discussions.microsoft.com> wrote in message
news:760AF5E1-D44C-4888-BFB5-B4D61E4F7EB0@.microsoft.com...
> Hi,
> we have to migrate data from three tables in 3 different servers into one
> table on fourth servers.. and the scenariou is as below
> ServerA/Database : One table named as Access with Pkey and identity field.
> This identity field is Fkey in another table.
> ServerB/Database : One table named as Access with Pkey and identity field.
> This identity field is Fkey in another table.
> ServerC/Database : One table named as Access with Pkey and identity field.
> This identity field is Fkey in another table.
> We have to merge data/table of all the above three servers into one
> database. We have to merge all records from all three servers into one
> table
> which will be in another server.
> How should we take care of identity issues and fkey constraints as table
> has
> different identity in all three servers and they are related to some other
> tables as Fkey Constraints. table structure is same in all servers.
> Thanks in advance ,
> Sunny
>|||Thanks, but could you please provide more details what exactly you mean here
.
"Uri Dimant" wrote:

> Sunny
>
> Perhsps by using DTS Package to move the data but you will have to decide
> how to store the data because what if these table have the same identity
> value. It is up to you to decide. Ome option is to create a group of thes
e
> values (i mean identities) from three table and generate a PK to each
> group.
>
> "Sunny" <Sunny@.discussions.microsoft.com> wrote in message
> news:760AF5E1-D44C-4888-BFB5-B4D61E4F7EB0@.microsoft.com...
>
>

Sunday, February 19, 2012

DB locking up when adding indexes programmatically

I've got this big giant script that drops all my default constraints, drops
all indexes, then drops all clustered index constraints, then adds alot of
new indexes, constraints, and clustered indexes. I've got it running
without throwing any errors now. However, sometimes the database locks up.
It seems to be set to single user mode but it's not really. Often times one
user can still use the database but everybody else gets their Enterprise
Manager locked up if they try to do anything with that database. Even Cold
Fusion queries time out. During this time we can't even see the current
activity. If we close out the window in Query Analyzer that I used to run
it, it will warn me that there are uncommitted transactions. Restarting the
SQL Server service will fix the problem. When it's back up, I can see that
everything got dropped, but no indexes or anything was added. I have only
done this to test databases so far but I have 140 customer databases I have
to run this on and I cannot do that at this point due to the lockups. I
thought it was due to us having a failover cluster but yesterday I got it to
happen on a development server that is not clustered. Any ideas?
Thanks in advance,
CoryHi
A clustered index build requires a table lock in SQL Server 2000.
During this time, nobody can acces that table. It also needs disk space, so
it might need to grow the DB.
Run sp_who2 whilst the script is running to see what is happening.
Mike Epprecht, Microsoft SQL Server MVP
Zurich, Switzerland
MVP Program: http://www.microsoft.com/mvp
Blog: http://www.msmvps.com/epprecht/
"Cory Harrison" wrote:

> I've got this big giant script that drops all my default constraints, drop
s
> all indexes, then drops all clustered index constraints, then adds alot of
> new indexes, constraints, and clustered indexes. I've got it running
> without throwing any errors now. However, sometimes the database locks up
.
> It seems to be set to single user mode but it's not really. Often times o
ne
> user can still use the database but everybody else gets their Enterprise
> Manager locked up if they try to do anything with that database. Even Col
d
> Fusion queries time out. During this time we can't even see the current
> activity. If we close out the window in Query Analyzer that I used to run
> it, it will warn me that there are uncommitted transactions. Restarting t
he
> SQL Server service will fix the problem. When it's back up, I can see tha
t
> everything got dropped, but no indexes or anything was added. I have only
> done this to test databases so far but I have 140 customer databases I hav
e
> to run this on and I cannot do that at this point due to the lockups. I
> thought it was due to us having a failover cluster but yesterday I got it
to
> happen on a development server that is not clustered. Any ideas?
>
> Thanks in advance,
> Cory
>
>|||If the table(s) is(are) big then Dropping and Re-creating is going to be
pretty resource intensive during which time it is going
to freeze the server. You might want to look at improving the performance of
the Index Creation process.
Did you try the SORT IN TEMPDB option ? This might help a bit though not to
a large extent.
Also, I hope you are Dropping the Non-Clustered Index before Dropping
Clustered Index and Create Clustered Index
before creating the Non-Clustered Index.
Gopi
"Cory Harrison" <charrison@.csiweb.com> wrote in message
news:%238yru4LTFHA.336@.TK2MSFTNGP09.phx.gbl...
> I've got this big giant script that drops all my default constraints,
> drops all indexes, then drops all clustered index constraints, then adds
> alot of new indexes, constraints, and clustered indexes. I've got it
> running without throwing any errors now. However, sometimes the database
> locks up. It seems to be set to single user mode but it's not really.
> Often times one user can still use the database but everybody else gets
> their Enterprise Manager locked up if they try to do anything with that
> database. Even Cold Fusion queries time out. During this time we can't
> even see the current activity. If we close out the window in Query
> Analyzer that I used to run it, it will warn me that there are uncommitted
> transactions. Restarting the SQL Server service will fix the problem.
> When it's back up, I can see that everything got dropped, but no indexes
> or anything was added. I have only done this to test databases so far but
> I have 140 customer databases I have to run this on and I cannot do that
> at this point due to the lockups. I thought it was due to us having a
> failover cluster but yesterday I got it to happen on a development server
> that is not clustered. Any ideas?
>
> Thanks in advance,
> Cory
>
>