Skip to content

Commit 7abf03a

Browse files
committed
Merge branch 'rcu-db-role' into 'main'
Add oracle_database_admin_role to the RCUDbInfo section, and apply in RCU runner See merge request weblogic-cloud/weblogic-deploy-tooling!1799
2 parents 488f071 + 1963343 commit 7abf03a

File tree

5 files changed

+24
-19
lines changed

5 files changed

+24
-19
lines changed

core/src/main/java/oracle/weblogic/deploy/create/RCURunner.java

+5-13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2017, 2024, Oracle and/or its affiliates.
2+
* Copyright (c) 2017, 2025, Oracle and/or its affiliates.
33
* Licensed under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl.
44
*/
55
package oracle.weblogic.deploy.create;
@@ -71,7 +71,6 @@ public class RCURunner {
7171
private static final String DB_CONNECT_SWITCH = "-connectString";
7272
private static final String DB_USER_SWITCH = "-dbUser";
7373
private static final String DB_ROLE_SWITCH = "-dbRole";
74-
private static final String ORACLE_DB_ROLE = "SYSDBA";
7574
private static final String SCHEMA_PREFIX_SWITCH = "-schemaPrefix";
7675
private static final String COMPONENT_SWITCH = "-component";
7776
private static final String READ_STDIN_SWITCH = "-f";
@@ -104,14 +103,15 @@ public class RCURunner {
104103
* @param connectString the database connect string
105104
* @param schemaPrefix the schema prefix
106105
* @param dbUser the database administrator user name
106+
* @param dbRole the database administrator role
107107
* @param componentsList the list of RCU schemas
108108
* @param extraRcuArgsMap any extra RCU arguments map
109109
* @param sslArgsProperties the SSL-related arguments map
110110
* @throws CreateException if a parameter validation error occurs
111111
*/
112112
public RCURunner(String oracleHome, String javaHome, String databaseType, String oracleDatabaseConnectionType,
113-
String connectString, String schemaPrefix, String dbUser, List<String> componentsList,
114-
PyDictionary extraRcuArgsMap, PyDictionary sslArgsProperties)
113+
String connectString, String schemaPrefix, String dbUser, String dbRole,
114+
List<String> componentsList, PyDictionary extraRcuArgsMap, PyDictionary sslArgsProperties)
115115
throws CreateException {
116116

117117
this.oracleHome = validateExistingDirectory(oracleHome, "ORACLE_HOME");
@@ -128,7 +128,7 @@ public RCURunner(String oracleHome, String javaHome, String databaseType, String
128128

129129
this.schemaPrefix = validateNonEmptyString(schemaPrefix, "rcu_prefix");
130130
this.dbUser = validateNonEmptyString(dbUser, "rcu_admin_user");
131-
this.dbRole = computeDbRole();
131+
this.dbRole = dbRole;
132132
this.componentsList = validateNonEmptyListOfStrings(componentsList, "rcu_schema_list");
133133
this.extraRcuArgsMap = extraRcuArgsMap;
134134
this.sslArgsProperties = sslArgsProperties;
@@ -206,14 +206,6 @@ private boolean isOracleDatabase() {
206206
return ORACLE_DB_TYPE.equals(this.databaseType) || EBR_DB_TYPE.equals(this.databaseType);
207207
}
208208

209-
private String computeDbRole() {
210-
String dbRole = null;
211-
if (isOracleDatabase() && !this.atpDB) {
212-
dbRole = ORACLE_DB_ROLE;
213-
}
214-
return dbRole;
215-
}
216-
217209
private Map<String, String> getRcuDropEnv() {
218210
Map<String, String> env = new HashMap<>(1);
219211
env.put("JAVA_HOME", this.javaHome.getAbsolutePath());

core/src/main/python/wlsdeploy/aliases/model_constants.py

+1
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,7 @@
214214
OPSS_WALLET_PASSPHRASE = 'OPSSWalletPassphrase'
215215
OPTIONAL_FEATURE = 'OptionalFeature'
216216
OPTIONAL_FEATURE_DEPLOYMENT = 'OptionalFeatureDeployment'
217+
ORACLE_DATABASE_ADMIN_ROLE = 'oracle_database_admin_role'
217218
ORACLE_DATABASE_CONNECTION_TYPE = 'oracle_database_connection_type'
218219
ORACLE_OID_AUTHENTICATOR = 'OracleInternetDirectoryAuthenticator'
219220
ORACLE_OUD_AUTHENTICATOR = 'OracleUnifiedDirectoryAuthenticator'

core/src/main/python/wlsdeploy/tool/create/rcudbinfo_helper.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2017, 2025, Oracle and/or its affiliates.
33
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55
import os
@@ -14,6 +14,7 @@
1414
from wlsdeploy.aliases import alias_utils
1515
from wlsdeploy.aliases.model_constants import ATP_DEFAULT_TABLESPACE
1616
from wlsdeploy.aliases.model_constants import ATP_TEMPORARY_TABLESPACE
17+
from wlsdeploy.aliases.model_constants import ORACLE_DATABASE_ADMIN_ROLE
1718
from wlsdeploy.aliases.model_constants import TNS_ENTRY
1819
# Deprecated in WDT 4.0.0
1920
from wlsdeploy.aliases.model_constants import DATABASE_TYPE
@@ -95,6 +96,15 @@ def get_rcu_database_type(self):
9596
rcu_database_type = ORACLE_DB_TYPE
9697
return rcu_database_type
9798

99+
def get_oracle_database_admin_role(self):
100+
_method_name = 'get_oracle_database_admin_role'
101+
oracle_db_admin_role = None
102+
if self.is_oracle_database_type() and not self.is_use_atp():
103+
oracle_db_admin_role = self._get_dictionary_element_value(ORACLE_DATABASE_ADMIN_ROLE)
104+
if oracle_db_admin_role is None:
105+
oracle_db_admin_role = "SYSDBA"
106+
return oracle_db_admin_role
107+
98108
def get_oracle_database_connection_type(self):
99109
_method_name = 'get_oracle_database_connection_type'
100110
oracle_db_conn_type = self._get_dictionary_element_value(ORACLE_DATABASE_CONNECTION_TYPE)

core/src/main/python/wlsdeploy/tool/util/rcu_helper.py

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Copyright (c) 2017, 2024, Oracle and/or its affiliates.
2+
Copyright (c) 2017, 2025, Oracle and/or its affiliates.
33
Licensed under the Universal Permissive License v1.0 as shown at https://oss.oracle.com/licenses/upl.
44
"""
55
import exceptions
@@ -115,7 +115,7 @@ def check_or_run_rcu(self):
115115
# ####<Mar 29, 2024 3:19:53 PM> <SEVERE> <FanManager> <configure> <> <attempt to configure
116116
# ONS in FanManager failed with oracle.ons.NoServersAvailable: Subscription time out>
117117
#
118-
118+
119119
if self._rcu_db_info.is_use_atp():
120120
System.setProperty('oracle.jdbc.fanEnabled', 'false')
121121

@@ -399,6 +399,7 @@ def __run_rcu(self):
399399
oracle_home = self._model_context.get_oracle_home()
400400
java_home = self._model_context.get_java_home()
401401
rcu_database_type = rcu_db_info.get_rcu_database_type()
402+
oracle_database_admin_role = rcu_db_info.get_oracle_database_admin_role()
402403
oracle_database_connection_type = rcu_db_info.get_oracle_database_connection_type()
403404
rcu_db_conn_string = rcu_db_info.get_rcu_db_conn_string()
404405
rcu_prefix = rcu_db_info.get_rcu_prefix()
@@ -430,8 +431,8 @@ def __run_rcu(self):
430431

431432
disable_rcu_drop_schema = self._model_context.get_model_config().get_disable_rcu_drop_schema() == 'true'
432433
rcu_runner = RCURunner(oracle_home, java_home, rcu_database_type, oracle_database_connection_type,
433-
rcu_db_conn_string, rcu_prefix, rcu_admin_user, rcu_schemas, extra_rcu_args_map,
434-
ssl_conn_properties)
434+
rcu_db_conn_string, rcu_prefix, rcu_admin_user, oracle_database_admin_role,
435+
rcu_schemas, extra_rcu_args_map, ssl_conn_properties)
435436
rcu_runner.runRcu(rcu_admin_pass, rcu_schema_pass, disable_rcu_drop_schema)
436437

437438
self.__run_post_create_rcu_schemas_script()

core/src/main/resources/oracle/weblogic/deploy/aliases/category_modules/RCUDbInfo.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"copyright": "Copyright (c) 2019, 2023, Oracle and/or its affiliates.",
2+
"copyright": "Copyright (c) 2019, 2025, Oracle and/or its affiliates.",
33
"license": "Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl",
44
"wlst_type": "RCUDbInfo",
55
"folders": {},
@@ -14,6 +14,7 @@
1414
"javax.net.ssl.trustStore": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "javax.net.ssl.trustStore", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "uses_path_tokens": "true" } ],
1515
"javax.net.ssl.trustStoreType": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "javax.net.ssl.trustStoreType", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
1616
"javax.net.ssl.trustStorePassword": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "javax.net.ssl.trustStorePassword", "wlst_path": "WP001", "default_value": null, "wlst_type": "password", "secret_suffix": "ssltruststore" } ],
17+
"oracle_database_admin_role": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "oracle_database_admin_role", "wlst_path": "WP001", "default_value": null, "wlst_type": "string" } ],
1718
"oracle_database_connection_type": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "oracle_database_connection_type", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "comment": "New parameter replacing the deprecated databaseType" } ],
1819
"oracle.net.tns_admin": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "oracle.net.tns_admin", "wlst_path": "WP001", "default_value": null, "wlst_type": "string", "uses_path_tokens": "true"} ],
1920
"rcu_admin_password": [ {"version": "[10,)", "wlst_mode": "both", "wlst_name": "rcu_admin_password", "wlst_path": "WP001", "default_value": null, "wlst_type": "password" } ],

0 commit comments

Comments
 (0)