Tuesday, April 25, 2017

DBTutorial #1 - Setting Up Oracle Database 11G R2 on a Windows Machine

Learning databases begins with doing practical hands on a functional database application software. Database is used across all dimensions of software development and will always remain integral part of any application. In the upcoming series of tutorials that I am writing, we will focus on learning databases from beginner’s point of view. Currently in software industry, Oracle Database is the most widespread used software for deploying database for range of enterprise applications as per client’s needs.   Pre-requisite for learning Oracle Database is basic knowledge about database concepts and SQL queries.

Oracle Database installation is a simple process with easy to understand GUI installer provided with Oracle. In this tutorial, we will talk about setting up Oracle 11G R2 database on a windows machine (Windows 10). The oracle database can be installed on any Virtual machine as well like CentOS using VMWare about which we will cover in next set of tutorial as the steps will be a bit different as comparison to GUI setup of Oracle database. Also please note that this installation is for basic desktop class database setup to maintain simplicity. We will work on in-depth details in upcoming tutorials.

Download the Oracle 11G R2 database installation files from Oracle website. Follow the installation as per the steps described in the screenshots (Click on any screenshot to view larger screen resolution version).
  • Step 1 - Mount the database setup and click on setup

  • Step 2  -  Let Oracle Universal Installer perform required system diagnosis.

  • Step 3 - Oracle setup will launch

  • Step 4 - Enter your email id if you want to receive updates from Oracle. 

  • Step 5 - Select create and configure a database option and click next

  • Step 6 - Select Desktop class option as we want to set up a beginner level database for learning purpose. Server class option is mostly used when installing on Windows Server Operating system for deploying production level database catering to large number of users. 

  • Step 7 - Provide basic parameters like installation location, user id, passwords. Leave the Database edition and character set to default. Note down important parameters like global database name/password details in a separate notepad file for future references. 

  • Step 8 - Oracle universal installer will perform some prerequisite checks and provide summary of setup so far. Click Finish to begin the installation. 

  • Step 9 - Setup will start and will take 10-20 minutes depending upon your machine's hardware capacity. Sit back & relax till the installation finishes.

  • Step 10 - Allow access to JDK if windows firewall prompts a security alert. 

  • Step 11 - The setup will complete and Database configuration assistant will prompt summary of installation. You can use Password Management option to set/change passwords of default users. We will skip this for this point of time.

  • Step 12 - Oracle Database setup is now complete. Close the installer. 

  • Step 13 - Now it's time to check if Oracle Database is up and running or not on our system. We have two ways to do so - one from CMD and another from local host GUI oracle db manager. For CUI, open command prompt and type following command - C:\> set ORACLE_SID=orcl.
  • The oracle SID (System ID) is used to identify the database installed on a system. When we use this command, we instruct our system to work on a particular database. 

  • Step 14 - After setting ORACLE_SID, use following command to connect to SQL*Plus that will allow you to perform basic database administration tasks. 
c:\> sqlplus userid/password as sysdba

Once you are connected to SQL*Plus, use following command to retrieve the name of the database instance you are currently working on.

SQL > select name from v$database;

  • Step 15 - You can also access GUI console for managing your database. The local host URL will be generated at the end of the installation. Simply enter your user id and password. Select your role and connect to database.

  • Step 16 - Upon logging in, you will get the GUI console to administer your database. 

So after performing all these steps, we have confirmed that our database is finally setup and is up and running perfectly. 

In next set of tutorial we will continue further... Thanks for reading guys. 

No comments: