Friday, October 25, 2013

Oracle developer day VM : How to use Pre-Built Oracle database for learning and testing

Oracle developer day pre-installed virtual machine is very useful to finish your homework, teach yourself about Oracle database, or get ready for that job interview in SQL / PL SQL.
If you want the Oracle database for testing purpose or if you need mobility database just you can export your application database and import into this pre-installed oracle VM, It is very quick and easy to setup. Here i'm explain how i have import our application database into this VM from scratch.

Oracle provide the pre-Build oracle installed VM for testing and learning purpose. This virtual machine contains:
  • Oracle Linux 5
  • Oracle Database 11g Release 2 Enterprise Edition
  • Oracle TimesTen In-Memory Database Cache
  • Oracle XML DB
  • Oracle SQL Developer
  • Oracle SQL Developer Data Modeler
  • Oracle Application Express
  • Oracle JDeveloper
  • Hands-On-Labs (accessed via the Toolbar Menu in Firefox)

  1. Download and install Oracle Virtual Box here
  2. Download Oracle Developer Day pre-installed VM from here
  3. Import downloaded ova file into Virtual Box
Click the "Import Appliance.." to import the downloaded ova file

Select the downloaded ova file

Click the check box as Highlighted

Importing Appliance..


Imported.


I have selected the network setting as "Host only Adapter" because i wanted to use the database only within the hosted PC. So i can connect the database from PC which i installed the virtualbox. If you need to access the database from other network you might need to select "Bridge Connection"



Once you finished the Vertualbox installation you can notice new network adapter to connect virtual machines. This will act as gatway between your PC and all virtual mechines.

Check the virtual adapter's setting  for more understanding about network connections

Start the virtual machine and login as oracle , password also "oracle"

configuration parameters.




4. Oracle TNS tnsnames.ora file has configurations for pre-installed database , below is the terminal output

[oracle@localhost ~]$ cat /home/oracle/app/oracle/product/11.2.0/dbhome_2/network/admin/tnsnames.ora # tnsnames.ora Network Configuration File: /home/oracle/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora # Generated by Oracle configuration tools. LISTENER_ORCL = (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521)) ORCL = (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 0.0.0.0)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = orcl) ) ) TTORCL = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521)) ) (CONNECT_DATA = (SERVICE_NAME = orcl) ) ) [oracle@localhost ~]$
5. Login into oracle database as sysdba then create new user with DBA privileges and normal user to import the database dump.The default password for all accounts is 'oracle'.So you can connect as SYS, HR with 'oracle' as the password. The Linux password are all ‘oracle’ too, so you can login as ‘root’ or as ‘oracle’ in the Linux desktop. Below are the terminal outputs to create the schema / user
[oracle@localhost ~]$ sqlplus 'sys as sysdba' SQL*Plus: Release 11.2.0.2.0 Production on Thu Oct 24 22:44:58 2013 Copyright (c) 1982, 2010, Oracle.  All rights reserved. Enter password: Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> CREATE USER oracle_dba IDENTIFIED BY password$1; User created. SQL> GRANT CONNECT TO oracle_dba; Grant succeeded. SQL> GRANT DBA TO oracle_dba; Grant succeeded. SQL>; CREATE USER SNSDIA IDENTIFIED BY password$1; User created. SQL> GRANT CONNECT TO SNSDIA; Grant succeeded. SQL>ALTER USER SNSDIA QUOTA 100M ON USERS; User altered.
6. Import the data dump into newly created schema / user

[oracle@localhost ~]$ imp oracle_dba@TTORCL file=/home/oracle/Desktop/exp_xxxxx.dmp LOG=xxxxx_import.log FROMUSER=abc TOUSER=acb ignore=Y;
7. Connect to newly created schema from host PC using sql developer



7 comments:

  1. Good Post. I like your blog. Thanks for Sharing
    Oracle Training Noida

    ReplyDelete
  2. where do i find sd? i had to use local instead in connection typpe

    ReplyDelete
  3. You are awesome!! thank guy, this is for my DBA class !

    ReplyDelete
  4. are these entire steps for MAC or windows ?
    also when i am trying to access this db using local sql developer as shown..i am facing TNS related error..

    requesting for help here ...

    ReplyDelete

  5. Iam so thrilled because of finding your alluring website here.Actually i was searching for Oracle SQL.Your blog is so astounding and informative too..Iam very happy to find such a creative blog. Iam also find another one by mistake while am searching the same topicOracle APEX.Thank you soo much..

    ReplyDelete
  6. This comment has been removed by the author.

    ReplyDelete
  7. Why to import data dumb? Pls answer this.

    ReplyDelete