Showing posts with label linux. Show all posts
Showing posts with label linux. Show all posts

Monday, November 4, 2013

Oracle 12c on Linux Part Deux: SQL Developer

Assuming that you have successfully installed Oracle 12c on your Linux box (and if you don't know how to accomplish that, look here), one of the next things you'll probably want to do is to get SQL Developer up and running.

In the next post (Part Three) I'll talk about how to access the sample schemas, which, as of 12c, are now tucked away inside "pluggable" databases.

1. Install Java (specifically JDK 7u45 & NetBeans 7.4, or something more or less equivalent). The download can be found here: http://www.oracle.com/technetwork/java/javase/downloads/index.html. Follow the installation instructions found here: http://www.oracle.com/technetwork/java/javase/downloads/jdk-7-netbeans-install-433844.html#linux

2. Download SQL Developer 4 rpm file. The download is here:  http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/sqldev-download-v4-1925679.html

3. Install SQL Developer following the instructions found here: http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/sqldev-install-linux-1969676.html

4. During the installation you should probably accept all the defaults, at least as far as where things are to be installed (/usr/local/). If you get a "DISPLAY" error at this point (or at any other point) refer to step #5 in the previous post.

5. Once the installation completes, log in as the oracle user and just execute "sqldeveloper". The first time you fire up SQL Developer it will ask you where your JDK is, and you should enter something like this: /usr/local/jdk1.7.0_45.

6. That's it! I really should be that simple. As long as you know your way around Linux, and you have installed Oracle properly in the first place, there should be no problems. But if you do run into any problems feel free to leave a comment and I will see if I can help you out!

Sunday, November 3, 2013

Oracle 12c Cheat Sheet for Linux (part one)

This blog post will cover the basic steps that will get you to the point where you have Oracle12c up and running on a Linux system. I am assuming Oracle Linux, but I have also verified that (with a few tweaks here and there, perhaps) things work pretty much the same with CentOs.

In Part Two I will talk about accessing "pluggable" databases (which you need to get to the sample schemas, such as "hr", etc), and also getting SQL Developer up and running.

1. Install latest version of Oracle Linux. I did this on a virtual machine using Vmware Workstation 10 running on Windows 8 Pro. More details are here : Installing Oracle Linux on a virtual machine.

2. Apply Oracle's set up scripts via yum (see https://blogs.oracle.com/wim/entry/easily_install_oracle_rdbms_12cr1) for some more details:

sudo yum install oracle-rdbms-server-12cR1-preinstall

3. Create directory /home/OraDB12c and download the two installation zip files here. (look here if you don't know how to do this: http://www.oracle.com/technetwork/articles/servers-storage-admin/ginnydbinstallonlinux-488779.html).

4. IMPORTANT: Before installation you must manually create /oradata as root (or at least this was the case when I did it - despite the claim that the "setup" scripts were supposed to take care of this kind of thing):

mkdir /oradata
chown oracle /oradata
chgrp oinstall /oradata

5. Depending on what other configuration you have done on your linux box, there might be one more mthing before the install! Execute this command as root:

xhost +SI:localuser:oracle

6. Now run the installation script as the "oracle" user. The script is called "runInstall", and it should be found in the directory /home/OraDB12c/database. If you get a "DISPLAY" error, see step #5 above. During installation there is a step that requires manually running some more scripts (AS ROOT). These scripts get installed as part of the installation process - you will be prompted to do this at the appropriate time.

7. After installation completes successfully you must still manually set the the environment variables ORACLE_HOME, ORACLE_BASE, and ORACLE_SID, and also update your path (and when updating the path you should explicitly add ORACLE_HOME/bin). Here is what I put in my .bashrc file (for the "oracle" user) to accomplish this:

ORACLE_SID="orcl"; export ORACLE_SID
ORACLE_HOME="/home/oracle/app/oracle/product/12.1.0/dbhome_1/"; export ORACLE_HOME
ORACLE_BASE="/home/oracle/app/oracle/product/12.1.0/"; export ORACLE_BASE
PATH=$PATH:$ORACLE_BASE:$ORACLE_HOME:$ORACLE_HOME/bin; export PATH


7. At this point you should log in as the "oracle" user and you should be able to fire up sqlplus as usual:

sqlplus / as sysdba

8. If that doesn't work then you can either google the error message(s) you get, and/or leave a comment below and I'll try to help you out!

9. Note that Oracle has apparently changed the default locations for ORACLE_HOME and ORACLE_BASE. If you are unsure about what to set these environment variables to, check out this blog post by Kevin Closson: "Using Linux /proc To Identify ORACLE_HOME and Instance Trace Directories."

Here is the two step process for discovering where ORACLE_HOME is using /proc:

Step 1: ps -ef | grep lgwr | grep -v grep

Step 2: ls -l /proc/<PID>/exe

In my case the oracle home turned out to be, very reasonably, /home/oracle/app/oracle/product/12.1.0/dbhome_1/. In other words, it is the same as the "old style" ORACLE_HOME, but with "/u01/" replaced by "/home/oracle/". ORACLE_BASE is just the directory immediately above ORACLE_HOME.

Wednesday, October 24, 2012

Just Enough juju

The cloud may or may not be intrinsically evil, and even if not intrinsically evil it might be evil in most or nearly all of its actual implementations, or at least in its most pervasive commercial implementations.

But admit it. You want it.

Ubuntu is free and easy to install. And Amazon Web Services has a "Free Usage Tier". And the connection between the two is juju:
Getting Started:
https://juju.ubuntu.com/docs/getting-started.html
User Tutorial:
https://juju.ubuntu.com/docs/user-tutorial.html

Other stuff:
Beginning PHP with Eclipse:
http://www.i-programmer.info/programming/php/463-beginning-php-with-eclipse.html

AWS toolkit for Eclipse:
http://aws.amazon.com/eclipse/

PHP and Git on AWS Elastic Beanstalk:
http://acloudyplace.com/2012/03/php-and-git-on-aws-elastic-beanstalk/
"When Amazon announced Beanstalk’s support for PHP I was curious to know what it would look like. So I decided to give it a try. I hadn’t used my AWS account for a while, so I had to do some account setup tasks, configuring command line tools, etc. In this article I will explain how to set up a PHP application in Beanstalk from scratch."

Up and running with Elastic Beanstalk:
http://www.w2lessons.com/2012/03/up-and-running-with-elastic-beanstalk.html
"Elastic Beanstalk isn’t a service per se. Rather it is a collection of existing Amazon services strung together to yield a low maintenance, easy to set up and highly scalable web hosting environment for JVM based applications and recently, Amazon has added support for PHP and Git deployments. Beanstalk is geared at new AWS users as well as companies that have not yet achieved a scale that requires very fine tuning of their infrastructure. Although Elastic Beanstalk is relatively simple to use, a good deal of the challenges you’ll encounter stem from the immediate requirement to make your application work under a distributed environment. For those that have been writing AWS based applications for some time, this is second nature, but for those new to the task, it can pose a number of challenges. The great thing about adhering to the restrictions imposed by Elastic Beanstalk is that it forces you to think about scalability from the outset making your applications more robust and decoupled. This can also be a deterrent as few of us want to invest precious idea validation time writing highly scalable code, but with a good game plan it proves to be less onerous than expected."

Monday, October 1, 2012

Socket Programming, Anyone??

For now this is just some links. After I have a chance to play around more with this stuff, I will update this post with more substantial comments on what really works and what gets you there the quickest and easiest.

http://www2.its.strath.ac.uk/courses/c/

http://www.cprogramming.com/tutorial/c-tutorial.html

Introduction to network functions in C
http://shoe.bocks.com/net/

Beej's Guide to Network Programming Using Internet Sockets
http://beej.us/guide/bgnet/

But if you really want to be able to do and understand socket programming in Linux, this looks like the place to go:
http://www.linuxhowtos.org/C_C++/socket.htm

Hmmm - here's a new link that looks promising:
http://www.prasannatech.net/2008/07/socket-programming-tutorial.html

figure from:  http://www.troubleshooters.com/codecorn/sockets/

Friday, September 7, 2012

triple booting windows 7, centos, and ubuntu

This blog will be a place for me to keep track of things that I have found to be useful. For example, in this first post I am linking to an excellent resource for anyone interested in acheiving peaceful coexistence among Windows 7, CentOS 6, and Ubuntu 12, all on one hard drive:

http://www.linuxbsdos.com/2011/05/31/how-to-triple-boot-fedora-15-ubuntu-11-04-and-windows-7/

teh intenets are littered with worse-than-useless "how-tos" and "solutions" that accomplish nothing but wasting our time and encouraging misanthropic despair. But this article was one of the most amazingly helpful and well written I've ever seen.

I used CentOS 6.3 instead of fedora 15, and I used ubuntu 12 instead of ubuntu 11. Also, I had to first restore my original windows mbr using my repair disk, due to the fact that I had previously blown it away from doing multiple installs of both CentOS and Ubuntu without really caring what was happening with regard to "who" was being given charge of boot management (thus allowing grub to seize control, which is workable, but not, at least in my opinion, ideal).
Coming soon: An (almost) absolute beginner's guide to getting started with Android programming (assuming that you already know a little xml and java, which, unless you do, well, you gotta learn that first, but I'll try to give some pointers there, too).