1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
|
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
-
- 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
-
-
-->
<refentry id="fn_repl_status">
<refmeta>
<refentrytitle>repl_status</refentrytitle>
<refmiscinfo>repl</refmiscinfo>
</refmeta>
<refnamediv>
<refname>repl_status</refname>
<refpurpose>returns status of a published or subscribed publication</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis id="fsyn_repl_status">
<funcprototype id="fproto_repl_status">
<funcdef><function>repl_status</function></funcdef>
<paramdef>in <parameter>publisher</parameter> varchar</paramdef>
<paramdef>in <parameter>publication</parameter> varchar</paramdef>
<paramdef>out <parameter>level</parameter> integer</paramdef>
<paramdef>out <parameter>stat</parameter> integer</paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1 id="desc_repl_status"><title>Description</title>
<para>Given a publisher and publication name this returns the
status of the publication on the local server.</para>
</refsect1>
<refsect1 id="params_repl_status"><title>Parameters</title>
<refsect2><title>publisher</title>
<para>Name of the publisher.</para>
</refsect2>
<refsect2><title>publication</title>
<para>Name of the publication.</para>
</refsect2>
<refsect2><title>level</title>
<para>If the publisher is the name of the local server this returns the
next transaction number to be assigned to a transaction as the level
output parameter.</para>
<para>If the publisher is other than the local server this returns the
transaction number of the last transaction of that publication that has
successfully been replicated to the local database as the level output
parameter.</para>
</refsect2>
<refsect2><title>stat</title>
<para>The stat output parameter reflects the current state of the
subscription. If the publisher is the local server the stat is always 0.
Otherwise it has the following possible values:</para>
<simplelist>
<member><emphasis>0 - off</emphasis> The subscription exists but there is no present or past activity..</member>
<member><emphasis>1 - syncing</emphasis> - A sync has successfully been requested and
transactions are coming from the publisher at the present time.</member>
<member><emphasis>2 - in sync</emphasis> - The syncing phase has terminated and and this
server is in sync with the publisher. This does not mean all the publisher's
published transactions have at all times been replayed but this does mean
that the sync request reached the end of the replication transaction log
and that the servers were in sync at that moment.</member>
<member><emphasis>3 - disconnected by remote</emphasis> - The remote has disconnected
this subscriber. This may be for various reasons, including that this
subscriber has fallen too far behind in replaying the published transaction
and has thus fallen out of sync. This state means that a resync can be
retried with the <function>repl_sync()</function> function.</member>
<member><emphasis>4 - disconnected locally</emphasis> - This state is set for forward
(publisher to subscriber) accounts when the corresponding pushback
account is disconnected because of replication queue overflow. This
state means that a resync can be retried with the
<function>repl_sync()</function> function.</member>
<member><emphasis>5 - waiting for local disconnect</emphasis> - Local disconnect
is about to happen for this account. This state is set for forward
(publisher to subscriber) accounts when corresponding pushback account is
disconnected because of replication queue overflow.
This state means that "disconnected locally" state will be set for
this account when next replication message for this account arrives.
This state means that a resync can be retried with the
<function>repl_sync()</function> function.</member>
</simplelist>
</refsect2>
</refsect1>
<!-- 3019
This function has no return value, it returns values in output parameters
Errors:
TR068 37000 No such account
-->
<refsect1 id="examples_repl_status"><title>Example</title>
<example id="ex_repl_status_1"><title>Retrieving the subscription status</title>
<para>This example shows an analogue of the REPL_STAT() function.</para>
<screen>
create procedure MY_REPL_STAT ()
{
declare server, account, status varchar;
declare level, stat integer;
status := vector ('OFF', 'SYNCING', 'IN SYNC', 'REMOTE DISCONNECTED', 'DISCONNECTED', 'TO DISCONNECT');
result_names (server, account, level, stat);
for select SERVER, ACCOUNT from DB.DBA.SYS_REPL_ACCOUNTS do
{
repl_status (SERVER, ACCOUNT, level, stat);
result (SERVER, ACCOUNT, level, aref (status, stat));
}
};
</screen>
</example>
</refsect1>
<refsect1 id="seealso_repl_status"><title>See Also</title>
<para><link linkend="fn_sub_schedule"><function>sub_schedule()</function></link></para>
<para><link linkend="fn_repl_disconnect"><function>repl_disconnect()</function></link></para>
<para><link linkend="fn_repl_grant"><function>repl_grant()</function></link></para>
<para><link linkend="fn_repl_init_copy"><function>repl_init_copy()</function></link></para>
<para><link linkend="fn_repl_new_log"><function>repl_new_log()</function></link></para>
<para><link linkend="fn_repl_pub_add"><function>repl_pub_add()</function></link></para>
<para><link linkend="fn_repl_pub_init_image"><function>repl_pub_init_image()</function></link></para>
<para><link linkend="fn_repl_pub_remove"><function>repl_pub_remove()</function></link></para>
<para><link linkend="fn_repl_publish"><function>repl_publish()</function></link></para>
<para><link linkend="fn_repl_revoke"><function>repl_revoke()</function></link></para>
<para><link linkend="fn_repl_sched_init"><function>repl_sched_init()</function></link></para>
<para><link linkend="fn_repl_server"><function>repl_server()</function></link></para>
<para><link linkend="fn_repl_server_rename"><function>repl_server_rename()</function></link></para>
<para><link linkend="fn_repl_stat"><function>repl_stat()</function></link></para>
<para><link linkend="fn_repl_subscribe"><function>repl_subscribe()</function></link></para>
<para><link linkend="fn_repl_sync"><function>repl_sync()</function></link></para>
<para><link linkend="fn_repl_sync_all"><function>repl_sync_all()</function></link></para>
<para><link linkend="fn_repl_text"><function>repl_text()</function></link></para>
<para><link linkend="fn_repl_this_server"><function>repl_this_server()</function></link></para>
<para><link linkend="fn_repl_unpublish"><function>repl_unpublish()</function></link></para>
<para><link linkend="fn_repl_unsubscribe"><function>repl_unsubscribe()</function></link></para>
</refsect1>
</refentry>
|