10 setembro 2013

Java SE 7 update 40 e o Mission Control 5.2

Java SE Downloads
Chegou uma nova atualização do Java SE 7: update 40. Esta versão inclui várias novas funcionalidades como o Java Mission Control, Deployment Rule Set, suporta para o Retina display no Mac, e suporte a Hard Float ABI no Linux ARM v7. Também inclui diversas correções de bugs. Para quem desenvolve Applets e aplicações Java Web Start, este release, fica a atenção para conhecer e enteder as mudanças.

Deployment Rule Sets

Esta funcionalidade permite um administrador de desktops a controlar o nivel de compatibilidade para clientes Java assim como níveis de segurança para a empresa. Para maiores detalhes, veja a documentação do Deployment Rule Set.

Java Mission Control

O Mission Control era até então uma ferramenta disponível para clientes Oracle, e que foi lançada há muito tempo atrás junto com o JRockit (JRMC). Mas a Oracle agora disponibilizou a ferramenta junto com a JRE HotSpot 7u40. 

Esta ferramenta permite monitorar, gerenciar, introspectar, e detectar memory leaks nas suas aplicações Java, sem ter que introduzir códigos para isso, que normalmente degradam a performance da aplicação. Hoje esta ferramenta está agora disponível no download do Oracle HotSpot JDK 7u40!

Flight Recorder

Mas a principal e mais importante característica é o Flight Recorder. Este recurso funciona através da leitura de eventos produzidos pela JVM. Mesmo ativando a geração destes eventos, a sobrecarga total  para as suas aplicações ainda fica abaixo de 2%, que considerando o tipo e o valor de informação que você recebe, é quase nada. Um exemplo de evento é a chamada de um método de uma classe Java.

Com o profile de chamadas de métodos você pode descobrir onde o aplicativo está gastando a maior parte do tempo executando seu código Java. Este é, por exemplo, útil para otimizar a aplicação onde as otimizações realmente terão impacto. Isto sem precisar introspectar seu código manualmente!

Alem disso, você tem também uma visão de otimização para alocação de objetos. Você pode ver por exemplo, a alocação em tempo real de objetos na Old Gen da memória heap. diretamente no espaço de idade, além de outras abas que oferecem diversas informações importantes sobre o processamento de informações na sua aplicação Java. Leituras de arquivos I/O, Socket I/O e muito mais.

Se você precisa de mais informações sobre o Mission Control, entre na página da ferramenta em www.oracle.com/missioncontrol.

E obrigado ao Markus Eisele por ter cedido parte deste post! :-)

06 setembro 2013

Install Fusion Middleware Infrastructure on Oracle DB 12c

This week I had the opportunity to play a little with the new and recently released Oracle DB 12c. This version brings a new approach for databases, calledPluggable Databases. There are plenty of articles and YouTube videos already explaining this and I will not focus this article on it. Instead, I want to help you on How to Install Oracle Fusion Middleware Infrastructure on Oracle DB 12c.
There are a couple of steps and commands to be followed, and some very important observations. Starting with a simple one:

Do NOT execute the RCU installer on top of a CDB.
One more time: do NOT execute RCU on top of a CDB. 


If you do point the RCU tool to install over a CDB, you might get this message:

ORA-65096: invalid common user or role name

Now with this in mind, I believe you have understood that the first step is, obviously, to create a PDB. There are some options, but I will use pure SQL commands.

Step 0 - Use the correct encoding for your Database install

Make sure you have installed your DB with the AL32UTF8 encoding. 
This is recommended, but it might work in case you are using something else.

Step 1 - Create a PDB to hold the FMW Infrastructure Data

The following command will create a PDB called PDBFMW with a user "fmw" and password "welcome1".

SQL> CREATE PLUGGABLE DATABASE PDBFMW ADMIN USER fmw IDENTIFIED BY welcome1
 FILE_NAME_CONVERT=(
  '/u01/app/oracle/oradata/orcl/pdbseed/system01.dbf', 
  '/u01/app/oracle/oradata/orcl/pdbfmw/system01.dbf',
  '/u01/app/oracle/oradata/orcl/pdbseed/sysaux01.dbf', 
  '/u01/app/oracle/oradata/orcl/pdbfmw/sysaux01.dbf',
  '/u01/app/oracle/oradata/orcl/pdbseed/pdbseed_temp01.dbf', 
  '/u01/app/oracle/oradata/orcl/pdbfmw/pdbfmw_temp01.dbf'
  )
 STORAGE UNLIMITED

Please make sure to adjust the values to your installation. 

Step 2 - Open the PDB for changes

After you have the PDB created, make sure you change its state to READ_WRITE

SQL> ALTER PLUGGABLE DATABASE PDBFMW OPEN READ WRITE

Step 3 - Fix user privileges

Now you must make sure the user "fmw" has all required privileges. As this is for Development, I will just give everything.

SQL> GRANT ALL PRIVILEGES TO fmw WITH ADMIN OPTION
SQL> GRANT SYS TO fmw

* Important note: I'm not a DBA expert and these might not be the correct privileges for production environment. So please make sure to give only the necessary privileges following the documentation.

Step 4 - Run the RCU tool

This step considers that you have correctly installed Fusion Middleware Infrastructure into your Middleware Home / WebLogic installation folder. In my case, I'm using the full WebLogic + JDeveloper installation package, which brings the FMW Infra bundled. Now go to your $MW_HOME folder and run the RCU tool:

$ cd $MW_HOME
$ cd oracle_common/bin
$ ./rcu

Make sure to use the correct properties to connect to your recently created Pluggable Database:
Database Type: Oracle Database
Host Name: db12c (change to your DB IP address)
Port: 1521
Service Name: pdbfmw (here you use the PDB name)
Username: fmw
Password: welcome1 (or whatever you defined)
Role: SYSDBA
Click "Next" and see if it worked. If you are not using AL32UTF8, it will ask you to Ignore. Just do it, but remember: it might not work properly.

Step 5 - Select components and create new prefix

I like to select everything, and use the "FMW" prefix. Click "Next", "Next", "Next", etc, etc, etc... Until it finishes.

FINISHED!

You have successfuly created the right database structure for your Fusion Middleware Infrastructure, and now you can create a WebLogic domain with ADF and everything else, pointing to this PDB.

If you have any question, post a comment!
Contato

Email:bruno.borges(at)gmail.com

LinkedIn: www.linkedin.com/in/brunocborges
Twitter: www.twitter.com/brunoborges
Comprei e Não Vou
Rio de Janeiro, RJ Brasil
Oracle
São Paulo, SP Brasil