中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

發布時間:2020-08-05 09:45:07 來源:ITPUB博客 閱讀:184 作者:zheng_jinlong1 欄目:關系型數據庫
  1. DG 機器配置

 

本文文檔結構:

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

這一步的DG機器配置就相當于安裝單實例的DB+ASM 一樣,這里我把之前的文檔內容直接拷貝過來了,也不做過多的解釋了

 

  1. 安裝之前的配置工作

 

  1. 檢查硬件

在正式安裝開始前,請先檢查你的軟硬件條件是否滿足安裝需要。

硬件上可以使用命令查看內存情況和 CPU 特性:

#more /proc/meminfo

#more /proc/cpuinfo

其中內存的要求是不低于 1G

下面的不是必須的,可選使用

#df –k /dev/shm 檢查共享內存

#df –k /tmp 檢查臨時磁盤空間

#more /proc/version 檢查操作系統版本

#uname –r 檢查內核版本

 

內存

# grep MemTotal /proc/meminfo

交換空間

# grep SwapTotal /proc/meminfo

磁盤空間

# df -ah

# free

#free -m

 

  1. 安裝軟件包檢查

 

可以統一檢查:

rpm -q binutils \

compat-libstdc++-33 \

elfutils-libelf \

gcc \

gcc-c++ \

glibc \

glibc-common \

glibc-devel \

glibc-headers \

ksh \

libaio \

libaio-devel \

libgomp \

libgcc \

libstdc++ \

libstdc++-devel \

make \

sysstat \

unixODBC \

unixODBC-devel \

numactl-devel

 

我們可以看到沒有安裝過的包會已is not installed 出現:

[root@rhel6_lhr ~]# rpm -q binutils \

> compat-libstdc++-33 \

> elfutils-libelf \

> gcc \

> gcc-c++ \

> glibc \

> glibc-common \

> glibc-devel \

> glibc-headers \

> ksh \

> libaio \

> libaio-devel \

> libgomp \

> libgcc \

> libstdc++ \

> libstdc++-devel \

> make \

> sysstat \

> unixODBC \

> unixODBC-devel \

> numactl-devel

binutils-2.20.51.0.2-5.36.el6.x86_64

compat-libstdc++-33-3.2.3-69.el6.x86_64

compat-libstdc++-33-3.2.3-69.el6.i686

elfutils-libelf-0.152-1.el6.x86_64

gcc-4.4.7-4.el6.x86_64

gcc-c++-4.4.7-4.el6.x86_64

glibc-2.12-1.132.el6.x86_64

glibc-common-2.12-1.132.el6.x86_64

glibc-devel-2.12-1.132.el6.x86_64

glibc-headers-2.12-1.132.el6.x86_64

package ksh is not installed

libaio-0.3.107-10.el6.x86_64

libaio-devel-0.3.107-10.el6.x86_64

libaio-devel-0.3.107-10.el6.i686

libgomp-4.4.7-4.el6.x86_64

libgcc-4.4.7-4.el6.x86_64

libstdc++-4.4.7-4.el6.x86_64

libstdc++-devel-4.4.7-4.el6.x86_64

libstdc++-devel-4.4.7-4.el6.i686

make-3.81-20.el6.x86_64

sysstat-9.0.4-22.el6.x86_64

unixODBC-2.2.14-12.el6_3.x86_64

unixODBC-2.2.14-12.el6_3.i686

unixODBC-devel-2.2.14-12.el6_3.i686

unixODBC-devel-2.2.14-12.el6_3.x86_64

package numactl-devel is not installed

[root@rhel6_lhr ~]#

   

如果部分包不存在

可以批量更新安裝,但如果依賴關系缺失,可能需要多執行兩遍

或者手工調整

 

 

  1. 修改主機名

永久生效:

[root@zijuan /]# vim /etc/sysconfig/network

NETWORKING=yes

NETWORKING_IPV6=yes

HOSTNAME=dg

 

注意:修改主機名后,需要重啟系統后生效,或者切換個用戶然后切換回來就OK

 

 

查看/etc/hosts文件中必須包含a fully qualified name for the server

 [root@localhost lhr]# cat /etc/hosts

127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4

::1 localhost localhost.localdomain localhost6 localhost6.localdomain6

192.168.59.140 dg

[root@localhost lhr]# hostname dg

[root@localhost lhr]# hostname

dg

 

  1. 磁盤準備

 

這里為了節省空間,我們采用dd命令來faking 5塊裸設備磁盤

 

1塊硬盤安裝操作系統

234塊用于實現ASM 存儲數據

5塊硬盤用于存儲FRA

 

 

------------------------ 直接貼腳本,root用戶下執行

mkdir /asmdisk

dd if=/dev/zero of=/asmdisk/disk1 bs=1024k count=2000

dd if=/dev/zero of=/asmdisk/disk2 bs=1024k count=2000

dd if=/dev/zero of=/asmdisk/disk3 bs=1024k count=2000

dd if=/dev/zero of=/asmdisk/disk4 bs=1024k count=2000

dd if=/dev/zero of=/asmdisk/disk5 bs=1024k count=2000

 

