Monday, December 28, 2009

Oracle Wallet Manager(OWM) :Exception in thread "main" java.lang.UnsatisfiedLinkError: owm2

Recently, we encounter the error as below in the Oracle Wallet Manager,

Exception in thread "main" java.lang.UnsatisfiedLinkError: owm2 (No such file or directory)
at java.lang.ClassLoader.loadLibraryWithPath(ClassLoader.java:993)
at java.lang.ClassLoader.loadLibraryWithClassLoader(ClassLoader.java:962)
at java.lang.System.loadLibrary(System.java:465)
at oracle.security.wallet.NZNative.(NZNative)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at oracle.security.admin.wltmgr.owma.OwmaApp.init(OwmaApp)
at oracle.sysman.emSDK.client.appContainer.WebApplication.launch(WebApplication.java:3446)
at oracle.sysman.emSDK.client.appContainer.WebApplication.main(WebApplication.java:3327)

To try to fix this error, we try to set the path for LD_LIBRARY_PATH to $ORACLE_HOME/lib but still the error persists. In the end , we found out that the error is due to the JDK , which we have upgrade from the existing 1.5 JDK to 1.6 JDK 64bit.

To fix it, we change the path in the file $ORACLE_HOME/bin/owm
JRE_HOME=/ApplTop/ias10gr2/app/product/10.1.3/jdk/jre
to JRE_HOME=/ApplTop/ias10gr2/app/product/10.1.3/jdk.orig/jre/ (Points back to original 1.5 JDK)

Monday, October 19, 2009

SQL Server 2000 - The process could not execute 'sp_replcmds'

Recently, in SQL Server 2000 we encounter the error
" The process could not execute 'sp_replcmds' " and also
" Timeout expired (Source: ODBC SQL Server Driver (ODBC); Error number: 0)"
this is due to recent password changed.

To solved this , right click the Distributor -> choose configure Publisher and
distributor properties and choose -> Click on the Publishers/Distributors and the "..." in the lists below and then set the sa passsword.



Replication information
http://www.replicationanswers.com/Transactional.asp

Thursday, October 08, 2009

How to install Oracle Client or Oracle Database into debian

Here are some of the links that you can follow to install the oracle client or Oracle xe on the debian

Oracle: Database for Debian installation guide
http://www.togaware.com/linux/survivor/Oracle_Database.html

Installing Oracle XE on Debian
http://www.debian-administration.org/articles/430

Installing Oracle XE on Debian
http://mediakey.dk/~cc/howto-install-oracle-on-debian/

Tuesday, August 18, 2009

Oracle Forms -REP-56055 exceeded max connections allowed Oracle Reports Error

If you encounter the error, REP-56055 exceeded max connections allowed Oracle Reports Error then you need to increased the number of database connection in the reports configuration file.



1. Goto $ORACLE_HOME/reports/conf/ , find your server report name e.g. TestReport.conf

2. find the connection maxConnect= and set it to a higher values.

3. Restart the reports services .



There is also a possibilities that after you increase to high value on the maximum database connection , the error still persists.



If so, then if your reports takes a long time to generated out and has many pages the possibilities are that the number of session in 1 reports engine more than the reports engine can handled.



Then you need to changed the engineid , engine id="rwEng" engLife="50" to lesser values such as 5 and increase your maxEngine from 1 to higher value like 5.

Monday, August 17, 2009

Oracle Application Server - Java OutOfMemory , Analyzing the javacore dump



  1. Download the IBM Thread & Monitor Dump Analyzer for Java at http://www.alphaworks.ibm.com/tech/jca


  2. Follow the guide in How to Diagnose Java Resource Starvation http://java.sys-con.com/node/921279?page=0,1


  3. Use the JDK 1.5 to run the jca.jar and open the javacore*.txt file with all the same thread file name. e.g. javacore147902.xxxxx.txt


  4. In the Compare Monitors of the tool, you will noticed the blocked by 1. Clicked the blocked for more information. In the state, “Monitor”, the action is “Owns Monitor Lock on Heap Lock” , that means it is currently owning the lock when the dump is initiated.


  5. Notice the last thread information on the detail. If the information is something like below, then it is possible that your application is logging to many data in the logs file and caused the locking issue.




  6. at
    java.util.AbstractCollection.toString(AbstractCollection.java(Compiled Code))at
    java.lang.String.valueOf(String.java(Compiled Code))at
    java.lang.StringBuffer.append(StringBuffer.java(Compiled Code))at
    org.apache.commons.lang.builder.ToStringStyle.appendDetail(ToStringStyle.java(Compiled
    Code))at
    org.apache.commons.lang.builder.ToStringStyle.appendInternal(ToStringStyle.java(Compiled
    Code))at
    org.apache.commons.lang.builder.ToStringStyle.append(ToStringStyle.java(Compiled
    Code))at
    org.apache.commons.lang.builder.ToStringBuilder.append(ToStringBuilder.java(Compiled
    Code))at
    org.apache.commons.lang.builder.ReflectionToStringBuilder.appendFieldsIn(ReflectionToStringBuilder.java(Compiled
    Code))at
    org.apache.commons.lang.builder.ReflectionToStringBuilder.toString(ReflectionToStringBuilder.java(Compiled
    Code))at
    org.apache.commons.lang.builder.ReflectionToStringBuilder.toString(ReflectionToStringBuilder.java(Compiled
    Code))at
    org.apache.commons.lang.builder.ReflectionToStringBuilder.toString(ReflectionToStringBuilder.java(Compiled
    Code))at
    org.apache.commons.lang.builder.ToStringBuilder.reflectionToString(ToStringBuilder.java(Compiled
    Code))



  7. In our case, the logging is set by the Log4j , which we found out that the settings is set to full debug mode, we changed it to WARN mode. "log4j.rootLogger=DEBUG, app" to "log4j.rootLogger=WARN, app" , more information at here http://www.laliluna.de/log4j-tutorial.html


  8. After this, our application server java core dump is greatly reduce.

Thursday, July 16, 2009

Oracle Application Server - Java OutOfMemory Issue

If your Oracle application server 10.1.2 or Oracle Forms encounter the Java OutOfmemory issue, then you may need to changed your OC4J container java option in the opmn.xml to increase the heap memory. Add the following below , the start parameters and in the java-options.


data id="java-options" value="-Xms1024m -Xmx2048m -Xss256k "


The Xms specified the start of the heap memory , Xmx , specified the maximum memory settings for the java container. the Xss specified to set the maximum native stack size for any thread.





Starts from the 512m for the memory settings and the xss128k until the issue can be resolved.

After that, dcmctl updateconfig to update the configuration.





For more information, on the using of this Java parameters, please refer to



Fine-Tuning Memory Usage of 32-Bit Java on AIX

http://www.ibmsystemsmag.com/print/print.aspx?print_page=%2Faix%2Foctobernovember04%2Ftechnicalcorner%2F6643printp1.aspx&string_referer=/aix/octobernovember04/technicalcorner/6643p2.aspx



Forum on Java Outofmemory issue,

http://www.ibm.com/developerworks/forums/message.jspa?messageID=13853385



Metalink Note : 298551.1

OPMN and Process Monitoring



Metalink Note : 823504.1

What are the minimum and maximum sizes recommended for Java heap configuration for OC4J?

Running dbms_scheduler within a timing interval

To run a statspack snap within a scheduled timing , you can use the below, it will start the job at 8 am and run until 8pm from monday until friday.


exec dbms_scheduler.create_job(JOB_NAME => 'JOB_STATSPACK_SNAP',job_type=> 'PLSQL_BLOCK', JOB_ACTION => 'BEGIN STATSPACK.SNAP; END; ', START_DATE => trunc(sysdate) + 8/24 , REPEAT_INTERVAL => 'FREQ=HOURLY; BYDAY=MON,TUE,WED,THU,FRI; BYHOUR=8,9,10,11,12,13,14,15,16,17,18,19,20', ENABLED => TRUE, AUTO_DROP =>FALSE, COMMENTS =>'Statpacks snap') ;

another example , would be below running in between the time 8am til 8pm with interval 15 mins


