Showing posts with label dbs. Show all posts
Showing posts with label dbs. Show all posts

Sunday, March 11, 2012

Detaching and Attaching DB;s

I'm trying to detach a DB and then attach it with the
data and log files in a different location.
Here's what I'm doing.
I detach the DB in question
Copy the data and log files to a different location
Attach DB, using the copied files.
It attaches fine, but it makes the DB Read-Only, and I'm
unable to uncheck the read-only option in the properties
of the db. It gives a long error about the possibiliy of
the data and log files not being correct, which I know
they are.
Any thoughts?
Thanks much
MattSuggest running DBCC CHECKDB on the source, if good try detaching again
--
HTH
Ryan Waight, MCDBA, MCSE
"Matt Bender" <matt.bender@.berbee.com> wrote in message
news:093c01c3b2a8$d108f1a0$a001280a@.phx.gbl...
> I'm trying to detach a DB and then attach it with the
> data and log files in a different location.
> Here's what I'm doing.
> I detach the DB in question
> Copy the data and log files to a different location
> Attach DB, using the copied files.
> It attaches fine, but it makes the DB Read-Only, and I'm
> unable to uncheck the read-only option in the properties
> of the db. It gives a long error about the possibiliy of
> the data and log files not being correct, which I know
> they are.
> Any thoughts?
> Thanks much
> Matt|||Hi Matt
Is it possible the files themselves are read only in the OS? Maybe the
folder you copied them to had its readonly property set, and the db files
inherited that.
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Matt Bender" <matt.bender@.berbee.com> wrote in message
news:093c01c3b2a8$d108f1a0$a001280a@.phx.gbl...
> I'm trying to detach a DB and then attach it with the
> data and log files in a different location.
> Here's what I'm doing.
> I detach the DB in question
> Copy the data and log files to a different location
> Attach DB, using the copied files.
> It attaches fine, but it makes the DB Read-Only, and I'm
> unable to uncheck the read-only option in the properties
> of the db. It gives a long error about the possibiliy of
> the data and log files not being correct, which I know
> they are.
> Any thoughts?
> Thanks much
> Matt|||thanks for the response. I did check that as well and
that is not the case either.
matt
>--Original Message--
>Hi Matt
>Is it possible the files themselves are read only in the
OS? Maybe the
>folder you copied them to had its readonly property set,
and the db files
>inherited that.
>--
>HTH
>--
>Kalen Delaney
>SQL Server MVP
>www.SolidQualityLearning.com
>
>"Matt Bender" <matt.bender@.berbee.com> wrote in message
>news:093c01c3b2a8$d108f1a0$a001280a@.phx.gbl...
>> I'm trying to detach a DB and then attach it with the
>> data and log files in a different location.
>> Here's what I'm doing.
>> I detach the DB in question
>> Copy the data and log files to a different location
>> Attach DB, using the copied files.
>> It attaches fine, but it makes the DB Read-Only, and
I'm
>> unable to uncheck the read-only option in the
properties
>> of the db. It gives a long error about the possibiliy
of
>> the data and log files not being correct, which I know
>> they are.
>> Any thoughts?
>> Thanks much
>> Matt
>
>.
>|||Are you sure no one is in the database? What happens when you try to set the
db to not read-only using ALTER DATABASE WITH ROLLBACK...
(Please see BOL for full syntax details.)
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Matt Bender" <anonymous@.discussions.microsoft.com> wrote in message
news:06d601c3b2cd$4df5cca0$a101280a@.phx.gbl...
> thanks for the response. I did check that as well and
> that is not the case either.
> matt
> >--Original Message--
> >Hi Matt
> >
> >Is it possible the files themselves are read only in the
> OS? Maybe the
> >folder you copied them to had its readonly property set,
> and the db files
> >inherited that.
> >
> >--
> >HTH
> >--
> >Kalen Delaney
> >SQL Server MVP
> >www.SolidQualityLearning.com
> >
> >
> >"Matt Bender" <matt.bender@.berbee.com> wrote in message
> >news:093c01c3b2a8$d108f1a0$a001280a@.phx.gbl...
> >> I'm trying to detach a DB and then attach it with the
> >> data and log files in a different location.
> >>
> >> Here's what I'm doing.
> >> I detach the DB in question
> >> Copy the data and log files to a different location
> >> Attach DB, using the copied files.
> >> It attaches fine, but it makes the DB Read-Only, and
> I'm
> >> unable to uncheck the read-only option in the
> properties
> >> of the db. It gives a long error about the possibiliy
> of
> >> the data and log files not being correct, which I know
> >> they are.
> >>
> >> Any thoughts?
> >>
> >> Thanks much
> >> Matt
> >
> >
> >.
> >