/sbin/losetup /dev/loop1 /asmdisk/disk1

/sbin/losetup /dev/loop2 /asmdisk/disk2

/sbin/losetup /dev/loop3 /asmdisk/disk3

/sbin/losetup /dev/loop4 /asmdisk/disk4

/sbin/losetup /dev/loop5 /asmdisk/disk5

 

raw /dev/raw/raw1 /dev/loop1

raw /dev/raw/raw2 /dev/loop2

raw /dev/raw/raw3 /dev/loop3

raw /dev/raw/raw4 /dev/loop4

raw /dev/raw/raw5 /dev/loop5

 

chmod 660 /dev/raw/raw1

chmod 660 /dev/raw/raw2

chmod 660 /dev/raw/raw3

chmod 660 /dev/raw/raw4

chmod 660 /dev/raw/raw5

chown oracle:dba /dev/raw/raw1

chown oracle:dba /dev/raw/raw2

chown oracle:dba /dev/raw/raw3

chown oracle:dba /dev/raw/raw4

chown oracle:dba /dev/raw/raw5

 

------ 將以下內容添加到文件/etc/rc.local文件中

------Add the following entries to the file "/etc/rc.local"

/sbin/losetup /dev/loop1 /asmdisk/disk1

/sbin/losetup /dev/loop2 /asmdisk/disk2

/sbin/losetup /dev/loop3 /asmdisk/disk3

/sbin/losetup /dev/loop4 /asmdisk/disk4

/sbin/losetup /dev/loop5 /asmdisk/disk5

 

raw /dev/raw/raw1 /dev/loop1

raw /dev/raw/raw2 /dev/loop2

raw /dev/raw/raw3 /dev/loop3

raw /dev/raw/raw4 /dev/loop4

raw /dev/raw/raw5 /dev/loop5

 

chmod 660 /dev/raw/raw1

chmod 660 /dev/raw/raw2

chmod 660 /dev/raw/raw3

chmod 660 /dev/raw/raw4

chmod 660 /dev/raw/raw5

chown oracle:dba /dev/raw/raw1

chown oracle:dba /dev/raw/raw2

chown oracle:dba /dev/raw/raw3

chown oracle:dba /dev/raw/raw4

chown oracle:dba /dev/raw/raw5

 

 

 

如果需要刪除的話,刪除命令:

losetup –d /dev/loop1

losetup –d /dev/loop1

......

 

 

 

查看結果:

 

[root@dg ~]# ll /dev/raw/raw*

crw-rw---- 1 oracle dba 162, 1 Oct 9 16:35 /dev/raw/raw1

crw-rw---- 1 oracle dba 162, 2 Oct 9 16:35 /dev/raw/raw2

crw-rw---- 1 oracle dba 162, 3 Oct 9 16:35 /dev/raw/raw3

crw-rw---- 1 oracle dba 162, 4 Oct 9 16:35 /dev/raw/raw4

crw-rw---- 1 oracle dba 162, 5 Oct 9 16:35 /dev/raw/raw5

crw-rw---- 1 root disk 162, 0 Oct 5 15:42 /dev/raw/rawctl

[root@dg ~]#

 

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

 

 

更多請參考:

E:\云盤\資料盤\李華榮(個人整理)\oracle-linux\asmdisk_創建asm磁盤.sql

 

 

  1. 配置目錄、用戶等

 

  1. 配置用戶及用戶組

利用 /usr/sbin/groupadd 命令

 

------這里Oracle用戶可能已經安裝過的,沒有影響:

代碼:

groupadd oinstall

groupadd dba

groupadd oper

groupadd asmadmin

groupadd asmoper

groupadd asmdba

 

--添加用戶到組

useradd -g oinstall -G dba,asmdba,oper,asmadmin oracle

useradd -g oinstall -G asmadmin,asmdba,asmoper,dba grid

 

--修改密碼

passwd oracle

passwd grid

 

echo oracle | passwd --stdin lhr

echo grid | passwd --stdin lhr

 

---查看屬主

[root@rhel_linux_asm ~]# id oracle

uid=501(oracle) gid=502(dba) groups=502(dba),501(oinstall),504(asmadmin),506(asmdba)

[root@rhel_linux_asm ~]# id grid

uid=502(grid) gid=501(oinstall) groups=501(oinstall),502(dba),504(asmadmin),505(asmoper),506(asmdba)

[root@rhel_linux_asm ~]#

  1. 創建目錄并且配置 grid 和 oracle 用戶的配置文件

代碼:

--root用戶下:

mkdir -p /u01/app/oracle

mkdir -p /u01/app/grid

mkdir -p /u01/app/11.2.0/grid

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

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

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

chmod -R 775 /u01

 

mkdir -p /u01/app/oraInventory

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

chmod -R 775 /u01/app/oraInventory

 

 

--------Oracle User----切換到Oracle用戶下------

[root@rhel_linux_asm ~]# su - oracle

[grid@rhel_linux_asm ~]$ vi ~/.bash_profile

export ORACLE_SID=phydb

export ORACLE_BASE=/u01/app/oracle

export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1

export LD_LIBRARY_PATH=$ORACLE_HOME/lib

export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"

