Product Documentation

Database Integrity Utilities

Previous Topic

Next Topic

dyndmp and dyndumpsetopt

The Dynamic Dump can send a script to the server and receive a dump stream and/or status messages from the server. The following capabilities are available for scripting a dynamic dump:

  1. When scheduling a dynamic dump, the client can send the dump script to the server.
  2. When running a dynamic dump, the client can request that status messages be sent to it while the dump is performed and/or the dump stream file can also be sent to the client process.

To use these options, call the function dyndmpsetopt() before calling dyndmp():

extern NINT dyndmpsetopt(NINT option,pVOID value);

The following are the supported options. All options are disabled by default.

  • DDOPT_SENDSCRIPT - Send dump script to server. Set value to the script name, or set it to NULL to disable this option. Example:

    dyndmpsetopt(DDOPT_SENDSCRIPT, "script.txt");

  • DDOPT_RECVSTREAM - Receive dump stream from server. Set value to YES to enable this option or NO to disable this option. Example:

    dyndmpsetopt(DDOPT_RECVSTREAM, (pVOID) YES);

  • DDOPT_RECVSTATUS - Receive status messages from server. Set value to YES to enable this option or NO to disable this option. Example:

    dyndmpsetopt(DDOPT_RECVSTATUS, (pVOID) YES);

  • DDOPT_SETCALLBK - Set callback function. Set value to the callback function pointer, or set it to NULL to disable the use of the callback function. Example:

    extern ctCONV NINT mycallback(pVOID pctx,pVOID pdata,NINT datalen,NINT opcode);

    dyndmpsetopt(DDOPT_SETCALLBK , &mycallback);

  • DDOPT_SETCONTEXT - Set callback function context pointer. Set value to the context pointer that will be passed to the callback function. Example:

    mystruct mycontext;

    dyndmpsetopt(DDOPT_SETCONTEXT, &mycontext);

  • DDOPT_SETBUFSIZ - Set communication buffer size. Set value to the buffer size to use. Example:

    dyndmpsetopt(DDOPT_SETBUFSIZ, (pVOID) 100000);

Notes:

1) The dump options remain in effect for all dynamic dumps performed by the current connection until they are changed.

2) When the DDOPT_RECVSTREAM or DDOPT_RECVSTATUS options are used, the following dynamic dump script options are ignored:

COPY_NONCTREE - Non-ctree files cannot be copied.

DATE and TIME - No scheduling of dump for later time.

EXT_SIZE - Only one dump extent is created.

FREQ - No repeat of dump.

SEGMENT - No segmenting of dump stream.

The ctdump utility supports these features through command-line options:

usage: ctdump [-s svn] [-u uid] [-p upw] [-t script] [-b bufsiz] [-n] [-c] [-o backup]

Options:

  • -s svn - c-tree Server name
  • -u uid - User name
  • -p upw - User password
  • -t - Dump script name
  • -b bufsiz - Use buffer size of bufsiz bytes
  • -c - Send dump script from client
  • -m - Minimize progress notifications
  • -n - Send progress notifications to the client
  • -o backup_filename - Write dump stream from server to file on client

Example:

# ctdump -u ADMIN -p ADMIN -o backup.fcd -c -t script.txt -s FAIRCOMS -n

Results:

c-tree(tm) Version 11.1.0.46197(Build-150826) Dynamic Backup Utility

Copyright (C) 1992 - 2015 FairCom Corporation

ALL RIGHTS RESERVED.

Reading dump stream from server with buffer size of 100000

Start dump. Estimated dump size: 2691072

FAIRCOM.FCS

86% 100% [ 2328576 of 2326528 bytes]

SYSLOGDT.FCS

89% 100% [ 86016 of 81920 bytes]

SYSLOGIX.FCS

99% 100% [ 266240 of 262144 bytes]

S0000000.FCS

100% 100% [ 4096 of 128 bytes]

S0000001.FCS

100% 100% [ 4096 of 128 bytes]

L0000001.FCS

100% 100% [ 2048 of 679 bytes]

End dump. Actual dump size: 2705408

Dynamic Dump has been successfully written to the file backup.fcd.

See Also:

Previous Topic

Next Topic

ctdump stdout changes to the ctree Library

Changes to the ctree Library

To safely support directing the dump to stdout, the ctree library has been updated so it does not internally write to stdout, which would corrupt the dump stream. To accomplish this, references to stdout/stderr were replaced with macros CT_STDOUT, CT_STDERR, which are now controlled by internal functions:

extern ctCONV FILE * ctDECL getCtreeSTDOUT(void);

extern ctCONV FILE * ctDECL getCtreeSTDERR(void);

extern void ctDECL setCtreeSTDOUT(FILE * out);

extern void ctDECL setCtreeSTDERR(FILE * err);

We have updated references to the following to allow other c-tree utilities to make use of stdout redirection for greater conformance to Unix behavior standards:

  • printf
  • vprintf
  • stdout
  • stderr

TOCIndex