Friday, February 24, 2012

Design Table; Columns/Description get with SP??

Hi,

I'm using stored procedures to create an online data dictionary for
all of our dbs and I thought it would be very cool if there was a way
that I could somehow pull the columns description entered in the table
design view (lower pane) of EM. I have poked around, but have not
found a way. It is my suspcion that this may be impossible. Does any
smart person out there know?

Also want to pull pks and fks and other constraints, which I think I
can figure out how to do, but if anyone has any pointers, that would
also be appreciated.

Many Thanks,

Georgiavesta (vesta0424@.gmail.com) writes:

Quote:

Originally Posted by

It looks to me like you create your extended properties with this
function. Are there any default functions to get the information that
has been manually entered in the description field?


No, functions don't create anything, they can only retrieve data. To
add an extended property from T-SQL, you use sp_addextendedproperty.

I cannot really give any examples of using either, because I have not
used extended properties myself very much. Or rather not at all.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

Tuesday, February 14, 2012

Design DBs with HA in mind

Is there any article,white paper etc that tells me how to design my
databases with High Availability in mind..
Im not talking about clustering,log shipping,etc. that can help prevent
hardware failures but to minimize downtime by designing the databases such
that customers are broken down by names or geographic locations, etc.. that
would help prevent losing the entire customer db should the server be
unavailable and hence total outage to the application.
I am looking for ways on how clients have designed their apps..
I hope this makes sense... I am not looking for too much details but just
some generic overview would immensely help
ThanksHi
You may want to look at table partitioning and the ability to restore
filegroups offered in SQL 2005.
http://msdn2.microsoft.com/en-us/library/ms190787(SQL.90).aspx
Or you can look at a federated database and partitioned views (distibuted or
locally) in both SQL 2000 and SQL 2005
http://msdn2.microsoft.com/en-us/library/ms191185(SQL.90).aspx
HTH
John
"Hassan" wrote:
> Is there any article,white paper etc that tells me how to design my
> databases with High Availability in mind..
> Im not talking about clustering,log shipping,etc. that can help prevent
> hardware failures but to minimize downtime by designing the databases such
> that customers are broken down by names or geographic locations, etc.. that
> would help prevent losing the entire customer db should the server be
> unavailable and hence total outage to the application.
> I am looking for ways on how clients have designed their apps..
> I hope this makes sense... I am not looking for too much details but just
> some generic overview would immensely help
> Thanks
>
>

Design DBs with HA in mind

Is there any article,white paper etc that tells me how to design my
databases with High Availability in mind..
Im not talking about clustering,log shipping,etc. that can help prevent
hardware failures but to minimize downtime by designing the databases such
that customers are broken down by names or geographic locations, etc.. that
would help prevent losing the entire customer db should the server be
unavailable and hence total outage to the application.
I am looking for ways on how clients have designed their apps..
I hope this makes sense... I am not looking for too much details but just
some generic overview would immensely help
ThanksHi
You may want to look at table partitioning and the ability to restore
filegroups offered in SQL 2005.
http://msdn2.microsoft.com/en-us/library/ms190787(SQL.90).aspx
Or you can look at a federated database and partitioned views (distibuted or
locally) in both SQL 2000 and SQL 2005
http://msdn2.microsoft.com/en-us/library/ms191185(SQL.90).aspx
HTH
John
"Hassan" wrote:

> Is there any article,white paper etc that tells me how to design my
> databases with High Availability in mind..
> Im not talking about clustering,log shipping,etc. that can help prevent
> hardware failures but to minimize downtime by designing the databases such
> that customers are broken down by names or geographic locations, etc.. tha
t
> would help prevent losing the entire customer db should the server be
> unavailable and hence total outage to the application.
> I am looking for ways on how clients have designed their apps..
> I hope this makes sense... I am not looking for too much details but just
> some generic overview would immensely help
> Thanks
>
>