Nov 13 2009

Oracle SQL Developer 설치하기

분류: Database, How to, Ubuntu최 태현 @ 11:38 오전

Oracle SQL Developer is a free SQL development environment from Oracle. It provides a graphical tool to interact with your database. Furthermore, it is a complete standalone application thus neither SQL*Plus or Oracle Database Client software need to be installed beforehand in order to use it.

It does however, require that the Sun Java 6 JDK be installed on your system. Install it by typing:
sudo apt-get install sun-java6-jdk

Note:
You may also use OpenJDK

To obtain the installable package, navigate to Oracle’s SQL Developer download page at:
http://www.oracle.com/technology/software/products/sql/index.html

You must agree to the OTN License Agreement for SQL Developer in order to download the software. Once doing so, choose the Accept License Agreement radio button.

Scroll down and select the package entitled ‘Oracle SQL Developer RPM for Linux’ to download the package.

Note:
If you do not have an account with the Oracle Technology Network, go ahead and create one. It’s free and also required in order to download the package.

Next we will convert the .rpm to a .deb to install it in Ubuntu. We’ll do this by using an application called ‘alien’. Install it by typing:
sudo apt-get install alien

Next, navigate to where you saved the SQL Developer .rpm package and type:
sudo alien -k –scripts sqldeveloper*.rpm

This will create a .deb package ready to be installed into our system. We do so by typing:
sudo dpkg -i sqldeveloper*.deb

Oracle SQL Developer is now installed. However, in order to run it, we need to point it to the JDK. Failure to do so, will result in the following message when trying to run Oracle SQL Developer:

Oracle SQL Developer
Copyright (c) 2008, Oracle. All rights reserved.

Type the full pathname of a J2SE installation (or Ctrl-C to quit), the path will be stored in ~/.sqldeveloper/jdk

Looking at the message we can see that it’s trying to obtain the JDK path by reading a file called ‘jdk’ in a directory called ‘~/.sqldeveloper’. Let’s resolve this dependency.

First we’ll create the missing directory by typing:
mkdir -p ~/.sqldeveloper

Next we’ll create an empty jdk file by typing:
touch ~/.sqldeveloper/jdk

Edit this file and input the path to the JDK by typing:
gedit ~/.sqldeveloper/jdk
and pasting into it:
/usr/lib/jvm/java-6-sun

You may now run Oracle SQL Developer by typing:
sqldeveloper
Or by going to:
Applications > Programming > SQL Developer

You may also go ahead and delete the .rpm downloaded and subsequent .deb that was created.

Tags: , ,


Jun 12 2009

Oracle xe 환경설정하기(Tora 접속방법)

분류: Database, How to, Ubuntu최 태현 @ 4:21 오전
  1. Go to the following directory:

    /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin

  2. Look for the following scripts:
    • oracle_env.csh (for C or tcsh shell)
    • oracle_env.sh (for Bourne, Bash, or Korn shell)
  3. Run the appropriate script for your shell. For example:
    • Bourne, Bash, or Korn shell:
      $ . ./oracle_env.sh
    • C or tcsh shell:
      % source oracle_env.csh

You may also want edit your login or profile files so that these environment variables are set properly each time you log in or open a new shell.

For Bourne, Bash, or Korn shell, enter the following line into the .bash_profile (to log in) or .bashrc file (to open a new shell):

. /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh

For C or tcsh shell, enter the following line into the .login file (to log in) or .cshrc file (to open a new shell):

source /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.csh

Tags: ,


Jun 12 2009

Oracle 접속오류 해결방법

분류: Database, How to최 태현 @ 1:47 오전

Why I got ORA-27121: unable to determine size of
shared memory segment ?

A. The full erros stack:
ERROR:
ORA-01034: ORACLE not available
ORA-27121: unable to determine size of shared memory
segment
Linux Error: 13: Permission denied

This is caused by Oracle installer not setting setuid
on $ORACLE_HOME/bin/oracle.

To fix do:
$ cd $ORACLE_HOME/bin
$ chmod 6751 oracle

Tags: , ,


Jun 11 2009

Tora With Oracle, MySQL

분류: Database, Desktop, How to최 태현 @ 9:54 오후

The “tora” database client package in Feisty Fawn comes with Postgres support, and MySQL if you have the libraries. This How-To shows you how to build Oracle Instantclient 10g support into tora.

This is client only. You will not install the whole Oracle database.

BTW, if you don’t have time to build the whole thing, here is the .deb package I built using this How-To. It’s x386 only, and you’ll need to have instantclient installed before you can use it.

tora_1.3.22-5_i386.deb is an updated .deb package for instantclient 11.1.0.1 and tora 1.3.22.

Continue reading “Tora With Oracle, MySQL”

Tags: , ,


Jun 11 2009

Oracle 10g 설치하기

분류: Database, How to, Ubuntu최 태현 @ 8:42 오후

OCI를 ubuntu에서 설치해보고 아예 오라클 자체를 Desktop에 설치하고 study할때 써보기로 맘 먹었습니다.

  • $ sudo vi /etc/sources.list <- 다음 라인을 맨 끝에 추가
  • deb http://oss.oracle.com/debian unstable main non-free
  • $ sudo wget http://oss.oracle.com/el4/RPM-GPG-KEY-oracle  -O- | sudo apt-key add -
    $ sudo apt-get update
    $ sudo apt-get install oracle-xe-universal
  • $ sudo /etc/init.d/oracle-xe configure <- 웹 관리 포트 및 리스너 포트, 비밀번호 등을 설정. sid는 기본 xe로 설정되어 있음.
  • $ 웹 브라우저에서 http://localhost:8080/apex 로 접속해서 시험해본다.
  • $ sudo vi /etc/environment
    ORACLE_HOME=/usr/lib/oracle/xe/app/oracle/product/10.2.0/server
    PATH=$PATH:$ORACLE_HOME/bin
    export ORACLE_HOME
    export ORACLE_SID=XE
    export NLS_LANG=’KOREAN_KOREA.AL32UTF8
  • $ source /etc/environment
  • $ sqlplus ’sys /as sysdba’ 로 접속해서 테스트 해본다.
  • $ sudo /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh

첫줄의 #!/bin/sh를 #!/bin/bash로 변경한다.

참고사이트 : http://nameslayer.tistory.com/286

http://ids.snu.ac.kr/wiki/Oracle_Express_Edition

Tags: ,


Jun 11 2009

PHP + OCI8 설치

분류: Apache2, Desktop, How to, Web Server최 태현 @ 7:43 오후

도서관리시스템(KOLAS)이 오라클 DB를 사용해서 홈페이지 개발시 oracle instant client를 설치 했습니다.

  • $ sudo apt-get install build-essential php5-dev php-pear alien
  • Oracle 에서 Instant client 프로그램(instantclient-basic, instantclient-SDK)를 다운받는다. deb 파일 전환을 위해 rpm 파일을 다운받는다.
  • $ sudo alien -k oracle-instantclient-basic-10.2.0.4-1.i386.rpm
  • $ sudo alien -k oracle-instantclient-devel-10.2.0.4-1.i386.rpm
  • $ sudo dpkg -i oracle-instantclient-basic_10.2.0.4-1_i386.deb
  • $ sudo dpkg -i oracle-instantclient-devel_10.2.0.4-1_i386.deb
  • $ sudo pecl install oci8 ; pecl로 php rebuild

Continue reading “PHP + OCI8 설치”

Tags: , ,