<!--
 -  
 -  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
 -  project.
 -  
 -  Copyright (C) 1998-2018 OpenLink Software
 -  
 -  This project is free software; you can redistribute it and/or modify it
 -  under the terms of the GNU General Public License as published by the
 -  Free Software Foundation; only version 2 of the License, dated June 1991.
 -  
 -  This program is distributed in the hope that it will be useful, but
 -  WITHOUT ANY WARRANTY; without even the implied warranty of
 -  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 -  General Public License for more details.
 -  
 -  You should have received a copy of the GNU General Public License along
 -  with this program; if not, write to the Free Software Foundation, Inc.,
 -  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
 -  
 -  
-->
<?xml version="1.0" encoding="ISO-8859-1"?>
<refentry id="RE-SB-3">
  <refmeta>
    <refentrytitle>Bidirectional Snapshot Replicaton Setup</refentrytitle>
    <refmiscinfo>tutorial</refmiscinfo>
  </refmeta>
  <refnamediv>
    <refname>Defining subscribers for published table</refname>
    <refpurpose>Defining subscribers</refpurpose>
  </refnamediv>

<refsect1 id="RE-SB-3a">
<title>Preliminaries</title>
<para>In order to run this example you need two Virtuoso servers running
(publisher and subscriber). In the example scripts it is assumed that the first Virtuoso server
(publisher) is running at localhost:1111 and the second Virtuoso server
(subscriber) is running at localhost:1112. If you are running ODBC
versions of the servers there should be 2 ODBC DSN's records named
"localhost:1111" and "localhost:1112". Subscriber should have
"ServerName" configuration parameter set to "demoserver2".
</para>
</refsect1>

<refsect1 id="RE-SB-3b">
<title>Example creating a subscription</title>
<para>These steps should be executed on publisher.</para>
<orderedlist>
  <listitem>Login to the Conductor UI using the dba account.</listitem>
  <listitem>Go to the "Replication" tab and then go to the "Bidirectional Snapshot" tab.</listitem>
  <listitem>Click "Subscriptions" for desired published table ("Demo.demo.Orders").</listitem>
  <listitem>Press "New Subscriber" button.</listitem>
  <listitem>Select connected DSN from the list and then press
    "Create Subscription" button. If the desired DSN is not connected yet
    you can connect to it using "Specify new data source" dialog below.
  </listitem>
</orderedlist>
</refsect1>

<refsect1 id="RE-SB-3c">
<title>Equivalent SQL commands to above</title>
<orderedlist>
  <listitem>Connect to the publisher via ISQL utility as DBA user.</listitem>
  <listitem>Define a replication server "demoserver2" at "localhost:1112"
    and subscribe it to published "Demo.demo.Orders" table.
  <programlisting>
SQL&gt; repl_snp_server('localhost:1112');
SQL&gt; repl_create_snapshot_sub('demoserver2', 'Demo.demo.Orders', 2, 'dba', 'dba');
  </programlisting></listitem>
</orderedlist>
</refsect1>
</refentry>
