The practices are designed to be independent of each other. However, before starting a practice it is suggested that you re-create your database in your testing environment.
You should not run these labs on a production system. Commands and scripts are provided solely for testing purposes and need some adaptation to your testing environment.
Step 1 : Create an Oracle Database 21c instance
Create an Oracle Database 21c instance. If you plan to create the instance in Oracle Cloud Infrastructure, follow the instructions described in the Create an Oracle Cloud Infrastructure VM Database tutorial.
In the tutorial, in Lab 4 Create an Oracle Cloud Infrastructure VM Database - Step 2 Create a Database Virtual Machine - Substep 4 define the CDB and PDB as:
Database name: Choose default database name to "cdb21".
PDB name field, enter "pdb21".
Step 2 : Define and test the connections
Log in to the VM of your Database Virtual Machine. Following the tutorial, Lab 4 Create an Oracle Cloud Infrastructure VM Database - Step 3 Gather system details and connect to the Database using SSH to get the IP address of the node and the procedure to log in to the VM.
Create the net service name alias CDB21 for the container database CDB21 and the net service name alias PDB21 for the pluggable database PDB21.
Run the lsnrctl utility to find the path of the /u01/app/oracle/homes/OraDB21Home1/network/admin/tnsnames.ora file. The letters in the Unix prompt following the login username (opc or root or oracle) are the Hostname prefix defined during the Database VM creation via the tutorial, Lab 4 Create an Oracle Cloud Infrastructure VM Database - Step 2 Create a Database Virtual Machine - Subset 3 On the DB System Information form.
The OraDB21Home1 sub-directory is the sub-directory mentioned in the /u01/app/oraInventory/ContentsXML/inventory.xml file.
Open the /u01/app/oracle/homes/OraDB21Home1/network/admin/tnsnames.ora file. There is a net service alias for the container database, CDB21, using the databaseUniqueName. Replace the SERVICE_NAME entry with the value found in the service from lsnrctl, such as CDB21_fra1xn.sub12100925130.xxxxx.oraclevcn.com.
Create an alias entry by copying the CDB alias entry. Replace the CDB alias name with CDB21.
Create an alias entry for the PDB by copying the CDB alias entry. Replace the CDB alias name with PDB21.
Save the updates in the /u01/app/oracle/homes/OraDB21Home1/network/admin/tnsnames.ora file.
Test the connection to CDB21.
Connect to CDB21 with SQL*Plus.
Verify that the container name is CDB$ROOT.
Test the connection to PDB21, and then exit SQL*Plus.
Copy the /home/opc/Cloud_21c_labs_for_practices.zip to /home/oracle/Cloud_21c_labs_for_practices.zip.
Unzip Cloud_21c_labs.zip.
Step 4 : Update the practices scripts to the current environment
Execute the /home/oracle/labs/update_pass.sh shell script. The shell script prompts you to enter the password_defined_during_DBSystem_creationand sets it in all shell scripts and SQL scripts that will be used in the practices.
Make the script readable, writable, and executable by everyone.