After you install the Db2 service, you can upgrade your license from Db2 Community Edition to Db2 Advanced Edition.
About this task
You can upgrade your Db2 Community Edition license to any of the Db2 12.1 production licenses:
Table 1. Processor and memory limits per
Db2 server or pureScale®
cluster
| Db2 edition |
Processor cores |
Allowed instance memory |
| Advanced |
Unlimited |
Unlimited |
| Standard |
Up to 16 |
128 GB |
| Community |
Up to 4 |
16 GB |
You can download the license keys for the Advanced and Standard editions from the
IBM®
Passport Advantage® site.
- Db2 Advanced Edition: db2adv_vpc.lic
- Db2 Standard Edition: db2std_vpc.lic
Note: You must be entitled to use a license before you can download it. Ensure that you or your
organization purchased the required license.
Procedure
-
Encode your license to Base64 and export it to an environment variable by running the following
command:
base64 license.lic | tr -d '\n' > /tmp/encode.lic
export license=$(cat /tmp/encode.lic)
- Optional: Export your secret key and secret name to environment
variables.
export secretKeyName=<SecretKeyNameValue>
export secretName=<secretNameValue>
Note: The value that you set
<secretKeyNameValue> and
<secretNameValue> to must be supported by
Kubernetes. For more information, see
Object Names and IDs in the
Kubernetes documentation.
- Optional: Create a secret by using the license from
step 1 and the secret from step 2. For example:
apiVersion: v1
data:
${secretKeyName}: ${license}
kind: Secret
metadata:
name: ${secretName}
namespace: ${PROJECT_CPD_INST_OPERANDS}
type: Opaque
- Export your
licenseType to an environment variable.
export licenseType=<licensetype>
Where <licensetype> is either Advanced or
Standard, depending on which license is being upgraded.
- Patch
Db2oltpservice with the license information.
- If you created a secret in step 3, run the
following
command:
oc patch Db2oltpservice db2oltp-cr -n ${PROJECT_CPD_INST_OPERANDS} --type merge -p "{\"spec\":{\"license\":{\"license\":\"${licenseType}\",\"licenseValue\":{\"valueFrom\":{\"secretKeyRef\":{\"key\":\"${secretKeyName}\",\"name\":\"${secretName}\"}}}}}}"
- If you did not create a secret, run the following
command:
oc patch Db2oltpservice db2oltp-cr -n ${PROJECT_CPD_INST_OPERANDS} --type merge -p "{\"spec\":{\"license\":{\"license\":\"${licenseType}\",\"licenseValue\":{\"value64\":\"${license}\"}}}}"
- Wait for the Db2 service to be in
Completed
state. To get the state value, run the following
command:
oc get Db2oltpService db2oltp-cr -n ${PROJECT_CPD_INST_OPERANDS} -o jsonpath='{.status.db2oltpStatus} {"\n"}'