CentOS5.3
- CDドライブにインストールCDを挿入して再起動する。
- F12 を押して、CDドライブから起動する。
boot: <Enter>
- To begin testing the CD media before installation press OK.: Skip
- What language would you like to use during the installation process?: English
- Select the appropriate keyboard for the system: Japanese
- Installation requires partitioning of ...: Create custom layout
mount point |
size |
/ |
10GB |
/var |
10GB |
/usr |
5GB |
swap |
4GB |
/usr/local |
2GB |
/tmp |
2GB |
/u01 |
残り |
- The GRUB boot loader will be installed on /dev/sda.
Default |
Label |
Device |
checked |
CentOS |
/dev/sda1 |
Active on Boot |
Device |
Ipv4/Netmask |
IPv6/Prefix |
checked |
eth0 |
192.168.xxx.4/23 |
Auto |
- Hostname
- manually: db01-sec2.xxx.xxx.xxx
- Miscellaneous Settings
- Gateway: 192.168.0.254
- Primary DNS: xxx.xxx.xxx.xxx
- Please click into the map to choose a region: Asia/Tokyo
- System clock use UTC: checked
- Root Password: ********
- The default installation of CentOS includes a set of ...
- Please select any additional ...
- Package from CentOS Extras: not checked
- You can further customize ...: Customize later
- Firewall: Disabled
- SELinux Setting: Disabled
- Network Time Protocol
- Enable Network Time Protocol: checked
- NTP Servers
0.centos.pool.ntp.org
1.centos.pool.ntp.org
2.centos.pool.ntp.org
- Create User
- Username: neo
- Password: matrix
- ランレベルを 3 にする。
id:3:initdefault:
Oracle10gR2
ハードウェア要件の確認
- スワップ領域が物理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
- 以下のパッケージがインストールされていることを確認する。
egrep "binutils|compat-libstdc++-33|elfutils-libelf|gcc|glibc|libaio|libgcc|libstdc++|make|sysstat|unixODBC"|sort
-
- 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
設定いろいろ
- カーネルパラメータの設定
- kernel.shmmax は物理RAMの半分の512MBにする。
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 1024 65000
net.core.rmem_default = 1048576
net.core.rmem_max = 1048576
net.core.wmem_default = 262144
net.core.wmem_max = 262144
- I/O スケジューラを deadline に設定する
kernel ... elevator=deadline
LABEL=/u01 /u01 ext3 defaults,noatime,data=writeback 1 2
Maximum mount count: -1
Check interval: 0 (<none>)
Maximum mount count: -1
Check interval: 0 (<none>)
...
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)
ネットワーク設定の確認
- /etc/hostsファイルが名前解決に使用されることを確認する。
hosts: files dns
- hostname コマンドを実行するとホスト名が表示されることを確認する。
centos51
- ドメイン名が動的に設定されていないことを確認する。
(none)
192.168.0.4 db01-sec2.xxxxx.xxxxx.co.jp db01-sec2
- hosts に完全修飾ホスト名が含まれていることを確認する。
127.0.0.1 db01-sec2.xxxx.xxxx.co.jp db01-sec2 localhost.localdomain localhost
192.168.138.4 db01-sec2.xxxx.xxxx.co.jp db01-sec2
サイレント・モードでインストールする
- ここでVMwareのスナップショットをとっておく。
- oraInst.loc を作成する。
$ su -
inventory_loc=/u01/app/oracle/oraInventory
inst_group=oinstall
- Oracle10gR2(10.2.0.1) EE をサイレント・インストールする。
$ mkdir -p /u01/app/oracle/software/oracle10gR2_linux/102010
$ cd /u01/app/oracle/software/oracle10gR2_linux/102010
$ ls|xargs -n1 unzip
$ wget http://github.com/yoheia/yoheia/raw/master/oracle/response/102010_ee.rsp
$ vi 102010_ee.rsp
FROM_LOCATION="/u01/app/oracle/software/oracle10gR2_linux/102010/database/stage/products.xml"
$ cd database
$ export LANG=C
$ export NLS_LANG=American_America.JA16SJISTILDE
$ ./runInstaller -silent -noconfig -responseFile /u01/app/oracle/software/oracle10gR2_linux/102010/102010_ee.rsp
$ su -
$ cd /u01/app/oracle/software/oracle10gR2_linux/102040
$ unzip p6810189_10204_Linux-x86.zip
$ wget http://github.com/yoheia/yoheia/raw/master/oracle/response/102040_ee.rsp
$ vi 102040_ee.rsp
FROM_LOCATION="/u01/app/oracle/software/oracle10gR2_linux/102040/Disk1/stage/products.xml"
$ cd Disk1
$ export LANG=C
$ export NLS_LANG=American_America.JA16SJISTILDE
$ ./runInstaller -silent -noconfig -responseFile /u01/app/oracle/software/oracle10gR2_linux/102040/102040_ee.rsp
$ su -
$ 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.JA16SJISTILDE
export ORACLE_SID=orcl
$ . ~/.bash_profile
$ su - oracle
$ export ORACLE_BASE=/u01/app/oracle
$ export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
$ export ORACLE_SID=orcl
$ mkdir -p ${ORACLE_BASE}/oradata/${ORACLE_SID}
$ mkdir -p ${ORACLE_BASE}/admin/${ORACLE_SID}/{adump,bdump,cdump,dpdump,pfile,udump,scripts}
$ mkdir -p ${ORACLE_HOME}/cfgtoollogs/dbca/${ORACLE_SID}
$ mkdir -p ${ORACLE_HOME}/dbs
$ cd /u01/app/oracle/admin/orcl/scripts
$ wget -r -np -nd --cut-dirs=6 http://...
$ perl -i -ple 's/\/opt\/app\/oracle/\/u01\/app\/oracle/g' *
$ chmod 744 orcl.sh
$ ./orcl.sh exec
$ lsnrctl start
$ sqlplus / as sysdba
SQL> alter system register;
SQL> exit
$ /u01/app/oracle/product/10.2.0/db_1/bin/emctl stop dbconsole
$ /u01/app/oracle/product/10.2.0/db_1/bin/emctl config emkey -repos -sysman_pwd manager
$ /u01/app/oracle/product/10.2.0/db_1/bin/emctl secure dbconsole -sysman_pwd manager
$ /u01/app/oracle/product/10.2.0/db_1/bin/emctl start dbconsole
$ cd /u01/app/oracle/admin/orcl/scripts
$ nohup sqlplus / as sysdba @add_datafiles.sql &
orcl:/u01/app/oracle/product/10.2.0/db_1:Y
ORATAB=/etc/oratab
ORACLE_HOME=`awk -F: '/^[^#:]+:.+:[Y]$/ { print $2; exit}' $ORATAB`
if [ x$ORACLE_HOME = "x" ]; then
echo "There is not Y entry in $ORATAB."
exit 1
fi
ORACLE=`ls -l $ORACLE_HOME/bin/dbstart | awk '{print $3}'`
PATH=${PATH}:$ORACLE_HOME/bin
export ORACLE_HOME PATH
case $1 in
'start')
su - $ORACLE -c "$ORACLE_HOME/bin/dbstart"
su - $ORACLE -c "$ORACLE_HOME/bin/lsnrctl start"
;;
'stop')
su - $ORACLE -c "$ORACLE_HOME/bin/lsnrctl stop"
su - $ORACLE -c "$ORACLE_HOME/bin/dbshut"
;;
*)
echo "usage: $0 {start|stop}"
exit
;;
esac
exit
- ノーアーカイブログ・モードにして、初期化パラメータも変更する。
$ sqlplus / as sysdba
SQL> alter system set log_checkpoint_interval=999999999 scope=both;
SQL> create pfile from spfile;
SQL> exit
$ vi $ORACLE_HOME/dbs/initorcl.ora
*.pga_aggregate_target=2G
...
*.sga_max_size=2400M
*.sga_target=2400M
SQL> shutdown immediate
SQL> startup mount pfile='initorcl.ora'
SQL> create spfile from pfile;
SQL> alter databace noarchivelog;
SQL> alter database open;