exec dbms_scheduler.create_job(JOB_NAME => 'JOB_STATSPACK_SNAP',job_type=> 'PLSQL_BLOCK', JOB_ACTION => 'BEGIN STATSPACK.SNAP; END; ', START_DATE => trunc(sysdate) + 8/24 , REPEAT_INTERVAL => FREQ=DAILY; BYDAY=MON,TUE,WED,THU,FRI,SAT,SUN; BYHOUR=8,9,10,11,12,13,14,15,16,17,18,19;BYMINUTE=0,15,30,45', ENABLED => TRUE, AUTO_DROP =>FALSE, COMMENTS =>'Statpacks snap') ;

To check if your calendar string is correct , you can use below to do this.


declare
L_start_date TIMESTAMP;
l_next_date TIMESTAMP;
l_return_date TIMESTAMP;
begin
l_start_date := trunc(SYSTIMESTAMP);
L_RETURN_DATE := L_START_DATE;
for ctr in 1..100 loop
DBMS_SCHEDULER.EVALUATE_CALENDAR_STRING(
'FREQ=DAILY; BYDAY=MON,TUE,WED,THU,FRI; BYHOUR=8,20',
l_start_date, l_return_date, l_next_date
);
dbms_output.put_line('Next Run on: '
to_char(l_next_date,'mm/dd/yyyy hh24:mi:ss')
);
l_return_date := l_next_date;
end loop;
end;
/

Thursday, June 25, 2009

ORACLE :- Query remote LOB data ORA-22992

There's a issue in querying the LOB object prior Ora 10gr2.

Prior Ora10gr2,

You need to create a view in the source DB to convert the lob to string using either view or materialized view.
or same as below, create a function / procedure to convert the lob to string.

For Ora10gr2,
you can use the following to workaround the issue.

create or replace function lobconverterproc
( col1 in varchar2) return varchar2
is
var1 varchar2(1000);
BEGIN
SELECT FYDSCR INTO var1 FROM tablename
WHERE col1=v_col1;

RETURN var1;
END;
/

select lobconverterproc('Test') from dual;

Monday, June 22, 2009

Migrating from IAS 10.1.2 to 10.1.3.4

Other than the different in Application Server control GUI, if your application ear is compiled using JDK 1.42 , it might has error if it used the JDK 1.5.



Other issue, is that it could be a bug as in the note “java.lang.NoClassDefFoundError: org/apache/log4j/Category After Upgrading from 10.1.3.1.0” ,Note ID : 460448.1
Which mentioned


http://forums.oracle.com/forums/thread.jspa?threadID=616870


To resolved this follow the guide here


http://www.pascalalma.net/2008/07/14/using-commons-logging-with-oc4j/




Opmn logs: -

Caused by: com.evermind.server.ejb.deployment.InvalidEJBAssemblyException: Unable to load ejb-class com.bidm.misc.ejb.session.ejbeans.MiGenBean, see section 23.2 of the EJB 2.1 specificationjava.lang.NoClassDefFoundError: org.apache.log4j.Logger


at com.evermind.server.ejb.exception.ValidationExceptions.unableToLoadEJBClass(ValidationExceptions.java:36)


Caused by: java.lang.NoClassDefFoundError: org/apache/log4j/Categoryat java.lang.Class.getDeclaredConstructors0(Native Method)at java.lang.Class.privateGetDeclaredConstructors(Class.java:2328)at java.lang.Class.getConstructor0(Class.java:2640)

Sunday, June 21, 2009

Different between IAS 10.1.2 and 10.1.3

1. In 10.1.3 the dcmctl tool is no longer available, to performed the task that normally using the dcmctl you need to use the oc4j_admin at $ORACLE_HOME/j2ee/home or download the admin_client.jar in http://download.oracle.com/otn/java/oc4j/10131/oc4j_admin_client_101310.zip.

2. For the Oracle® Containers for J2EE Configuration and Administration Guide, Using the admin_client.jar Utility please refered the link here.

E.g. normally to deploy application in 10.1.2 , you use

dmctl deployapplication -file xxx.ear -a TestInstance -co TestName

In 10.1.3 ,

java -jar admin_client.jar deployer:oc4j:opmn://test-cycle.oracle.com/TestName oc4jadmin welcome1 -deploy -file d:\temp\xxx.ear -deploymentName TestInstance –bindAllWebApps


3. Another important consideration in when migrating is that the default behaviour of the 10.1.3. 10.1.10 Invocation by Servlet Name without Mapping Is Disabled by Default

The 10.1.3.x Oracle Containers for J2EE Servlet Developer's Guide notes that by default, servlet invocation by class name is now disabled, but can be enabled through the property setting -Dhttp.webdir.enable=true. (Servlet invocation by class name was enabled by default in versions 10.1.2.x and prior.)

What is similar, but undocumented, is that this also applies to invoking a servlet through its value when there is no corresponding entry. Invoking a servlet through its servlet name in this way was enabled by default in 10.1.2.x and prior, but requires the setting -Dhttp.webdir.enable=true in 10.1.3.x versions.

For example, consider the following web.xml entry, with no corresponding entry:

    
TestIt
mypackage.TestIt

In 10.1.2.x, you could access this servlet using /servlet/TestIt without any property setting. In 10.1.3.x, you must set -Dhttp.webdir.enable=true to access the servlet in this way with the given configuration.



Sunday, June 07, 2009

IAS error - REP-56040: Server rep_ already exists in the network

If you encounter these error "REP-56040: Server rep_ already exists in the network", then there's a possiblity that the report services detected the same services name in other server. To find out if it can detect other report services , run below command.

In MS Windows: %ORACLE_HOME%\bin\rwdiag.bat -findall
In Unix: $ORACLE_HOME/bin/rwdiag.sh -findAll

Broadcast mechanism used to locate servers------------------------------------------
Channel address = 228.4.6.6 Channel port = 14021
(1) Name = : Type = server : Host = .oracle.com
(2) Name = : Type = server : Host = .oracle.com
(3) Name = : Type = server : Host = .oracle.com
(4) Name = : Type = server : Host = .oracle.com

notice, that the report server services appear on the different hostname. In the rwservlet.trc,
Exception 51002 (): Bind to Reports Server failed.

There's two way to resolve this , 1 way is to set different report_server name compare with other server or 2 , changing the naming method in the $ORACLE_HOME/reports/rwnetwork.conf

Uncoment the multicast and enabled the naming method. e.g.

multicast channel="228.5.6.7" port="14021" timeout="1000" retry="3"/
!--namingService name="Cos" host="%NAMING_HOST%" port="%NAMING_PORT%"/--

to

discoveryService

!-- multicast channel="228.5.6.7" port="14021" timeout="1000" retry="3"/--
namingService name="Cos" host="testserver" port="14021"
/discoveryService


Metalink note:
- Intermittent REP-51002 or REP-56040 and Same Repserver is Displayed Multiple Times in Rwdiag.sh Output, Note ID :563367.1
-REP-51002 And Rep-56040 if More than one OC4J_BI_FORMS Instance is Created, Note ID : 390412.1

Wednesday, May 06, 2009

How TO: change the sql server service account

This internet link, show how you can changed the SQL Server service account without using SQL entereprise Manager, it can also helps you if you want to troubleshoot any problem once you changed the SQL server service account .


HOW TO: Change the SQL Server Service Account Without Using SQL Enterprise Manager in SQL Server 2000
http://www.myitforum.com/articles/18/view.asp?id=6724

Monday, April 20, 2009

Oracle 10g materialized view bug, when using import fromuser , touser. ORA-00942

If you have materialized view, and importing using the option fromuser and touser , you may have the error below :-

BEGIN
dbms_mview.refresh('MV_TEST','C');
END;
*ERROR at line 1:ORA-00942: table or view does not exist
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2254
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2460
ORA-06512: at "SYS.DBMS_SNAPSHOT", line 2429ORA-06512: at line 1

This is a bug in the oracle 10g, to workaround this recreate the materialized view.

Friday, April 17, 2009

SQL 2000, ANSI_DEFAULTS, ANSI NULL settings

Recently, i have the problem of a query  in a sp comparing null values and is unable to return values..

After going through this, found out that if a sp is created in query analyzer with null values setting is set to ANSI_NULL is set to on , the sp itself when run by user will take this settings.

"It is slightly more complicated to resolve ANSI_NULL problems when dealing with stored procedures, triggers and views as the ANSI_NULLS setting is saved when these objects are created or altered and is enabled (used) upon their execution. In other words, these objects inherit the ANSI settings of the user session that is used to creates them."

This is explain by the url below.

Understanding the Implications of ANSI SQL92 SET Options

http://www.sqlservercentral.com/articles/Administration/understandingtheimplicationsofansisql92setoptions/482/

Thursday, April 16, 2009

SQL server database backup - Important to check the backup policy

Recently , we have a sql server data corruption that needed the backup to be restored. We have two scheduled backup , 1 is to a backup disk and the other one is to the backup tape.

After checking the backups, found out that the only usable restoration is by using the backup tape. This is because the task to backup to tape reinitialized the transaction log , this caused the folder backup cannot be restored to point in time.

The point is, Make sure that if there are two backup policy ensure that both of them didn't clear the other one backup transaction log.

Monday, March 16, 2009

Apache Slow performance with NFS mount

Recently we have a slow performance with our web site after we redirect our OC4J Application logs to the NFS mount, which is using servlet to logs the application log.

Metalink :

Log Directories In NFS Mounted Device Environment Causes Performance Problem With Apache , Note: 180522.1

Bad performance of Apache when filesystem is NFS mounted, Note : 467315.1

Monday, March 09, 2009

Import DataPump : Error after importing PLS-00103 - compilation error

If you encounter error PLS-00103 while using import data pump to import data pump data into a new database with Oracle 10g but dont have problem if using the import and export utility . (imp/exp) .

Then most probably you encounter the bug in oracle 10g. If the source package/procedure... is wrapped and uses mulitbyte character set when using the import data pump, it add extra line behind the wrap.

To workaround this , 1)use the imp/exp tools. 2) manually edit the source code to removed the extra lines. 3) Find and get the bug fixed patch in the metalink.

Impdp Returns ORA-39082 When Importing Wrapped Procedures
Metalink Note :- 460267.1

Thursday, February 26, 2009

Performance problem while starting up Opmnctl / Application for Oracle Application 10.1.2.0 in clustered

If you have performance problem while starting up Opmnctl / Application for Oracle Application 10.1.2.0 in clustered, this could be due to the bug in the OC4J.

As higlighted , in the bug fixed for the 10.2.2.2 ,

In a clustered environment the command 'dcmctl updateConfig ..' in one node copies the orion-ejb-jar.xml to other node and as a result unnecessary redeployment of the j2ee application occurs in other node.

To check, goto both server of the clustered and compared the files at $ORACLE_HOME/j2ee/APP/application-deployments/AppName/AppName.jar/orion-ejb-jar.xml

You will also notice in the log files, if you have set the OC4J options -out

09/02/23 20:34:16 Auto-deploying - AppEJB.jar (orion-ejb-jar.xml had been updated since the previous deployment)...

References:-
Metalink Doc ID: 398955.1

Wednesday, February 25, 2009

Error in Oracle Infrastructure - LDAP ora31203

If you encounter the below error, while installing your Oracle OID / Infrastructure , make sure that the /etc/hosts for both server contain your hostname and hostname.domain

LDAP error : ORA-31203: DBMS_LDAP: PL/SQL - Init Failed.

Eror: ORA-31203 (ORA-31203)

Text: DBMS_LDAP: PL/SQL - Init Failed.

---------------------------------------------------------------------------

Cause: There has been an error in the DBMS_LDAP Init operation. Action: Please check the host name in the hosts file and the port number to see if it's been taken up, or report the error number and description to Oracle Support.

Monday, January 19, 2009

SQL server performance diagnostics tool

PSSDIAG data collection utility


PSSDIAG is a general purpose diagnostic collection utility that Microsoft Product Support Services uses to collect various logs and data files. PSSDIAG can natively collect Performance Monitor logs, SQL Profiler traces, SQL Server blocking script output, Windows Event Logs, and SQLDIAG output.


http://support.microsoft.com/kb/830232





RML Utilities for SQL Server (x86)

Tools to help database administrators manage the performance of Microsoft SQL Server.

http://www.microsoft.com/downloads/details.aspx?FamilyId=7EDFA95A-A32F-440F-A3A8-5160C8DBE926&displaylang=en

SQL Nexus Tool



Tool that helps you identify the root cause of SQL Server performance issues


http://www.codeplex.com/sqlnexus










DbDiff - DbScripting (without dmo,smo)



Compare MSSql database structures. (Sql 7,Sql 2000,Sql 2005)


http://www.codeplex.com/DbDiff

