OMBPlus: masking usernames / passwords in log files with ********?

Hi all,
Subjects says it: how to hide username and password in OMBPlus logs.
Any ideas...?
Br: Ykspisto

I don't use default OMB+ logging for this reason, plus I often want more robust logging. I also built a wrapper for executing OMB+ statements to simplify my exception handling in my main scripts. By catching both the return string from a statement as well as the exception strings, I keep full control over what gets logged.
HEre is the meat of my main library file:
# PVCS Version Information
#/* $Workfile:   omb_library.tcl  $ $Revision:   2.9  $ */
#/* $Author:   michael.broughton  $
#/* $Date:   10 Mar 2009 11:04:50  $ */
# Default logging function.
#  Accepts inputs: LOGMSG - a text string to output
proc log_msg {LOGTYPE LOGMSG} {
   #logs to screen and file
   global SPOOLFILE
   if {![info exists SPOOLFILE]} {
       puts "LOGFILE UNDEFINED! :-> $LOGTYPE:-> $LOGMSG"
   } else {
       set fout [open "$SPOOLFILE" a+]     
       puts $fout "$LOGTYPE:-> $LOGMSG"
       puts "$LOGTYPE:-> $LOGMSG"
       close $fout
proc log_msg_file_only {LOGTYPE LOGMSG} {
    #logs to file only
    global SPOOLFILE
    if {![info exists SPOOLFILE]} {
       puts "LOGFILE UNDEFINED! :-> $LOGTYPE:-> $LOGMSG"
    } else {
       set fout [open "$SPOOLFILE" a+]     
       puts $fout "$LOGTYPE:-> $LOGMSG"
       close $fout
proc exit_failure { msg } {
   log_msg ERROR "$msg"
   log_msg ERROR "Rolling Back....."
   exec_omb OMBROLLBACK
   log_msg ERROR "Exiting....."
   # return and also bail from calling function
   return -code 2
proc exec_omb { args } {
   # Uncomment if you want all source commands spooled out to log
   # disabled in production to avoid logging passwords.
   # log_msg_file_only OMBCMD "$args"
   # the point of this is simply to return errorMsg or return string, whichever is applicable,
   # to simplify error checking using omb_error{}
   if [catch { set retstr [eval $args] } errmsg] {
      log_msg OMB_ERROR "$errmsg"
      log_msg "" ""
      return $errmsg
   } else {
      log_msg OMB_SUCCESS "$retstr"
      log_msg "" ""
      return $retstr
proc omb_error { retstr } {
   # OMB and Oracle errors may have caused a failure.
   if [string match OMB0* $retstr] {
      return 1
   } elseif [string match ORA-* $retstr] {
      return 1
   } elseif [string match java.* $retstr] {
      return 1
   } elseif [string match Error* $retstr] {
      return 1
   } else {
      return 0
proc ers_omb_connect { OWB_USER OWB_PASS OWB_HOST OWB_PORT OWB_SRVC OWB_REPOS } {
   # Commit anything from previous work, otherwise OMBDISCONNECT will fail out.
   catch { set retstr [ OMBSAVE ] } errmsg
   log_msg LOG "Checking current connection status...."
   #Ensure that we are not already connected.
   if [catch { set discstr [ OMBDISCONNECT ] } errmsg ] {
      set discstr $errmsg
   # Test if message is "OMB01001: Not connected to repository." or "Disconnected."
   # any other message is a showstopper!
   if [string match Disconn* $discstr ]  {
      log_msg LOG "Success Disconnecting from previous repository...."
   } else {
      # We expect an OMB01001 error for trying to disconnect when not connected
      if [string match OMB01001* $discstr ] {
          log_msg LOG "Disconnect unneccessary. Not currently connected...."
      } else {
          log_msg ERROR "Error Disconnecting from previous repository....Exiting process."
          exit_failure "$discstr"
   set print [exec_omb OMBCONNECT $OWB_USER/$OWB_PASS@$OWB_HOST:$OWB_PORT:$OWB_SRVC USE REPOSITORY '$OWB_REPOS']
   if [string match *Connected* $print] {
      return $print
   } else {
      return "OMB0-Unknown Error connecting. Validate connection settings and try again"
}and I handle setting up the log file with a standard header at the top of each script, as illustrated here in a script I use to set up and register a location and control centers for when we build a new dev environment. Most of the referenced variables are held in a config script that we use to define our current working environment, which I am not attaching as the names are pretty descriptive I think.
# PVCS Version Information
#/* $Workfile:   setup_dev_location.tcl  $ $Revision:   2.1  $ */
#/* $Author:   michael.broughton  $
#/* $Date:   27 Nov 2008 10:00:00  $ */
#  Get Current Directory and time
# supporting config and library files must be in the same directory as this script
set dtstmp     [ clock format [clock seconds] -format {%Y%m%d_%H%M}]
set scrpt      [ file split [file root [info script]]]
set scriptDir  [ file dirname [info script]]
set scriptName [ lindex $scrpt [expr [llength $scrpt]-1]]
set cnfg_lib "$scriptDir/ombplus_config.tcl"
set owb_lib  "$scriptDir/omb_library.tcl"
set sql_lib  "$scriptDir/omb_sql_library.tcl"
#  Import Lbraries
#get config file
source $cnfg_lib
#get standard library
source $owb_lib
#get SQL library
source $sql_lib
#  Set Logfile
#    This will overwrite anything set in the config file.
set LOG_PATH "$scriptDir/logs"
file mkdir $LOG_PATH
set    SPOOLFILE  ""
append SPOOLFILE $LOG_PATH "/log_"  $scriptName "_" $dtstmp ".txt"
#  Connect to repos
set print [ers_omb_connect $OWB_DEG_USER $OWB_DEG_PASS $OWB_DEG_HOST $OWB_DEG_PORT $OWB_DEG_SRVC $OWB_DEG_REPOS]
if [omb_error $print] {
    log_msg ERROR "Unable to connect to repository."
    log_msg ERROR "$print"
    log_msg ERROR "Exiting Script.............."
    return
} else {
    log_msg LOG "Connected to Repository"   
# Connect to project
set print [exec_omb OMBCC '$PROJECT_NAME']
if [omb_error $print] {
   exit_Failure "Project $PROJECT_NAME does not exist. Exiting...."
} else {
   log_msg LOG "Switched context to project $PROJECT_NAME"
# Check Existance of Oracle Module
set print [exec_omb OMBCC '$ORA_MODULE_NAME']
if [omb_error $print] {
   exit_Failure "Module $ORA_MODULE_NAME does not exist. Creating...."
} else {
   log_msg LOG "Confirmed existance of module $ORA_MODULE_NAME"
#switch back up to project level. You cannot attach locations to a module if you are in it.
exec_omb OMBCC '..'
log_msg LOG "Switched context back up to project $PROJECT_NAME"
# Force Re-registration of OWB User
log_msg LOG "(Re-)Registering user $DATA_LOCATION_USER"
log_msg LOG "Disconnecting from Corporate Design Repository"
exec_omb OMBCOMMIT
exec_omb OMBDISCONNECT
log_msg LOG "Connecting to Runtime Repository"
set print [ers_omb_connect $CONTROL_CENTER_SCHEMA $CONTROL_CENTER_PASS $DATA_LOCATION_HOST $DATA_LOCATION_PORT $DATA_LOCATION_SRVC $CONTROL_CENTER_SCHEMA]
set print [ exec_omb OMBUNREGISTER USER '$DATA_LOCATION_USER' IDENTIFIED BY '$DATA_LOCATION_PASS' ]
set print [ exec_omb OMBREGISTER USER '$DATA_LOCATION_USER' SET PROPERTIES (DESCRIPTION, ISTARGETSCHEMA, TARGETSCHEMAPWD) VALUES ('$DATA_LOCATION_USER', 'true', '$DATA_LOCATION_PASS')]
if [omb_error $print] {
   exit_failure "Unable to register user '$DATA_LOCATION_USER'"
log_msg LOG "Disconnecting from Runtime Repository"
exec_omb OMBCOMMIT
exec_omb OMBDISCONNECT
log_msg LOG "Re-Connecting to Corporate Design Repository"
set print [ers_omb_connect $OWB_DEG_USER $OWB_DEG_PASS $OWB_DEG_HOST $OWB_DEG_PORT $OWB_DEG_SRVC $OWB_DEG_REPOS]
log_msg LOG "Changing context back to project $PROJECT_NAME"
set print [exec_omb OMBCC '$PROJECT_NAME']
# Validate to Control Center
set lst [OMBLIST CONTROL_CENTERS]
if [string match *$CONTROL_CENTER_NAME* $lst] {
   log_msg LOG "Verified Control Center $CONTROL_CENTER_NAME Exists."
   set lst [OMBLIST LOCATIONS]
   if [string match *$DATA_LOCATION_NAME* $lst] {
       log_msg LOG "Verified Location $DATA_LOCATION_NAME Exists."
       log_msg LOG "Setting Control Center as default control center for project"
       exec_omb OMBCC 'DEFAULT_CONFIGURATION'
       set print [exec_omb OMBALTER DEPLOYMENT 'DEFAULT_DEPLOYMENT' SET REF CONTROL_CENTER '$CONTROL_CENTER_NAME' ]
       if [omb_error $print] {
          exit_failure "Unable to set Control Center $CONTROL_CENTER_NAME in default configuration"
       exec_omb OMBCOMMIT
       exec_omb OMBCC '..'
       log_msg LOG "Setting Passwords to enable import and deploy"
       set print [exec_omb OMBALTER LOCATION '$DATA_LOCATION_NAME' SET PROPERTIES (PASSWORD) VALUES ('$DATA_LOCATION_PASS')]
       if [omb_error $print] {
          exit_failure "Unable to log onto location '$DATA_LOCATION_NAME' with password $DATA_LOCATION_PASS"
       exec_omb OMBCOMMIT
       log_msg LOG "Connecting to Control Center $CONTROL_CENTER_NAME"
       set print [exec_omb OMBCONNECT CONTROL_CENTER USE '$DATA_LOCATION_PASS' ]
       if [omb_error $print] {
          exit_failure "Unable to connect to Control Center $CONTROL_CENTER_NAME"
       exec_omb OMBCOMMIT
       log_msg LOG "Connected.............."
   } else {
       log_msg LOG "Control Center Exists, but Location Does Not."
       log_msg LOG "Creating Code Location."
       log_msg LOG "Checking Global_names...."
       set dbGlobalNames FALSE
       set oraConn [oracleConnect $OWB_DEG_HOST $OWB_DEG_SRVC $OWB_DEG_PORT $OWB_DEG_USER $OWB_DEG_PASS ]
       set oraRs [oracleQuery $oraConn "select value pvalue FROM V\$PARAMETER where name = 'global_names'"]
       while {[$oraRs next]} {
           set dbGlobalNames [$oraRs getString pvalue]
       $oraRs close
       $oraConn close
       log_msg LOG "Global_names are $dbGlobalNames...."
       if [string match TRUE $dbGlobalNames] {
           set print [exec_omb OMBCREATE LOCATION '$DATA_LOCATION_NAME' SET PROPERTIES (TYPE, VERSION, DESCRIPTION, BUSINESS_NAME, HOST, PORT, SERVICE, CONNECT_AS_USER, PASSWORD, DATABASE_NAME) VALUES ('ORACLE_DATABASE','$DATA_LOCATION_VERS','ERS Datamart Code User','$DATA_LOCATION_NAME', '$DATA_LOCATION_HOST','$DATA_LOCATION_PORT','$DATA_LOCATION_SRVC', '$DATA_LOCATION_USER','$DATA_LOCATION_PASS','$DATA_LOCATION_SRVC' ) ] 
       } else {
           set print [exec_omb OMBCREATE LOCATION '$DATA_LOCATION_NAME' SET PROPERTIES (TYPE, VERSION, DESCRIPTION, BUSINESS_NAME, HOST, PORT, SERVICE, CONNECT_AS_USER, PASSWORD) VALUES ('ORACLE_DATABASE','$DATA_LOCATION_VERS','ERS Datamart Code User','$DATA_LOCATION_NAME', '$DATA_LOCATION_HOST','$DATA_LOCATION_PORT','$DATA_LOCATION_SRVC', '$DATA_LOCATION_USER','$DATA_LOCATION_PASS') ] 
       if [omb_error $print] {
          exit_failure "Unable to create location '$DATA_LOCATION_NAME'"
       exec_omb OMBSAVE
       log_msg LOG "Adding Location $DATA_LOCATION_NAME to Control Center $CONTROL_CENTER_NAME"
       set print [exec_omb OMBALTER CONTROL_CENTER '$CONTROL_CENTER_NAME' ADD REF LOCATION '$DATA_LOCATION_NAME' SET PROPERTIES (IS_TARGET, IS_SOURCE) VALUES ('true', 'true') ]
       if [omb_error $print] {
           exit_failure "Unable to add Location $DATA_LOCATION_NAME to Control Center $CONTROL_CENTER_NAME"
       exec_omb OMBCOMMIT
       log_msg LOG "Setting Control Center as default control center for project"
       exec_omb OMBCC 'DEFAULT_CONFIGURATION'
       set print [exec_omb OMBALTER DEPLOYMENT 'DEFAULT_DEPLOYMENT' SET REF CONTROL_CENTER '$CONTROL_CENTER_NAME' ]
       if [omb_error $print] {
          exit_failure "Unable to set Control Center $CONTROL_CENTER_NAME in default configuration"
       exec_omb OMBCOMMIT
       exec_omb OMBCC '..'
       log_msg LOG "Connecting to Control Center $CONTROL_CENTER_NAME"
       set print [exec_omb OMBCONNECT CONTROL_CENTER USE '$DATA_LOCATION_PASS' ]
       if [omb_error $print] {
          exit_failure "Unable to connect to Control Center $CONTROL_CENTER_NAME"
       exec_omb OMBCOMMIT
       log_msg LOG "Registering Code Location."
       set print [exec_omb OMBALTER LOCATION '$DATA_LOCATION_NAME' SET PROPERTIES (PASSWORD) VALUES ('$DATA_LOCATION_PASS')]
       exec_omb OMBCOMMIT
       set print [exec_omb OMBREGISTER LOCATION '$DATA_LOCATION_NAME']
       if [omb_error $print] {
          exit_failure "Unable to register Location $DATA_LOCATION_NAME"
       exec_omb OMBCOMMIT
} else {
   log_msg LOG "Need to create Control Center $CONTROL_CENTER_NAME."
   log_msg LOG "Creating Code Location."
   log_msg LOG "Checking Global_names...."
   set dbGlobalNames FALSE
   set oraConn [oracleConnect $DATA_LOCATION_HOST $DATA_LOCATION_SRVC $DATA_LOCATION_PORT $CONTROL_CENTER_SCHEMA $CONTROL_CENTER_PASS ]
   set oraRs [oracleQuery $oraConn "select value pvalue FROM V\$PARAMETER where name = 'global_names'"]
   while {[$oraRs next]} {
     set dbGlobalNames [$oraRs getString pvalue]
   $oraRs close
   $oraConn close
   log_msg LOG "Global_names are $dbGlobalNames...."
   if [string match TRUE $dbGlobalNames] {
       set print [exec_omb OMBCREATE LOCATION '$DATA_LOCATION_NAME' SET PROPERTIES (TYPE, VERSION, DESCRIPTION, BUSINESS_NAME, HOST, PORT, SERVICE, CONNECT_AS_USER, PASSWORD, DATABASE_NAME) VALUES ('ORACLE_DATABASE','$DATA_LOCATION_VERS','ERS Datamart Code User','$DATA_LOCATION_NAME', '$DATA_LOCATION_HOST','$DATA_LOCATION_PORT','$DATA_LOCATION_SRVC', '$DATA_LOCATION_USER','$DATA_LOCATION_PASS','$DATA_LOCATION_SRVC' ) ] 
   } else {
       set print [exec_omb OMBCREATE LOCATION '$DATA_LOCATION_NAME' SET PROPERTIES (TYPE, VERSION, DESCRIPTION, BUSINESS_NAME, HOST, PORT, SERVICE, CONNECT_AS_USER, PASSWORD) VALUES ('ORACLE_DATABASE','$DATA_LOCATION_VERS','ERS Datamart Code User','$DATA_LOCATION_NAME', '$DATA_LOCATION_HOST','$DATA_LOCATION_PORT','$DATA_LOCATION_SRVC', '$DATA_LOCATION_USER','$DATA_LOCATION_PASS') ] 
   if [omb_error $print] {
      exit_failure "Unable to create location '$DATA_LOCATION_NAME'"
   exec_omb OMBCOMMIT
   log_msg LOG "Creating Control Center"
   set print [exec_omb OMBCREATE CONTROL_CENTER '$CONTROL_CENTER_NAME' SET PROPERTIES (DESCRIPTION, BUSINESS_NAME, HOST, PORT, SERVICE_NAME, USER, SCHEMA, PASSWORD) VALUES ('ERS Datamart Control Center','$CONTROL_CENTER_NAME', '$DATA_LOCATION_HOST','$DATA_LOCATION_PORT','$DATA_LOCATION_SRVC', '$DATA_LOCATION_USER', '$CONTROL_CENTER_SCHEMA','$DATA_LOCATION_PASS') ]
   if [omb_error $print] {
      exit_failure "Unable to create control center '$CONTROL_CENTER_NAME'"
   exec_omb OMBCOMMIT
   log_msg LOG "Adding Location $DATA_LOCATION_NAME to Control Center $CONTROL_CENTER_NAME"
   set print [exec_omb OMBALTER CONTROL_CENTER '$CONTROL_CENTER_NAME' ADD REF LOCATION '$DATA_LOCATION_NAME' SET PROPERTIES (IS_TARGET, IS_SOURCE) VALUES ('true', 'true') ]
   if [omb_error $print] {
      exit_failure "Unable to add Location $DATA_LOCATION_NAME to Control Center $CONTROL_CENTER_NAME"
   exec_omb OMBCOMMIT
   log_msg LOG "Setting Control Center as default control center for project"
   exec_omb OMBCC 'DEFAULT_CONFIGURATION'
   set print [exec_omb OMBALTER DEPLOYMENT 'DEFAULT_DEPLOYMENT' SET REF CONTROL_CENTER '$CONTROL_CENTER_NAME' ]
   if [omb_error $print] {
      exit_failure "Unable to set Control Center $CONTROL_CENTER_NAME in default configuration"
   exec_omb OMBCOMMIT
   exec_omb OMBCC '..'
   log_msg LOG "Connecting to Control Center $CONTROL_CENTER_NAME"
   set print [exec_omb OMBCONNECT CONTROL_CENTER USE '$DATA_LOCATION_PASS' ]
   if [omb_error $print] {
      exit_failure "Unable to add Location $DATA_LOCATION_NAME to Control Center $CONTROL_CENTER_NAME"
   exec_omb OMBCOMMIT
   log_msg LOG "Registering Code Location."
   set print [exec_omb OMBALTER LOCATION '$DATA_LOCATION_NAME' SET PROPERTIES (PASSWORD) VALUES ('$DATA_LOCATION_PASS')]
   exec_omb OMBCOMMIT
   set print [exec_omb OMBREGISTER LOCATION '$DATA_LOCATION_NAME']
   if [omb_error $print] {
      exit_failure "Unable to register Location $DATA_LOCATION_NAME"
   exec_omb OMBCOMMIT
# Assign location to Oracle Module
log_msg LOG "Assigning Code Location to Oracle Module."
set print [ exec_omb OMBALTER ORACLE_MODULE '$ORA_MODULE_NAME' ADD REFERENCE LOCATION '$DATA_LOCATION_NAME' SET AS DEFAULT ]
if [omb_error $print] {
   exit_failure "Unable to add reference location '$DATA_LOCATION_NAME' to module '$ORA_MODULE_NAME' "
set print [ exec_omb OMBALTER ORACLE_MODULE '$ORA_MODULE_NAME' SET REFERENCE METADATA_LOCATION '$DATA_LOCATION_NAME' ]
if [omb_error $print] {
   exit_failure "Unable to set metadata location '$DATA_LOCATION_NAME' on module '$ORA_MODULE_NAME' "
set print [ exec_omb OMBALTER ORACLE_MODULE '$ORA_MODULE_NAME' SET PROPERTIES (DB_LOCATION) VALUES ('$DATA_LOCATION_NAME') ]
if [omb_error $print] {
   lexit_failure "Unable to add db_location '$DATA_LOCATION_NAME' to module '$ORA_MODULE_NAME' "
exec_omb OMBCOMMIT
exec_omb OMBDISCONNECT

Similar Messages

  • I can no longer access a password protected Numbers file with the correct password. Error message only says the file "cannot be opened."

    I'm using Numbers version 3.2.2.
    Suddenly I cannot access my password protected Numbers file with the correct password. I have the correct password written down so I know I haven't made a mistake.
    The response box that pops up says that the file cannot be opened. There are no other options for me to choose from.

    Also, I tried to open it through an older version of Numbers but it sent this error message.

  • Can't create log file with java.util.logging

    Hi,
    I have created a class to create a log file with java.util.logging
    This class works correctly as standalone (without jdev/weblogic)
    import java.io.IOException;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.logging.*;
    public class LogDemo
         private static final Logger logger = Logger.getLogger( "Logging" );
         public static void main( String[] args ) throws IOException
             Date date = new Date();
             DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
             String dateStr = dateFormat.format(date);
             String logFileName = dateStr + "SEC" + ".log";
             Handler fh;          
             try
               fh = new FileHandler(logFileName);
               //fh.setFormatter(new XMLFormatter());
               fh.setFormatter(new SimpleFormatter());
               logger.addHandler(fh);
               logger.setLevel(Level.ALL);
               logger.log(Level.INFO, "Initialization log");
               // force a bug
               ((Object)null).toString();
             catch (IOException e)
                  logger.log( Level.WARNING, e.getMessage(), e );
             catch (Exception e)
                  logger.log( Level.WARNING, "Exception", e);
    }But when I use this class...
    import java.io.File;
    import java.io.IOException;
    import java.text.DateFormat;
    import java.text.SimpleDateFormat;
    import java.util.Date;
    import java.util.logging.FileHandler;
    import java.util.logging.Handler;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import java.util.logging.XMLFormatter;
    public class TraceUtils
      public static Logger logger = Logger.getLogger("log");
      public static void initLogger(String ApplicationName) {
        Date date = new Date();
        DateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
        String dateStr = dateFormat.format(date);
        String logFileName = dateStr + ApplicationName + ".log";
        Handler fh;
        try
          fh = new FileHandler(logFileName);
          fh.setFormatter(new XMLFormatter());
          logger.addHandler(fh);
          logger.setLevel(Level.ALL);
          logger.log(Level.INFO, "Initialization log");
        catch (IOException e)
          System.out.println(e.getMessage());
    }and I call it in a backingBean, I have the message in console but the log file is not created.
    TraceUtils.initLogger("SEC");why?
    Thanks for your help.

    I have uncommented this line in logging.properties and it works.
    # To also add the FileHandler, use the following line instead.
    handlers= java.util.logging.FileHandler, java.util.logging.ConsoleHandlerBut I have another problem:
    jdev ignore the parameters of the FileHandler method .
    And it creates a general log file with anothers log files created each time I call the method logp.
    So I play with these parameters
    fh = new FileHandler(logFileName,true);
    fh = new FileHandler(logFileName,0,1,true);
    fh = new FileHandler(logFileName,10000000,1,true);without succes.
    I want only one log file, how to do that?

  • Do we need to format data and log files with 64k cluster size for sql server 2012?

    Do we need to format data and log files with 64k cluster size for sql server 2012?
    Does this best practice still applies to sql server 2012 & 2014?

    Yes.  The extent size of SQL Server data files, and the max log block size have not changed with the new versions, so the guidance should remain the same.
    Microsoft SQL Server Storage Engine PM

  • Getting empty log files with log4j and WebLogic 10.0

    Hi!
    I get empty log files with log4j 1.2.13 and WebLogic 10.0. If I don't run the application in the application server, then the logging works fine.
    The properties file is located in a jar in the LIB folder of the deployed project. If I change the name of the log file name in the properties file, it just creates a new empty file.
    What could be wrong?
    Thanks!

    I assume that when you change the name of the expected log file in the properties file, the new empty file is that name, correct?
    That means you're at least getting that properties file loaded by log4j, which is a good sign.
    As the file ends up empty, it appears that no logger statements are being executed at a debug level high enough for the current debug level. Can you throw in a logger.error() call at a point you're certain is executed?

  • Merging Log Files with same name

    Hello,
    I have log files with same name 00000000.jdb (because created at different machines). I would like to merge data stored in these two files.
    I tried below approaches which do not work:
    1. rename one of the files -> doesn't work as file header has file name info which doesn't match with renamed value
    2. db dump/load -> dump and load works without error. (i have to dump Entity related Database and Format related Database -- from -l option) However when i try to read the file, it gives error.
    Exception in thread "main" com.sleepycat.je.EnvironmentFailureException: (JE 5.0.103) Catalog could not be refreshed, may indicate corruption, errorFormatId=52 nFormats=51, . UNEXPECTED_EXCEPTION: Unexpected internal Exception, may have side effects.
    I am using EntityStore and thus Annotated Entities.
    Does any one has any insights?
    Thanks.

    Yuvaraj,
    As you discovered, it is not possible to use .jdb files from one environment in a different environment.  The .jdb files use an internal format with relationships between files that form the Btree.
    I'm glad to hear you were able to use DbDump and DbLoad successfully.
    --mark

  • Analzing log files with external tools?

    Hi,
    is there any way to use web analytics software like Webtrends with EP? In other words, does EP produce
    an access log file with date, URL, user, referrer,
    etc.?
    Thanks in advance,
    Stefan.

    Thanks for the hint. Apparently httpaccess\responses.0.trc contains log entries that look very familiar to something an ordinary web server produces, which is good.
    A simple perl script could transform the logfile (date, etc.) into a format that a Web statistics tool on the market (e.g. WebTrends) could use.
    The SAP built-in reports are not something that drives a marketing department wild.
    Thanks,
    Stefan

  • Nginx client_ip in log file, with ssh -R Port forwarding

    Hi, everyone!
    First, I run a nginx server M1 (in my offce)  behind a router R1 and M1's IP addr is 192.168.5.126. I set nginx's log format like this:
    log_format main '$remote_addr - $remote_user [$time_local] "$request" '
    '$status $body_bytes_sent "$http_referer" '
    '"$http_user_agent" "$http_x_forwarded_for"';
    After that, I will get the correct client ip in the access log.
    192.168.5.88 - - [21/Apr/2015:11:12:47 +0800] "GET /js/date.js HTTP/1.1" 200 403 "http://192.168.5.126/" "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.118 Safari/537.36" "-"
    Then, I want to visit M1 outside (in the campus) .  Unfortunately, I can do nothing with the router R1. But I have a router R2 whose framework is OpenWrt and its IP 222.xx.xx.xx can be visited by anyone who has logged into the campus network.
    Then I wrote a autossh service to do that:
    [Unit]
    Description=AutoSSH service for local port 80 forwarded to 222.xx.xx.xx:80
    # place this in /etc/systemd/system/, than enable this.
    After=network.target
    Requires=nginx.service
    After=nginx.service
    [Service]
    Environment="AUTOSSH_GATETIME=0" "AUTOSSH_POLL=60" "AUTOSSH_LOGFILE=/var/log/nginxssh.log"
    ExecStart=/usr/bin/autossh -M 22000 -NR 222.xx.xx.xx:808:localhost:808 -NR 222.xx.xx.xx:80:localhost:80 -o TCPKeepAlive=yes -p xxxx [email protected] -i /home/username/.ssh/id_rsa
    [Install]
    WantedBy=multi-user.target
    Yeah, It works! BUT BUT when someone visits 222.xx.xx.xx, I lost the  the client ip in nginx log file. That would always be 127.0.0.1, why?
    127.0.0.1 - - [27/Apr/2015:00:34:07 +0800] "GET /static/mathjax/MathJax.js?config=TeX-AMS_HTML HTTP/1.1" 304 0 "http://222.xx.xx.xx:808/url/jakevdp.github.com/downloads/notebooks/XKCD_plots.ipynb" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:37.0) Gecko/20100101 Firefox/37.0" "-"
    After ``ssh -R Port forwarding``,  client ip is lost?
    If so,  what should I use to replace ``ssh -R``?
    Last edited by limser (2015-05-04 12:39:18)

    It seems there is a port forwarding configuration trouble with you modem.
    When you access from the WAN or from the LAN, you don't enter in you modem the same way, so the behavior is different.
    It seems that the port 22 of your modem is not directly forwarded to your server. The modem itself asks you a login/password. The key-pair authentification is between laptop and server. The modem itself is not recognized during this authentification.
    Don't touch your ssh-config. It's OK since it was working for monthes before you change your modem.

  • "Share over Wan" - passworded but log files say differently?

    In a desperate attempt to get backup features to work on my TC, I enabled "Share over Wan". Thinking that I've got more than enough security with disk passwords, I didn't automatically think there'd be a problem.
    I then looked at my log files on my TC a day later and saw successful logins from IP's other than mine - but all within the same subdomain.
    Does "Share over Wan" supersede the disk passwords? I've tried accessing from other subdomains (my work) and always get prompted for passwords. Should I be worried about these successful logins or ignore them as successful pings (or the like?)
    I've, of coarse, now turned off "Share over Wan".

    awkwood wrote:
    Cheers omp!
    I have one suggestion: your count_lines method will be quite slow on large log files.
    Rather than use readlines you can optimize the read operations like so:
    line_count = 0
    File.open(identifier.to_cache_path) do |f|
    while block = f.read(1024)
    line_count += block.count("\n")
    end
    end
    The speed boost makes it comparable to shelling out to wc.
    Thanks for the suggestion; I just committed it.

  • RDS 2012 - Embed username/password in RDP file

    Hi all,
    I have tested editing an RDP file internally and embedding a username/password(hashed) in it so that it automatically logs on.
    This works fine from a PC on the network.
    I've tried to do the same from a PC connecting in through an RDS Gateway but it prompts for a password when launching the RDP file. Is it possible to embed the username/password(hashed) when connecting via a gateway?
    Thanks,
    Paul.

    Hi Paul,
    No, the credentials in the rdp file cannot be used for RD Gateway.
    -TP

  • How to retrieve the username/password of logged user so to use web services

    Hi Experts,
    we are using web services from a web dynpro application, the web services we use are CAF web services; actually we are "hardcoding" username and password so to be able to execute these web services, using this code before calling the web service:
    wdContext.currentRequest_ReporteDeRendicionDetallada_RElement().modelObject().setInvokerProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY,"testuser");
      wdContext.currentRequest_ReporteDeRendicionDetallada_RElement().modelObject().setInvokerProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY,"testpassword");
    but as this is not a very good practice, we want to replace the "testuser" with the logged user and, of course, retrieve the password and use it instead of "testpassword".
    How can we achieve this? I couldn´t find any tips on this.
    Best regards,
    Marco.

    Hello,
    thanks for your anwsers, although I´ve followed both links I couldn´t find the answer to my problem.
    I need to know how to retreive user and password from the UME of the portal so to be able to execute web services in the java stack, the UME is connected to a LDAP in our corporation.. so may be the passwords are not stored in the UME?
    If it is not possible to retrieve the passwords of the users , which is the best practice to deal with username/passwords to execute CAF webservices from web dynpro java? Hardcoding is not a very good practice..
    Best regards,
    Marco.

  • How to Run Export and Make Dump and Log File with Dates on NT

    Hi Gurus,
    set ORACLE_SID=ORCL
    set ORACLE_HOME=D:\ORACLE\ora92
    for /f "tokens=2,3,4 delims=/ " %%a in ('date /t') do
    set fdate=%%a%%b%%c
    exp userid=userid/password@connectstring
    file=exp%fdate%.dmp log=exp%fdate%.log full=y
    I am using above script for export and make dump file with dates, but when i am excuting this script with Schedule task i am getting error.
    C:\Documents and Settings\krishna>for /f "tokens=2,3,4 delims=/ " %%a in ('date
    /t') do
    %%a was unexpected at this time.
    Help is highly appriciated.
    Thanks & Regards
    praveen

    HOST('EXP80 MRPAY/MRPAYS FILE=D:\BACKUP\MRPAY'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=MRPAY CONSISTENT=Y');
    HOST('EXP80 SECSYS/SECSYS FILE=D:\BACKUP\SECSYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=SECSYS CONSISTENT=Y');
    HOST('EXP80 SICPA/SICPA FILE=D:\BACKUP\SICPA'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=SICPA CONSISTENT=Y');
    HOST('EXP80 SICPAINVSYS/SICPAINVSYS FILE=D:\BACKUP\SICPAINVSYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=SICPAINVSYS CONSISTENT=Y');
    HOST('EXP80 SICPAGLSYS/SICPAGLSYS FILE=D:\BACKUP\SICPAGLSYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=SICPAGLSYS CONSISTENT=Y');
    HOST('EXP80 SICPAPURHSYS/SICPAPURHSYS FILE=D:\BACKUP\SICPAPURHSYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=SICPAPURHSYS CONSISTENT=Y');
    HOST('EXP80 SICPARECSYS/SICPARECSYS FILE=D:\BACKUP\SICPARECSYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=SICPARECSYS CONSISTENT=Y');
    HOST('EXP80 SICPASECSYS/SICPASECSYS FILE=D:\BACKUP\SICPASECSYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=SICPASECSYS CONSISTENT=Y');
    HOST('EXP80 FASYS/FASYS FILE=D:\BACKUP\FASYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=FASYS CONSISTENT=Y');
    HOST('EXP80 ATTSYS/ATTSYS FILE=D:\BACKUP\ATTSYS'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=ATTSYS CONSISTENT=Y');
    HOST('EXP80 ATTENDANCESYSTEM/ATTENDANCESYSTEM FILE=D:\BACKUP\ATTENDANCESYSTEM'||TO_CHAR(SYSDATE,'DDMMRRHH24MI')||'.DMP OWNER=ATTENDANCESYSTEM CONSISTENT=Y');
    Arshad

  • Problem with USERNAME & PASSWORD creation--JDBC connection with MYSQL

    How to connect to JDBC with Mysql Connector
    i installed mysql & created table, it works fine
    During Password---> I gave it as tiger , no username
    i installed mysql connector
    i saved the .jar file path in class path
    HOW TO CREATE USERNAME & PASSWORD & DATASOURCE NAME ---> Is it the password -tiger or something else like (ADMinstrative tools-ODBC-services--etc )
    Pl, help,
    tks
    Xx

    How to connect to JDBC with Mysql Connector
    i installed mysql & created table, it works fine
    During Password---> I gave it as tiger , no usernameTiger? This ain't Oracle.
    I think you should give a username and password. How can it look up a password without a username? Better GRANT the right permissions, too.
    Read the MySQL docs a bit more closely. Your path isn't the way to go.
    %

  • Create different log file with different schema by spool

    Hello,
    I want to know a way to create a different log file depend on different schema
    I have two schema on same db server
    1) schema kennam/*****/kennam
    2) schema koonhey/*****/koonhey
    by a way, I want to create a different log file name e.g. kennam.log / koonhey.log on such two schema...
    I always run @showbalance; to run showbalance.sql to create that report..
    I hope you understand what I talking about (english is not my native language........), anyone could help?
    showbalancelog.sql
    spool c:\log.log+
    spool c:\log.log
    select to_char(sysdate,'dd-mm-yyyy hh:mi:ss') from dual;
    column com_name format a20;
    select cus.tid, cus.com_name com_name, cus.com_balance,
    NVL((select sum(invoice_total) from invoice where com_id=cus.tid),0) sum_invoice,
    NVL((select sum(cheque_amount) from income where com_id=cus.tid),0) sum_income,
    cus.com_balance -
    NVL((select sum(invoice_total) from invoice where com_id=cus.tid),0) +
    NVL((select sum(cheque_amount) from income where com_id=cus.tid),0) total_balance
    from customers cus
    order by cus.tid;
    spool off

    okey I solved on this way, is anyone know another simpler way?
    be simpler part
    variable vspoolfile varchar2(20)
    declare
    username varchar2(20);
    spoolfile varchar2(50);
    begin
    select 'c:\' || user || '.log' into spoolfile from dual;
    -- spoolfile := 'c:\' || username || '.log';
    :vspoolfile := spoolfile;
    -- dbms_output.PUT_LINE(spoolfile);
    end;
    -- print :vspoolfile;
    column spoolfilecol new_value definespoolfile noprint
    select :vspoolfile spoolfilecol from dual;full content of my showbalancelog.sql file
    variable vspoolfile varchar2(20)
    declare
    username varchar2(20);
    spoolfile varchar2(50);
    begin
    select 'c:\' || user || '.log' into spoolfile from dual;
    -- spoolfile := 'c:\' || username || '.log';
    :vspoolfile := spoolfile;
    -- dbms_output.PUT_LINE(spoolfile);
    end;
    -- print :vspoolfile;
    column spoolfilecol new_value definespoolfile noprint
    select :vspoolfile spoolfilecol from dual;
    spool &definespoolfile;
    column com_name format a20;
    select cus.tid, cus.com_name com_name, cus.com_balance,
    NVL((select sum(invoice_total) from invoice where com_id=cus.tid),0) sum_invoice,
    NVL((select sum(cheque_amount) from income where com_id=cus.tid),0) sum_income,
    cus.com_balance -
    NVL((select sum(invoice_total) from invoice where com_id=cus.tid),0) +
    NVL((select sum(cheque_amount) from income where com_id=cus.tid),0) total_balance
    from customers cus
    order by cus.tid;
    spool off;

  • Parsing Log file with PowerShell

    Hey Guys, I have the following line in a txt file (log file) 
    2012-08-14 18:00:00 [ERROR] . Exception SQL error 1 2012-08-14 18:10:00 [ERROR] . Exception SQL error 22012-08-15 18:00:00 [INFO] . Started 
    - Check the most recent entry(s) the last 24 hours
    - if there's an error [ERROR] write-out a statement that says (Critical) with the date-time of the error
    - If there's no erros write-out (Ok)
    So far I learned to write this much and would like to learn more from you:
    $file = "C:\Users\example\Documents\Log.txt" cat $file | Select-String "ERROR" -SimpleMatch

    Hello,
    I am new to PowerShell, and looking for same requirement, here is my function.
    Function CheckLogs()
        param ([string] $logfile)
        if(!$logfile) {write-host "Usage: ""<Log file path>"""; exit}
        cat $logfile | Select-String "ERROR" -SimpleMatch | select -expand line |
             foreach {
                        $_ -match '(.+)\s\[(ERROR)\]\s(.+)'| Out-Null 
                        new-object psobject -Property @{Timestamp = [datetime]$matches[1];Error = $matches[2]} |
                        where {$_.timestamp -gt (get-date).AddDays(-1)}
                        $error_time = [datetime]($matches[1])
                        if ($error_time -gt (Get-Date).AddDays(-1) )
                            write-output "CRITICAL: There is an error in the log file $logfile around 
                                          $($error_time.ToShortTimeString())"; exit(2)
      write-output "OK: There was no errors in the past 24 hours." 
    CheckLogs "C:\Log.txt" #Function Call
    Content of my log file is as follows
    [ERROR] 2013-12-23 19:46:32
    [ERROR] 2013-12-24 19:46:35
    [ERROR] 2013-12-24 19:48:56
    [ERROR] 2013-12-24 20:13:07
    After executing above script, getting the below error, can you please correct me.
     $error_time = [datetime]($matches[1])
    +                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : NullArray
    Cannot index into a null array.
    At C:\PS\LogTest.ps1:10 char:21
    +                     new-object psobject -Property @{Timestamp = 
    [datetime]$match ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    ~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : NullArray
    Cannot index into a null array.
    At C:\Test\LogTest.ps1:12 char:21
    +                     $error_time = [datetime]($matches[1])
    +                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (:) [], RuntimeException
        + FullyQualifiedErrorId : NullArray

Maybe you are looking for

  • Problem with Itunes and New

    Hello, Can anyone offer me advice how to effecti'vely transfer a (protected I tunes (MP4) file to my Creative Zen? I followed the instructions as Creative has offered, yet I receive a message stating that my player does not support the file. Thanks

  • Error message in photoshop cs4

    I am trying to download ExtractPlus into photoshop cs4 extended, and I get an error message that says "could not complete your request because it is not the right kind of document.  I realize I have to go into windows and change users etc. and I have

  • Adobe PDF printer  - Use VBA??

    I am using Microsoft Access 2003 and have Acrobat 7 (Adobe PDF) and Acrobat 5 (Adobe PDF Writer) installed on my machine.   I can print to the Adobe PDF printer by using this code: Set Application.Printer = Application.Printers("Adobe PDF") DoCmd.Ope

  • Re: Connecting Macbook VGA to TV

    Asking on behalf of a friend of mine, and I'd appreciate any input offered. He'd like to connect his Macbook Pro 7.1 to a Sony Bravia EX740 television. He's using a VGA-mini adaptor to connect the computer to a longer VGA cable, which connects to the

  • Bringing already existing html pages into iWeb, possible???

    My sister is a graphic designer who created some html pages for me using Dreamweaver & GoLive. I want to update the text, images, and tables in these pages, and thought I could use iWeb, but it only wants to let me use it's templates. Am I doing some