Create GCE VM with oracle 11g
This article highlights steps to spin up a GCE vm and install oracle 11g in it. It also provides basic steps to configure the database for use from within Cloud Data Fusion
Environment Variables
export PROJECT=<customer-project-name>
export INSTANCE_NAME=<oracle-instance-name>
export ZONE=<zone-to-create>
Add firewall rule
Note: The firewall rule gets deleted every 1 hour by the GCE enforcer. If by any chance any of the steps take too long and starts to fails with ssh error check for the firewall rule. If deleted recreate it again.
gcloud compute firewall-rules create ${INSTANCE_NAME}-allow-ssh \
--allow=tcp:22 \
--source-ranges=0.0.0.0/0 \
--target-tags=${INSTANCE_NAME}-allow-ssh \
--network=default \
--project=${PROJECT}
Create GCE VM
Note: The network used here is the default network. If you need the VM to be in a specific network for private instance please configure the network appropriately.
gcloud compute instances create ${INSTANCE_NAME} \
--project=${PROJECT} \
--zone=${ZONE} \
--machine-type=n2-standard-2 \
--subnet=default \
--network-tier=PREMIUM \
--maintenance-policy=MIGRATE \
--image-project=gce-uefi-images \
--image-family=centos-7 \
--scopes=https://www.googleapis.com/auth/cloud-platform \
--boot-disk-type=pd-standard \
--boot-disk-device-name=${INSTANCE_NAME} \
--tags=${INSTANCE_NAME}-allow-ssh
Install required libraries for oracle
Setup swap space/file for installation
Download Oracle11g rpm image
Install Oracle 11g
Setup Oracle user
After installation and setup now this oracle database can be accessed in CDF instance via GCE VM’s external IP.
Reference:
https://www.youtube.com/watch?v=xuVp1SVnt7k