Tuesday, March 11, 2014

Using to_date function oracle

The to_date function can be used to compare dates :
Usage can be as follows

select
from message 
where message_text like '%888309%' 
and message_received >= to_date('20131119', 'yyyymmdd');

The date format can be changed according to needs.

How to remove dead EPR JBOSS

To remove dead EPR go to 
C:\Vineet\JBoss\jboss-soa-p-5.2\jboss-as\server\sao\deployers\esb.deployer\jbossesb-properties.xml

add the following to transports 



Fix the error ORA-28002: the password will expire within 7 days

ORA-28002: the password will expire within 7 days
Cause: The user's account is about to about to expire and the password needs 
to be changed.
Action: Change the password or contact the database administrator.

Reference: Oracle Documentation 

Solutions:

1) Simply change the password to avoid it temporary

  [oracle@lnxsvr ~]$ sqlplus scott/tiger

  SQL*Plus: Release 11.2.0.1.0 Production on Wed Jun 20 14:08:01 2012

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

  ERROR:
  ORA-28002: the password will expire within 7 days

  Connected to:
  Oracle Database 11g Release 11.2.0.1.0 - 64bit Production

  SQL> PASSWORD
  Changing password for SCOTT
  Old password:
  New password:
  Retype new password:
  Password changed

How to fix the error ORA-01691: unable to extend lob segment

For the error like this 
org.jboss.soa.esb.services.persistence.MessageStoreException: java.sql.SQLException: ORA-01691: unable to extend lob segment
SAO.SYS_LOB0000049247C00003$$ by 1024 in tablespace SYSTEM

        at org.jboss.internal.soa.esb.persistence.format.db.DBMessageStoreImpl.addMessage(DBMessageStoreImpl.java:100)
        at org.jboss.soa.esb.actions.MessagePersister.process(MessagePersister.java:72)
        at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:649)
        at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.processPipeline(ActionProcessingPipeline.java:603)
        at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline.java:433)
        at org.jboss.soa.esb.listeners.message.MessageAwareListener$TransactionalRunner.run(MessageAwareListener.java:550)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.sql.SQLException: ORA-01691: unable to extend lob segment SAO.SYS_LOB0000049247C00003$$ by 1024 in tablespace
SYSTEM

Following these steps
SQL> select * from dba_tablespace_usage_metrics order by used_percent desc;

use the file location from the below SQL to the ALTER database
SQL> select dbms_metadata.get_ddl('TABLESPACE','SYSTEM') from dual;

SQL> ALTER DATABASE
  2  DATAFILE '/u01/app/oracle/oradata/XE/system.dbf'
  3  RESIZE 256M;
  
SQL> select * from dba_tablespace_usage_metrics order by used_percent desc;

Tuesday, March 4, 2014

GWT Setup Steps

For setting up the GWT in your local environment the following things are required.
  • Download and install JDK 1.7. The GWT tutorial say you can use 1.6 or higher. For me it did the app Engine did not work with 1.6 and required 1.7.
  • Download Eclipse Kepler 4.3 or higher.
  • Install the Google plugin in eclipse using the software update feature in the Eclipse
  • You can create a sample project after all the installation is done. To create a Web Application, select File > New > Web Application Project from the Eclipse menu.
  • In the New Web Application Project wizard, enter a name for your project “MyWebApp” and a java package name, e.g., “com.mycompany.mywebapp”. If you installed the Google App Engine SDK, the wizard gives you the option to use App Engine as well. For now, uncheck this option and click Finish.
  • The wizard creates a directory structure for the project, including a src/ directory for Java source files, and a war/ directory for compiled classes and other files for the application, libraries, configuration files, static files such as images and CSS, and other data files. The wizard also creates a servlet source file and two configuration files.
  • To run the Project go to Run As >  Web Application. The Development mode will give a URL on which the application is running. ( For the first time the browser will prompt you to add a GWT plugin. Install the plugin).
  • You can double click the link to start on the default browser. Or you can right click and click on Open With to choose the browser which you want to use to open the link.
  • If you get an error message as below then follow these steps
o    Right click on your web project -> Run as -> Run configurations.
o    Select 'Server' and 'GWT' tabs respectively and check on 'Automatically select an unused port'
o    Clear Cache from your Chrome browser (do the same on Firefox if you are using Firefox, remember the GWT plugin is not available on the latest Firefox versions, 3-10 I believe).
o    Run and hopefully enjoy.


Wednesday, October 9, 2013

Set Custom Date Format in SQL Developer.

You can change this in preferences:

  1. From Oracle SQL Developer's menu go to: Tools > Preferences.
  2. From the Preferences dialog, select Database > NLS from the left panel.
  3. From the list of NLS parameters, enter DD-MON-RR HH24:MI:SS into the Date Format field.
  4. Save and close the dialog, done!

Here is a screenshot:

Friday, December 10, 2010

Accessing Services in Windows.


There are two ways to view Services on your computer. The first is to use the MS Configuration Utility by typing msconfig.exe in the Run box accessed via the Start Menu, followed by clicking the Services tab. If you want a quick visual of which items are running or stopped.

The preferred way to make changes to services is to launch services.msc from the Run option on the Start Menu. The Services window shown below will open. From here you can stop , start or restart a service. This can be useful if you are using a MySQL, Tomcat or other services which you may want to start or stop or restart. You can just create a shortcut to the Desktop which is a easy way to access services.