Database JUNKY

MySQL,MariaDBを中心としたブログです

OracleXE をインストールしてみる

Oracle XEのインストールに挑戦してみました。

Oracle XEとは、無料で使える、Oracleデータベースです。 機能は、商用版とほぼ同等でありますが、メモリの制限、ディスクの 制限等はあります。(memは、1GB で、 ディスクは、2GBだったっけか?。。)

以下当方が行った作業手順です。

RPMからORACLEをインストール

[root@orasrv src]# rpm -ivh oracle-xe-univ-10.2.0.1-1.0.i386.rpm 準備中...                ########################################### [100%]    1:oracle-xe-univ         ########################################### [100%] Executing Post-install steps... You must run '/etc/init.d/oracle-xe configure' as the root user to configure the database.

# 環境設定shellを起動する

[root@orasrv src]# /etc/init.d/oracle-xe configure

Oracle Database 10g Express Edition Configuration

This will configure on-boot properties of Oracle Database 10g Express Edition.  The following questions will determine whether the database should be starting upon system boot, the ports it will use, and the passwords that will be used for database accounts.  Press <Enter> to accept the defaults. Ctrl-C will abort.

# WEB 管理コンソールのポート番号を指定する。(デフォルト:8080)

Specify the HTTP port that will be used for Oracle Application Express [8080]:

Specify a port that will be used for the database listener [1521]:

# SYSTEM ユーザーのパスワードを指定する

Specify a password to be used for database accounts.  Note that the same password will be used for SYS and SYSTEM.  Oracle recommends the use of different passwords for each database account.  This can be done after initial configuration: Confirm the password:

# OS起動時に、インスタンスも起動する?

Do you want Oracle Database 10g Express Edition to be started on boot (y/n) [y]:y

Starting Oracle Net Listener...Done Configuring Database...Done Starting Oracle Database 10g Express Edition Instance...Done Installation Completed Successfully. To access the Database Home Page go to "http://127.0.0.1:8080/apex"

# oracle接続用のユーザーを作成してみる。

[root@orasrv src]# useradd ora [root@orasrv src]# passwd ora Changing password for user ora. New UNIX password: Retype new UNIX password: passwd: all authentication tokens updated successfully. [root@orasrv src]# su - ora

# .bashrcに以下の設定を追記する

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

[ora@orasrv ~]$ vi .bashrc

.bashrc

Source global definitions

if [ -f /etc/bashrc ]; then         . /etc/bashrc fi

User specific aliases and functions

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

# SQLPLUS起動 [ora@orasrv ~]$ sqlplus

SQL*Plus: Release 10.2.0.1.0 - Production on 木 7月 16 18:04:22 2009

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

ユーザー名を入力してください: system パスワードを入力してください: ERROR: ORA-01017: invalid username/password; logon denied ユーザー名を入力してください: system パスワードを入力してください: 自分で設定したパスワード

Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production に接続されました。 SQL> # インスタンスを確認する

SQL> select instance_name, status, version, edition from v$instance;

INSTANCE_NAME    STATUS       VERSION           EDITION


XE               OPEN         10.2.0.1.0        XE

インスタンスパラメタを確認する

SQL> select * from v$nls_parameters;

PARAMETER

VALUE

NLS_LANGUAGE JAPANESE

NLS_TERRITORY JAPAN

NLS_CURRENCY \

PARAMETER

VALUE

NLS_ISO_CURRENCY JAPAN

NLS_NUMERIC_CHARACTERS .,

NLS_CALENDAR GREGORIAN

PARAMETER

VALUE

NLS_DATE_FORMAT RR-MM-DD

NLS_DATE_LANGUAGE JAPANESE

NLS_CHARACTERSET AL32UTF8

PARAMETER

VALUE

NLS_SORT BINARY

NLS_TIME_FORMAT HH24:MI:SSXFF

NLS_TIMESTAMP_FORMAT RR-MM-DD HH24:MI:SSXFF

PARAMETER