Skip to content

Commit ee172f0

Browse files
author
Ashageetha Rao
authored
Fix for issue 1610 in create-rcu-schema scripts (#1612)
* Fix for issue 1610 in develop branch * Incorporated review comments * Incorporated latest comments from Ryan. * Incorporated changes to make imagePullPolicy customizable. * Added wrongly removed $ in README.md * Updated README.md based on latest review comments from maggiehe00
1 parent 3734e90 commit ee172f0

File tree

6 files changed

+227
-115
lines changed

6 files changed

+227
-115
lines changed

kubernetes/samples/scripts/create-rcu-schema/README.md

Lines changed: 93 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,30 @@ The script assumes that either the image, `container-registry.oracle.com/middlew
2323

2424
```
2525
$ ./create-rcu-schema.sh -h
26-
usage: ./create-rcu-schema.sh -s <schemaPrefix> -t <rcuType> -d <dburl> -i <image> -s <dockerstore> [-h]
26+
usage: ./create-rcu-schema.sh -s <schemaPrefix> -t <schemaType> -d <dburl> -i <image> -u <imagePullPolicy> -p <docker-store> -n <namespace> -q <sysPassword> -r <schemaPassword> -o <rcuOutputDir> [-h]
2727
-s RCU Schema Prefix (required)
2828
-t RCU Schema Type (optional)
29-
Supported values: fmw(default),soa,osb,soaosb,soaess,soaessosb
29+
(supported values: fmw(default), soa, osb, soaosb, soaess, soaessosb)
3030
-d RCU Oracle Database URL (optional)
3131
(default: oracle-db.default.svc.cluster.local:1521/devpdb.k8s)
32-
-p Fmw Infrastructure ImagePull Secret (optional)
33-
(default: docker-store)
34-
-i Fmw Infrastructure Image (optional)
32+
-p FMW Infrastructure ImagePullSecret (optional)
33+
(default: none)
34+
-i FMW Infrastructure Image (optional)
3535
(default: container-registry.oracle.com/middleware/fmw-infrastructure:12.2.1.4)
36+
-u FMW Infrastructure ImagePullPolicy (optional)
37+
(default: IfNotPresent)
38+
-n Namespace for RCU pod (optional)
39+
(default: default)
40+
-q password for database SYSDBA user. (optional)
41+
(default: Oradoc_db1)
42+
-r password for all schema owner (regular user). (optional)
43+
(default: Oradoc_db1)
44+
-o Output directory for the generated YAML file. (optional)
45+
(default: rcuoutput)
3646
-h Help
3747
3848
$ ./create-rcu-schema.sh -s domain1
39-
40-
ImagePullSecret[docker-store] Image[container-registry.oracle.com/middleware/fmw-infrastructure:12.2.1.4] dburl[oracle-db.default.svc.cluster.local:1521/devpdb.k8s]
41-
[oracle-db-54667dfd5f-76sxf] already initialized ..
42-
Checking Pod READY column for State [1/1]
43-
NAME READY STATUS RESTARTS AGE
44-
oracle-db-54667dfd5f-76sxf 1/1 Running 0 5m1s
49+
ImagePullSecret[none] Image[container-registry.oracle.com/middleware/fmw-infrastructure:12.2.1.4] dburl[oracle-db.default.svc.cluster.local:1521/devpdb.k8s] rcuType[fmw]
4550
pod/rcu created
4651
[rcu] already initialized ..
4752
Checking Pod READY column for State [1/1]
@@ -50,67 +55,68 @@ NAME READY STATUS RESTARTS AGE
5055
rcu 1/1 Running 0 6s
5156
NAME READY STATUS RESTARTS AGE
5257
rcu 1/1 Running 0 11s
53-
CLASSPATH=/usr/java/jdk1.8.0_211/lib/tools.jar:/u01/oracle/wlserver/modules/features/wlst.wls.classpath.jar:
58+
CLASSPATH=/u01/jdk/lib/tools.jar:/u01/oracle/wlserver/modules/features/wlst.wls.classpath.jar:
5459
55-
PATH=/u01/oracle/wlserver/server/bin:/u01/oracle/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.9.8.0.0/apache-ant-1.9.8/bin:/usr/java/jdk1.8.0_211/jre/bin:/usr/java/jdk1.8.0_211/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/java/default/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin:/u01/oracle/container-scripts:/u01/oracle/wlserver/../oracle_common/modules/org.apache.maven_3.2.5/bin
60+
PATH=/u01/oracle/wlserver/server/bin:/u01/oracle/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.10.5.0.0/apache-ant-1.10.5/bin:/u01/jdk/jre/bin:/u01/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/u01/jdk/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin:/u01/oracle:/u01/oracle/wlserver/../oracle_common/modules/org.apache.maven_3.2.5/bin
5661
5762
Your environment has been set.
58-
Check if the DB service is ready to accept requests
59-
DB Connection URL [oracle-db.default.svc.cluster.local:1521/devpdb.k8s] and schemaPrefix is [domain1] rcuType [fmw]"
63+
Check if the DB Service is ready to accept request
64+
DB Connection String [oracle-db.default.svc.cluster.local:1521/devpdb.k8s], schemaPrefix [domain1] rcuType [fmw]
6065
6166
**** Success!!! ****
67+
6268
You can connect to the database in your app using:
69+
6370
java.util.Properties props = new java.util.Properties();
64-
props.put("user", "scott")
65-
props.put("password", "*****");
71+
props.put("user", "sys as sysdba");
72+
props.put("password", "Oradoc_db1");
6673
java.sql.Driver d =
6774
Class.forName("oracle.jdbc.OracleDriver").newInstance();
6875
java.sql.Connection conn =
69-
Driver.connect("scott", props);
76+
Driver.connect("sys as sysdba", props);
77+
Creating RCU Schema for FMW Domain ...
78+
Extra RCU Schema Component Choosen[]
7079
71-
Creating RCU Schema for FMW Domain ..
72-
RCU Logfile: /tmp/RCU2019-09-03_23-13_1113614917/logs/rcu.log
73-
Enter the database password(User:sys):
7480
Processing command line ....
75-
Repository Creation Utility - Checking Prerequisites
76-
Checking Global Prerequisites
77-
The selected Oracle database is not configured to use the AL32UTF8 character set. Oracle strongly recommends using the AL32UTF8 character set for databases that support Oracle Fusion Middleware.
78-
Enter the schema password. This password will be used for all schema users of following components:MDS,IAU,IAU_APPEND,IAU_VIEWER,OPSS,WLS,STB.
7981
8082
Repository Creation Utility - Checking Prerequisites
8183
Checking Component Prerequisites
8284
Repository Creation Utility - Creating Tablespaces
8385
Validating and Creating Tablespaces
86+
Create tablespaces in the repository database
8487
Repository Creation Utility - Create
8588
Repository Create in progress.
86-
Percent Complete: 12
87-
Percent Complete: 30
88-
.....
89-
Percent Complete: 97
90-
Percent Complete: 100
89+
Executing pre create operations
90+
Percent Complete: 20
91+
Percent Complete: 20
92+
.....
93+
Percent Complete: 96
94+
Percent Complete: 100
95+
.....
96+
Executing post create operations
9197
9298
Repository Creation Utility: Create - Completion Summary
9399
94100
Database details:
95-
--------------------
96-
Host Name : oracle-db.default.svc.cluster.local
97-
Port : 1521
98-
Service Name : DEVPDB.K8S
99-
Connected As : sys
101+
-----------------------------
102+
Host Name : oracle-db.default.svc.cluster.local
103+
Port : 1521
104+
Service Name : DEVPDB.K8S
105+
Connected As : sys
100106
Prefix for (prefixable) Schema Owners : DOMAIN1
101-
RCU Logfile : /tmp/RCU2019-08-30_21-21_1875987468/logs/rcu.log
107+
RCU Logfile : /tmp/RCU2020-05-01_14-35_1160633335/logs/rcu.log
102108
103109
Component schemas created:
104110
-----------------------------
105-
Component Status Logfile
111+
Component Status Logfile
106112
107-
Common Infrastructure Services Success /tmp/RCU2019-08-30_21-21_1875987468/logs/stb.log
108-
Oracle Platform Security Services Success /tmp/RCU2019-08-30_21-21_1875987468/logs/opss.log
109-
Audit Services Success /tmp/RCU2019-08-30_21-21_1875987468/logs/iau.log
110-
Audit Services Append Success /tmp/RCU2019-08-30_21-21_1875987468/logs/iau_append.log
111-
Audit Services Viewer Success /tmp/RCU2019-08-30_21-21_1875987468/logs/iau_viewer.log
112-
Metadata Services Success /tmp/RCU2019-08-30_21-21_1875987468/logs/mds.log
113-
WebLogic Services Success /tmp/RCU2019-08-30_21-21_1875987468/logs/wls.log
113+
Common Infrastructure Services Success /tmp/RCU2020-05-01_14-35_1160633335/logs/stb.log
114+
Oracle Platform Security Services Success /tmp/RCU2020-05-01_14-35_1160633335/logs/opss.log
115+
Audit Services Success /tmp/RCU2020-05-01_14-35_1160633335/logs/iau.log
116+
Audit Services Append Success /tmp/RCU2020-05-01_14-35_1160633335/logs/iau_append.log
117+
Audit Services Viewer Success /tmp/RCU2020-05-01_14-35_1160633335/logs/iau_viewer.log
118+
Metadata Services Success /tmp/RCU2020-05-01_14-35_1160633335/logs/mds.log
119+
WebLogic Services Success /tmp/RCU2020-05-01_14-35_1160633335/logs/wls.log
114120
115121
Repository Creation Utility - Create : Operation Completed
116122
[INFO] Modify the domain.input.yaml to use [oracle-db.default.svc.cluster.local:1521/devpdb.k8s] as rcuDatabaseURL and [domain1] as rcuSchemaPrefix
@@ -122,69 +128,79 @@ Use this script to drop the RCU schema based `schemaPrefix` and `dburl`.
122128

123129
```
124130
$ ./drop-rcu-schema.sh -h
125-
usage: ./drop-rcu-schema.sh -s <schemaPrefix> -d <dburl> [-h]
131+
usage: ./drop-rcu-schema.sh -s <schemaPrefix> -d <dburl> -n <namespace> -q <sysPassword> -r <schemaPassword> [-h]
126132
-s RCU Schema Prefix (required)
127-
-d Oracle Database URL
128-
(default: oracle-db.default.svc.cluster.local:1521/devpdb.k8s)
129133
-t RCU Schema Type (optional)
130-
Supported values: fmw(default),soa,osb,soaosb,soaess,soaessosb
134+
(supported values: fmw(default), soa, osb, soaosb, soaess, soaessosb)
135+
-d Oracle Database URL (optional)
136+
(default: oracle-db.default.svc.cluster.local:1521/devpdb.k8s)
137+
-n Namespace where RCU pod is deployed (optional)
138+
(default: default)
139+
-q password for database SYSDBA user. (optional)
140+
(default: Oradoc_db1)
141+
-r password for all schema owner (regular user). (optional)
142+
(default: Oradoc_db1)
131143
-h Help
132144
133145
$ ./drop-rcu-schema.sh -s domain1
134-
CLASSPATH=/usr/java/jdk1.8.0_211/lib/tools.jar:/u01/oracle/wlserver/modules/features/wlst.wls.classpath.jar:
146+
CLASSPATH=/u01/jdk/lib/tools.jar:/u01/oracle/wlserver/modules/features/wlst.wls.classpath.jar:
147+
148+
PATH=/u01/oracle/wlserver/server/bin:/u01/oracle/wlserver/../oracle_common/modules/thirdparty/org.apache.ant/1.10.5.0.0/apache-ant-1.10.5/bin:/u01/jdk/jre/bin:/u01/jdk/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/u01/jdk/bin:/u01/oracle/oracle_common/common/bin:/u01/oracle/wlserver/common/bin:/u01/oracle:/u01/oracle/wlserver/../oracle_common/modules/org.apache.maven_3.2.5/bin
135149
136150
Your environment has been set.
137-
Check if the DB service is ready to accept requests
138-
DB Connection URL [oracle-db.default.svc.cluster.local:1521/devpdb.k8s] and schemaPrefix is [domain1]
151+
Check if the DB Service is ready to accept request
152+
DB Connection String [oracle-db.default.svc.cluster.local:1521/devpdb.k8s] schemaPrefix [domain1] rcuType[fmw]
139153
140154
**** Success!!! ****
155+
141156
You can connect to the database in your app using:
157+
142158
java.util.Properties props = new java.util.Properties();
143-
props.put("user", "scott");
144-
props.put("password", "****");
159+
props.put("user", "sys as sysdba");
160+
props.put("password", "Oradoc_db1");
145161
java.sql.Driver d =
146162
Class.forName("oracle.jdbc.OracleDriver").newInstance();
147163
java.sql.Connection conn =
148-
Driver.connect("scott", props);
149-
150-
RCU Logfile: /tmp/RCU2019-08-30_21-29_1679536190/logs/rcu.log
164+
Driver.connect("sys as sysdba", props);
165+
Dropping RCU Schema for FMW Domain ...
166+
Extra RCU Schema Component(s) Choosen[]
151167
152-
Enter the database password(User:sys):
153168
Processing command line ....
154169
Repository Creation Utility - Checking Prerequisites
155170
Checking Global Prerequisites
156171
Repository Creation Utility - Checking Prerequisites
157172
Checking Component Prerequisites
158173
Repository Creation Utility - Drop
159174
Repository Drop in progress.
160-
Percent Complete: 2
161-
Percent Complete: 14
162-
....
163-
Percent Complete: 99
164-
Percent Complete: 100
175+
Percent Complete: 2
176+
Percent Complete: 14
177+
.....
178+
Percent Complete: 99
179+
Percent Complete: 100
180+
.....
165181
166182
Repository Creation Utility: Drop - Completion Summary
167183
168184
Database details:
169-
----------------------------
170-
Host Name : oracle-db.default.svc.cluster.local
171-
Port : 1521
172-
Service Name : DEVPDB.K8S
173-
Connected As : sys
185+
-----------------------------
186+
Host Name : oracle-db.default.svc.cluster.local
187+
Port : 1521
188+
Service Name : DEVPDB.K8S
189+
Connected As : sys
174190
Prefix for (prefixable) Schema Owners : DOMAIN1
175-
RCU Logfile : /tmp/RCU2019-08-30_21-29_1679536190/logs/rcu.log
191+
RCU Logfile : /tmp/RCU2020-05-01_14-42_651700358/logs/rcu.log
176192
177193
Component schemas dropped:
178194
-----------------------------
179-
Component Status Logfile
180-
181-
Common Infrastructure Services Success /tmp/RCU2019-08-30_21-29_1679536190/logs/stb.log
182-
Oracle Platform Security Services Success /tmp/RCU2019-08-30_21-29_1679536190/logs/opss.log
183-
Audit Services Success /tmp/RCU2019-08-30_21-29_1679536190/logs/iau.log
184-
Audit Services Append Success /tmp/RCU2019-08-30_21-29_1679536190/logs/iau_append.log
185-
Audit Services Viewer Success /tmp/RCU2019-08-30_21-29_1679536190/logs/iau_viewer.log
186-
Metadata Services Success /tmp/RCU2019-08-30_21-29_1679536190/logs/mds.log
187-
WebLogic Services Success /tmp/RCU2019-08-30_21-29_1679536190/logs/wls.log
195+
Component Status Logfile
196+
197+
Common Infrastructure Services Success /tmp/RCU2020-05-01_14-42_651700358/logs/stb.log
198+
Oracle Platform Security Services Success /tmp/RCU2020-05-01_14-42_651700358/logs/opss.log
199+
Audit Services Success /tmp/RCU2020-05-01_14-42_651700358/logs/iau.log
200+
Audit Services Append Success /tmp/RCU2020-05-01_14-42_651700358/logs/iau_append.log
201+
Audit Services Viewer Success /tmp/RCU2020-05-01_14-42_651700358/logs/iau_viewer.log
202+
Metadata Services Success /tmp/RCU2020-05-01_14-42_651700358/logs/mds.log
203+
WebLogic Services Success /tmp/RCU2020-05-01_14-42_651700358/logs/wls.log
188204
189205
Repository Creation Utility - Drop : Operation Completed
190206
pod "rcu" deleted

kubernetes/samples/scripts/create-rcu-schema/common/createRepository.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ echo "Check if the DB Service is ready to accept request "
88
connectString=${1:-oracle-db.default.svc.cluster.local:1521/devpdb.k8s}
99
schemaPrefix=${2:-domain1}
1010
rcuType=${3:-fmw}
11+
sysPassword=${4:-Oradoc_db1}
1112

1213
echo "DB Connection String [$connectString], schemaPrefix [${schemaPrefix}] rcuType [${rcuType}]"
1314

1415
max=100
1516
counter=0
1617
while [ $counter -le ${max} ]
1718
do
18-
java utils.dbping ORACLE_THIN scott tiger ${connectString} > dbping.err 2>&1
19+
java utils.dbping ORACLE_THIN "sys as sysdba" ${sysPassword} ${connectString} > dbping.err 2>&1
1920
[[ $? == 0 ]] && break;
2021
((counter++))
2122
echo "[$counter/${max}] Retrying the DB Connection ..."
@@ -26,7 +27,7 @@ if [ $counter -gt ${max} ]; then
2627
echo "[ERROR] Oracle DB Service is not ready after [${max}] iterations ..."
2728
exit -1
2829
else
29-
java utils.dbping ORACLE_THIN scott tiger ${connectString}
30+
java utils.dbping ORACLE_THIN "sys as sysdba" ${sysPassword} ${connectString}
3031
fi
3132

3233
# SOA needs extra component(s) SOAINFRA ESS (optional)

kubernetes/samples/scripts/create-rcu-schema/common/dropRepository.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@ echo "Check if the DB Service is ready to accept request "
88
connectString=${1:-oracle-db.default.svc.cluster.local:1521/devpdb.k8s}
99
schemaPrefix=${2:-domain1}
1010
rcuType=${3:-fmw}
11+
sysPassword=${4:-Oradoc_db1}
1112

1213
echo "DB Connection String [$connectString] schemaPrefix [${schemaPrefix}] rcuType[${rcuType}]"
1314

1415
max=20
1516
counter=0
1617
while [ $counter -le ${max} ]
1718
do
18-
java utils.dbping ORACLE_THIN scott tiger ${connectString} > dbping.err 2>&1
19+
java utils.dbping ORACLE_THIN "sys as sysdba" ${sysPassword} ${connectString} > dbping.err 2>&1
1920
[[ $? == 0 ]] && break;
2021
((counter++))
2122
echo "[$counter/${max}] Retrying the DB Connection ..."
@@ -26,7 +27,7 @@ if [ $counter -gt ${max} ]; then
2627
echo "[ERROR] Oracle DB Service is not ready after [${max}] iterations ..."
2728
exit -1
2829
else
29-
java utils.dbping ORACLE_THIN scott tiger ${connectString}
30+
java utils.dbping ORACLE_THIN "sys as sysdba" ${sysPassword} ${connectString}
3031
fi
3132

3233
# SOA needs extra component(s) SOAINFRA ESS (optional)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Copyright (c) 2020, Oracle and/or its affiliates.
2+
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
3+
#
4+
# This is a template for RCU Pod
5+
#
6+
apiVersion: v1
7+
kind: Pod
8+
metadata:
9+
labels:
10+
run: rcu
11+
name: rcu
12+
namespace: %NAMESPACE%
13+
spec:
14+
containers:
15+
- args:
16+
- sleep
17+
- infinity
18+
image: container-registry.oracle.com/middleware/fmw-infrastructure:12.2.1.4
19+
imagePullPolicy: %WEBLOGIC_IMAGE_PULL_POLICY%
20+
name: rcu
21+
%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%imagePullSecrets:
22+
%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%- name: %WEBLOGIC_IMAGE_PULL_SECRET_NAME%

0 commit comments

Comments
 (0)