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

Monday, March 19, 2012

How to configure multiple subscriber to same publisher using filte

Hi,
I have a base table in publisher db. I have a column, using which i want to
filter it and replicate it to certain dbs. how do i dynamically do it ?
Like for eg, consider this table :
ID Project name center
1 A NY
2 B LON
3 C PAR
now, i want to filter using the column "center". if center = 'NY', then i
must direct it to a particular subscriber. if it is "LON" then it must be
directed to someother subscriber. also, i must accomplish this using merge
replication
for my requirement, i am not able to use multiple publishers to accomplish
it. i must use one publisher, with a filter which varies dynamically
depending on the subscriber.
please explain how i can accomplish this.
PS : I'm new to databases. sorry if this question is very basic
Ki,
this question is not at all basic
You can use dynamic filtering in merge replication. Set up the filter as
center = HOST_NAME(). In the merge agent, before initializing, edit the
command-line parameters and add -HOSTNAME NY for the NY subscriber and so on
for the others.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

Wednesday, March 7, 2012

How to compare 2 tables ot different DBs in Oracle style

In Oracle this is done this way :
SQL>
1 select ID, NAME from TABLENAME
2* minus select ID,NAME from TABLENAME@.DATABASE2
SQL>

Any ideas ?Yeah...minus is a way to do a non existance checj=k...or a left outer join where the right table key is null...

I don't know what your talking about with @.DATABASE2|||Originally posted by Brett Kaiser
I don't know what your talking about with @.DATABASE2 That's Oracle speak for DATABASE2..TABLENAME in SQL-92.

-PatP|||See...my Oracle naivite' is showing...

Never dealt with more than 1 db in Oracle...|||select ID, NAME from TABLENAME
minus select ID,NAME from TABLENAME@.DATABASE2

This statement compares table TABLENAME in current database and DATABASE2 and shows the lines that are missing in the current database.

If it returns

1 | Test1
2 | Test2

this meanse that these 2 lines exists in TABLENAME in current DB, and doest not exists in TABLENAME in DATABASE2.

In SQL Server it should be something like this :

SELECT ID, NAME FROM TABLENAME
MINUS
SELECT ID,NAME FROM DATABASE2..TABLENAME

but we don't have MINUS in T-SQL|||Might I suggest using a FULL OUTER JOIN to see what was added or deleted, then a compare of the column values to see what keys have different values associated with them?

-PatP|||FYI, http://www.sql-server-performance.com/vg_database_comparison_sp.asp

Originally posted by The-Saint
In Oracle this is done this way :

SQL>
1 select ID, NAME from TABLENAME
2* minus select ID,NAME from TABLENAME@.DATABASE2
SQL>

Any ideas ?