Sunday, September 20, 2015

download, install, and query an oracle database in minutes


  1. Determine what bit version you want to download.  In my case, I use SQL Server 64-bit, and excel 64-bit, so I want oracle 64-bit
  2. google "oracle database 11g free 64-bit"
  3. I first am experimenting with the oracle express edition.  I'll only be using my home database for testing connection that I otherwise would not feel comfortable with on work databases.  Plus I have control over settings and configurations that might otherwise not be possible.  
  4. Download and install.  Installation says is 70mb
  5. It will prompt for a database password, and installation will complete.

SQL Developer
The oracle database installation does not come with an IDE client.  SQL Developer is a client provided free from oracle that is easiest to install and set up.

  1. Google for oracle sql developer download.  Once again, download the 64-bit version.  I am downloading sqldeveloper-4.1.1.19.59-x64
  2. Unzip.  


Start the database
  1. In oracle, start the database.  Oracle 11g Express Edition -> Start Database
  2. Start Sqldeveloper in the unzipped directory
  3. Go to connections, add new connection.  The username is SYSTEM, and the password is the one created above.  The defaults worked fine, but were:
    • connection type: basic
    • role: default
    • hostname: localhost
    • port: 1521
    • SID: xe
     4.  Select "Test" to test the connection.  Enter a connection Name ("oraclepc") Then "save password" and "save".

     5.  Connect to the database.  See if everything works by creating, inserting, and querying the data.

CREATE TABLE test_db( 
fld01 VARCHAR2(5),
fld02 VARCHAR2(5),
fld03 DATE
)



insert into test_db (fld01, fld02, fld03) values ('A','1','20-AUG-2015');
insert into test_db (fld01, fld02, fld03) values ('B','2','20-AUG-2015');
insert into test_db (fld01, fld02, fld03) values ('C','3','20-AUG-2015');



SELECT  *
FROM    test_db
WHERE   fld03 > '01-AUG-2015';