Oracle10gXEインストール


ダウンロード


http://www.oracle.com/technology/software/products/database/xe/index.html


# rpm -ivh /media/cdrecorder/Fedora/RPMS/libaio-0.3.104-2.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.
[root@]# ls
Desktop oracle-xe-univ-10.2.0.1-1.0.i386.rpm
[root@]# /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.
&br()
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]:
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/init.d/oracle-xe start  

停止
#/etc/init.d/oracle-xe stop  

OS起動時にデータベースを開始する設定にした場合は、
#service oracle-xe { start | stop }  

接続するユーザの.bash_profileに以下を追加
. /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/bin/oracle_env.sh

[root@netv01 admin]# sqlplus
SQL*Plus: Release 10.2.0.1.0 - Production on 土 3月 31 03:23:03 2007
Copyright (c) 1982, 2005, Oracle. All rights reserved.
ユーザー名を入力してください: SYSTEM
パスワードを入力してください:デフォルトはMANAGER
Oracle Database 10g Express Edition Release 10.2.0.1.0 - Production

ログオンせずに起動する場合は
$ sqlplus /nolog
SQL*Plus: Release 10.2.0.1.0 - Production on 水 11月 4 00:05:30 2009
Copyright (c) 1982, 2005, Oracle.  All rights reserved.

※起動した後で接続
SQL> connect system/XXXX @192.168.1.XXX/XE


ネットワーク設定の編集
※編集せずに起動可能
場所
/usr/lib/oracle/xe/app/oracle/product/10.2.0/server/network/admin/

①listener.ora
# listener.ora Network Configuration File:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = XE)
(GLOBAL_DBNAME = XE.send.test)
(ORACLE_HOME = /usr/lib/oracle/xe/app/oracle/product/10.2.0/server)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = netv01.send.test)(PORT = 1521))
)
)
)

②tnsnames.ora
# tnsnames.ora Network Configuration File:
XE =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = netv01.send.test)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = XE.send.test)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC_FOR_XE))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)

接続テスト:
SQL> connect system/**pass**@netv01.send.test:1521/XE

SQL> create table mail_test(
2 no number,
3 from_addr varchar2(256),
4 rcpt_addr varchar2(256),
5 count number
6 );

SQL> create user hama identified by hama ;

SQL> update mail_test set count=count+1 where FROM_ADDR='tome@send.test' AND RCPT_ADDR='hama@recv.test';
最終更新:2009年11月04日 00:19