How to connect SQL developer to your Siebel IP21.x demo environment on Oracle Cloud
In my previous blogpost I described, using a whitepaper, how to set up your own demo Siebel IP20/21 environment on Oracle Cloud Infrastructure (OCI). In this blogpost I will explain how to connect with SQL Developer, from your local laptop, to the Oracle Linux instance on OCI. Keep in mind that there is no database running on the Linux instance itself. The actual (sample) database is running in a Docker container.
After starting the Siebel cloud instance and installing SQL Developer on your local machine, you need the following steps:
- Obtain the IP address of the Database docker container, running on the Virtual machine
- Obtain the database name and domain name from the database container, using Oracle’s listener control utility
- Create a ssh connection from SQL developer
- Create a database connection, using the ssh connection from the previous step
In order to logon to the virtual machine (or instance as it is called in OCI) , we use the public IP address from the instance and the private key, which is generated during creation of the instance. Use the following command to connect:
ssh -i <name of private key file>.key opc@<public IP address>
Step 1:
To obtain the IP address of de database Docker container, first find the ID of the container:
sudo docker ps –format “{{.ID}} {{.Names}} {{.Status}}”
Output, database ID will be 718cba88354d :
To get the IP address:
sudo docker inspect –format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}’ 718cba88354d
Output, IP address of the Database container 172.18.0.2:
Step 2:
To obtain the database name and domain name, we need to connect to the database container, using bash:
sudo docker exec -it 718cba88354d /bin/bash
Access Oracle’s listener:
lsnrctl
Get the status:
LSNRCTL> status
Output, our sample database will be: sample.localdomain
Step 3:
Open SQL developer and navigate to View -> SSH
Right-click on SSH-host and create a new connection:
You will need the public IP address of instance (A) and the IP address of the docker database container (B). Also provide the private key file. This is the same file as you would use when setting up a ssh connection via commandline.
After creating this ssh connection, you should be able to Test this connection (right click -> “Test”)
Step 4:
Create a new Oracle Connection, using the ssh connection from the previous step:
Create a new Oracle connection. Make sure you select Connection Type “SSH” (A), select the correct SSH connection (B) and use the database name and domain from step 2 (C)
After creating this ssh connection, you should be able to Test this connection (right click -> “Test”)
You should be able to Test and connect to your database.
Alternative: open port 1521
Instead of using a ssh connection to access your database, you could also add port 1521 in your Virtual Cloud Network (VCN), by adding an Ingress Rule. Navigate tour VCN, drilldown on the name, drilldown the Public Subnet and drilldown on the security list. Choose “Add Ingress Rule” set the following values:
You can now create a database connection from SQL Developer. You will need your public IP address from your instance and the database service name as found in step 2.
Keep in mind that the combination IP address and port number is accessible from the Internet, so everybody with credentials can now access your database! To limit this risk, do not use “0.0.0.0/0” but use your own IP address or range in the Ingress rule. However it is safer to use the ssh solution!
Do you still have any questions after reading this blog? Do not hesitate to contact us.
Neem contact met op met Pieter voor meer informatie over Siebel
Neem contact op met Ebicus via het contactformulier of raadpleeg direct één van onze collega’s om je direct te ondersteunen!