ハードウェア要件の確認
- スワップ領域が物理RAMのサイズの1.5倍以上であることを確認する。
- /tmp に400MB以上の空き領域があることを確認する。
- Oracleソフトウェアのインストール先に1.5GB以上の空き領域があることを確認する。
- Oracleデータベースの作成先に1.2GB以上の空き領域があることを確認する。
ソフトウェア要件の確認
CentOS release 5.3 (Final)
Kernel \r on an \m
- カーネルのバージョンが 2.6.18-8 以上であることを確認する。
Disabled
- 無効(Disabled)でない場合は、無効(Disabled)に設定して再起動する。
SELINUX=disabled
- 以下のパッケージがインストールされていることを確認する。
- binutils-2.17.50.0.6-2.el5
- compat-libstdc++-33-3.2.3-61
- elfutils-libelf-0.125-3.el5
- elfutils-libelf-devel-0.125
- gcc-4.1.1-52
- gcc-c++-4.1.1-52
- glibc-2.5-12
- glibc-common-2.5-12
- glibc-devel-2.5-12
- glibc-headers-2.5-12
- libaio-0.3.106
- libaio-devel-0.3.106
- libgcc-4.1.1-52
- libstdc++-4.1.1
- libstdc++-devel-4.1.1-52.e15
- make-3.81-1.1
- sysstat-7.0.0
- unixODBC-2.2.11
- unixODBC-devel-2.2.11
egrep "binutils|compat-libstdc++|elfutils-libelf|elfutils-libelf-devel|gcc|glibc|\
libaio|libgcc|libstdc++|make|sysstat|unixODBC"|sort
- 不足しているパッケージをインストールする。
- CentOS-5.3-i386-bin-1of6.iso 〜 CentOS-5.3-i386-bin-6of6.iso を順番にマウントして、必要な rpm を探す。
- [VM]-[設定]-[ハードウェア]-[CD/DVD(IDE)]
- [デバイスのステータス]-[接続中]: チェックする
- [デバイスのステータス]-[起動時に接続]: チェックする
- [ISOイメージファイルを使用]: iso ファイルのパスを指定する。
設定いろいろ
- カーネルパラメータの設定
- kernel.shmmax は物理RAMの半分の512MBにする。
kernel.shmall = 2097152
kernel.shmmax = 536870912
kernel.shmmni = 4096
kernel.sem = 250 32000 100 128
fs.file-max = 65536
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
- /etc/pam.d/login ファイルに以下の通り記述する。
session required pam_limits.so
if [ $USER = "oracle" ]; then
ulimit -u 16384
ulimit -n 65536
fi
export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=orcl
unset ORACLE_HOME
uid=99(nobody) gid=99(nobody) 所属グループ=99(nobody)
vsftpd 用の vsftpd を起動中: [ OK ]
vsftpd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
ネットワーク設定の確認
- /etc/hostsファイルが名前解決に使用されることを確認する。
hosts: files dns
- hostname コマンドを実行するとホスト名が表示されることを確認する。
centos51
- ドメイン名が動的に設定されていないことを確認する。
(none)
192.168.135.101 centos51 centos51.yoheia.jp centos51
- hosts に完全修飾ホスト名が含まれていることを確認する。
192.168.135.101 centos51 centos51.yoheia.jp centos51
127.0.0.1 centos51 localhost.localdomain localhost
サイレント・モードでインストールする
- ここでVMwareのスナップショットをとっておく。
- oraInst.loc を作成する。
$ su -
inventory_loc=/u01/app/oracle/oraInventory
inst_group=oinstall
$ mkdir software/oracle10gR2_linux
$ cd /home/oracle/software/oracle10gR2_linux
$ unzip 10201_database_linux32.zip
$ mkdir oracle102010
$ mv database oracle102010/
$ startx
$ export LANG=C
$ export NLS_LANG=American.America_JA16EUC
$ cd /home/oracle/software/oracle10gR2_linux/oracle102010/database
$ ./runInstaller -ignoreSysPrereqs -record -destinationFile /home/oracle/software/oracle10gR2_linux/oracle102010/database/response/102010_ee.rsp
-
- OUI で以下の通り指定する
- Select Installation Type: Enterprise Edition
- Product Languages: English, Japanese
- Specify Home Details
- Name: OraDb10g_home1
- Path: /u01/app/oracle/product/10.2.0/db_1
- Select Configuration Option: Install databse Software only
- 最後に [Cancel] を押して終了する。
$ export LANG=C
$ export NLS_LANG=American.America_JA16EUC
$ ./runInstaller -silent -noconfig -responseFile /home/oracle/software/oracle10gR2_linux/oracle102010/database/response/102010_ee.rsp
WARNING:The following configuration scripts
/u01/app/oracle/product/10.2.0/db_1/root.sh
need to be executed as root for configuring the system. If you skip the exec
ution of the configuration tools, the configuration will not be complete and
the product wont function properly. In order to get the product to function
properly, you will be required to execute the scripts and the configuration
tools after exiting the OUI.
The installation of Oracle Database 10g was successful.
Please check '/u01/app/oracle/oraInventory/logs/silentInstall2009-10-08_02-27-42PM.log' for more details.
$ su -
Running Oracle10 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/10.2.0/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
PSR 10.2.0.4.0 を適用する
$ cd /home/oracle/software/oracle10gR2_linux
$ unzip p6810189_10204_Linux-x86.zip
$ mkdir psr102040
$ mv Disk1 psr102040/
$ mv README.html psr102040/
$ startx
$ export LANG=C
$ export NLS_LANG=American.America_JA16EUC
$ cd /home/oracle/software/oracle10gR2_linux/psr102040/Disk1
$ ./runInstaller -ignoreSysPrereqs -record -destinationFile /home/oracle/software/oracle10gR2_linux/oracle102010/database/response/102010_ee.rsp
-
- OUI で以下の通り指定する
- Specify Home Details
- Name: OraDb10g_home1
- Path: /u01/app/oracle/product/10.2.0/db_1
- 最後に [Cancel] を押して終了する
$ export LANG=C
$ export NLS_LANG=American.America_JA16EUC
$ ./runInstaller -silent -noconfig -responseFile /home/oracle/software/oracle10gR2_linux/psr102040/Disk1/response/102040_ee.rsp
End of install phases.(Thursday, October 8, 2009 9:48:56 PM JST)
WARNING:
The following configuration scripts need to be executed as the "root" user.
/u01/app/oracle/product/10.2.0/db_1/root.sh
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts
The installation of Oracle Database 10g Release 2 Patch Set 3 was successful.
Please check '/u01/app/oracle/oraInventory/logs/silentInstall2009-10-08_09-42-04PM.log' for more details.
$ su -
Running Oracle10 root.sh script...
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /u01/app/oracle/product/10.2.0/db_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The file "dbhome" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying dbhome to /usr/local/bin ...
The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying oraenv to /usr/local/bin ...
The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)
[n]: y
Copying coraenv to /usr/local/bin ...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root.sh script.
Now product-specific root actions will be performed.
$ vi ~/.bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export PATH=.:$ORACLE_HOME/bin:$PATH
export ORA_NLS10=$ORACLE_HOME/nls/data
export LD_LIBRARY_PATH=.:$ORACLE_HOME/lib:$LD_LIBRARY_PATH
export TNS_ADMIN=$ORACLE_HOME/network/admin
export NLS_LANG=American_America.JA16EUC
export ORACLE_SID=orcl
$ . ~/.bash_profile
データベースを作成する
$ mkdir -p $ORACLE_BASE/admin/orcl/scripts
$ mkdir -p $ORACLE_BASE/oradata/orcl
$ cat <<EOF > $ORACLE_HOME/dbs/initorcl.ora
control_files = (/u01/app/oracle/oradata/orcl/control01.ctl)
db_name = orcl
db_block_size = 8192
undo_management = AUTO
undo_tablespace = undotbs
compatible = 10.2.0
shared_pool_size = 100M
EOF
$ cat <<EOF > $ORACLE_BASE/admin/orcl/scripts/create_database.sql
CREATE DATABASE orcl
LOGFILE GROUP 1 ('/u01/app/oracle/oradata/orcl/redo01.log') SIZE 100M,
GROUP 2 ('/u01/app/oracle/oradata/orcl/redo02.log') SIZE 100M,
GROUP 3 ('/u01/app/oracle/oradata/orcl/redo03.log') SIZE 100M
MAXLOGFILES 5
MAXLOGMEMBERS 5
MAXLOGHISTORY 1
MAXDATAFILES 100
MAXINSTANCES 1
CHARACTER SET JA16EUC
NATIONAL CHARACTER SET AL16UTF16
DATAFILE '/u01/app/oracle/oradata/orcl/system01.dbf' SIZE 50M REUSE
AUTOEXTEND ON
SYSAUX DATAFILE '/u01/app/oracle/oradata/orcl/sysaux01.dbf' SIZE 50M REUSE
AUTOEXTEND ON
DEFAULT TEMPORARY TABLESPACE temp
TEMPFILE '/u01/app/oracle/oradata/orcl/temp01.dbf'
SIZE 20M REUSE
AUTOEXTEND ON
UNDO TABLESPACE undotbs
DATAFILE '/u01/app/oracle/oradata/orcl/undotbs01.dbf'
SIZE 50M REUSE AUTOEXTEND ON;
EOF
$ cd /u01/app/oracle/admin/orcl/scripts
$ export ORACLE_SID=orcl
$ sqlplus / as sysdba
SQL> spool create_database.log
SQL> startup nomount
SQL> @create_database
SQL> spool off
- 動的パフォーマンスビュー、データ・ディクショナリビューと標準PL/SQLパッケージを作成する。
SQL> spool build.log
SQL> @?/rdbms/admin/catalog
SQL> @?/rdbms/admin/catproc
- 一般ユーザーでSQL*Plusでデータベースに接続時にエラーメッセージが表示されないようSQL*Plusの製品情報を作成する。
SQL> conn system/manager
SQL> @?/sqlplus/admin/pupbld
SQL> spool off
SQL> create bigfile tablespace users datafile '/u01/app/oracle/oradata/orcl/user01.dbf' size 5m;
SQL> alter database default tablespace users;
SQL> alter database add logfile group 4('/u01/app/oracle/oradata/orcl/redo04.log') size 10m;
SQL> alter database add logfile member
'/u01/app/oracle/oradata/orcl/redo11.log' to group 1,
'/u01/app/oracle/oradata/orcl/redo12.log' to group 2,
'/u01/app/oracle/oradata/orcl/redo13.log' to group 3,
'/u01/app/oracle/oradata/orcl/redo14.log' to group 4;
SQL> shutdown immediate
SQL> exit
$ vi $ORACLE_HOME/dbs/initorcl.ora
control_files=(/u01/app/oracle/oradata/orcl/control01.ctl,/u01/app/oracle/oradata/orcl/control02.ctl,/u01/app/oracle/oradata/orcl/control03.ctl)
$ cd /u01/app/oracle/oradata/orcl
$ cp control01.ctl control02.ctl
$ cp control01.ctl control03.ctl
$ sqlplus / as sysdba
SQL> startup
SQL> create user scott identified by tiger
default tablespace users
temporary tablespace temp
quota unlimited on users;
SQL> grant create session, create table to scott;
SQL> create spfile from pfile='?/dbs/initorcl.ora';
SQL> shutdown immediate
SQL> quit
$ cd $ORACLE_HOME/dbs
$ mv initorcl.ora initorcl.ora.org
$ sqlplus / as sysdba
SQL> startup
SQL> show parameter spfile
NAME TYPE VALUE
spfile string /u01/app/oracle/product/10
.2.0/db_1/dbs/spfileorcl.ora