Service Name VS SID – Database Access

By W.ZH, Dec 2011


For using service name, if you use sqlplus to open DB, then you can use:

sqlplus sys/$system_pass@'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=$db_ip)(PORT=$db_port))(CONNECT_DATA=(

for config to access from jdbc code or WLS Datasource for the DB URL:



But if you are using SID – old way:

sqlplus sys/$system_pass@'(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=$db_ip)(PORT=$db_port))(CONNECT_DATA=(

for config to access from jdbc code or WLS Datasource for the DB URL:


Please note one is “:”, one is “/” in URL!


So what is difference between SID and Service Name access? Basically SID is for single DB instance but Service Name can be for cluster environment. You can read Oracle DB book for them.

Create Data Source BeanAlreadyExistsException Error

By W.ZH Dec 2011


When I use my python script to install my data source, I get this error:


Bean already exists: “weblogic.j2ee.descriptor.wl.JDBCPropertyBeanImpl@2c56a3a([gis_dbSource]/JDBCDriverParams/Properties/Properties[user])”

So I suspect there is same named DS not be cleaned, so go to WLS console try to delete DS. After I delete and restart my WLS, my script gets this error again! And again! I met this error years ago,, but just can not dig out this time…


Do to WLS’s domain config folder  under jdbc sub-folder , you can see your DS ‘s xml file still there. But if you open the config.xml, it does not include your DS in the config.xml(so Conole ui can see it.)


So remove that data srouce xml in the jdbc sub-folder , and double check the config.xml does not have your DS item, then restart the WLS and try.

Savepoint Error and Support Global Transactions

By W.ZH Nov 2011


When you try to use the AM(ADF – Application Module) to commit one new created object, you get this save error in jdbc:oracle.jbo.DMLException: JBO-26041: Failed to post data to database during
“Rollback to Savepoint”: SQL Statement “null”.

This error can happen also in the Exposed Web Service by AM, Such as to the SDO Web Service object create/save from WS API.


You can read the
ADF guide and also the “JDBC Data Source Transaction Options” in  Oracle® Fusion Middleware Configuring and Managing JDBC Data Sources for Oracle WebLogic Server 11g Release 1 (10.3.4)

In the Tansaction of the JDBC Datasource configuration for WLS. You need to enable the “Support Global Transactions” and “Emulate Two-Phase Commit”, can solve this issue.

java.sql.SQLException: ORA-01005: null password given; logon denied

By W.ZH Sept 2011


When i have one project ADF BC in Jdeveloper, config datasource and it can work, then i deploy this project into WLS server, and also config the right Datasource in WLS. but when this project start to run ti get this error:

oracle.jbo.DMLException: JBO-26061: Error while opening JDBC connection.
at oracle.jbo.server.ConnectionPool.createConnection(
at oracle.jbo.server.ConnectionPool.instantiateResource(
at oracle.jbo.pool.ResourcePool.createResource(
at oracle.jbo.pool.ResourcePool.useResource(
at oracle.jbo.server.ConnectionPool.getConnectionInternal(
Truncated. see log file for complete stacktrace
java.sql.SQLException: ORA-01005: null password given; logon denied


To read here last step:

To ensure that the credentials that you supply in the database connections for your ADF Application are deployed and include the password, add to the JAVA_PROPERTIES entry in the FMW_HOME/user_projects/domains/yourdomain/bin/ file (or setDomainEnv.cmd if you are on Windows), and restart the server using FMW_HOME/user_projects/domains/yourdomain/bin/

weblogic.jdbc.wrapper.Clob…. error

By W.ZH  Sept 1 2011


When I use the Clob and Blob in the DB, such as try to use ADF-BC to retrieve them out , it can not be converted to string from the blob domain object. System log shows that read out blob data is a weblogic.jdbc.wrapper.Clob_weblogic_jdbc_base_Base Object. So it gets conversion error.

Another problem you may facing is that, when you try to write a clob data into the DB by commit, you get an error like this:

“java.lang.NullPointException at oracle.domain.ClobDomain.writerCharsToClob (……)”

This issue also is caused by same reason.


In the Data Soruce configuration  In Weblogic, there is a flag can control this:

Admin Console –> DataSource–> your DS–> Connection pool –>Advanced–>

There is check box for “Wrap Data Types”, uncheck this , restart your WLS to test again. you will see the db data readout will be sql blob….

How to install Database 11GR1 in Linux


  • Install a DB is not hard work, just download the DB install zip file
  • use unzip file -d ./destfolder   to unzip it
  • run the runinstaller to start setup from VNC console,
  • then follow the steps to install it. write the password, key file and urls that need.


Control UI: 11g use https to access the em control web UI, not http

Key file:
11g db info use encrypt format to save, so you need to back that key file of emkey.ora file

Port Note: if you have another application with DB running in your server, then DB install will auto allocate a new number for your DB. you have be clear about what DN already running in your server. Such as I install a Oracle SES first. it has a DB inside. then when i install the oracle DB 11g in this server, DB port will be 1522. the install steps will not alert or tell you any info about this, you can go to em control UI to find out the listener listen to which port.

Oracle DB Basic – database and instance

They are different!

The database is the set of files where application data and meta data is stored.

An instance is the software (and memory) that Oracle uses to manipulate the data in the database.

In order for the instance to be able to manipulate that data, the instance must
open the database. A database can be opened (or
mounted) by more than one instance, however, an instance can open at most one database.

Using sqlplus to call the startup command , in fact start the instance. then mount the database to this instance, last open this instance to user access the data.

  1. Start an instance.
  2. Mount the database.
  3. Open the database.

and for the shudown, in fact also three steps:

  1. Close the database.
  2. Unmount the database.
  3. Shut down the instance.

Refer to:

I copy Joe Lax article to here =========================================================================================

Oracle Concepts: The Instance and the Database

The complexity of information storage and retrieval is hidden from casual database users, but that’s exactly what you need to know if you want to administer Oracle.

by Joe Lax

atabase programs, with few exceptions, need to utilize both the computer’s memory and permanent storage space such as the hard drive to operate. The drives provide both long-term storage and the necessary room for millions of records and gigabytes worth of information. However, accessing information from disks is much slower than retrieving the same information from memory. Therefore, database engines use memory to cache information, which speeds its retrieval.

The complexity of how the information is stored and where it is retrieved from is hidden from the casual user who queries the database. But if you plan on administering Oracle, you need to become familiar with how Oracle handles both resources. In this article, I discuss two basic but important concepts with regard to memory and disk: the database and the instance.

The Database
In Oracle, a database is used to describe the physical files used to store information. There are three types of physical files:

  • Data files store—you guessed it—all the data that caused us to get a database engine to begin with.
  • Control files store metadata about the rest of the database for use by the Oracle engine.
  • Redo-log files are used to record all changes made to the data for use in backup and recovery.

Regardless of how many files are used, they are all part of one database.

SQL Server uses the term database very differently. It’s used to define a collection of objects such as tables. Each of these collections is stored in a separate set of files. One SQL Server installation typically contains many databases. In fact, the SQL Server installation process itself creates four databases.

Understanding how each vendor uses the term is critical to understanding the literature written about each of the products.

The Instance
Database files themselves are useless without the memory structures and processes to interact with the database. Oracle defines the term instance as the memory structure and the background processes used to access data from a database.

An instance has two major memory structures:

  • The System Global Area, also known as the Shared Global Area (SGA) stores information in memory that is shared by the various processes in Oracle.
  • The Program Global Area, also known as the Private Global Area (PGA) contains information that is private to a particular process.

The SGA contains, among other things, the database buffer cache that is used to cache information read from the data files, a data dictionary cache used to cache metadata information, and a library cache that caches recently used SQL and PL/SQL statements. The PGA is used to allocate memory for information such as sort space, variables, arrays, and cursor information that is private to each process. The instance also contains numerous background processes that cooperate to fulfill all the various functions needed. Some examples of these processes include the Database Writer, responsible for writing all changes to the database, and the Process Monitor, responsible for cleaning up after failed user processes.

In the SQL Server world, it has not been till the 2000 version that the word instance has had any practical significance. Up to that point, you could only have one installation of SQL Server on a machine. With the 2000 version, you can actually have many “instances” of SQL Server running at once. In the SQL Server world, an instance refers to both the memory and files used by that particular installation.

More Than Just a Name
Other than providing yet more acronyms to remember, is there any practical implication to the distinction between the disk files and memory in Oracle? The answer is a resounding yes. Let’s look at a couple of Oracle features that illustrate this.

Oracle Parallel Server  A single machine can contain only so many CPUs and so much memory. The separation between the memory structures and data files allows Oracle to scale beyond a single machine by allowing multiple instances—that is, multiple separate Oracle memory structures—on different machines to access the same database.

My understanding is that the configuration and use of Parallel Server is rather complicated. Additionally, single Oracle boxes (especially on Unix) can scale quite high with numerous CPUs and large amounts of memory. You may never need this feature, but it does illustrate one practical outcome of the division between the database and the instance.

Starting Oracle Server  The division between the instance and the database can be seen by the various steps for starting Oracle. The first step is when the instance itself is started. Memory in the computer is allocated and the various background processes are started. The second step is when the instance then “mounts” the database—i.e., accesses the database files themselves. The last step is opening the database for access by users.

Although you normally make Oracle go through all three steps when starting, it is possible and sometimes necessary to make Oracle stop at a particular stage in the process. Let’s look at some of the syntax involved. Use SQL*Plus to log in to Oracle and try these commands if you like. (Assuming Oracle has already started, you can issue the shutdown command to first shut Oracle down.)

STARTUP or STARTUP OPEN tells Oracle to go through all three stages of the startup process. If you want Oracle only to start up the instance, you can instead issue a STARTUP NOMOUNT instead. Oracle will start the instance but not touch any of the database files yet.

Why would you want to do this? Well, let’s say you were creating new control files (the files used to store the metadata about the rest of the database) or a whole new database. Such operations need to occur before the database is accessed. You can also issue a STARTUP MOUNT (or if you’ve previously issued a STARTUP NOMOUNT you can issue an ALTER DATABASE MOUNT) to tell Oracle to mount the database files. In this condition, the instance itself has access to all the information regarding the database. However, it is not yet accessible to users. One example of an operation that must be done in this state is renaming the files used by the SYSTEM tablespace. Once you’ve finished your changes you can issue the ALTER DATABASE OPEN command to make the database accessible to the public.

As I said, in Oracle an instance refers to the memory and background processes. A database refers to the physical files that store the data. Both are needed to provide the user with the information he or she needs. But Oracle allows (and in some cases requires) you to deal with both parts separately.