豚吐露@wiki

install

最終更新:

Bot(ページ名リンク)

- view
管理者のみ編集可

Oracle Database install手順

Ubuntu 10.04 LTS
Oracle Database 10g Release 2 (10.2.0.1) Express Edition for Linux x86


■ Downlaod
Oracle Database 10g Release 2 (10.2.0.1) Express Edition for Linux x86
http://www.oracle.com/technetwork/database/express-edition/downloads/102xelinsoft-102048.html
Ubuntuなので、上記URLからDebian用pkg(拡張子がdebのヤツ)を取得する。


■ Install
Oracleに必要な外部libraryの導入
$ sudo apt-get install libaio1

OracleXEの導入。
$ sudo dpkg -i oracle-xe-universal_10.2.0.1-1.0_i386.deb

OracleXE Clientの導入。
$ sudo dpkg -i oracle-xe-client_10.2.0.1-1.0_i386.deb

OracleXEの初期設定
$ sudo /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.

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]:

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:

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"
正常に終了すると『/etc/default/oracle-xe』が生成される。
このファイルがある限り、再度configureオプションの実行はできない。
再度実行したかったらOracle止めて、file消して、再度configure実施。

Oracleユーザのパスワード設定
$ sudo passwd oracle
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
任意のパスワードを設定。

Oracleユーザへ変更
$ su -l oracle
先ほど設定したパスワードを入力。

環境変数設定
Oracleを触る為に必要な環境変数を設定するscriptが用意されているので適応。
$ source /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh
適応すると以下のようなエラーが発生する。
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh: 114: [[: not found
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh: 114: [[: not found
どうやら既存のバグらしい。対象fileを手動で以下のように修正し、回避する。
$ sudo vi /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/nls_lang.sh
108
109
110
111
112
113
114
if [[ -n "$LC_ALL" ]]; then
  locale=$LC_ALL
elif [[ -n "$LANG" ]]; then
  locale=$LANG
else
  locale=
fi
if [ -n "$LC_ALL" ]; then
  locale=$LC_ALL
elif [ -n "$LANG" ]; then
  locale=$LANG
else
  locale=
fi
具体的には108、110行目の『 [ [』『] ] 』をそれぞれ『 [』『] 』に修正。
もう一度適用。
$ source /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh
エラーが出なくなっているハズ。

この環境変数設定はloginする度に必要となるため、『.bashrc』などに追記しておくと楽。

環境設定後、以下のコマンドを実行でSQL*Plusが実行できれば環境設定完了。
$ sqlplus / as sysdba


■ uninstall
インストールされてるpkg名が知りたいので...」
$ dpkg -l | grep oracle
Oracleがinstallされてることがわかる。
$ sudo dpkg -r oracle-xe-client
$ sudo dpkg -r oracle-xe-universal
で、OS再起動。
もっかいlistを見ると
$ dpkg -l | grep oracle
削除済になってることが分かる。



更新日: 2012年12月11日 (火) 14時17分03秒

名前:
コメント:

すべてのコメントを見る
記事メニュー
ウィキ募集バナー