admin 管理员组

文章数量: 887021


2024年1月15日发(作者:类风湿因子正常能排除类风湿吗)

1 Oracle Enterprise Linux6.3下安装Oracle11g Grid ASM

1.1 查看版本信息

cat /etc/redhat-release

uname -a

1.2 添加Oracle用户

useradd oracle -u 600

useradd grid -u 601

1.3 添加Oracle用户组

groupadd -g 1000 oinstall

groupadd -g 1001 dba

groupadd -g 1002 oper

groupadd -g 1003 asmadmin

groupadd -g 1004 asmoper

groupadd -g 1005 asmdba

groupadd -g 1006 orauser

1.4 修改Oracle用户所属组

usermod -g oinstall -G dba,asmdba oracle

usermod -g oinstall -G dba,asmdba,oper,oinstall,asmadmin grid

1.5 设置密码

passwd oracle (oracle)

passwd grid (grid)

1.6 创建目录

mkdir /u01

mkdir -p /u01/soft(存放grid和数据库软件)

mkdir -p /u01/app/oracle

mkdir -p /u01/app/oraInventory

mkdir -p /u01/app/oracle/product/11.2.0/grid

mkdir -p /u01/app/oracle/product/11.2.0/db_1

1.7 解压缩安装文件

Grid文件:

unzip /mnt/hgfs/SoftWare/oracle11g_linux64_11.2.0.3.0/p10404530_112030_Linux-x86-64_

1.8 设置目录所有者

chown -R oracle:oinstall /u01

chown -R grid:oinstall /u01/soft/grid

chown -R oracle:oinstall /u01/app/oracle

chown -R grid:oinstall /u01/app/oraInventory

chown -R grid:oinstall /u01/app/oracle/product/11.2.0/grid

chown -R oracle:oinstall /u01/app/oracle/product/11.2.0/db_1

1.9 更改文件权限

chmod -R 775 /u01/soft/grid

chmod -R 775 /u01/app/oracle/product/11.2.0/grid

chmod -R 775 /u01/app/oracle/product/11.2.0/db_1

chmod -R 775 /u01/app/oraInventory

1.10 查看安装的包

rpm -qa binutils

rpm -q compat-libstdc++-33(rpm -qa compat-libstdc++*)

rpm -qa | grep compat-

rpm -qa | grep elfutils

rpm -qa gcc

rpm -qa gcc-c++

rpm -qa glibc

rpm -qa glibc-common

rpm -qa glibc-devel

rpm -qa libaio

rpm -qa libaio-devel(需要安装)

rpm -qa libgcc

rpm -qa libstdc++

rpm -qa libstdc++-devel

rpm -qa make

rpm -qa sysstat

rpm -qa unixODBC

rpm -q binutils compat-libstdc++-33 elfutils-libelf elfutils-libelf-devel gcc gcc-c++ glibc

glibc-common glibc-devel

rpm -q glibc-headers ksh libaio libaio-devel libgcc libstdc++ libstdc++-devel make

numactl-devel sysstat

1.11 安装缺少的包

下载:

1、

2、 6.x86_

3、 6.x86_

放到: K:SoftWareOracleEnterpriseLinux6.3rpm下

cd /mnt/hgfs/SoftWare/OracleEnterpriseLinux6.3/rpm

4、执行

rpm -Uvh 6.x86_

rpm -Uvh 6.x86_

rpm -Uvh 6.x86_

1.12 修改系统用户资源权限

vi /etc/profile,增加:

#oracle

if [ $USER = "oracle" ] || [ $USER = "grid" ]; then

if [ $SHELL = "/bin/ksh" ]; then

ulimit -p 16384

ulimit -n 65536

else

ulimit -u 16384 -n 65536

fi

umask 022

fi

1.13 设置内核参数

1.13.1修改

vi /etc/,添加:

# = 2097152(已有)

# = 2147483648(已有)

= 4096

= 250 32000 100 128

_default = 262144

_max = 4194304

_default = 262144

_max = 1048576

_local_port_range = 9000 65500

_dumpable = 1

-max = 6815744

-max-nr = 1048576

1.13.2查看内核参数

/sbin/sysctl -a | grep -max-nr

1.13.3使内核参数生效

/sbin/sysctl -p

1.14 修改oracle 用户shell 限制

vi /etc/security/,增加:

#add by lcs for oracle

grid soft nproc 2047

grid hard nproc 16384

grid soft nofile 1024

grid hard nofile 65536

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

1.15 oracle用户限制,登录

vi /etc/pam.d/login

#add by lcs for oracle

session required pam_

1.16 设置磁盘配置策略

vi /etc/sysconfig/selinux

#modify by lcs for oracle

#old SELINUX=enforcing

SELINUX=disabled

1.17 重新启动系统

reboot

1.18 Oracle asm设置

1.18.1下载oracle asm安装文件

位置:K:SoftWareOracleEnterpriseLinux6.3rpm

1、 6.x86_;

2、 6.x86_

1.18.2安装

cd /mnt/hgfs/SoftWare/OracleEnterpriseLinux6.3/rpm

3、 rpm –Uvh 6.x86_

4、 rpm –Uvh 6.x86_

1.18.3oracleasm配置

5、 配置: /etc/init.d/oracleasm configure

信息:

Default user to own the driver interface [grid]: grid

Default group to own the driver interface [dba]: asmadmin

Start Oracle ASM library driver on boot (y/n) [y]:

Scan for Oracle ASM disks on boot (y/n) [y]:

Writing Oracle ASM library driver configuration: done

Initializing the Oracle ASMLib driver:

Scanning the system for Oracle ASMLib disks:

[ OK ]

[ OK ]

1.18.4通过vmware增加磁盘

1、 增加磁盘:在vmware中settings下通过:hareware-add disk,增加2个10g的磁盘分区

1.18.5 创建分区

2、 通过:fdisk –l看到Disk /dev/sdb: 10.7 GB;Disk /dev/sdc: 10.7 GB

3、 创建分区1:fdisk /dev/sdb

[root@localhost ~]# fdisk /dev/sdb

Command (m for help): n

Command action

e extended

p primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-1305, default 1):

Using default value 1

Last cylinder, +cylinders or +size{K,M,G} (1-1305, default 1305):

Using default value 1305

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

4、 创建分区2:fdisk /dev/sdc

fdisk /dev/sdc

[root@localhost ~]# fdisk /dev/sdc

Command (m for help): n

Command action

e extended

p primary partition (1-4)

p

Partition number (1-4): 1

First cylinder (1-1305, default 1):

Using default value 1

Last cylinder, +cylinders or +size{K,M,G} (1-1305, default 1305):

Using default value 1305

Command (m for help): w

The partition table has been altered!

Calling ioctl() to re-read partition table.

Syncing disks.

1.18.6 创建asm卷

/etc/init.d/oracleasm createdisk asm_lv1 /dev/sdb1

/etc/init.d/oracleasm createdisk asm_lv2 /dev/sdb2

都提示:

Marking disk "asm_lv1" as an ASM disk:

/etc/init.d/oracleasm scandisks

1.18.7 查看oracleasm日志

创建工程中若出错看日志:

tail -f /var/log/oracleasm

more /var/log/oracleasm

1.19 配置ip地址和主机名

1、设置ip地址

vi /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE="eth0"

#modify by lcs for oracle

#old BOOTPROTO="dhcp"

BOOTPROTO=static

ONBOOT="yes"

IPADDR=192.168.2.101

NETMASK=255.255.255.0

GATEWAY=192.168.2.1

HWADDR="00:0C:29:33:E9:23"

NM_CONTROLLED="yes"

#old ONBOOT="no"

TYPE="Ethernet"

UUID="6777b2c9-5fd6-48be-a5cf-53169427b6b2"

2、修改主机名

vi /etc/sysconfig/network

#modify by lcs for oracle

#old HOSTNAME=omain

HOSTNAME=oraclerac1

[ OK ]

3.修改hosts文件

vi /etc/hosts

#modify by lcs for oracle

192.168.2.101 oraclerac1

127.0.0.1 localhost omain localhost4 omain4

#old ::1 localhost omain localhost6 omain6

1.20 配置grid用户环境变量

进入gird用户:su – grid

vi .bash_profile

#add by lcs for oracle

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/grid

export ORACLE_SID=+ASM

export PATH=$ORACLE_HOME/bin:$PATH

export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib:/lib:/usr/lib:/usr/local/lib

export TMP=/tmp

export CLASSPATH=$CLASSPATH:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib

1.21 安装grid

1.21.1 切换到root

su –

xhost +

1.21.2 设置当前运行环境变量

Su - grid

export DISPLAY=:0.0

export LANG=en_-8

1.21.3 执行安装

Cd /u01/soft/grid

./runInstaller

1.21.4 设置口令

sys/asmsnmp口令=oracle

1.21.5 执行

在root用户下:

Su - root

/u01/app/oraInventory/

提示信息:

Changing permissions of /u01/app/oraInventory.

Adding read,write permissions for group.

Removing read,write,execute permissions for world.

Changing groupname of /u01/app/oraInventory to oinstall.

The execution of the script is complete.

/u01/app/oracle/product/11.2.0/grid/

Performing root user operation for Oracle 11g

The following environment variables are set as:

ORACLE_OWNER= grid

ORACLE_HOME= /u01/app/oracle/product/11.2.0/grid

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/

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 script.

Now product-specific root actions will be performed.

Using configuration parameter file:

执行:

/u01/app/oracle/product/11.2.0/grid/crs/install/crsconfig_params

提示信息:

Creating trace directory

LOCAL ADD MODE

Creating OCR keys for user 'grid', privgrp 'oinstall'..

Operation successful.

LOCAL ONLY MODE

Successfully accumulated necessary OCR keys.

Creating OCR keys for user 'root', privgrp 'root'..

Operation successful.

CRS-4664: Node oraclerac1 successfully pinned.

Adding Clusterware entries to upstart

oraclerac1 2012/10/06 20:12:51

/u01/app/oracle/product/11.2.0/grid/cdata/oraclerac1/backup_20121006_

Successfully configured Oracle Grid Infrastructure for a Standalone Server

1.21.6 安装成功验证

su –grid

sqlplus / as sysasm

select name,state from v$asm_diskgroup;

1.21.7 安装日志查看

/u01/app/oraInventory/logs/installActions2012-10-06_


本文标签: 用户 设置 安装 查看 修改