jueves, 12 de junio de 2014

Windows /var/logs

I 'm starting to think I 'm not writing this stuff just to get a record of my trip from Linux to Windows development environment but I 'm also doing it to occupy my hands in the keyboard rather than using them to pull my hair off (I actually running out of hair, so I better take care of what's still left).

This time I was using Oracle XE 11g (windows) like a boss, but some day it stopped working. In fact it's behavior was like if it was starting and never ended starting.

It would not accept connections, even as sysdba user.

I 've issued several commands, here I show them with their output.

The conclusion is that the oracle instance (XE) was in BLOCKED status because it couldn't write it's audit records in the WINDOWS EVENT LOG.


sqlplus as sysdba:
 

PS C:\oraclexe\app\oracle\diag\tnslsnr\ARBAN326\listener> sqlplus "/as sysdba"

SQL*Plus: Release 11.2.0.2.0 Production on Jue Jun 12 11:01:53 2014

Copyright (c) 1982, 2010, Oracle.  All rights reserved.

ERROR:
ORA-28056: Writing audit records to Windows Event Log failed
OSD-245021808: Message 245021808 not found;  product=RDBMS; facility=SOSD
O/S-Error: (OS 1502) The event log file is full.
ORA-01075: you are currently logged on

      

lsnrctl command (this command controls the oracle connection listener, at least I  could use it to ask for it's status):

 PS C:\Documents and Settings\a506334> lsnrctl  
   
 LSNRCTL for 32-bit Windows: Version 11.2.0.2.0 - Production on 12-JUN-2014 10:49:13  
   
 Copyright (c) 1991, 2010, Oracle. All rights reserved.  
   
 Welcome to LSNRCTL, type "help" for information.  
   
 LSNRCTL> STATUS OF LISTENER  
 NL-00857: wrong number (0 - 1 needed) of arguments to "status"  
 LSNRCTL> status  
 Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))  
 STATUS of the LISTENER  
 ------------------------  
 Alias           LISTENER  
 Version          TNSLSNR for 32-bit Windows: Version 11.2.0.2.0 - Production  
 Start Date        12-JUN-2014 09:41:55  
 Uptime          0 days 1 hr. 16 min. 54 sec  
 Trace Level        off  
 Security         ON: Local OS Authentication  
 SNMP           OFF  
 Default Service      XE  
 Listener Parameter File  C:\oraclexe\app\oracle\product\11.2.0\server\network\admin\listener.ora  
 Listener Log File     C:\oraclexe\app\oracle\diag\tnslsnr\ARBAN326\listener\alert\log.xml  
 Listening Endpoints Summary...  
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1ipc)))  
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=ARBAN326.scba.ar.int.atosorigin.com)(PORT=1521)))  
 Services Summary...  
 Service "CLRExtProc" has 1 instance(s).  
  Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...  
 Service "PLSExtProc" has 1 instance(s).  
  Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...  
 Service "xe" has 1 instance(s).  
  Instance "xe", status BLOCKED, has 1 handler(s) for this service...  
 The command completed successfully  
 LSNRCTL>  
   
   
   
So, the WINDOWS EVENT LOG...

I 've found a couple of useful posts in oracle forums that helped me to figure out how to solve this problem of full logs. One of them told where were the logs and how to clear them.

Control Panel->Administrative Tools->Event Viewer->Clear All Events


In case that doesn't work once you 're in the log viewer if you right-click each of the logs and select Properties then you would access to a menu where you can clear logs, but you 've got also a couple more interesting options like:

  • Increase log maximum size (DEFAULTS ARE INCREDIBLE AS LOW AS 512kb)
  • Allow overwriting of logs, in case the log reaches it's maximum size it still works by overwriting oldest entries (THOSE WITH 512kb LOW LIMITS WERE ALSO SETTED IN DO NOT OVEWRITE)
So once again I 've lost a couple of hours with all this stuff, hope this helps anyone else, enjoy windows and please do not jump... life continues.

miércoles, 11 de junio de 2014

NTLM? RTFA

