Showing posts with label decided. Show all posts
Showing posts with label decided. Show all posts

Tuesday, March 20, 2012

an OpenRowset little doubt

Hi all.

Seeing that the old system table syslang is no longer updateable(Not even in DAC) i decided to take a look at the definition of it, just to see where the languages are stored.(out of curiosity)

Select Object_Definition(Object_Id('SysLanguages'))

and it returns

Select .......

FROM OpenRowset(TABLE SYSLANG)

The odd thing is I tried to run that query but it gives me an error telling an incorrect sintax near TABLE.

so, the question is if does anybody knows why i can't run the same query that the object_definition returned?

any comments are most apreciated

This syntax works only in mssqlsystemresource database context.|||

Thanks a lot! i copy and attached the mssqlsystemresource as an standar database and it worked out.

Thanks for your help!

Wednesday, March 7, 2012

An architecture question on replication

I have a large central server. I need to replicate the data to around 50
smaller sqlserver at various locations. The subscription is decided by a join
between two tables and the where clause is a specific location_id. The larger
table in central DB is around 200 million rows and the local DB is 200/50= 4
million rows/local DB.
Since i need to do a join two tables, i think i cannot use transaction
replication, need to go with merge replication. What i found is when i create
multiple publication(right now just 2) and all merge agents running on
publisher, it takes out too much resource. So i am worried about going with
an approach of 50 publications .
I tried the option of running merge agents at subscriber, a single
publication differentiate by HOST_NAME. I couldn't make it work.
Please give your thoughts, what could be my best approach for this problem.
(or i could go a .net solution using msmq or SSB)
You can do a join as part of a filter in transactional replication. Please
provide more info about the join and I can write a udf to do it.
For merge replication you need to limit the number of concurrent merge
agents, and possibly use a hierarchy.
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"skv" <skv@.discussions.microsoft.com> wrote in message
news:89ADE585-E17C-4C9C-9A5A-6A49305AA398@.microsoft.com...
>I have a large central server. I need to replicate the data to around 50
> smaller sqlserver at various locations. The subscription is decided by a
> join
> between two tables and the where clause is a specific location_id. The
> larger
> table in central DB is around 200 million rows and the local DB is 200/50=
> 4
> million rows/local DB.
> Since i need to do a join two tables, i think i cannot use transaction
> replication, need to go with merge replication. What i found is when i
> create
> multiple publication(right now just 2) and all merge agents running on
> publisher, it takes out too much resource. So i am worried about going
> with
> an approach of 50 publications .
> I tried the option of running merge agents at subscriber, a single
> publication differentiate by HOST_NAME. I couldn't make it work.
> Please give your thoughts, what could be my best approach for this
> problem.
> (or i could go a .net solution using msmq or SSB)
>
|||Dynamic filtering is now pretty straightforward in SQL 2005. Please see this
article for some relevant info and screenshots:
http://www.replicationanswers.com/MergeChangesArticle1.asp
To minimise proc congestion, you could have the merge agents run on the
subscribers (pull), stagger the sync times and as Hilary mentions limit the
number of concurrent merge agents.
HTH,
Paul Ibison
|||query1
select *
from customer
where base_loc=1
query2
select B.*
from customer A,customer_preference B
where A.customer_id=B.customer_id
and A.base_loc=1
this select will return 4 million and customer_preference table will have
200 million rows . I need to create 50 transactional replication/or merge
replication to replicate to 50 locations. What are your thoughts about
performance.
Thanks
"Hilary Cotter" wrote:

> You can do a join as part of a filter in transactional replication. Please
> provide more info about the join and I can write a udf to do it.
> For merge replication you need to limit the number of concurrent merge
> agents, and possibly use a hierarchy.
> --
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "skv" <skv@.discussions.microsoft.com> wrote in message
> news:89ADE585-E17C-4C9C-9A5A-6A49305AA398@.microsoft.com...
>
>
|||Given that you have a large number of records and a largish number of
subscribers I'd create 50 publications each with a static filter. Dynamic
filters are not as optimised and this route could end up being slow. 50
publications is not unmanageable and the processing could be offloaded by
having the subscriptions all set up as pull ones.
HTH,
Paul Ibison
|||So you are recommending me a merge replication with the merge agent running
on subscriber.
What are the advantages of merge over transactional replication for my
scenario. (still i have not figured out how to create a join for
transactional replication)
Thanks
"Paul Ibison" wrote:

> Given that you have a large number of records and a largish number of
> subscribers I'd create 50 publications each with a static filter. Dynamic
> filters are not as optimised and this route could end up being slow. 50
> publications is not unmanageable and the processing could be offloaded by
> having the subscriptions all set up as pull ones.
> HTH,
> Paul Ibison
>
|||I'm assuming that you have updating subscribers. For such a large number of
updating subscribers, merge is the preference. There are other advantages
over queued updating subscribers inc it handles updates to BLOBS, has more
conflict resolvers.
HTH,
Paul Ibison
|||thanks for the reply. i am surprised to see insert/update/delete triggers on
the table for merge replication. This can cause performance issue.
Can we use transactional replication with joins, which doesn't use triggers.
Your thoughts.
Thanks
"Paul Ibison" wrote:

> I'm assuming that you have updating subscribers. For such a large number of
> updating subscribers, merge is the preference. There are other advantages
> over queued updating subscribers inc it handles updates to BLOBS, has more
> conflict resolvers.
> HTH,
> Paul Ibison
|||But we are designing the sytem such a way that subscriber never will change
the data, so we can avoid merges. I like to see less overhead on publisher,
because it needs to handle 50 publication. Your thoughts.
Thanks
skv
"Paul Ibison" wrote:

> For either method (merge or transactional with updating subscribers) there
> will be an overhead at the subscriber end. Can I just confirm that the
> subscribers will be editing data?
> Cheers,
> Paul Ibison
>
>
|||OK - as far as I can tell from your explanations, you have 50 subscribers
which don't update data and which each have a different subset of data. In
this case I'd set up 50 Transactional publications, each having one
subscriber and each defined to take a different set of data.
HTH,
Paul Ibison

Thursday, February 16, 2012

Amazing scenario

OK Here it is.
The production database was detached so it could be moved. Upon
reattachment it decided it was corrupt and refused to allow me to reattach.
Another member of the dba team had a physical copy of the MDF and LDF from a
few days ago. He copied the current files off for safe keeping and
reattached the old copy. Now he wants to apply the current LDF log to the 5
day old database that was attached. Is this possible?
This nightmare is neverending. Please someone help!
Richard> He copied the current files off for safe keeping and reattached the old copy. Now he want
s to
> apply the current LDF log to the 5 day old database that was attached. Is this po
ssible?
No, SQL Server keep track of the internal "timestamp" of the database files
and you have to attach
from the same point in time. Otherwise, we would have chaos.
I suggest you open a ticket with MS Support and see if they can assist with
the attach. I always do
a DBCC CHECKDB and also a backup before these things, btw...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Richard Douglass" <RDouglass@.arisinc.com> wrote in message
news:uDSpGga3GHA.5024@.TK2MSFTNGP02.phx.gbl...
> OK Here it is.
> The production database was detached so it could be moved. Upon reattachm
ent it decided it was
> corrupt and refused to allow me to reattach. Another member of the dba tea
m had a physical copy of
> the MDF and LDF from a few days ago. He copied the current files off for
safe keeping and
> reattached the old copy. Now he wants to apply the current LDF log to the
5 day old database that
> was attached. Is this possible?
> This nightmare is neverending. Please someone help!
> Richard
>

Amazing scenario

OK Here it is.
The production database was detached so it could be moved. Upon
reattachment it decided it was corrupt and refused to allow me to reattach.
Another member of the dba team had a physical copy of the MDF and LDF from a
few days ago. He copied the current files off for safe keeping and
reattached the old copy. Now he wants to apply the current LDF log to the 5
day old database that was attached. Is this possible?
This nightmare is neverending. Please someone help!
Richard
> He copied the current files off for safe keeping and reattached the old copy. Now he wants to
> apply the current LDF log to the 5 day old database that was attached. Is this possible?
No, SQL Server keep track of the internal "timestamp" of the database files and you have to attach
from the same point in time. Otherwise, we would have chaos.
I suggest you open a ticket with MS Support and see if they can assist with the attach. I always do
a DBCC CHECKDB and also a backup before these things, btw...
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Richard Douglass" <RDouglass@.arisinc.com> wrote in message
news:uDSpGga3GHA.5024@.TK2MSFTNGP02.phx.gbl...
> OK Here it is.
> The production database was detached so it could be moved. Upon reattachment it decided it was
> corrupt and refused to allow me to reattach. Another member of the dba team had a physical copy of
> the MDF and LDF from a few days ago. He copied the current files off for safe keeping and
> reattached the old copy. Now he wants to apply the current LDF log to the 5 day old database that
> was attached. Is this possible?
> This nightmare is neverending. Please someone help!
> Richard
>

Amazing scenario

OK Here it is.
The production database was detached so it could be moved. Upon
reattachment it decided it was corrupt and refused to allow me to reattach.
Another member of the dba team had a physical copy of the MDF and LDF from a
few days ago. He copied the current files off for safe keeping and
reattached the old copy. Now he wants to apply the current LDF log to the 5
day old database that was attached. Is this possible?
This nightmare is neverending. Please someone help!
Richard> He copied the current files off for safe keeping and reattached the old copy. Now he wants to
> apply the current LDF log to the 5 day old database that was attached. Is this possible?
No, SQL Server keep track of the internal "timestamp" of the database files and you have to attach
from the same point in time. Otherwise, we would have chaos.
I suggest you open a ticket with MS Support and see if they can assist with the attach. I always do
a DBCC CHECKDB and also a backup before these things, btw...
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Richard Douglass" <RDouglass@.arisinc.com> wrote in message
news:uDSpGga3GHA.5024@.TK2MSFTNGP02.phx.gbl...
> OK Here it is.
> The production database was detached so it could be moved. Upon reattachment it decided it was
> corrupt and refused to allow me to reattach. Another member of the dba team had a physical copy of
> the MDF and LDF from a few days ago. He copied the current files off for safe keeping and
> reattached the old copy. Now he wants to apply the current LDF log to the 5 day old database that
> was attached. Is this possible?
> This nightmare is neverending. Please someone help!
> Richard
>