Tuesday, March 27, 2012
Adding a new article to Transactional replication
I added a new article to an already existing publication via EM,
and reintialized it. When the snapshot agent ran the change was
replicated, but the snapshot agent took the snapshot of all the
articles in the publication about 85 of them, instead of just
replicating the change.
IS there a way to reintialize an article in the publication, so
snapshot agent would only snap that one article instead of the whole
publication?
Does this also apply to adding a new column or dropping a column from a
publication?
Thanks for your help.
GG
for sql 2000 replicating to sql 2000 subscribers, only the article should be
replicated. I am not sure what happened in your case.
Hilary Cotter
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
"GG" <gdabbara@.gmail.com> wrote in message
news:1117574970.901699.85980@.f14g2000cwb.googlegro ups.com...
> Hi,
> I added a new article to an already existing publication via EM,
> and reintialized it. When the snapshot agent ran the change was
> replicated, but the snapshot agent took the snapshot of all the
> articles in the publication about 85 of them, instead of just
> replicating the change.
> IS there a way to reintialize an article in the publication, so
> snapshot agent would only snap that one article instead of the whole
> publication?
> Does this also apply to adding a new column or dropping a column from a
> publication?
>
> Thanks for your help.
> GG
>
|||You mention that you reinitialized it - this is the reason why all articles
were created by the snapshot agent. After adding the article, you just need
to run the snapshot agent and then the distribution agent to get the single
article.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Thanks for your responses. I will try just starting the snapshot agent
instead of reintializing the whole publication. I was under the
impression that snapshot agent doesn't know about the change unless I
reintialize.
Thanks
GG
|||Adding an article is normally taken care of when running the snapshot. There
are some exceptions - if the initial publication was a nosync one, then the
snapshot of the new article won't generate anything by default. However
assuming this is niot the case you'll be fine.
Rgds,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
Thursday, March 22, 2012
Adding a article causes ALL articles to be refreshed
I have setup Transactional replication in SQL 2005 between two servers and have about 200 tables being replicated. The problem is that every time, I add or drop a table to replication, and start the Snapshot agent, it re-initializes every article and re-loads every article. This process takes 1 hour to complete and CPU usage goes to 100% during that time.
This behaviour seems very different from SQL 2000 where I would start Snapshot agent and only the relevant tables were added/dropped.
Has that functionality changed from 2000 to 2005? Am I not doing something right?
Thanks,
Amir
This is the default behavior for anonymous subscribers. IIRC through the GUI for named subscribers a complete snapshot will be generated. However if you use sp_addarticle only the mini snapshot for the one table will be generated.|||I have tried using sp_article. The problem is that it gives me the error:
Cannot make the change because a snapshot is already generated. Set @.force_invalidate_snapshot to 1 to force the change and invalidate the existing snapshot.
And in order to avoid the error, if I use the Option of @.force_invalidate_snapshot=1, then again I am back to where I was before and it re-initializes everything.
BTW, What does IIRC mean?
Thanks,
Amir
|||
Any more thoughts on this? If my replication is setup and running, is there NO WAY to add "one" table to the publication without having to do the Bulk copy on ALL tables? Adding a table to replication seems one of the most basic maintenance tasks. I'm still surprised that MSFT has made that basic task so difficult in 2005.
Tuesday, March 20, 2012
added article to current transactional repl. How to replicate additional article?
(production server to reporting server).
I have created a new table witha primary key and have added this table as
an article to the publication.
How can i get my setup to take an initial snapshot of the table and apply it
to the reporting server?
Any help most appreciated!
thanks
John
John,
you will need to run the snapshot agent then synchronize. The whole process
from start to finish is:
exec sp_addarticle @.publication = 'tTestFNames'
, @.article = 'tEmployees'
, @.source_table = 'tEmployees'
exec sp_addsubscription @.publication = 'tTestFNames'
, @.article = 'tEmployees'
, @.subscriber = 'RSCOMPUTER'
, @.destination_db = 'testrep'
Start snapshot agent, start distribuition agent.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
|||Thanks Paul,
Are you saying that I have to take a snapshot of the whole database all over
again?
I thought I could take a snapshot of just the article that has been newely
added to the publication?
In actual fact, the 'Last Action' column on my agent (subsicriber' is saying
"The initial snapshot for article 'myTable' is not yet available"
Many thanks!
John
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:OQ2XvSVEGHA.4000@.TK2MSFTNGP10.phx.gbl...
> John,
> you will need to run the snapshot agent then synchronize. The whole
> process from start to finish is:
> exec sp_addarticle @.publication = 'tTestFNames'
> , @.article = 'tEmployees'
> , @.source_table = 'tEmployees'
> exec sp_addsubscription @.publication = 'tTestFNames'
> , @.article = 'tEmployees'
> , @.subscriber = 'RSCOMPUTER'
> , @.destination_db = 'testrep'
> Start snapshot agent, start distribuition agent.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
> (recommended sql server 2000 replication book:
> http://www.nwsu.com/0974973602p.html)
>
|||John,
if you add a new table and subscription to that table, running the snapshot
agent won't create a complete snapshot - just the new article.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)
Tuesday, March 6, 2012
Add new article to transactional replication
We are using Transactional Replication with the subscribers initialized from
a backup (no snapshot). It's working great, but now we need to add several
new articles to the publication and have them picked up in the subscribers.
The only way I can get this to work is to drop the subscriber, backup the
published database, restore the previously made backup over the destination
databases and then re-create the subscriptions. There has to be a better
way?
I've tried using the sp_reinitializesubscription, but that doesn't work
since we aren't using a snapshot. I've tried skipping the restore, and just
creating the tables in both the source and destination databases. Doing
this, the subscription is re-created sucessfully, but data in the new
articles is not actually being replicated.
Replication isn't my forte, and the documentation on initializing with
backups is pretty sparse, so any advice is appreciated.
Use sp_addarticle followed by sp_addsubscription with @.sync_type =
automatic.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
Saturday, February 25, 2012
Add Extra Error Columns - From The Component?
I've read a MSDN article on enhancing error outputs with a script component. This solution added the script component astride the error output, and it was able to add a column with the error description text.
I would like to do something a little different. I'd like to add information from my custom component. When the component causes an error, it generally "knows why" - it has available to it the information that made it decide there was an error. I'd like to include that information in error outputs, but I haven't seen a way to do that.
Is this even possible using the error output directly? I could abandon error outputs and use Conditional Split, along with an "iserror" column plus my extra columns, but I'd prefer not to do that.
This might be possible. Try the following (I'm assuming your custom component is synchronous):
1. In your implementation of ProvideComponentProperties, create 2 outputs that are synchronous to the same input, put them in the same exclusion group and mark one of them as the error output. By marking it as an error output, you'll automatically get the 2 error output columns and the output should show up red in the designer. Then add a third column to that output for your error description.
2. In PreExecute, use FindColumnByLineageID to get the handle to the error description column you added. If you can't get the handle, then this isn't possible (I haven't tried it, but I can't think of anything in the API to keep you from getting it).
3. If you got the handle, use it in ProcessInput to set the error description before calling RedirectErrorRow.
|||
Ted Lee - MSFT wrote:
This might be possible. Try the following (I'm assuming your custom component is synchronous):
1. In your implementation of ProvideComponentProperties, create 2 outputs that are synchronous to the same input, put them in the same exclusion group and mark one of them as the error output. By marking it as an error output, you'll automatically get the 2 error output columns and the output should show up red in the designer. Then add a third column to that output for your error description.
That part worked. The extra column was added to the error output. Unfortunately:
Ted Lee - MSFT wrote:
2. In PreExecute, use FindColumnByLineageID to get the handle to the error description column you added. If you can't get the handle, then this isn't possible (I haven't tried it, but I can't think of anything in the API to keep you from getting it).
The above caused an error during PreExecute:
The output "TranslateProvidersErrorOutput" (347) is a synchronous output and the buffer type cannot be retrieved for a synchronous output.
The code I tried is:
Code Snippet
public override void ProvideComponentProperties()
{
ComponentMetaData.UsesDispositions = true;
IDTSInput90 input = ComponentMetaData.InputCollection.New();
input.Name = "TranslateProvidersInput";
input.ErrorRowDisposition = DTSRowDisposition.RD_FailComponent;
IDTSOutput90 output = ComponentMetaData.OutputCollection.New();
output.Name = "TranslateProvidersOutput";
output.SynchronousInputID = input.ID;
output.ExclusionGroup = 1;
// The new code:
IDTSOutput90 errorOutput = ComponentMetaData.OutputCollection.New();
errorOutput.Name = "TranslateProvidersErrorOutput";
errorOutput.SynchronousInputID = input.ID;
errorOutput.ExclusionGroup = 1;
errorOutput.IsErrorOut = true;
IDTSOutputColumn90 extraColumn = errorOutput.OutputColumnCollection.New();
extraColumn.Name = "ErrorDescription";
extraColumn.SetDataTypeProperties(DataType.DT_WSTR, 255, 0, 0, 0);
_extraColumnLineageID = extraColumn.LineageID;
// The original code:
//AddErrorOutput(
//"TranslateProvidersErrorOutput", input.ID, output.ExclusionGroup);
IDTSRuntimeConnection90 connection =
ComponentMetaData.RuntimeConnectionCollection.New();
connection.Name = "ADONET";
}
public override void PreExecute()
{
IDTSOutput90 errorOutput = ComponentMetaData.OutputCollection[1];
_extraColumnIndex =
BufferManager.FindColumnByLineageID(
errorOutput.Buffer, _extraColumnLineageID);
}
The hightlighted code is what failed.
I don't yet understand how buffers work with multiple outputs, so I can't figure out any other way to get the column index. I'm stuck at that point, for now.
If anyone has more ideas, I'll be glad to try them. One workaround I thought of was to add the extra columns to the default output and see if they get replicated to the error output when the default error output is created. This would have the unfortunate side-effect of proliferating error-only columns throughout the data flow, but should work well enough if the extra columns are truly required.
It will be necessary for components in the flow to not add one of these columns if it is already present.
|||John,
I've got this working in my destination component: adding error messages, row #, time, etc.
The difference I think is in this line:
IDTSOutput90 errorOutput = ComponentMetaData.OutputCollection[1];
_extraColumnIndex =
BufferManager.FindColumnByLineageID(
errorOutput.Buffer, _extraColumnLineageID);
The equivalent in my code would be:
IDTSInput90 input = ComponentMetaData.InputCollection[0];
_extraColumnIndex =
BufferManager.FindColumnByLineageID(
input.Buffer, _extraColumnLineageID);
It is the input buffer that actually has the slots for the new error columns.
Martin
Add Extra Error Columns - From The Component?
I've read a MSDN article on enhancing error outputs with a script component. This solution added the script component astride the error output, and it was able to add a column with the error description text.
I would like to do something a little different. I'd like to add information from my custom component. When the component causes an error, it generally "knows why" - it has available to it the information that made it decide there was an error. I'd like to include that information in error outputs, but I haven't seen a way to do that.
Is this even possible using the error output directly? I could abandon error outputs and use Conditional Split, along with an "iserror" column plus my extra columns, but I'd prefer not to do that.
This might be possible. Try the following (I'm assuming your custom component is synchronous):
1. In your implementation of ProvideComponentProperties, create 2 outputs that are synchronous to the same input, put them in the same exclusion group and mark one of them as the error output. By marking it as an error output, you'll automatically get the 2 error output columns and the output should show up red in the designer. Then add a third column to that output for your error description.
2. In PreExecute, use FindColumnByLineageID to get the handle to the error description column you added. If you can't get the handle, then this isn't possible (I haven't tried it, but I can't think of anything in the API to keep you from getting it).
3. If you got the handle, use it in ProcessInput to set the error description before calling RedirectErrorRow.
|||
Ted Lee - MSFT wrote:
This might be possible. Try the following (I'm assuming your custom component is synchronous):
1. In your implementation of ProvideComponentProperties, create 2 outputs that are synchronous to the same input, put them in the same exclusion group and mark one of them as the error output. By marking it as an error output, you'll automatically get the 2 error output columns and the output should show up red in the designer. Then add a third column to that output for your error description.
That part worked. The extra column was added to the error output. Unfortunately:
Ted Lee - MSFT wrote:
2. In PreExecute, use FindColumnByLineageID to get the handle to the error description column you added. If you can't get the handle, then this isn't possible (I haven't tried it, but I can't think of anything in the API to keep you from getting it).
The above caused an error during PreExecute:
The output "TranslateProvidersErrorOutput" (347) is a synchronous output and the buffer type cannot be retrieved for a synchronous output.
The code I tried is:
Code Snippet
public override void ProvideComponentProperties()
{
ComponentMetaData.UsesDispositions = true;
IDTSInput90 input = ComponentMetaData.InputCollection.New();
input.Name = "TranslateProvidersInput";
input.ErrorRowDisposition = DTSRowDisposition.RD_FailComponent;
IDTSOutput90 output = ComponentMetaData.OutputCollection.New();
output.Name = "TranslateProvidersOutput";
output.SynchronousInputID = input.ID;
output.ExclusionGroup = 1;
// The new code:
IDTSOutput90 errorOutput = ComponentMetaData.OutputCollection.New();
errorOutput.Name = "TranslateProvidersErrorOutput";
errorOutput.SynchronousInputID = input.ID;
errorOutput.ExclusionGroup = 1;
errorOutput.IsErrorOut = true;
IDTSOutputColumn90 extraColumn = errorOutput.OutputColumnCollection.New();
extraColumn.Name = "ErrorDescription";
extraColumn.SetDataTypeProperties(DataType.DT_WSTR, 255, 0, 0, 0);
_extraColumnLineageID = extraColumn.LineageID;
// The original code:
//AddErrorOutput(
//"TranslateProvidersErrorOutput", input.ID, output.ExclusionGroup);
IDTSRuntimeConnection90 connection =
ComponentMetaData.RuntimeConnectionCollection.New();
connection.Name = "ADONET";
}
public override void PreExecute()
{
IDTSOutput90 errorOutput = ComponentMetaData.OutputCollection[1];
_extraColumnIndex =
BufferManager.FindColumnByLineageID(
errorOutput.Buffer, _extraColumnLineageID);
}
The hightlighted code is what failed.
I don't yet understand how buffers work with multiple outputs, so I can't figure out any other way to get the column index. I'm stuck at that point, for now.
If anyone has more ideas, I'll be glad to try them. One workaround I thought of was to add the extra columns to the default output and see if they get replicated to the error output when the default error output is created. This would have the unfortunate side-effect of proliferating error-only columns throughout the data flow, but should work well enough if the extra columns are truly required.
It will be necessary for components in the flow to not add one of these columns if it is already present.
|||John,
I've got this working in my destination component: adding error messages, row #, time, etc.
The difference I think is in this line:
IDTSOutput90 errorOutput = ComponentMetaData.OutputCollection[1];
_extraColumnIndex =
BufferManager.FindColumnByLineageID(
errorOutput.Buffer, _extraColumnLineageID);
The equivalent in my code would be:
IDTSInput90 input = ComponentMetaData.InputCollection[0];
_extraColumnIndex =
BufferManager.FindColumnByLineageID(
input.Buffer, _extraColumnLineageID);
It is the input buffer that actually has the slots for the new error columns.
Martin
Friday, February 24, 2012
Add data files to tempdb.
According KB article 328551 FIX: Concurrency enhancements for the tempdb
database. I like to add data files to my tempdb in Prod server. Please help
me check if the following statements are right if the server has 4 CPUs.
alter database tempdb
modify file (name = 'tempdev', size = 250MB, maxsize = 2000MB,
filegrowth = 50MB)
go
alter database tempdb
add filegroup temp_group1
go
alter database tempdb
add file (
name = tempdev1,
filename = 'E:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\tempdev1.ndf',
size = 250MB,
maxsize = 2000MB,
filegrowth = 50MB)
to filegroup temp_group1
go
alter database tempdb
add filegroup temp_group2
go
alter database tempdb
add file (
name = tempdev2,
filename = 'E:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\tempdev2.ndf',
size = 250MB,
maxsize = 2000MB,
filegrowth = 50MB)
to filegroup temp_group2
go
alter database tempdb
add filegroup temp_group3
go
alter database tempdb
add file (
name = tempdev3,
filename = 'E:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\tempdev3.ndf',
size = 250MB,
maxsize = 2000MB,
filegrowth = 50MB)
to filegroup temp_group3
go
Regards!
ChenYou cannot add new filegroups to tempdb, only files.
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
Download the latest version of Books Online from
http://www.microsoft.com/technet/pr...oads/books.mspx
"Chen" <Chen@.discussions.microsoft.com> wrote in message
news:2690FA6F-12B1-42FB-874D-AC3AEC0C8D0B@.microsoft.com...
> Hi,
> According KB article 328551 FIX: Concurrency enhancements for the tempdb
> database. I like to add data files to my tempdb in Prod server. Please
> help
> me check if the following statements are right if the server has 4 CPUs.
> alter database tempdb
> modify file (name = 'tempdev', size = 250MB, maxsize = 2000MB,
> filegrowth = 50MB)
> go
> alter database tempdb
> add filegroup temp_group1
> go
> alter database tempdb
> add file (
> name = tempdev1,
> filename = 'E:\Program Files\Microsoft SQL
> Server\MSSQL.1\MSSQL\DATA\tempdev1.ndf',
> size = 250MB,
> maxsize = 2000MB,
> filegrowth = 50MB)
> to filegroup temp_group1
> go
> alter database tempdb
> add filegroup temp_group2
> go
> alter database tempdb
> add file (
> name = tempdev2,
> filename = 'E:\Program Files\Microsoft SQL
> Server\MSSQL.1\MSSQL\DATA\tempdev2.ndf',
> size = 250MB,
> maxsize = 2000MB,
> filegrowth = 50MB)
> to filegroup temp_group2
> go
> alter database tempdb
> add filegroup temp_group3
> go
> alter database tempdb
> add file (
> name = tempdev3,
> filename = 'E:\Program Files\Microsoft SQL
> Server\MSSQL.1\MSSQL\DATA\tempdev3.ndf',
> size = 250MB,
> maxsize = 2000MB,
> filegrowth = 50MB)
> to filegroup temp_group3
> go
> Regards!
> Chen
>
Add data files to tempdb.
According KB article 328551 FIX: Concurrency enhancements for the tempdb
database. I like to add data files to my tempdb in Prod server. Please help
me check if the following statements are right if the server has 4 CPUs.
alter database tempdb
modify file (name = 'tempdev', size = 250MB, maxsize = 2000MB,
filegrowth = 50MB)
go
alter database tempdb
add filegroup temp_group1
go
alter database tempdb
add file (
name = tempdev1,
filename = 'E:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\tempdev1.ndf',
size = 250MB,
maxsize = 2000MB,
filegrowth = 50MB)
to filegroup temp_group1
go
alter database tempdb
add filegroup temp_group2
go
alter database tempdb
add file (
name = tempdev2,
filename = 'E:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\tempdev2.ndf',
size = 250MB,
maxsize = 2000MB,
filegrowth = 50MB)
to filegroup temp_group2
go
alter database tempdb
add filegroup temp_group3
go
alter database tempdb
add file (
name = tempdev3,
filename = 'E:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\tempdev3.ndf',
size = 250MB,
maxsize = 2000MB,
filegrowth = 50MB)
to filegroup temp_group3
go
Regards!
Chen
You cannot add new filegroups to tempdb, only files.
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
Download the latest version of Books Online from
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
"Chen" <Chen@.discussions.microsoft.com> wrote in message
news:2690FA6F-12B1-42FB-874D-AC3AEC0C8D0B@.microsoft.com...
> Hi,
> According KB article 328551 FIX: Concurrency enhancements for the tempdb
> database. I like to add data files to my tempdb in Prod server. Please
> help
> me check if the following statements are right if the server has 4 CPUs.
> alter database tempdb
> modify file (name = 'tempdev', size = 250MB, maxsize = 2000MB,
> filegrowth = 50MB)
> go
> alter database tempdb
> add filegroup temp_group1
> go
> alter database tempdb
> add file (
> name = tempdev1,
> filename = 'E:\Program Files\Microsoft SQL
> Server\MSSQL.1\MSSQL\DATA\tempdev1.ndf',
> size = 250MB,
> maxsize = 2000MB,
> filegrowth = 50MB)
> to filegroup temp_group1
> go
> alter database tempdb
> add filegroup temp_group2
> go
> alter database tempdb
> add file (
> name = tempdev2,
> filename = 'E:\Program Files\Microsoft SQL
> Server\MSSQL.1\MSSQL\DATA\tempdev2.ndf',
> size = 250MB,
> maxsize = 2000MB,
> filegrowth = 50MB)
> to filegroup temp_group2
> go
> alter database tempdb
> add filegroup temp_group3
> go
> alter database tempdb
> add file (
> name = tempdev3,
> filename = 'E:\Program Files\Microsoft SQL
> Server\MSSQL.1\MSSQL\DATA\tempdev3.ndf',
> size = 250MB,
> maxsize = 2000MB,
> filegrowth = 50MB)
> to filegroup temp_group3
> go
> Regards!
> Chen
>
Add data files to tempdb.
According KB article 328551 FIX: Concurrency enhancements for the tempdb
database. I like to add data files to my tempdb in Prod server. Please help
me check if the following statements are right if the server has 4 CPUs.
alter database tempdb
modify file (name = 'tempdev', size = 250MB, maxsize = 2000MB,
filegrowth = 50MB)
go
alter database tempdb
add filegroup temp_group1
go
alter database tempdb
add file (
name = tempdev1,
filename = 'E:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\tempdev1.ndf',
size = 250MB,
maxsize = 2000MB,
filegrowth = 50MB)
to filegroup temp_group1
go
alter database tempdb
add filegroup temp_group2
go
alter database tempdb
add file (
name = tempdev2,
filename = 'E:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\tempdev2.ndf',
size = 250MB,
maxsize = 2000MB,
filegrowth = 50MB)
to filegroup temp_group2
go
alter database tempdb
add filegroup temp_group3
go
alter database tempdb
add file (
name = tempdev3,
filename = 'E:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\DATA\tempdev3.ndf',
size = 250MB,
maxsize = 2000MB,
filegrowth = 50MB)
to filegroup temp_group3
go
Regards!
ChenYou cannot add new filegroups to tempdb, only files.
--
Gail Erickson [MS]
SQL Server Documentation Team
This posting is provided "AS IS" with no warranties, and confers no rights
Download the latest version of Books Online from
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
"Chen" <Chen@.discussions.microsoft.com> wrote in message
news:2690FA6F-12B1-42FB-874D-AC3AEC0C8D0B@.microsoft.com...
> Hi,
> According KB article 328551 FIX: Concurrency enhancements for the tempdb
> database. I like to add data files to my tempdb in Prod server. Please
> help
> me check if the following statements are right if the server has 4 CPUs.
> alter database tempdb
> modify file (name = 'tempdev', size = 250MB, maxsize = 2000MB,
> filegrowth = 50MB)
> go
> alter database tempdb
> add filegroup temp_group1
> go
> alter database tempdb
> add file (
> name = tempdev1,
> filename = 'E:\Program Files\Microsoft SQL
> Server\MSSQL.1\MSSQL\DATA\tempdev1.ndf',
> size = 250MB,
> maxsize = 2000MB,
> filegrowth = 50MB)
> to filegroup temp_group1
> go
> alter database tempdb
> add filegroup temp_group2
> go
> alter database tempdb
> add file (
> name = tempdev2,
> filename = 'E:\Program Files\Microsoft SQL
> Server\MSSQL.1\MSSQL\DATA\tempdev2.ndf',
> size = 250MB,
> maxsize = 2000MB,
> filegrowth = 50MB)
> to filegroup temp_group2
> go
> alter database tempdb
> add filegroup temp_group3
> go
> alter database tempdb
> add file (
> name = tempdev3,
> filename = 'E:\Program Files\Microsoft SQL
> Server\MSSQL.1\MSSQL\DATA\tempdev3.ndf',
> size = 250MB,
> maxsize = 2000MB,
> filegrowth = 50MB)
> to filegroup temp_group3
> go
> Regards!
> Chen
>
Sunday, February 19, 2012
Add column to a merge article.
article in a merge replication. I know how to do that in
enterprise manager, but i need to add this new column in
the table primary key. I try to do it but it seem that i
have to remove the replication, do the changes and then
configure the replication again.
Do you know if i can do this changes without removing the
replication? Could you explain me how?
Thanks a lot for your help.
have you tried sp_repladdcolumn?
"maria" <mariaisabelguzman@.icasa.com.gt> wrote in message
news:f7d501c4135a$1e0f9aa0$a001280a@.phx.gbl...
> Hi, I need to add a new column to a table that is an
> article in a merge replication. I know how to do that in
> enterprise manager, but i need to add this new column in
> the table primary key. I try to do it but it seem that i
> have to remove the replication, do the changes and then
> configure the replication again.
> Do you know if i can do this changes without removing the
> replication? Could you explain me how?
> Thanks a lot for your help.
>
|||Sp_repladdcolumn is valid for SQL Server 2000. If you have SQL Server 7.0,
you must drop the subscriptions and publication before adding the column.
Regards,
Shirley
SQL Server Support
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. 2001 Microsoft Corporation. All rights
reserved.
Add Article(table) to Trans Repl - Move to Subscriber
and have it move to the Subscribers without having to re-generate the Whole
Snapshot?
What to I monitor to see this happen and how long to I wait to see it update?
Thanks and God Bless,
ThomBeaux
Thanks and God Bless,
ThomBeaux
"ThomBeaux" wrote:
> How to you add an Article (Table) to a Transaction Replication Publication,
> and have it move to the Subscribers without having to re-generate the Whole
> Snapshot?
> What to I monitor to see this happen and how long to I wait to see it update?
> --
> Thanks and God Bless,
> ThomBeaux
|||Will a new snpahot be created for the whole Publication?
Thanks and God Bless,
ThomBeaux
"Paul Ibison" wrote:
> Just running sp_addarticle and sp_addsubscription then running the snapshot
> agent should be fine. Unlike merge, just the new article will get created.
> exec sp_addarticle @.publication = 'tTestFNames'
> , @.article = 'tEmployees'
> , @.source_table = 'tEmployees'
> exec sp_addsubscription @.publication = 'tTestFNames'
> , @.article = 'tEmployees'
> , @.subscriber = 'RSCOMPUTER'
> , @.destination_db = 'testrep'
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com
>
>
Add Article to Transactional
Have a transactional replication between 2 SQL 2000 servers. 1 is the publisher and the 2nd one is both distributor and subscriber.
Attempted to add an article to a publication via EM: right click the publication under 'Replication' folder and navigate to the
'Articles' tab. I 'showed' unpublished tables, check-marked the table I wanted added, got the warning screen about version compatibility, selected 'Apply' and then 'OK' to exit the properties page.
Of course the table does not appear in the subscriber db. I thought I followed what BOL said but I obviously missed something.
Anyone have any ideas as to what it was?
Thank you for your time.
Joe,
you need to run the snapshot agent to create the table snapshot, then run
the distribution agent to send it down.
Regards,
Paul Ibison
Add Article To Trans Rep
I am trying to add a table to a publication that already has a subscriber and have that table replicate to the subscriber.
2 servers, win2000, SQL 2000 all sp's applied.
1 server is the publisher and the 2nd is both the distributor and subscriber.
I went through the publication's properties page (em-replication-right click- properties) and added the table to the published articles list.
Then on the good advice of Paul Ibson in an earlier post to this newsgroup I created a new snapshot of the table and had
the dist. agent apply it. All went well.
However, new data in the table is not being replicated.
I've exhausted BOL and the web searches. Any recommendations as to the exact process I should follow would be greatly appreciated.
Thank you for your time.
Joe,
have you run the distribution agent? Run sp_browsereplcmds in the
distribution database to see if your new rows are waiting there. If they are
then just running the distribution agent will fix it. If not, then perhaps
the log reader is disabled?
HTH,
Paul Ibison
Add article to subscription
Have publication replicating 300 tables and I want to add 1 table.
sp_addarticle adds to publication, how do I add to each subscription (4)? Can
add schema to subscribers - new table so no rows exist anywhere.
How to add to subs in order to start replicating w/out re-synching each sub?
Thanks
Run the snapshot agent. This should generates a mini snapshot with only the
new article. The next time the distribution agent runs it should pick up the
new mini snapshot and distribute it.
Hilary Cotter
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
"Chris" <Chris@.discussions.microsoft.com> wrote in message
news:E31D5A8C-5C44-4593-AEB1-8B8C05E7A5F0@.microsoft.com...
> Transactional Replication - SQL 2000 - remote distributor
> Have publication replicating 300 tables and I want to add 1 table.
> sp_addarticle adds to publication, how do I add to each subscription (4)?
Can
> add schema to subscribers - new table so no rows exist anywhere.
> How to add to subs in order to start replicating w/out re-synching each
sub?
> Thanks
|||And if my table has 5 million rows - am I forced to do a snapshot. Can I do
a similar alternative init like making sure new column is out at subscriber
and then telling SQL that the subscriber does not need initialization?
Thanks,
Chris
"Hilary Cotter" wrote:
> Run the snapshot agent. This should generates a mini snapshot with only the
> new article. The next time the distribution agent runs it should pick up the
> new mini snapshot and distribute it.
> --
> Hilary Cotter
> 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
> "Chris" <Chris@.discussions.microsoft.com> wrote in message
> news:E31D5A8C-5C44-4593-AEB1-8B8C05E7A5F0@.microsoft.com...
> Can
> sub?
>
>
|||Oh - and don't I have to tell SQL to add it to one or all subscription(s)?
Thanks Hillary,
Chris
"Hilary Cotter" wrote:
> Run the snapshot agent. This should generates a mini snapshot with only the
> new article. The next time the distribution agent runs it should pick up the
> new mini snapshot and distribute it.
> --
> Hilary Cotter
> 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
> "Chris" <Chris@.discussions.microsoft.com> wrote in message
> news:E31D5A8C-5C44-4593-AEB1-8B8C05E7A5F0@.microsoft.com...
> Can
> sub?
>
>
add article to publication in Merge Replication
no-sync. A subscriber replicated last night with the following error:
The merge process could not retrieve column information for table
'dbo.ChargeGroup'.
(Source: Merge Replication Provider (Agent); Error number: -2147201016)
Could not find stored procedure 'sp_sel_00BE6107195E4608967622C23A664DE2'.
(Source: CBD076\MGW (Data source); Error number: 2812)
Do I need to reinitialize all my subscribers? I'm trying to add the
article without having to manually touch each one of the subscribers since
all of them are remote.
Thanks
Tina
Yes you will have to. You must use the @.force_invalidate_snapshot switch
with a setting of 1.ie
sp_addmergearticle 'Publication','tableName','tableName',
@.force_invalidate_snapshot=1
The bad news is that you will have to regenerate your snapshot. The good
news is that only this new article/table will travel to the subscriber(s).
Before you do this, can you check a couple of things.
Do a
select *from sysmergearticles where
select_proc='sp_sel_00BE6107195E4608967622C23A664D E2' on your publication
database and the problem subscriber.
Do you get a row on the publisher and none on the subscriber?
Then do this on your publisher?
select name from sysmergearticles where
select_proc='sp_sel_00BE6107195E4608967622C23A664D E2'
using that name do this on your subscriber
select select_proc from sysmergearticles where name=the name you got on your
publisher.
If these don't agree you have to drop your publications and subscriptions
and start again. Were you using dynamic snapshots? I ran into this problem
when I deployed dynamic snapshots, but after fixing it the one time,
everything worked well.
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html
"Tina Smith" <tb.smith@.earthlink.net> wrote in message
news:e8hf7NGgEHA.3132@.TK2MSFTNGP10.phx.gbl...
> I added an article to one of my publication with sp_addmergearticle as a
> no-sync. A subscriber replicated last night with the following error:
> The merge process could not retrieve column information for table
> 'dbo.ChargeGroup'.
> (Source: Merge Replication Provider (Agent); Error number: -2147201016)
> ----
--
> --
> Could not find stored procedure 'sp_sel_00BE6107195E4608967622C23A664DE2'.
> (Source: CBD076\MGW (Data source); Error number: 2812)
> ----
--
> --
> Do I need to reinitialize all my subscribers? I'm trying to add the
> article without having to manually touch each one of the subscribers since
> all of them are remote.
> Thanks
> Tina
>
|||I already added the article with force_invalidate_snapshot = 1 and
regenerated the snapshot.
The sp_sel_ does exist in my sysmergearticles table on the publisher. The
subscriber is remote so I haven't had a chance to check for the stored
procedure on the subscriber.
Yes, I am using dynamic filters. I sure hope I don't have to drop my
publications to fix this.
"Hilary Cotter" <hilaryk@.att.net> wrote in message
news:u9WkigGgEHA.556@.tk2msftngp13.phx.gbl...
> Yes you will have to. You must use the @.force_invalidate_snapshot switch
> with a setting of 1.ie
> sp_addmergearticle 'Publication','tableName','tableName',
> @.force_invalidate_snapshot=1
> The bad news is that you will have to regenerate your snapshot. The good
> news is that only this new article/table will travel to the subscriber(s).
> Before you do this, can you check a couple of things.
> Do a
> select *from sysmergearticles where
> select_proc='sp_sel_00BE6107195E4608967622C23A664D E2' on your publication
> database and the problem subscriber.
> Do you get a row on the publisher and none on the subscriber?
> Then do this on your publisher?
> select name from sysmergearticles where
> select_proc='sp_sel_00BE6107195E4608967622C23A664D E2'
> using that name do this on your subscriber
> select select_proc from sysmergearticles where name=the name you got on
your[vbcol=seagreen]
> publisher.
> If these don't agree you have to drop your publications and subscriptions
> and start again. Were you using dynamic snapshots? I ran into this problem
> when I deployed dynamic snapshots, but after fixing it the one time,
> everything worked well.
> --
> Hilary Cotter
> Looking for a book on SQL Server replication?
> http://www.nwsu.com/0974973602.html
>
> "Tina Smith" <tb.smith@.earthlink.net> wrote in message
> news:e8hf7NGgEHA.3132@.TK2MSFTNGP10.phx.gbl...
> ----
> --
'sp_sel_00BE6107195E4608967622C23A664DE2'.[vbcol=seagreen]
> ----
> --
since
>
|||You mentioned that you added it as no-sync.
Did you mean the subscription was added as a no sync subscription ?
If so then, the table needs to exist at the subscriber when merge is run.
Hope that helps
--Mahesh
[ This posting is provided "as is" with no warranties and confers no
rights. ]
"Tina Smith" <tb.smith@.earthlink.net> wrote in message
news:ug9Z8HLgEHA.904@.TK2MSFTNGP09.phx.gbl...
> I already added the article with force_invalidate_snapshot = 1 and
> regenerated the snapshot.
> The sp_sel_ does exist in my sysmergearticles table on the publisher.
The[vbcol=seagreen]
> subscriber is remote so I haven't had a chance to check for the stored
> procedure on the subscriber.
> Yes, I am using dynamic filters. I sure hope I don't have to drop my
> publications to fix this.
> "Hilary Cotter" <hilaryk@.att.net> wrote in message
> news:u9WkigGgEHA.556@.tk2msftngp13.phx.gbl...
subscriber(s).[vbcol=seagreen]
publication[vbcol=seagreen]
> your
subscriptions[vbcol=seagreen]
problem[vbcol=seagreen]
a[vbcol=seagreen]
error:[vbcol=seagreen]
number: -2147201016)
> ----
> 'sp_sel_00BE6107195E4608967622C23A664DE2'.
> ----
> since
>
|||Hi Mahesh,
The table already exist at the subscriber.
Thanks
Tina
"Mahesh [MSFT]" <maheshrd@.hotmail.com> wrote in message
news:eHsJpXNgEHA.140@.TK2MSFTNGP12.phx.gbl...[vbcol=seagreen]
> You mentioned that you added it as no-sync.
> Did you mean the subscription was added as a no sync subscription ?
> If so then, the table needs to exist at the subscriber when merge is run.
> Hope that helps
> --Mahesh
> [ This posting is provided "as is" with no warranties and confers no
> rights. ]
> "Tina Smith" <tb.smith@.earthlink.net> wrote in message
> news:ug9Z8HLgEHA.904@.TK2MSFTNGP09.phx.gbl...
> The
switch[vbcol=seagreen]
good[vbcol=seagreen]
> subscriber(s).
> publication
on[vbcol=seagreen]
> subscriptions
> problem
as[vbcol=seagreen]
> a
> error:
> number: -2147201016)
> ----
> ----
the
>
|||I ran into something a little similar with dynamic snapshots.
I deployed one group of 20 subscribers one month, and then another month I
deployed a second 20. IIRC the first 20 encountered this error.
I had to start from scratch. The error I got was with missing sp_ins*,
sp_upd*, and sp_del* procs on the subscriber.
After the second deployement we never had the error again.
Hilary Cotter
Looking for a book on SQL Server replication?
http://www.nwsu.com/0974973602.html
"Tina Smith" <tb.smith@.earthlink.net> wrote in message
news:ug9Z8HLgEHA.904@.TK2MSFTNGP09.phx.gbl...
> I already added the article with force_invalidate_snapshot = 1 and
> regenerated the snapshot.
> The sp_sel_ does exist in my sysmergearticles table on the publisher.
The[vbcol=seagreen]
> subscriber is remote so I haven't had a chance to check for the stored
> procedure on the subscriber.
> Yes, I am using dynamic filters. I sure hope I don't have to drop my
> publications to fix this.
> "Hilary Cotter" <hilaryk@.att.net> wrote in message
> news:u9WkigGgEHA.556@.tk2msftngp13.phx.gbl...
subscriber(s).[vbcol=seagreen]
publication[vbcol=seagreen]
> your
subscriptions[vbcol=seagreen]
problem[vbcol=seagreen]
a[vbcol=seagreen]
error:[vbcol=seagreen]
number: -2147201016)
> ----
> 'sp_sel_00BE6107195E4608967622C23A664DE2'.
> ----
> since
>
|||Thanks for all your input. I have many shoppes scheduled to replicate
Monday night. I'll assess the issue Tuesday morning and see where I need
to go from there. I'll let you know how it turns out.
"Hilary Cotter" <hilaryk@.att.net> wrote in message
news:%23QzAfNTgEHA.2588@.TK2MSFTNGP10.phx.gbl...[vbcol=seagreen]
> I ran into something a little similar with dynamic snapshots.
> I deployed one group of 20 subscribers one month, and then another month I
> deployed a second 20. IIRC the first 20 encountered this error.
> I had to start from scratch. The error I got was with missing sp_ins*,
> sp_upd*, and sp_del* procs on the subscriber.
> After the second deployement we never had the error again.
>
> --
> Hilary Cotter
> Looking for a book on SQL Server replication?
> http://www.nwsu.com/0974973602.html
>
> "Tina Smith" <tb.smith@.earthlink.net> wrote in message
> news:ug9Z8HLgEHA.904@.TK2MSFTNGP09.phx.gbl...
> The
switch[vbcol=seagreen]
good[vbcol=seagreen]
> subscriber(s).
> publication
on[vbcol=seagreen]
> subscriptions
> problem
as[vbcol=seagreen]
> a
> error:
> number: -2147201016)
> ----
> ----
the
>
Add article to Merge Repl. Publication
Your help is greatly appreciated.
GaryHi, don't add the table to both sides. Just add the table at the publisher and include it in the publication using the ARTICLES tab of Replication-Properties in EM. Start the Snapshot-Agent. The merge agent would apply only the new table to the subscriber. It's for the subscribers running SQL2000.|||Thanks for the prompt reply. The scripts will also modify some stored procedures - is that handled by the snapshot, or are the changes just replicated?|||Hi, the merge-agent applies the new tables to the subscriber.
About stored-procedures i am not sure, can u modify the stored-procedure if it's being published? Published tables can't be modified unless we use sp_repladdcolumn/sp_repldropcolumn to add or drop columns within the published tables. See if u can modify a published stored procedure at the publisher.
Howdy!
Monday, February 13, 2012
Add a article to a Merge Replication
article, but I don't like reinitialize all my subscriptions.
I try to use the sp_addarticle,
sp_addarticle [ @.publication = ] 'NamePublication'
, [ @.article = ] 'NameArticle'
, [ @.source_table = ] 'source_table'
but when I 'm running the sp it is send me this message
Server: Msg 208, Level 16, State 1, Procedure sp_MSreinit_article, Line 25
Invalid object name 'syspublications'.
can you query the syspublications table on your publisher?
Are all objects owned by dbo?
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
"David Barquero" <davbarquero@.hotmail.com> wrote in message
news:um0KPj$9EHA.3504@.TK2MSFTNGP12.phx.gbl...
> I have a Merge Replication with 48 subscriptions and I like add a new
> article, but I don't like reinitialize all my subscriptions.
> I try to use the sp_addarticle,
> sp_addarticle [ @.publication = ] 'NamePublication'
> , [ @.article = ] 'NameArticle'
> , [ @.source_table = ] 'source_table'
> but when I 'm running the sp it is send me this message
> Server: Msg 208, Level 16, State 1, Procedure sp_MSreinit_article, Line 25
> Invalid object name 'syspublications'.
>
|||I was getting very similar messages when I was modifying system stored
procedures and did not restored their original attributes.
I am not sure how it all works, but if you modify system stored procedure,
it's attributes (in sysobjects table) are changed - column 'status' and
'base_schema_ver' are updated by the system. You have to restore those
values to the state that was before applying your modifications.
For example you are modifying stored procedure sp_addmergearticle.
1. Before doing your modifications, select current data from sysobjects for
that stored procedure.
SELECT * FROM [master].[dbo].[sysobjects] WHERE name = 'sp_addmergearticle'
2. Do your modifications to sp_addmergearticle
3. Update sysobjects with values selected in the 1st step
UPDATE [master].[dbo].[sysobjects]
SET [status]=-1073741823,
[base_schema_ver]=16
WHERE name = 'sp_addmergearticle'
4. Enjoy your working (hopefully) replication
Regards,
Kestutis Adomavicius
Consultant
UAB "Baltic Software Solutions"
"David Barquero" <davbarquero@.hotmail.com> wrote in message
news:um0KPj$9EHA.3504@.TK2MSFTNGP12.phx.gbl...
> I have a Merge Replication with 48 subscriptions and I like add a new
> article, but I don't like reinitialize all my subscriptions.
> I try to use the sp_addarticle,
> sp_addarticle [ @.publication = ] 'NamePublication'
> , [ @.article = ] 'NameArticle'
> , [ @.source_table = ] 'source_table'
> but when I 'm running the sp it is send me this message
> Server: Msg 208, Level 16, State 1, Procedure sp_MSreinit_article, Line 25
> Invalid object name 'syspublications'.
>
|||Please use sp_addmergearticle.
thanks - deepak
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"David Barquero" <davbarquero@.hotmail.com> wrote in message
news:um0KPj$9EHA.3504@.TK2MSFTNGP12.phx.gbl...
> I have a Merge Replication with 48 subscriptions and I like add a new
> article, but I don't like reinitialize all my subscriptions.
> I try to use the sp_addarticle,
> sp_addarticle [ @.publication = ] 'NamePublication'
> , [ @.article = ] 'NameArticle'
> , [ @.source_table = ] 'source_table'
> but when I 'm running the sp it is send me this message
> Server: Msg 208, Level 16, State 1, Procedure sp_MSreinit_article, Line 25
> Invalid object name 'syspublications'.
>
|||Great observation
sp_addarticle instead of sp_addmergearticle
Regards,
Kestutis Adomavicius
Consultant
UAB "Baltic Software Solutions"
"Deepak kumar [MSFT]" <dk@.online.microsoft.com> wrote in message
news:uQ3AnZQ$EHA.3708@.TK2MSFTNGP14.phx.gbl...
> Please use sp_addmergearticle.
> thanks - deepak
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.[vbcol=seagreen]
> Use of included script samples are subject to the terms specified at
> http://www.microsoft.com/info/cpyright.htm
> "David Barquero" <davbarquero@.hotmail.com> wrote in message
> news:um0KPj$9EHA.3504@.TK2MSFTNGP12.phx.gbl...
25
>