In my last post I was testing the Chocolatey package manager for windows and I complained about I couldn't get it to work behind a corporate NTLM proxy server.

Now I had time to test CNTLM. This software is a local web proxy you install in your computer and you configure it to interact with your company's proxy server, so you configure your user, password and domian in the CNTLM configuration file and you 'll never be asked for it anymore! Also this helps programs (like Chocolatey) that have trouble with proxy configurations.

Pros:

  • Configure your proxy credentials once in the CNTLM config file and you won't be asked to re enter them by any other program.
  • Password can be stored as an encrypted hash for your own security
  • CNTLM can work in a windows computer but also works on Linux based operating systems.
  • Unlike many programs CNTLM supports many proxy authentication methods so its best use may be to allow programs that do not support your company's proxy authentication method use CNTLM as proxy and let CNTLM authenticate to the company's proxy.

Usage:
  • Download CNTLM
  • Install it
  • Configure it by editing cntlm.ini (shortcut found in start menu)
  • You can start/stop cntlm with the corresponding shortcuts in the start menu. Remember to restart (stop,start) cntlm every time you finish editing the ini file so that your changes take effect.
  • Remember to configure windows proxy settings to reach CNTLM in 127.0.0.1 port 3128 (default port).

I recommend you reading the CNTML manual in order to understand how to configure it properly, but in case you 're as lazy as me you can also read this stackexchange answer it has every detail on how to configure CNTLM in windows environment:

http://superuser.com/a/760827/332423




martes, 10 de junio de 2014

Windows aptitude

If you came from a Linux distro which uses a package manager to install new software (there 're a bunch of them right now) you might find you missing such a feature during your windows usage hours.

When installing new software you can land in the software home page, look for the download link, click it, wait until the download finishes then you 'd see if you just double click the downloaded package or if you need an archive program to "unzip" what you downloaded, and so on... but it seems to be an alternative to this which is similar to the apt-get way of installing things.


NuGet is a package manager targeted to Windows software developers, so the could get the libraries they needed.

If you 're not a developer or you 'd like to install not only development libraries but also every day software (for i.e. Google Chrome or Firefox) then you 'd like to taste Chocolatey.

Chocolatey is a package manager for regular software, you could find Chocolatey's package catalog here, there you 'll find things like Java Runtime, Notepad++, Git, 7Zip, VLC and FileZilla among others. As you could see it catalog is full of open-source, multi-platform software that you would love to use.

Once you got Chocolatey installed using it should be simple, consider installing Mozilla Firefox for example, just invoke the "chocolatey install" command with the package name as parameter and voila:

c:>cinst Firefox

that's it.


Pros:
easy, ready for automation installation of software

Cons:
i couldn't test it fully because it has limited  proxy support. I think NTLM authentication is not working for me. I will test it using CNTLM local proxy later and will share the results.



EDIT ----------------------------------------------------

Finally (see my next post) I could use CNTLM for authenticating with my company's proxy and I 've just installed AdobeAcrobat reader with a single line command, like a charm!




lunes, 9 de junio de 2014

Trying to make Windows more Linux-like day 1

Wether you work tigh Git (SCM) or not, get yourself a copy of GITGUI.

This includes the MINGW package, which has a subset of the most common Linux tools like:

  • awk
  • basename
  • bash
  • chmod
  • curl
  • cut
  • diff
  • dirname
  • dos2unix
  • grep
  • gzip
  • kill
  • ls
  • ln
  • md5sum
  • mv
  • patch
  • pwd
  • rm
  • ssh
  • tee
  • touch
  • vi
  • xargs
Even more interesting is that it includes a linux-like command line utility where you can operate with all those command on the windows files by using / instead of \ and using auto completion with auto escaping of space characters by means of the Tab key. For example:

$ cd /c/WINDOWS 
$ cd /c/Documents\ and\ Settings

would be the equivalent to cd c:\WINDOWS   and cd "c:\Documents and Settings" respectively


PS: of course you may use MINGW directly, but in my case I was also needing GIT.