DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • A Beginner's Guide to Back-End Development
  • Create a CDC Event Stream From Oracle Database to Kafka With GoldenGate
  • Internal Architecture of the SQLite Database
  • Use MongoDB Node.js Native Driver Without Mongoose

Trending

  • How To Deploy Helidon Application to Kubernetes With Kubernetes Maven Plugin
  • Spring WebFlux Retries
  • Best Practices for Writing Clean Java Code
  • Modular Software Architecture: Advantages and Disadvantages of Using Monolith, Microservices and Modular Monolith
  1. DZone
  2. Data Engineering
  3. Databases
  4. Creating a Sandbox for Learning Node.js and Oracle Database

Creating a Sandbox for Learning Node.js and Oracle Database

Now more than ever is a good time to create a local sandbox for learning. And you can do it in less than 20 minutes without spending a dime. Read on to find out how!

Dan McGhan user avatar by
Dan McGhan
·
Jul. 17, 17 · Tutorial
Like (2)
Save
Tweet
Share
4.66K Views

Join the DZone community and get the full member experience.

Join For Free

With Oracle Database 12.2 and Node.js 8 now available, this is a great time to create a local sandbox for learning. Thanks to some prebuilt VMs provided by Oracle, you can have such an environment up and running in less than 20 minutes (excluding download times) without spending a dime!

In this post, I’ll walk you through the creation of such a sandbox. Here’s an overview of what we’ll be working through:

  • Install VirtualBox.
  • Import database app development VM.
  • Install Node.js and Git.
  • Install the Node.js driver and run a test

Install VirtualBox

The first thing you’ll want to do is install VirtualBox 5.1 or later. What is VirtualBox? From the online documentation:

VirtualBox is a cross-platform virtualization application. What does that mean? For one thing, it installs on your existing Intel or AMD-based computers, whether they are running Windows, Mac, Linux or Solaris operating systems. Secondly, it extends the capabilities of your existing computer so that it can run multiple operating systems (inside multiple virtual machines) at the same time.

VirtualBox is a great solution for this type of sandbox because we don’t have to install any software on our host operating system which would consume resources when not in use. I will not cover the installation process in any detail as it will vary depending on your host OS. Just navigate to the downloads page and download and install the appropriate binaries for your OS.

VirtualBox binaries

Import the Database App Development VM

Oracle provides a number of development VMs that are great for learning Oracle technology as you don’t have to muddle through complicated installs to get going. Head to
the Pre-Built Developer VMs page and scroll down until you see the Database App Development VM.

Database App Development VM

Check out all the goodies in that VM! Note that Oracle Database 12.2.0.1 includes a number of enhancements for working with JSON. See the Database JSON Developer’s Guide for details and give them a go once the VM is up and running.

Click the link that says Downloads and Instructions. On the next page, accept the license agreement and then click the link to download the VM.

License agreement

If you’ve not already authenticated with your Oracle account, you’ll be redirected to a page to do so before the download begins. If you don’t have an account just click the Create Account button on that page to create your free account.

Once the download completes you’ll be ready to import the VM into VirtualBox. Open VirtualBox and click File > Import Appliance. Use the appliance import wizard to select the DeveloperDaysVM2017-06-13_01 file you downloaded and click Import.

Import image

The import process will begin once you accept the license agreement. After a few minutes, you should see the following screen after clicking the imported VM.

Imported image

If you click the Start button a new window will open up with the VM running a terminal inside (you can resize the VM window as needed).

Running VM

Here are a few tips to get you started inside the VM:

  • The password for everything is oracle
  • Double-click the large START icon on the desktop to open a browser with labs on a variety of Oracle technology.
  • To access APEX, navigate the browser to http://localhost:8080/apex. Log in using OBE for the workspace and username fields and oracle for the password.
  • To be able to copy/paste things between the host and guest OS, go to the VirtualBox menu bar and select Devices > Shared Clipboard > Bidirectional. Trust me, this will come in handy!

With the VM up and running we’re ready to install Node.js and Git.

Install Node.js and Git

In this section, we’ll install Node.js and Git. Git will be used to clone the driver repo in the next step.

Open a terminal and switch to the root user:

su - root
# password is oracle

Run the following commands as the root user:

yum group install "Development Tools" -y
curl --silent --location https://rpm.nodesource.com/setup_8.x | bash -
yum install nodejs -y
yum install git -y

That’s all there is to it, Node.js and Git are ready to go. On to the driver!

Install the Node.js Driver and Run a Test

Example scripts for the driver can be found in the examples directory of the driver on GitHub. The easiest way to start running the examples is to use Git to clone the driver repo from GitHub. From there we can copy the examples into our own directory, change the password in dbconfig.js, install the driver, and start testing!

Close the previously opened terminal and open a new one (user should be Oracle!). Then run the following commands:

cd ~
echo 'export LD_LIBRARY_PATH=$ORACLE_HOME/lib' >> .bashrc
source .bashrc
git clone https://github.com/oracle/node-oracledb.git
mkdir -p projects/oracledb-examples
cp node-oracledb/examples/* projects/oracledb-examples
cd projects/oracledb-examples
sed -i -e 's/"welcome"/"oracle"/' dbconfig.js
npm install oracledb
node select1.js

Running subsequent examples only requires node followed by the name of the example you’d like to run:

cd ~/projects/oracledb-examples
node resultset1.js

Enjoy your new sandbox!

Node.js Oracle Database Database Sandbox (software development) Virtual Machine operating system VirtualBox Driver (software)

Published at DZone with permission of Dan McGhan, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • A Beginner's Guide to Back-End Development
  • Create a CDC Event Stream From Oracle Database to Kafka With GoldenGate
  • Internal Architecture of the SQLite Database
  • Use MongoDB Node.js Native Driver Without Mongoose

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: