环境:Suse11 sp3 oracle 11gR2
suse:~ # free -m total used free shared buffers cached Mem: 1865 1788 77 0 14 1647 -/+ buffers/cache: 127 1738 Swap: 5241 0 5241 suse:~ # zypper sa file:///mnt/suse/x86_64 local suse:~ # zypper lr # | Alias | Name | Enabled | Refresh --+--------------------------------------------------+--------------------------------------------------+---------+-------- 1 | SUSE-Linux-Enterprise-Server-11-SP3 11.3.3-1.138 | SUSE-Linux-Enterprise-Server-11-SP3 11.3.3-1.138 | Yes | No suse:~ #
安装依赖包:
suse:~ # zypper install binutils libstdc++ gcc gcc-c++ glibc glibc-devel glibc-devel-32bit libaio libaio-devel libaio-devel-32bit libgcc libstdc++ libstdc++-devel make sysstat unixODBC unixODBC-devellibstdc++43-devel-32bit libcap1 libcap1-32bit gcc-32bit suse:~ # rpm -qa|grep libelf libelf1-0.152-4.7.86 libelf0-0.8.12-1.1.52 suse:~ # suse:~ # egrep -w oracle /etc/hosts 172.24.16.1 oracle suse:~ #
suse:~ # groupadd oinstall suse:~ # groupadd oper suse:~ # groupadd dba suse:~ # groupadd asmadmin suse:~ # groupadd asmoper suse:~ # groupadd asmdba suse:~ # useradd -g oinstall -G dba,asmdba,oper -d /home/oracle -m -s /bin/bash oracle suse:~ # useradd -g oinstall -G asmadmin,asmdba,asmoper,dba -d /home/grid -m -s /bin/bash grid suse:~ # passwd oracle suse:~ # passwd grid suse:~ # mkdir -p /data/app/oracle suse:~ # mkdir -p /data/app/grid suse:~ # chown grid:oinstall /data/ -R suse:~ # chown oracle:oinstall /data/app/oracle/ -R suse:~ # chmod 775 /data/ -R suse:~ # tail -n 12 /etc/security/limits.conf #for oracle oracle soft nproc 2047 oracle hard nproc 16384 oracle soft nofile 1024 oracle hard nofile 65536 oracle soft stack 10240 #for grid grid soft nproc 2047 grid hard nproc 16384 grid soft nofile 1024 grid hard nofile 65536 grid soft stack 10240 suse:~ # suse:~ # tail -n 1 /etc/pam.d/login session required pam_limits.so suse:~ # suse:~ # tail -n 12 /etc/sysctl.conf # fs.aio-max-nr = 1048576 fs.file-max = 6815744 kernel.shmall = 2097152 kernel.shmmax = 4294967295 kernel.shmmni = 4096 kernel.sem = 250 32000 100 128 net.ipv4.ip_local_port_range = 9000 65500 net.core.rmem_default = 262144 net.core.rmem_max = 4194304 net.core.wmem_default = 262144 net.core.wmem_max = 1048576 suse:~ # sysctl -p
suse:~ # su - oracle [email protected]:~> tail -n 6 .profile export ORACLE_BASE=/data/app/oracle export ORACLE_SID=oracle export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1 export LD_LIBARY_PATH=$ORACLE_HOME/lib export PATH=$ORACLE_HOME/bin:$PATH umask 022 [email protected]:~> urce .profile oracle:~> echo $ORACLE_BASE /data/app/oracle [email protected]:~> echo $ORACLE_HOME /data/app/oracle/product/11.2.0/db_1 suse:~ # su - grid [email protected]:~> tail -n 6 .profile export ORACLE_BASE=/data/app/grid export ORACLE_SID=+ASM export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/grid export LD_LIBRARY_PATH=$ORACLE_HOME/lib export PATH=$ORACLE_HOME/bin:$PATH umask 022 [email protected]:~> source .profile [email protected]:~> echo $ORACLE_BASE /data/app/grid [email protected]:~> echo $ORACLE_HOME /data/app/grid/product/11.2.0/grid [email protected]:~>
给suse11添加5块磁盘做ASM+FRA
suse:~ # fdisk /dev/sdb suse:~ # fdisk /dev/sdc suse:~ # fdisk /dev/sdd suse:~ # fdisk /dev/sde suse:~ # fdisk /dev/sdf suse:~ # partprobe /dev/sd{b..f} suse:~ # cat /proc/partitions major minor #blocks name 8 0 52428800 sda 8 1 2095104 sda1 8 2 3148800 sda2 8 3 31455232 sda3 8 4 1 sda4 8 5 15718400 sda5 8 16 20971520 sdb 8 17 20970496 sdb1 8 32 20971520 sdc 8 33 20970496 sdc1 8 48 20971520 sdd 8 49 20970496 sdd1 8 64 20971520 sde 8 65 20970496 sde1 8 80 20971520 sdf 8 81 20970496 sdf1 suse:~ #
制作ASM磁盘:
http://www.oracle.com/technetwork/server-storage/linux/asmlib/index-101839.html
oracleasm:http://yunpan.cn/cj7aKYaNpYfG5 访问密码 2405
suse:/software # ls |grep oracleasm oracleasm-support-2.1.8-1.el5.x86_64.rpm oracleasmlib-2.0.4-1.el5.x86_64.rpm suse:/software # zypper install oracleasm-support-2.1.8-1.el5.x86_64.rpm oracleasmlib-2.0.4-1.el5.x86_64.rpm
suse:/software # /etc/init.d/oracleasm createdisk DISK1 /dev/sdb1 Marking disk "DISK1" as an ASM disk: done suse:/software # /etc/init.d/oracleasm createdisk DISK2 /dev/sdc1 Marking disk "DISK2" as an ASM disk: done suse:/software # /etc/init.d/oracleasm createdisk DISK3 /dev/sdd1 Marking disk "DISK3" as an ASM disk: done suse:/software # /etc/init.d/oracleasm createdisk DISK4 /dev/sde1 Marking disk "DISK4" as an ASM disk: done suse:/software # /etc/init.d/oracleasm createdisk DISK5 /dev/sdf1 Marking disk "DISK5" as an ASM disk: done suse:/software # /etc/init.d/oracleasm listdisks DISK1 DISK2 DISK3 DISK4 DISK5 suse:/software #
安装grid:
suse:/software # unzip linux.x64_11gR2_grid.zip suse:/software # cd grid/ suse:/software/grid # xhost + access control disabled, clients can connect from any host suse:/software/grid # 切换到grid用户登录,而不是su - grid [email protected]:~> cd /software/grid/ [email protected]:/software/grid> ./runInstaller Starting Oracle Universal Installer...
suse:~ # /data/app/oraInventory/orainstRoot.sh Changing permissions of /data/app/oraInventory. Adding read,write permissions for group. Removing read,write,execute permissions for world. Changing groupname of /data/app/oraInventory to oinstall. The execution of the script is complete. suse:~ # /data/app/grid/product/11.2.0/grid/root.sh Running Oracle 11g root.sh script... The following environment variables are set as: ORACLE_OWNER= grid ORACLE_HOME= /data/app/grid/product/11.2.0/grid Enter the full pathname of the local bin directory: [/usr/local/bin]: y Creating y directory... Copying dbhome to y ... Copying oraenv to y ... Copying coraenv to y ... 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. 2015-05-18 23:11:07: Checking for super user privileges 2015-05-18 23:11:07: User has super user privileges 2015-05-18 23:11:07: Parsing the host name Using configuration parameter file: /data/app/grid/product/11.2.0/grid/crs/install/crsconfig_params Creating trace directory -bash: /bin/env: No such file or directory LOCAL ADD MODE Creating OCR keys for user ‘grid‘, privgrp ‘oinstall‘.. Operation successful. CRS-4664: Node suse successfully pinned. Adding daemon to inittab CRS-4123: Oracle High Availability Services has been started. ohasd is starting ADVM/ACFS is not supported on SUSE suse 2015/05/18 23:11:37 /data/app/grid/product/11.2.0/grid/cdata/suse/backup_20150518_231137.olr Successfully configured Oracle Grid Infrastructure for a Standalone Server Updating inventory properties for clusterware Starting Oracle Universal Installer... Checking swap space: must be greater than 500 MB. Actual 5236 MB Passed The inventory pointer is located at /etc/oraInst.loc The inventory is located at /data/app/oraInventory ‘UpdateNodeList‘ was successful.
创建FRA磁盘组:
[email protected]:~> asmca
安装数据库:
suse:/software # unzip linux.x64_11gR2_database_1of2.zip && unzip linux.x64_11gR2_database_2of2.zip
用oracle用户登录:
[email protected]:~> cd /software/database/ [email protected]:/software/database> ./runInstaller
suse:~ # /data/app/grid/product/11.2.0/dbhome_1/root.sh Running Oracle 11g root.sh script... The following environment variables are set as: ORACLE_OWNER= grid ORACLE_HOME= /data/app/grid/product/11.2.0/dbhome_1 Enter the full pathname of the local bin directory: [/usr/local/bin]: y Creating y directory... Copying dbhome to y ... Copying oraenv to y ... Copying coraenv to y ... 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. Finished product-specific root actions. suse:~ #
建库:
用Oracle用户登录,非su -
oracle
[email protected]:/software/database> dbca
网速不好,正在一点点上传ing
时间: 2024-10-28 12:05:18