Results 1 to 8 of 8
  1. #1
    Join Date
    Feb 2002
    Location
    Hamilton
    Posts
    150

    Unanswered: writing logs to two different locations on the same server

    Couple of questions

    Can you write the DB2 logs to two different places concurrently on the same server? same effect as mirroring but live and not when the log files have closed.

    Also

    Can you write logs to remote locations ie another server?

    If so, does DB2 need to be installed on that remote server?

    thanks in advance

    Mark

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: writing logs to two different locations on the same server

    In Version 7.2 , dual logging was introduced in DB2 UDB on Unix(On mainframe this has been around for a while, atleast from V5).

    The registry variable NEWLOGPATH2 can be set to YES

    This parameter allows you to specify whether a secondary path should be used to implement dual logging. The path that will be used is generated by appending the character ’2’ to the current value of ’LOGPATH’.


    In V8, dual logging is available on all platforms with the additionla option of specifying the addiitonal log files' directory. The parm is mirrorlogpath.




    Originally posted by mark_maz
    Couple of questions

    Can you write the DB2 logs to two different places concurrently on the same server? same effect as mirroring but live and not when the log files have closed.

    |

    Also

    Can you write logs to remote locations ie another server?

    If so, does DB2 need to be installed on that remote server?

    thanks in advance

    Mark

  3. #3
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Arrow Re: writing logs to two different locations on the same server

    For your second set of questions, if I understand your question right, you are looking for archival logging. In archival logging, once the log file is closed, it is written to a tape, TSM etc. For this you'll have to enable the USEREXIT parameter. Enabling this parameter invokes a userexit every time db2uext2 every time a log file is closed. A sample userexit is provided in sqllib/samples directory ...

    HTH

    Cheers

    Sathyaram
    Originally posted by mark_maz
    Couple of questions

    Can you write the DB2 logs to two different places concurrently on the same server? same effect as mirroring but live and not when the log files have closed.

    Also

    Can you write logs to remote locations ie another server?

    If so, does DB2 need to be installed on that remote server?

    thanks in advance

    Mark

  4. #4
    Join Date
    Feb 2002
    Location
    Hamilton
    Posts
    150
    thanks for all of your input

    I am modifying the db2uext2.cdisk for my environment.

    The question I have is how is this userexit called? Does DB2 do it by itself or do we have to call a script or something like that?

    thanks

    Mark

  5. #5
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    Set the USEREXIT parameter to ON and copy the db2uext2 extecuatable in sqllib/bin directory ...

    Whenever a logfile is closed or archive requested, DB2 calls the userexit program .

    HTH

    Cheers

    Sathyaram

    Originally posted by mark_maz
    thanks for all of your input

    I am modifying the db2uext2.cdisk for my environment.

    The question I have is how is this userexit called? Does DB2 do it by itself or do we have to call a script or something like that?

    thanks

    Mark

  6. #6
    Join Date
    Feb 2002
    Location
    Hamilton
    Posts
    150
    So you can request it to be archived as well?

    Reason I am asking is that the people I am doing this for have a requirement that the archive logs have to be transferred to another server. The userexit will move the active logs to the archive log path, I understand that but they want to have more security in terms of the logs by copying them to another server(considering both servers are in the same rack in the same building connected to the same switch obviously doens't mean anything to them) but that is what they would like done.

    If we could request the archival then we could probably also code a job to transfer over the log files to that other server? Or could we in the userexit define the other server and have it transfer the files there?

    thanks

    Mark

  7. #7
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650
    In my opinion, transferring the file to a remote location should be outside the domain of DB2 ...

    You can use OS features or your Storage System features to copy the archived logs to a remote location ....

    What I mean by requesting an archive :

    From DB2 7.2, a logfile which is not closed by DB2 can be forcefully closed by the admin using the ARCHIVE LOG command.

    HTH

    Cheers

    Sathyaram


    Originally posted by mark_maz
    So you can request it to be archived as well?

    Reason I am asking is that the people I am doing this for have a requirement that the archive logs have to be transferred to another server. The userexit will move the active logs to the archive log path, I understand that but they want to have more security in terms of the logs by copying them to another server(considering both servers are in the same rack in the same building connected to the same switch obviously doens't mean anything to them) but that is what they would like done.

    If we could request the archival then we could probably also code a job to transfer over the log files to that other server? Or could we in the userexit define the other server and have it transfer the files there?

    thanks

    Mark

  8. #8
    Join Date
    Feb 2002
    Location
    Hamilton
    Posts
    150
    I modified the db2uext2.cdisk file renamed it and compiled it but i get a whole bunch of error messages

    "db2uext2.c", line 152.25: 1506-334 (S) Identifier offset_t has already been defined on line 572 of "/usr/include/sys/types.h".
    "db2uext2.c", line 230.1: 1506-166 (S) Definition of function define requires parentheses.
    "db2uext2.c", line 230.8: 1506-276 (S) Syntax error: possible missing '{'?
    "db2uext2.c", line 383.3: 1506-273 (E) Missing type in declaration of INPUT_PARMS.
    "db2uext2.c", line 401.30: 1506-275 (S) Unexpected text '*' encountered.
    "db2uext2.c", line 402.18: 1506-276 (S) Syntax error: possible missing identifier?
    "db2uext2.c", line 401.5: 1506-282 (S) The type of the parameters must be specified in a prototype.
    "db2uext2.c", line 406.31: 1506-275 (S) Unexpected text '*' encountered.
    "db2uext2.c", line 407.19: 1506-276 (S) Syntax error: possible missing identifier?
    "db2uext2.c", line 406.5: 1506-282 (S) The type of the parameters must be specified in a prototype.
    "db2uext2.c", line 421.33: 1506-275 (S) Unexpected text '*' encountered.
    "db2uext2.c", line 422.21: 1506-276 (S) Syntax error: possible missing identifier?
    "db2uext2.c", line 421.6: 1506-282 (S) The type of the parameters must be specified in a prototype.
    "db2uext2.c", line 430.29: 1506-275 (S) Unexpected text '*' encountered.
    "db2uext2.c", line 431.17: 1506-276 (S) Syntax error: possible missing identifier?
    "db2uext2.c", line 430.6: 1506-282 (S) The type of the parameters must be specified in a prototype.
    "db2uext2.c", line 439.20: 1506-046 (S) Syntax error.
    "db2uext2.c", line 444.20: 1506-046 (S) Syntax error.
    "db2uext2.c", line 462.17: 1506-275 (S) Unexpected text inputParmsStruct encountered.
    "db2uext2.c", line 463.17: 1506-045 (S) Undeclared identifier inputParms.
    "db2uext2.c", line 463.28: 1506-277 (S) Syntax error: possible missing ';' or ','?
    "db2uext2.c", line 465.17: 1506-045 (S) Undeclared identifier systemCallParms.
    "db2uext2.c", line 467.17: 1506-045 (S) Undeclared identifier auditFileName.
    "db2uext2.c", line 469.17: 1506-045 (S) Undeclared identifier errorHelpString.
    "db2uext2.c", line 495.7: 1506-045 (S) Undeclared identifier ERROR_ACTIVE.
    "db2uext2.c": 1506-099 (S) Unexpected argument.
    "db2uext2.c", line 538.12: 1506-045 (S) Undeclared identifier AUDIT_ACTIVE.
    "db2uext2.c", line 542.19: 1506-045 (S) Undeclared identifier AUDIT_ERROR_PATH.
    "db2uext2.c", line 613.38: 1506-277 (S) Syntax error: possible missing ')' or ','?
    "db2uext2.c", line 627.13: 1506-045 (S) Undeclared identifier inputParms.
    "db2uext2.c", line 629.15: 1506-280 (W) Function argument assignment between types "unsigned char*" and "int" is not allowed.
    "db2uext2.c", line 641.12: 1506-045 (S) Undeclared identifier ARCHIVE_PATH.
    "db2uext2.c", line 666.16: 1506-280 (W) Function argument assignment between types "unsigned char*" and "int" is not allowed.
    "db2uext2.c", line 672.30: 1506-280 (W) Function argument assignment between types "const unsigned char*" and "int" is not allowed.
    "db2uext2.c", line 684.24: 1506-280 (W) Function argument assignment between types "unsigned char*" and "int" is not allowed.
    "db2uext2.c", line 690.25: 1506-280 (W) Function argument assignment between types "unsigned char*" and "int" is not allowed.
    "db2uext2.c", line 699.22: 1506-280 (W) Function argument assignment between types "unsigned char*" and "int" is not allowed.
    "db2uext2.c", line 724.18: 1506-280 (W) Function argument assignment between types "unsigned char*" and "int" is not allowed.
    "db2uext2.c", line 736.18: 1506-280 (W) Function argument assignment between types "unsigned char*" and "int" is not allowed.
    "db2uext2.c", line 769.21: 1506-280 (W) Function argument assignment between types "unsigned char*" and "int" is not allowed.
    "db2uext2.c", line 793.18: 1506-280 (W) Function argument assignment between types "unsigned char*" and "int" is not allowed.
    "db2uext2.c", line 816.21: 1506-280 (W) Function argument assignment between types "unsigned char*" and "int" is not allowed.
    "db2uext2.c", line 827.21: 1506-280 (W) Function argument assignment between types "unsigned char*" and "int" is not allowed.
    "db2uext2.c", line 853.30: 1506-277 (S) Syntax error: possible missing ')' or ','?


    Are there other things that I have to change other than the following?


    define ARCHIVE_PATH "/tmp/" /* path must end with a slash */
    define RETRIEVE_PATH "/tmp/" /* path must end with a slash */
    define AUDIT_ACTIVE 1 /* enable audit trail logging */
    define ERROR_ACTIVE 1 /* enable error trail logging */
    define AUDIT_ERROR_PATH "/tmp/" /* path must end with a slash */
    define AUDIT_ERROR_ATTR "a" /* append to text file */
    #define BUFFER_SIZE 32 /* # of 4K pages for output buffer */

    I am using tmp because I am testing it on our sandbox

    thanks

    Mark

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •