Tuesday, February 19, 2013

But, every 180 days, you need to repeat the same action. If you are NOT concerned with strict security rules for your database, you can take the following approach to set user accounts to never expire.

What Profile Used by a User Account?

A profile[3] is a database object - a named set of resource limits. Using profile, you can enforce a limit on resource utilization using resource limit parameters Also you can maintain database security by using password management feature. Here is the SQL command you can use to query which profile is used by each user account:

Sunday, February 17, 2013

We have started oracle database, which is followed by starting the listener. Then we checked listener's status. As you can see below, at beginning, it reports that "The listener supports no services." However, after exactly 60 seconds, it reports that two services were supported (i.e., ps6stg7 and ps6stg7XDB).In this article, we explain what happened and will show you how to force service be registered with the listener. So, your application can find the services sooner.-bash-3.2$ $ORACLE_HOME/bin/lsnrctl statusLSNRCTL for Linux: Version 11.2.0.3.0 - Production on 17-FEB-2013 21:07:57Copyright (c) 1991, 2011, Oracle. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))STATUS of the LISTENER------------------------Alias LISTENERVersion TNSLSNR for Linux: Version 11.2.0.3.0 - ProductionStart Date 17-FEB-2013 21:06:58Uptime 0 days 0 hr. 0 min. 58 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /scratch/aime1/app/oracle11.2.0.3.0/product/11.2.0/dbhome_1/network/admin/listener.oraListener Log File /scratch/aime1/app/oracle11.2.0.3.0/diag/tnslsnr/myserver/listener/alert/log.xmlListening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=myserver.us.oracle.com)(PORT=1521)))The listener supports no servicesThe command completed successfully-bash-3.2$ $ORACLE_HOME/bin/lsnrctl statusLSNRCTL for Linux: Version 11.2.0.3.0 - Production on 17-FEB-2013 21:07:59Copyright (c) 1991, 2011, Oracle. All rights reserved.Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))STATUS of the LISTENER------------------------Alias LISTENERVersion TNSLSNR for Linux: Version 11.2.0.3.0 - ProductionStart Date 17-FEB-2013 21:06:58Uptime 0 days 0 hr. 1 min. 0 secTrace Level offSecurity ON: Local OS AuthenticationSNMP OFFListener Parameter File /scratch/aime1/app/oracle11.2.0.3.0/product/11.2.0/dbhome_1/network/admin/listener.oraListener Log File /scratch/aime1/app/oracle11.2.0.3.0/diag/tnslsnr/myserver/listener/alert/log.xmlListening Endpoints Summary... (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521))) (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=myserver.us.oracle.com)(PORT=1521)))Services Summary...Service "ps6stg7" has 1 instance(s). Instance "ps6stg7", status READY, has 1 handler(s) for this service...Service "ps6stg7XDB" has 1 instance(s). Instance "ps6stg7", status READY, has 1 handler(s) for this service...The command completed successfully

PMON

In our case, we have executed the following shell commands in a script named startDB.sh:

#!/bin/bash

. /scratch/aime1/scripts/db/setEnvPs6stg7.sh

echo "### Restart Oracle databse instance $ORACLE_SID ###"

$ORACLE_HOME/bin/sqlplus / as sysdba << EOF

startup;

EOF

echo "Done"

echo "### Starting tns listener ###"

$ORACLE_HOME/bin/lsnrctl start

sleep 20;

$ORACLE_HOME/bin/lsnrctl stat

However, when the last listener status command was executed, it showed:

"The listener supports no services."

Then I did some research and found out that what happened behind the scene is that: PMON process wakes up at every 60 seconds and provide (or register) information to the listener. So, not until 60 seconds later, did listener's status show it supported two services.

Alter System Register

Without waiting for 60 seconds, you can use

alter system register command

This command forces the registration of database information to the listener. So, I decided to give it a try and I added the new sql command in my script as follows:

$ORACLE_HOME/bin/sqlplus / as sysdba << EOF

startup;

alter system register;

EOF

However, this didn't work. After some detective works, finally I have figured out that I need to start the listener first before starting the database. In other words, when the command tried to manually register server information with the listener. The listener needs to be up and running. So, after I have moved "lsnrctl start" command before the database start command, it then worked. Also, you don't need to sleep for 20 seconds before checking the listener's status.

Friday, February 8, 2013

If you see something similar to the following messages in the WebLogic Server console output or log files:

at oracle.jbo.server.DBTransactionImpl.establishNewConnection(DBTransactionImpl.java:1045) at oracle.jbo.server.DBTransactionImpl.getInternalConnection(DBTransactionImpl.java:1433) at oracle.jbo.server.DBSerializer.setup(DBSerializer.java:147) at oracle.jbo.server.DBSerializer.passivateRootAM(DBSerializer.java:287)at oracle.jbo.server.DBSerializer.passivateRootAM(DBSerializer.java:268)
Truncated. see log file for complete stacktrace
Caused By: weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool ApplicationDB to allocate to applications, please increase the size of the pool and retry..

You have a need to tune your JDBC Connection Pool. In this article, we show you how to validate the issue and how to fix it.

JDBC Connection Pools

Connections to a database are expensive to create, which it involves creating a process on the database. A connection pool can be maintained so that the connections can be reused when future requests to the database are required.

In Java programming paradigm, a Java DataBase Connectivity (JDBC) resource (or data source) provides applications with the means of connecting to a database. A JDBC connection pool contains a group of JDBC connections that are created when the connection pool is registered.

How to Validate the Issue?

it shows you how to validate (or montior) JDBC Connection Pool at Runtime. For example, if you find the following statistics:

Waiting For Connection Failure Total

has a non-zero entry, you know you need to tune the JDBC Connection Pool with associated data source.

How to Fix the Issue?

You can tune JDBC Connection Pool from the WebLogic Server Administration Console or you can modify JDBC configuration file used by data source "ApplicationDB" directly. But, before you modify the configuration file, you need to shut down servers first.

JDBC configuration files can be located here:

DOMAIN_NAME/config/jdbc

For example, the one for the ApplicationDB data source is named ApplicationDB-8936-jdbc.xml in our application (ATG CRMDemo).

After trial-and-errors, we have found the following settings are good for our application (note that each application has specific needs and depends on the hardware too):

Friday, February 1, 2013

With two similarly cloned environments, one env works and another env fails. Both of them use /etc/hosts to redirect:

idm-db.us.oracle.com

to its own IP address[1]. However, when one of the WLS managed server tried to connect to its Admin Server using the following URL:

t3://[2606:a800:2010:4048:221:28ff:fefb:7756]:17001,

it failed.

In this article, we discuss how to trouble shoot and resolve this issue.

Log Messages[2]

WebLogic Server provides handlers for sending log messages to standard out, the server log file, broadcasting messages to the domain log, remote clients, and a memory buffer for tail viewing log events in the WebLogic Server Administration Console. You can achieve volume control for each type of handler by filtering log messages based on severity level and other criteria. The LogMBean, described in Oracle WebLogic Server MBean Reference[3], defines attributes for setting the severity level and specifying filter criteria for WebLogic Server handlers.

For example, a Stdout Handler is provided in WLS—it sends stdout of the JVM in which a WebLogic Server instance runs to server terminal console. WLS also provides a Stdout Filter which can be configured to filter log events being sent to the standard out. By default, the Stdout Handler has a NOTICE threshold severity level. Therefore, INFO and DEBUG level messages are not sent to standard out. There is also an attribute named RedirectStdoutToServerLogEnabled in LogMBean. When enabled, this redirects the stdout of the JVM in which a WebLogic Server instance runs, to the WebLogic logging system.

For our case, the above-mentioned error message was found in the standard out which was redirected to a file when the WebLogic Server instance was started.

So, we need to figure out why the connection failed and why

[2606:a800:2010:4048:221:28ff:fefb:7756]

was referenced in the URL. After some digging, we have found that [2606...] is the inet6 addr as shown below:

Cloning Advantage

When you clone a system, you usually have a working system to clone from. So, if your cloned system failed to start, you can compare the working and non-working systems side-by-side. For our case, we have found that the system that fails have ipv6 enabled and the one works didn't.

So, the next step for us to take is to disable IPv6 protocol. First, we have tried it from the JVM level.

Disabling the IPv6 Protocol at JVM Level

Two JVM options are provided in JRockit to enable and disable ipv6 addresses as below:

-Djava.net.preferIPv6Addresses=true (or false)

-DuseIPv6Address=true (or false)

However, when we tried the above tricks from the command line that started the WLS server instance, it didn't work. Since we don't own the application (note that we use the application as a benchmark only), we cannot change coding to make it work with IPv6. So, the next step is for us to disable IPv6 Protocol at kernel level.

Disabling the IPv6 Protocol at Kernel Level

We have followed the instructions described in [4-6] to disable IPv6 protocol at Linux kernel level. There are two files we (as root) have edited by adding lines as shown below:

After saved and closed files, we rebooted the system. Finally, the above changes help us resolve the issue. Be warned that your Linux platform (note that our OS is Redhat Linux) may need different configuration from the one described here.

These are link-local scoped addresses, derived automatically from the interfaces’ hardware addresses. The link-local scope is significant—you can’t access these addresses from anywhere but the local subnet, so don’t use them in delegation, masters substatements, and the like.

Disclaimer

The statements and opinions expressed here are my own and do not necessarily represent those of Oracle.For your computer health, follow me @xmlandmore. To improve your personal health, follow me @travel2health.

About Me

Healthy pursuits are like traveling. We know there is a wonderland called wellness. But, there are no fixed routes to reach there. The pursuits need effort and determination. We cannot act like tourists who don't know where they've been. We must take notes of warning signs sent by our bodies.

On the journey to wellness, there are many dangers to be avoided; there are many footsteps to be taken; unfortunately, there are no short-cuts.

Travelers walking in the night follow North Star. Healthy pursuits work similarly. We know our goal; we know the signposts; we know the dangers on the road; we can adjust pace if we are tired; we can change travel plans due to the weather. But, We walk steadily and persistently. With my companionship, hopefully, your journey will be made easier.