Skip to Content

How to connect JAVA app server to a different DB

Lets say you have a JAVA application server (EP or just Java app) connected to it’s DB, and now you need to transfer the

DB to a different server (For consolidation purposes, hardware change, etc.)

The DBA exported the entire DB to a different server and gave you the new server name and DB port.

These are the steps* you need to do in order to connect your JAVA app server to the new DB:

* The backup of folders and files is only for reverting back in case it is needed

1. Create a backup of the entire profile folder by copying <drive>:\usr\sap\<SID>\sys\profile and renaming the copied folder to Profile_ORIG

2. In the original Profile folder go to oracle folder, edit tnsnames.ora file and replace the HOST with the remote DB Hostname and PORT with the remote port. (Details should be provided by DBA) SAVE.

3. In the original Profile folder edit DEFAULT.PFL file and replace SAPDBHOST = <REMOTE_DB_HOSTNAME> j2ee/dbhost = <REMOTE_DB_HOSTNAME>

4. Create a backup of the entire security folder by copying <drive>:\usr\sap\<SID>\SYS\global\security and renaming the copied folder to security_ORIG

5. Run configtool.bat from <drive>:\usr\sap\<SID>\JC##\j2ee\configtool

6. In the left pane select secure store

7. In the right pane, click on the line jdbc/pool/SID/Url

In the bottom edit the value “jdbc:oracle:thin:@<HOSTNAME>:<PORT>:<SID>” with the new server & port details —> Press ADD !

8. Click on “Apply Changes” on the upper left corner

9. Click on “file” —-> “Reencrypt Secure Content”

10. Click on “Apply Changes” on the upper left corner (just to be on the safe side)

11. Exit the configtool.

12. Restart the JAVA app using MMC

If all is well – the JAVA app server will be connected to the new DB.

Important notes:

1. Troubleshoot problems after the DB change by inspecting dev_w0 log file in the work directory.

2. If the JAVA app server is a virutal machine – take a snapshot before you change anything. Reverting back is much easier this way.

3. After system copy / DB export the WebDynpro JCo’s must be manually recreated. Refer to note 899144 for further details

Enjoy 🙂

You must be Logged on to comment or reply to a post.
  • Hi Adi,


    I guess the title leads to misunderstanding. When I first read, I thought you wrote about connecting AS Java to a different DB. "Seperating AS Java Database from AS Java Application Server" would be a better title


    Anyway, thanx for information

    • Hi Huseyin

      The information is relevant even if your App java server is already seperated from the DB server.

      It doesn't matter if your DB is on the same server as the App server or not, the information is relevant for any situation in which you need to change the DB connection of App server JAVA to a different DB.