Thursday, January 15, 2009

SQL Server data corruption - DBCC checkdb ( REPAIR_ALLOW_DATA_LOSS )

Recently one of our sql server has a RAID 5 hard disk failure, after the hard disk is changed the sql server report data error while running the dbcc checkdb.

If the DBCC checkdb , returns error such as below, that means that the clustered index (index ID 0) could have been corrupted and data loss is a possiblities.

Server: Msg 8928, Level 16, State 1, Line 1Object ID 1335232803, index ID 0: Page (1:14469854) could not be processed. See other errors for details.
Server: Msg 8939, Level 16, State 1, Line 1Table error: Object ID 1335232803, index ID 0, page (1:14469854). Test (IS_ON (BUF_IOERR, bp->bstat) && bp->berrcode) failed. Values are 2057 and -1.
Server: Msg 8928, Level 16, State 1, Line 1Object ID 1335232803, index ID 0: Page (1:14469855) could not be processed. See other errors for details.Server: Msg 8928, Level 16, State 1, Line 1

If the Index ID is more than 1 , then only the index is spoilt.

After determining, the Page id we can get the raw data by using the below command. The 3 that's means formatted data and the 2 is the raw data.

DBCC TRACEON (3604);
GO
DBCC PAGE ('DB', 1, 14469854, 3);
GO

After this, we can find out the primary key of the tables . Based on this we can restored the data from the backup to here.

Another way is to restore the page data, this is only can be done minimumly in sql 2005

Links :-
SQL Server in Recovery by Paul S. Randal.
http://www.sqlskills.com/BLOGS/PAUL/category/Corruption.aspx#p31

Fixing damaged pages using page restore or manual inserts
http://blogs.msdn.com/sqlserverstorageengine/archive/2007/01/18/fixing-damaged-pages-using-page-restore-or-manual-inserts.aspx

Thursday, January 08, 2009

Problem in restoring share point ? Error SQLException access to module is blocked

If you encounter this error, while restoring your sharepoint to another share point server,

Object Project Server Application failed in event OnPostRestore. For more information, see the error log located in the backup directory. SqlException: Access to module dbo.proc_MIP_GetObjectVersion is blocked because the signature is not valid.

This is could be due to that the shared services cannot be install in SQL server 2005 embedded version. The error when creating a new shared services "SSP Databases cannot be created in the Windows Internal Database; they must be created in SQLExpress or a full SQL Server installation"

or these error

Access to the table dbo.sites is blocked because the signature is not valid.
Access to module dbo.proc_GetCurrent is blocked because the signature is not valid.

Please follow the below guide,

This will provision the SPWebService service has not been fully provision after we restored.http://kbalertz.com/944154/receive-error-message-browse-SharePoint-collections-after-hotfix-package-public-update-Windows-SharePoint-Services-applied.aspx

If you still has error, then follow this guide to Restore a shared service provider administration site.

http://blog.tylerholmes.com/2008/03/restoring-shared-service-provider-admin.html

To check the shared services db is the problem , login to ms sql and query the shared_services1_db tables and you will see error.

Tuesday, January 06, 2009

Working with Oracle Forms and NLS Language/Globalization issues - others

Other information regarding troubleshooting the forms issues and so on.


Using PDF in Oracle Reports
http://download.oracle.com/docs/cd/B25521_01/doc/frs/reports/B14048_01/pbr_pdf.htm

which included Comparison of PDF Font Features ( which is interesting to note)


and also
Resolving Cross-Platform Porting Issues
http://download-uk.oracle.com/docs/cd/B14099_19/bi.1012/b14048/pbr_xplat.htm

Managing oracle fonts in Oracle Reports
http://download.oracle.com/docs/html/B10314_01/pbr_font.htm#1010309