export TMP=/tmp

export TMPDIR=$TMP

export PATH=$PATH:$ORACLE_HOME/bin

 

 

export GLOBAL_DB_UNIQUE_NAME=phydb

export ORACLE_HOSTNAME=192.168.59.140

export ORACLE_UNQNAME=phydb

 

 

 

export ORACLE_ALERT=$ORACLE_BASE/diag/rdbms/$ORACLE_UNQNAME/$ORACLE_SID/trace

alias sqlplus='rlwrap sqlplus'

alias rman='rlwrap rman'

alias asmcmd='rlwrap asmcmd'

alias alert_log='tail -200f $ORACLE_ALERT/alert_$ORACLE_SID.log'

alias alert_listener='tail -200f $ORACLE_BASE/diag/tnslsnr/rhel6/listener/trace/listener.log'

 

 

--------Grid User-----切換到grid用戶下-----

 

cd /home/grid

vim .bash_profile

export ORACLE_SID=+ASM

export ORACLE_BASE=/u01/app/grid

export ORACLE_HOME=/u01/app/11.2.0/grid

export LD_LIBRARY_PATH=$ORACLE_HOME/lib

export NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"

export PATH=$ORACLE_HOME/bin:$PATH

 

alias sqlplus='rlwrap sqlplus'

alias asmcmd='rlwrap asmcmd'

alias alert_log='tail -200f $ORACLE_BASE/diag/asm/+asm/$ORACLE_SID/trace/alert_$ORACLE_SID.log'

 

修改完成后執行 source .bash_profile 讓設置生效

  1. 系統內核參數修改

    1. 編輯 /etc/security/limits.conf 文件,在文件尾部添加如下內容:

[root@localhost ~]# tail -8 /etc/security/limits.conf

# add by lhr for oracle and grid on 2014-05-02

oracle soft nproc 2047

oracle hard nproc 16384

oracle soft nofile 1024

oracle hard nofile 65536

grid soft nproc 2047

grid hard nproc 16384

grid soft nofile 1024

grid hard nofile 65536

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

  1. 編輯 /etc/pam.d/login 文件,在文件尾部添加如下內容:

[root@localhost ~]# tail -1 /etc/pam.d/login

session required pam_limis.so

[root@localhost ~]#

  1. 編輯 /etc/profile 文件,設置 shell 限制,在文件尾部添加如下內容:

[root@localhost ~]# tail -9 /etc/profile

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. /etc/sysctl.conf

Configuring Kernel Parameters for Linux

 

vim /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

 

生效

# /sbin/sysctl -p

 

 

  1. 備庫安裝grid軟件

安裝GridInfrastructure:

 

 

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

  1. 創建ASM磁盤組

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

 

 

 

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

  1. 執行root腳本

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

 

 

[root@dg 11.2.0]# /u01/app/oraInventory/orainstRoot.sh

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.

 

[root@dg 11.2.0]# /u01/app/11.2.0/grid/root.sh

Performing root user operation for Oracle 11g

 

The following environment variables are set as:

ORACLE_OWNER= grid

ORACLE_HOME= /u01/app/11.2.0/grid

 

Enter the full pathname of the local bin directory: [/usr/local/bin]:

The contents of "dbhome" have not changed. No need to overwrite.

The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)

[n]:

The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)

[n]:

 

 

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

Now product-specific root actions will be performed.

Using configuration parameter file: /u01/app/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 dg successfully pinned.

Adding Clusterware entries to upstart

 

dg 2014/10/02 22:59:43 /u01/app/11.2.0/grid/cdata/dg/backup_20141002_225943.olr

Successfully configured Oracle Grid Infrastructure for a Standalone Server

[root@dg 11.2.0]#

 

 

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

  1. 安裝oracle軟件

①以oracle用戶登錄圖形界面,執行/home/oracle/database/runInsta

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

 

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

 

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

 

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

 

 

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

 

[root@dg ~]# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh

Performing root user operation for Oracle 11g

 

The following environment variables are set as:

ORACLE_OWNER= oracle

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

 

Enter the full pathname of the local bin directory: [/usr/local/bin]:

The contents of "dbhome" have not changed. No need to overwrite.

The file "oraenv" already exists in /usr/local/bin. Overwrite it? (y/n)

[n]:

The file "coraenv" already exists in /usr/local/bin. Overwrite it? (y/n)

[n]:

 

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.

Finished product-specific root actions.

[root@dg ~]#

 

一步一步搭建11gR2 rac+dg之DG 機器配置(七)

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

平远县| 枞阳县| 洛南县| 阜宁县| 延寿县| 泾川县| 北海市| 莱州市| 乐山市| 正镶白旗| 五大连池市| 西和县| 商丘市| 句容市| 息烽县| 通城县| 盐津县| 东辽县| 嵊州市| 楚雄市| 会同县| 乌审旗| 汝州市| 钟祥市| 浦北县| 璧山县| 栖霞市| 汉源县| 乐平市| 呼伦贝尔市| 大连市| 鸡东县| 天镇县| 仁怀市| 阿城市| 镇远县| 嘉兴市| 永仁县| 永嘉县| 红安县| 东乡族自治县|