Not logged in : Login

About: VirtTransactionLogsRead     Goto   Sponge   NotDistinct   Permalink

An Entity of Type : atom:Entry, within Data Space : ods.openlinksw.com associated with source document(s)

AttributesValues
type
Date Created
Date Modified
label
  • VirtTransactionLogsRead
maker
Title
  • VirtTransactionLogsRead
isDescribedUsing
has creator
content
  • %META:TOPICPARENT{name="VirtTipsAndTricksGuide"}% ---++Reading Virtuoso Transaction Logs ---++What? A Stored Procedure that uses the in-built [[http://docs.openlinksw.com/virtuoso/fn_read_log.html][read_log()]] function to read the Transaction log of a Virtuoso Instance, in regards to Quad Store activity. ---++Why? There are times when you application functionality benefits from being able to read Virtuoso Transaction logs. In particular, the database triggers on the <code>RDF_QUAD</code> table are not meant to be supported in Virtuoso 7+, thus reading transaction logs as indicated below is the recommended method for tracking changes to the <code>RDF_QUAD</code> table. ---++How? To read the changes made to the <code>RDF_QUAD</code> table i.e RDF data, one can use the following Virtuoso Stored procedure that uses the in-built [[http://docs.openlinksw.com/virtuoso/fn_read_log.html][read_log()]]: ---+++Sample Scenario 1 Insert sample data so to change the rdf_quad index: <verbatim> SQL> SPARQL INSERT INTO <g> { <s> <p> <o> }; </verbatim> 1 Create the following example procedure: <verbatim> create procedure rlt (in f any, in inpos int := 0) { declare h, op, g, s, p, o any; declare pos int; result_names (op, g, s, p, o); h := file_open (f, inpos); declare r, rr any; while ((rr := read_log (h, pos)) is not null) { declare rw, k any; declare i int; rw := null; k := null; for (i := 1; i < length (rr); i := i + 1) { r := rr[i]; if (r[0] = 13) -- key insert { rw := r[2]; op := 'I'; } else if (r[0] in (1,8,9)) -- insert,soft,replacing { rw := r[1]; op := 'I'; } else if (r[0] in (3,14)) -- delete { rw := r[1]; op := 'D'; } if (rw is not null) { k := rw[0]; if (k = 273) -- RDF_QUAD, should check with SYS_KEYS { result (op, __ro2sq (rw[1]), __ro2sq (rw[2]), __ro2sq (rw[3]), __ro2sq (rw[4])); } } } } result (pos + inpos, '', '', '', ''); } ; </verbatim> 1 Call the procedure: * In case of no changes to the <code><nowiki>RDF_QUAD</nowiki> Index</code> are done, it will return: <verbatim> SQL> rlt('tmp/Virtuoso.trx'); Query result: op g s p o ANY ANY ANY ANY ANY 8403 No. of rows in result: 1 </verbatim> * In case of changes to the <code><nowiki>RDF_QUAD</nowiki> Index</code> are done ( example with the short INSERT we did above), it will return for example: <verbatim> SQL> rlt('tmp/Virtuoso.trx'); Query result: op g s p o ANY ANY ANY ANY ANY I g s p o 71446 No. of rows in result: 2 </verbatim> To read the transaction log in general, one should use the Virtuoso [[http://docs.openlinksw.com/virtuoso/fn_read_log.html][read_log()]] function. ---++Related * [[http://docs.openlinksw.com/virtuoso/vsp1.html#longhttptrans][Long HTTP Transactions.]] * [[http://docs.openlinksw.com/virtuoso/clusteroperation.html#clusteroperationtransc][Cluster Operations transactions.]] * [[http://docs.openlinksw.com/virtuoso/fn_log_text.html][Insert a SQL statement into the roll forward log.]] * [[http://docs.openlinksw.com/virtuoso/fn_log_enable.html][Enable logs.]]
id
  • a8b72f39b5f50e3e14fa7a14f89fbf7e
link
has container
http://rdfs.org/si...ices#has_services
atom:title
  • VirtTransactionLogsRead
links to
atom:source
atom:author
atom:published
  • 2017-06-13T05:45:53Z
atom:updated
  • 2017-06-13T05:45:53Z
topic
is made of
is container of of
is link of
is http://rdfs.org/si...vices#services_of of
is creator of of
is atom:entry of
is atom:contains of
Faceted Search & Find service v1.17_git132 as of May 12 2023


Alternative Linked Data Documents: iSPARQL | ODE     Content Formats:   [cxml] [csv]     RDF   [text] [turtle] [ld+json] [rdf+json] [rdf+xml]     ODATA   [atom+xml] [odata+json]     Microdata   [microdata+json] [html]    About   
This material is Open Knowledge   W3C Semantic Web Technology [RDF Data] Valid XHTML + RDFa
OpenLink Virtuoso version 07.20.3238 as of May 23 2023, on Linux (x86_64-generic-linux-glibc25), Single-Server Edition (15 GB total memory, 3 GB memory in use)
Data on this page belongs to its respective rights holders.
Virtuoso Faceted Browser Copyright © 2009-2024 OpenLink Software