24 Mar 2015

Java/Jsp and the Euro Symbol €

To handle the € Euro Symbol in pages within a JSP/Java app, you better use the Windws-1252 charset encoding.
Just do the 2 following notes:

1) Put those lines in your jsp page to force the encoding in the response page:

<%@ page contentType="text/html;charset=windows-1252"%>
<%@ page pageEncoding="windows-1252"%>


2) and then, before reading anything from the submitted pages, force the same encoding on the request:

request.setCharacterEncoding( "windows-1252" );

(*) this is needed because the browser may send back datas using their default encoding, and not the one you setted on your page, causing.


Last but not least, if you are going to write/read datas to a database, be careful to configure your db with a compatible encoding.
For example, on sql server, e dafault collation Latin1_General_CI_AS would be fine.

19 Mar 2015

Oracle recovery-reset password SYS

To reset the password for the user SYS,
you need to sign on to Oracle as sysdba from within the same server where Oracle is running,
you should be able to log on without a password,
at this point simply change the password.



sqlplus /nolog
connect / as sysdba
ALTER USER SYS IDENTIFIED BY "change_on_install";


note: always remeber the passwords are case sensitive starting form oracle 10.

In some cases this methos may not work. Then the situation becomes complicated ... you can start trying to find another user with sysdba privileges, or you may


10 Mar 2015

Oracle WRAP not working: empty output file SOLUTION !

SOLUTION 1:

check the ORACLE_HOME is correctly set
(eg: set ORACLE_HOME=D:\oraclexe\app\oracle\product\11.2.0\server)


SOLUTION 2


try to run the wrap utility as administrator 
(executing CMD.EXE as administrator)

Note: this procedure should only be nedded for the 1st time, because of the missing dirs as reported @solution3.

SOLUTION 3


go to your ORACLE_HOME directory, and verify you have those directories "log\diag\clients" 
if not create them!

(eg: D:\oraclexe\app\oracle\product\11.2.0\server\log\diag\clients)


SOLUTION 4

checkout the (almost hidden) log file under:

C:\Users\<user>\Oracle\ORADIAG_<user>\DIAG\CLIENTS\USER_<user>\host_??????????_??\ALERT\LOG.XML

(obviously remeber to replace <USER> and host_??????????_?? with your own values)