Giter Site home page Giter Site logo

yottadb-journproc's Introduction

Introduction

This repo contains a Python executable that parses YottaDB journal files

Installation

  git clone https://github.com/RamSailopal/YottaDB-journproc.git
  cd YottaDB-journproc
  cp journproc /usr/local/bin
  export journpath="/root/.yottadb/r1.32_x86_64/g"

Make sure that ydb_dist is set as the path to mupip i.e. /opt/yottadb

Then run with:

 journproc

This will output YDB journal file entries to a flat text file /tmp/journalout.txt that then gets parsed for relevant data.

Execution with no options (as above) will output all entries from the yottadb.mjl file.

Options available to refine data searches:

 --glob - Search for a specific global
 --type - The type of journal activity to search for i.e. SETS or KILLS.
 --start - The Date/Time to search from i.e. 2021-09-27 08:34:00
 --end - The Date/Time to search to i.e. 2021-09-27 08:34:00
 --file - An alternate journal file name i.e yottadb.mjl_2021250130325
 --commit - Commit any SETS and KILLS to a commit log located at /tmp/journcommit. This can later be amended as required and committed to YDB with:

 ydb < /tmp/journcommit


 Note that the use of --commit will ignore --type and focus only on activity type SET and type KILL

Commit option example use case

A global gets set up with the following entry:

 Set ^YOTTATXT("hello")="world"

The global then gets inadvertedly deleted with:

 Kill ^YOTTATXT

The global can be recovered by doing the following:

 journproc --glob="YOTTATXT" --commit

 2021-09-27 14:45:25     SET     ^YOTTATXT("hello")="world"
 2021-09-27 14:45:25     KILL    ^YOTTATXT


 journal commit log has been saved to /tmp/journcommit

 Amend as required and then run:

 ydb < /tmp/journcommit

The file /tmp/journcommit contains the following entries:

 Set ^YOTTATXT("hello")="world"
 Kill ^YOTTATXT

We need to remove the inadvertent Kill execution to recover the global by editting the file and once we have done this, we can commit the changes to the YDB database by running:

 ydb < /tmp/journcommit

yottadb-journproc's People

Contributors

ramsailopal avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.