Monday, August 4, 2008

Run Java Application using Server JVM

Every form of Sun's Java runtime comes with both the "client VM" and the "server VM." Unfortunately, Java applications and applets run by default in the client VM. The Server VM is much faster than the Client VM, but it has the downside of taking around 10% longer to start up, and it uses more memory.

There are two ways to run Java applications with the server VM:

1. When launching a Java application from the command line, use java -server [arguments...] instead of java [arguments...]. For example, use java -server -jar beanshell.jar.

2. Modify the jvm.cfg file in your Java installation. (It's a text file, so you can use Notepad or Emacs to edit it.) This is located in C:\Program Files\Java\j2reXXX\lib\i386\ on Windows, /usr/java/j2reXXX/lib/i386/ on Linux. You will see two lines:

-client KNOWN
-server KNOWN

You should change them to:

-server KNOWN
-client KNOWN

This change will cause the server VM to be run for all applications, unless they are run with the -client argument.

Saturday, August 2, 2008

Solaris Log Files

  • /var/adm/syslog -- Logs common system events
  • /var/adm/messages -- Miscellaneous log file for most events on a system
  • /var/cron/log -- Logs all jobs run in crontab
  • /var/lp/logs/lpsched -- Logs information related to the print services
  • /var/adm/pacct -- Used for process accounting

Tuesday, July 29, 2008

Scripting Oracle SQL

To run sql commands of oracle in a script to use abilities of it like scheduling with crontab write the shell script commands in script.sh as belows

script.sh:
FILENAME=$(date +'%d-%m-%Y.txt')
sqlplus user/pass@db-sid <<EOL >> $FILENAME
select * from tbl1 where rownum<10000;
EOL

If sqlplus can't be run in the context of the this user the above script can be called in another script with su -c or specifying oracle user in crontab.

Monday, May 19, 2008

Delete Duplicate Rows in Oracle

DELETE FROM our_table
WHERE rowid not in
(SELECT MIN(rowid)
FROM our_table
GROUP BY column1, column2, column3... ;

Wednesday, May 14, 2008

Sun Volume Maintenance

1- Check volumes by metastat to see is there a mirror or submirror which contains not OK state(Last Erred|Needs Maintenance|Resyncing) like below:
metastat d5
d25: Submirror of d5
State: Resyncing
Size: 8395200 blocks
Stripe 0:
Device Start Block Dbase State Hot Spare
c1t1d0s5 0 No Resyncing

2- Check disk needs maintenance with format analyze or fsck commands.

3- If error repaired re-enable submirror with metareplace command:
metareplace -e d5 c1t1d0s5

after the command, submirror state change to Resyncing and if there is no hard error it will become OK.
Complete Help @ Sun

Tuesday, May 13, 2008

Microsoft Mary, Mike and Sam Voice SAPI 5.0

To install additional voice for Microsoft Text to Speech 5.0 (TTS) download and install the following package from Microsoft:
http://download.microsoft.com/download/speechSDK/SDK/5.1/WXP/EN-US/speechsdk51.exe

If the engine is not installed download engine 5.1 and install this first:
https://www.cepstral.com/downloads/public/other/SAPI_5.1_installer.msi

Microsoft Mary, Mike and Sam Voice SAPI 5.0

To install additional voice for Microsoft Text to Speech 5.0 (TTS) download and install the following package from Microsoft:
http://download.microsoft.com/download/speechSDK/SDK/5.1/WXP/EN-US/speechsdk51.exe

If the engine is not installed download engine 5.1 and install this first:
https://www.cepstral.com/downloads/public/other/SAPI_5.1_installer.msi