oracle / weblogic-deploy-tooling

WebLogic Deploy Tooling
https://oracle.github.io/weblogic-deploy-tooling/
Universal Permissive License v1.0
152 stars 90 forks source link

JRF Domain - How to connect RCU to SQL server database #1534

Closed sebfortier2288 closed 5 months ago

sebfortier2288 commented 5 months ago

Hello, I would like to know if it is possible to configure the RCU to connect to a SQL server database and if it is, how can we do it. We are able to do it when manually executing the RCU in interactive mode (with the UI) on RHEL servers. I didn't find a way to do the same thing with WDT models.

So far I have this configuration:

domainInfo:
  RCUDbInfo:
    rcu_prefix: '@@SECRET:test-rcu-access:rcu_prefix@@'
    rcu_schema_password: '@@SECRET:test-rcu-access:rcu_schema_password@@'
    rcu_db_conn_string: '@@SECRET:test-rcu-access:rcu_db_conn_string@@'
    rcu_admin_user: '@@SECRET:test-rcu-access:rcu_db_user@@'
    rcu_admin_password: '@@SECRET:test-rcu-access:rcu_db_pwd@@'

And I added a JDBCSystemResource for the sqljdbc driver (not sure if it is the right way to do it though...):

resources:
  JDBCSystemResource:
    jdbc/sqljdbc:
      JdbcResource:
        JDBCDataSourceParams:
          JNDIName: [
            jdbc/sqljdbc
          ]
          GlobalTransactionsProtocol: None
        JDBCDriverParams:
          DriverName: com.microsoft.sqlserver.jdbc.SQLServerDriver
          URL: @@SECRET:test-rcu-access:rcu_db_conn_string@@'
          PasswordEncrypted: @@SECRET:test-rcu-access:rcu_db_pwd@@'
          Properties:
            user:
              Value: @@SECRET:test-rcu-access:rcu_db_user@@'
        JDBCConnectionPoolParams:
          TestTableName: SQL SELECT 1
          TestConnectionsOnReserve: true

With this configuration, I see in the log that it is trying to connect to an Oracle database:

<Executing rcu: [cmd:[/usr/bin/sh, -c, /u01/oracle/oracle_common/bin/rcu -silent -dropRepository -databaseType ORACLE -connectString "jdbc:sqlserver://my.mssql.host:1433;databaseName=my_db" -dbUser db_user -dbRole SYSDBA -schemaPrefix my_schema -component MDS -component IAU -component IAU_VIEWER -component IAU_APPEND -component OPSS -component STB -component WLS -f]]>

I saw in this documentation that the rcu cmdline param "-databaseType" supports the SQLSERVER value: RCU

I tried adding this to the RCUDbInfo object in the model, but that didn't work: databaseType: 'SQLSERVER' In the logs, it say that I'm trying to use ATP database and that I'm missing tnsnames, etc...

Thank you for your help!

robertpatrick commented 5 months ago

@sebfortier2288 No one has ever asked for this so it is unlikely to work today. Happy to consider this as an enhancement request.

sebfortier2288 commented 5 months ago

Thank you for your answer. My end goal is to install weblogic on kubernetes. I was trying to deploy it using the Weblogic Kubernetes Operator, which in turn use the WDT tool in the process. Since our requirement (SQL Server) is not supported at the moment, I have used another method and managed to make it work.

I build my own weblogic image from the official one. I inject the sqljdbc driver in the image and I use a modified entrypoint script and WSLT script to setup everything.

Glad this can be considered as an enhancement request! If this ever get implemented, I will gladly migrate to this deployment method.

Thank you!

robertpatrick commented 5 months ago

@sebfortier2288 Well...

WDT support for running RCU against SQL Server is not working. However, there should be no reason that you cannot run RCU yourself and then point the WDT model's RCU DataSources at the SQL Server database. We are looking into addressing the run_rcu issue with SQL Server.

robertpatrick commented 5 months ago

@sebfortier2288 As of FMW Infrastructure 12.2.1, SQL Server is no longer a supported RCU database. RCU runs fine but creating the domain fails:

####<Mar 21, 2024 3:20:25 PM> <WARNING> <JpsDataManagerUtil> <getDBConnection> <> <Can not connect DB with URL jdbc:oracle:thin:@$host:1521:$dbms>
com.oracle.cie.domain.script.ScriptException: 64254: Error occurred in "OPSS Processing" phase execution
64254: Encountered error: oracle.security.opss.tools.lifecycle.LifecycleException: Error during configuring DB security store. Exception oracle.security.opss.tools.lifecycle.LifecycleException: oracle.security.jps.service.policystore.PolicyStoreConnectivityException: oracle.security.jps.service.policystore.PolicyStoreException: Can not connect DB with URL [jdbc:oracle:thin:@$host:1521:$dbms].
64254: Check log for more detail.

WDT cannot support SQL Server if the underlying products do not support it.

robertpatrick commented 5 months ago

@sebfortier2288 Just so you know, we have done our best to allow you to specify the RCU database type as SQLSERVER in the upcoming WDT 4.0 release. If the FMW product/version you are using supports a Target DB for RCU of SQL Server, RCU should run and the domain creation may work. If RCU completes and the domain creation does not, please open an Oracle Support SR on the FMW product you are using.

sebfortier2288 commented 5 months ago

Perfect, thank you for letting me know! I'll give it a try when this version gets available.