What all i need to change in the DB properties here?
#db.url=jdbc:oracle:thin:@<host>:1522:<sid>
#db.driver=oracle.jdbc.driver.OracleDriver
#db.username=<system>
#db.password=<password>
#db.tableprefix=
I am using Hybris 6.2 and wanted to connect it to Oracle 11g. I have downloaded Oracle11g,SqlDeveloper and made a connection between them. I've copied the Oracle Db server properties into the local.properties file of the Config folder in Hybris.
However i'm not able to understand the steps after that (what all info i need to put in connection properties above, do i have to intialize and upadate again?).
Avoid nasty OCI driver configuration.
Because geffchang's answer only shows the configuration with the OCI driver I'm showing here the most simple configuration with the thin client.
Reference is https://help.sap.com/viewer/a74589c3a81a4a95bf51d87258c0ab15/1905/en-US/551f907063044685a309a8b22f5779c3.html
db.url
looks like with thin client by specifyinghost
,port
andsid
. Here are some examples:jdbc:oracle:thin:@192.168.1.1:1521:orcl
jdbc:oracle:thin:@//ora01-ic.mydomain.net:1532/hybris
jdbc:oracle:thin:@//ora901scan.de.mydomain.net:1523/shop
db.driver=oracle.jdbc.driver.OracleDriver
username
andpassword
should be self explanatory.tableprefix
. You only need it if you want to have multiple hybris instances within a single DB. But if you need multiple instances you could alternatively also create a second DB in the Oracle DBMS (see difference between DB and DBMS!) and use an additional SID like e.g. hybris2.That's all:
host
/ip
,port
,SID
,username
andpassword
. Three configuration lines depending on your local environment and one staticdb.driver
setting.OCI vs. Thin driver
I mostly use the Thin driver. The way the hybris documentation explains the usage of the OCI driver is somewhat nasty (to avoid the term "insecure") by using
LD_LIBRARY_PATH
instead of usingld.conf
.Using the Thin driver is platform-independent and most easy to configure. Using OCI is the opposite and depends on the OS. OCI with
LD_LIBRARY_PATH
is targeted towards Linux.Reference OCI: https://docs.oracle.com/en/database/oracle/oracle-database/12.2/jjdbc/JDBC-OCI-features.html#GUID-A8201BD0-BAED-4C54-B53B-C26C5F295B32
Reference Thin client: https://docs.oracle.com/cd/B28359_01/java.111/b31224/jdbcthin.htm
The JDBC driver
It must be put into bin/platform/lib/dbdriver. Current version at time of this writing is
ojdbc8-12.2.0.1.0.jar
. Here's a list with other versions and timestamps matching their release dates:Other settings
db.pool
: The values in geffchang's answer are the default values already set in advanced.properties. You don't need to specify them a second time.oracle.statementcachesize
: In Hybris docs referenced above it is mentioned "Do not set any other value than 0". In fact you don't need to set it at all.tenant.restart.on.connection.error
: Usually you don't need to set it. Keeping it ontrue
(default inadvanced.properties
) MAY cause your DB to be locked at Hybris startup with wrong password because Hybris will try to connect to DB several times and some Oracle DB admins activate an user lock on e.g. 3rd failed login. In this case ask the Oracle admin to provide the correctpassword
and to unlock the account.