一步步进行 Oracle GI db 新建

1
2
3
4
5
-rwxrwxrwx. 1 root root 1239269270 Aug  6 09:38 linux.x64_11gR2_database_1of2.zip
-rwxrwxrwx. 1 root root 1111416131 Aug 6 09:47 linux.x64_11gR2_database_2of2.zip
-rwxrwxrwx. 1 root root 1052897657 Aug 6 09:32 linux.x64_11gR2_grid.zip
-rwxrwxrwx. 1 root root 19360 Aug 6 09:28 oracleasmlib-2.0.12-1.el7.x86_64.rpm
-rwxrwxrwx. 1 root root 86908 Aug 6 09:28 oracleasm-support-2.1.11-2.el7.x86_64.rpm

[root@localhost] yum install kmod-oracleasm
[root@localhost] rpm -ivh ./oracleasmlib-2.0.12-1.el7.x86_64.rpm oracleasm-support-2.1.11-2.el7.x86_64.rpm

[root@localhost] hostnamectl set-hostname rhel
[root@localhost] vim /etc/hosts
192.168.1.32 rhel
[root@rhel] groupadd -r -g 500 oinstall
[root@rhel] groupadd -r -g 501 dba
[root@rhel] groupadd -r -g 502 asmadmin
[root@rhel] groupadd -r -g 503 asmdba
[root@rhel] useradd -r -u 500 -g oinstall -G dba,asmadmin,asmdba -m -d /home/oracle oracle
[root@rhel] useradd -r -u 501 -g oinstall -G dba,asmadmin,asmdba -m -d /home/grid grid
[root@rhel] mkdir -p /u01/app/oraInventory
[root@rhel] mkdir -p /u01/app/grid
[root@rhel] mkdir -p /u01/app/11.2.0/grid
[root@rhel] mkdir -p /u01/app/oracle
[root@rhel] chown -R grid:oinstall /u01
[root@rhel] chown grid:oinstall /u01/app/oraInventory
[root@rhel] chown grid:oinstall /u01/app/grid
[root@rhel] chown grid:oinstall /u01/app/11.2.0/grid
[root@rhel] chown oracle:oinstall /u01/app/oracle
[root@rhel] chmod -R 775 /u01/
[root@rhel] chmod -R 775 /u01/app/oraInventory
[root@rhel] chmod -R 775 /u01/app/grid
[root@rhel] chmod -R 775 /u01/app/11.2.0
[root@rhel] chmod -R 775 /u01/app/oracle

[root@rhel] oracleasm configure -i
[root@rhel] fdisk /dev/sdb
[root@rhel] oracleasm status
[root@rhel] oracleasm init
[root@rhel] oracleasm status
[root@rhel] systemctl status oracleasm
[root@rhel] oracleasm createdisk data01 /dev/sdb1
[root@rhel] oracleasm createdisk data02 /dev/sdc1
[root@rhel/dev/oracleasm]# ls -ld /dev/oracleasm/
drwxr-xr-x. 4 root root 0 Aug 7 16:00 /dev/oracleasm/
[root@rhel/dev/oracleasm]# ll
total 0
drwxr-xr-x. 1 root root 0 Aug 7 16:06 disks
drwxrwx—. 1 grid oinstall 0 Aug 7 16:07 iid
[root@rhel/dev/oracleasm/disks]# ll
total 0
brw-rw----. 1 grid oinstall 8, 17 Aug 7 16:08 DATA01
brw-rw----. 1 grid oinstall 8, 33 Aug 7 16:08 DATA02

[root@rhel/u01]# tree -L 4 .
.
└── app
├── 11.2.0
│   └── grid
├── grid
├── oracle
└── oraInventory

6 directories, 0 files

[root@rhel] ll
-rwxrwxrwx. 1 root root 1239269270 Aug 6 09:38 linux.x64_11gR2_database_1of2.zip
-rwxrwxrwx. 1 root root 1111416131 Aug 6 09:47 linux.x64_11gR2_database_2of2.zip
-rwxrwxrwx. 1 root root 1052897657 Aug 6 09:32 linux.x64_11gR2_grid.zip

[root@rhel] unzip linux.x64_11gR2_grid.zip -d /tmp
[root@rhel] su - grid
打开xstart
[grid@rhel] export DISPLAY=10.242.138.45:0.0(export DISPLAY=192.168.1.1:0.0)
[grid@rhel/tmp/grid] ./runInstaller

/u01/app/oraInventory/orainstRoot.sh

[root@rhel] yum install -y binutils-* compat-libstdc+±* elfutils-libelf-* elfutils-libelf-devel-static-0.125 gcc-4.1.2 gcc-c+±4.1.2 glibc-2.5-24 glibc-common-2.5 glibc-devel-2.5 glibc-headers-2.5 ksh-20060214 libaio-0.3.106 libaio-devel-0.3.106 libgcc-4.1.2 libgomp-4.1.2 libstdc+±4.1.2 libstdc+±devel-4.1.2 make-3.81 sysstat-7.0.2

/u01/app/grid/product/11.2.0/grid/root.sh
[root@rhel] /bin/dd if=/var/tmp/.oracle/npohasd of=/dev/null bs=1024 count=1
[root@rhel] chown root:oinstall /var/tmp/.oracle/npohasd

[root@rhel] unzip linux.x64_11gR2_database_1of2.zip -d /tmp
[root@rhel] unzip linux.x64_11gR2_database_2of2.zip -d /tmp
[root@rhel] su - oracle
[oracle@rhel/tmp/database] ./runInstaller

/u01/app/oracle/product/11.2.0/dbhome_1/root.sh

[grid@rhel] /u01/app/grid/product/11.2.0/grid/bin/netca

创建的监听器一定要是默认的LISTENER(否则dbca时一定会报告Oracle Restart need a default listener)

[grid@rhelora ~]$ crsctl start res -all
CRS-2672: Attempting to start ‘ora.LISTENER.lsnr’ on ‘rhelora’
CRS-2672: Attempting to start ‘ora.cssd’ on ‘rhelora’
CRS-2672: Attempting to start ‘ora.diskmon’ on ‘rhelora’
CRS-2676: Start of ‘ora.LISTENER.lsnr’ on ‘rhelora’ succeeded
CRS-2676: Start of ‘ora.diskmon’ on ‘rhelora’ succeeded
CRS-2676: Start of ‘ora.cssd’ on ‘rhelora’ succeeded
CRS-2672: Attempting to start ‘ora.asm’ on ‘rhelora’
CRS-2676: Start of ‘ora.asm’ on ‘rhelora’ succeeded
CRS-2672: Attempting to start ‘ora.DATA.dg’ on ‘rhelora’
CRS-2676: Start of ‘ora.DATA.dg’ on ‘rhelora’ succeeded
[grid@rhelora ~]$ crsctl stat res -t

NAME TARGET STATE SERVER STATE_DETAILS

Local Resources

ora.DATA.dg
ONLINE ONLINE rhelora
ora.LISTENER.lsnr
ONLINE ONLINE rhelora
ora.asm
ONLINE ONLINE rhelora Started

Cluster Resources

ora.cssd
1 ONLINE ONLINE rhelora
ora.diskmon
1 ONLINE ONLINE rhelora

[grid@rhelora ~]$ crs_stat -t
Name Type Target State Host

ora.DATA.dg ora…up.type ONLINE ONLINE rhelora
ora…ER.lsnr ora…er.type ONLINE ONLINE rhelora
ora.asm ora.asm.type ONLINE ONLINE rhelora
ora.cssd ora.cssd.type ONLINE ONLINE rhelora
ora.diskmon ora…on.type ONLINE ONLINE rhelora

[root@rhelora ~]# ls -ld /dev/oracleasm/
drwxr-xr-x. 4 root root 0 Aug 9 03:39 /dev/oracleasm/
[root@rhelora ~]# ls -l /dev/oracleasm/
total 0
drwxr-xr-x. 1 root root 0 Aug 9 03:39 disks
drwxrwx—. 1 grid oinstall 0 Aug 9 03:39 iid
[root@rhelora ~]# ls -l /dev/oracleasm/disks/
total 0
brw-rw----. 1 grid oinstall 8, 37 Aug 9 03:56 DATA01
brw-rw----. 1 grid oinstall 8, 38 Aug 9 03:56 DATA02
[root@rhelora ~]#

[root@rhelora ~]# ls -ld /var/tmp/.oracle/
drwxrwxrwt. 2 root oinstall 4096 Aug 9 03:42 /var/tmp/.oracle/
[root@rhelora ~]# ls -l /var/tmp/.oracle/npohasd
prw-r–r--. 1 root oinstall 0 Aug 8 22:14 /var/tmp/.oracle/npohasd

[oracle@rhel] /u01/app/oracle/product/11.2.0/dbhome_1/bin/dbca


[grid@rhelora disks]$ ps -ef | grep ^grid
grid 1736 1 1 17:01 ? 00:03:23 /u01/app/11.2.0/grid/bin/ohasd.bin reboot
grid 2347 2345 0 17:01 pts/0 00:00:01 -bash
grid 2420 1 1 17:02 ? 00:03:21 /u01/app/11.2.0/grid/bin/oraagent.bin
grid 2422 1 0 17:02 ? 00:00:14 /u01/app/11.2.0/grid/bin/cssdagent
grid 2462 1 2 17:02 ? 00:05:39 /u01/app/11.2.0/grid/bin/ocssd.bin
grid 2463 1 0 17:02 ? 00:00:04 /u01/app/11.2.0/grid/bin/tnslsnr LISTENER -inherit
grid 2487 1 0 17:02 ? 00:00:08 /u01/app/11.2.0/grid/bin/orarootagent.bin
grid 2500 1 0 17:02 ? 00:01:37 /u01/app/11.2.0/grid/bin/diskmon.bin -d -f
grid 2561 1 0 17:03 ? 00:00:05 asm_pmon_+ASM
grid 2563 1 0 17:03 ? 00:01:46 asm_vktm_+ASM
grid 2567 1 0 17:03 ? 00:00:00 asm_gen0_+ASM
grid 2569 1 0 17:03 ? 00:00:01 asm_diag_+ASM
grid 2571 1 0 17:03 ? 00:00:00 asm_psp0_+ASM
grid 2573 1 0 17:03 ? 00:00:09 asm_dia0_+ASM
grid 2575 1 0 17:03 ? 00:00:01 asm_mman_+ASM
grid 2577 1 0 17:03 ? 00:00:00 asm_dbw0_+ASM
grid 2579 1 0 17:03 ? 00:00:00 asm_lgwr_+ASM
grid 2581 1 0 17:03 ? 00:00:01 asm_ckpt_+ASM
grid 2583 1 0 17:03 ? 00:00:00 asm_smon_+ASM
grid 2585 1 0 17:03 ? 00:00:02 asm_rbal_+ASM
grid 2587 1 0 17:03 ? 00:00:09 asm_gmon_+ASM
grid 2589 1 0 17:03 ? 00:00:02 asm_mmon_+ASM
grid 2591 1 0 17:03 ? 00:00:04 asm_mmnl_+ASM
grid 2624 1 0 17:03 ? 00:00:00 asm_asmb_+ASM
grid 2626 1 0 17:03 ? 00:00:02 oracle+ASM_asmb_+asm (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
grid 2711 1 0 17:03 ? 00:00:02 oracle+ASM_asmb_myora (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
grid 8889 2347 0 21:19 pts/0 00:00:00 ps -ef
grid 8890 2347 0 21:19 pts/0 00:00:00 grep --color=auto ^grid
[grid@rhelora disks]$ ps -ef | grep ^oracle
oracle 2675 1 0 17:03 ? 00:00:06 ora_pmon_myora
oracle 2677 1 0 17:03 ? 00:01:44 ora_vktm_myora
oracle 2681 1 0 17:03 ? 00:00:00 ora_gen0_myora
oracle 2683 1 0 17:03 ? 00:00:01 ora_diag_myora
oracle 2685 1 0 17:03 ? 00:00:00 ora_dbrm_myora
oracle 2687 1 0 17:03 ? 00:00:01 ora_psp0_myora
oracle 2689 1 0 17:03 ? 00:00:13 ora_dia0_myora
oracle 2691 1 0 17:03 ? 00:00:04 ora_mman_myora
oracle 2693 1 0 17:03 ? 00:00:04 ora_dbw0_myora
oracle 2695 1 0 17:03 ? 00:00:04 ora_lgwr_myora
oracle 2697 1 0 17:03 ? 00:00:13 ora_ckpt_myora
oracle 2699 1 0 17:03 ? 00:00:04 ora_smon_myora
oracle 2701 1 0 17:03 ? 00:00:00 ora_reco_myora
oracle 2703 1 0 17:03 ? 00:00:00 ora_rbal_myora
oracle 2705 1 0 17:03 ? 00:00:00 ora_asmb_myora
oracle 2707 1 0 17:03 ? 00:00:07 ora_mmon_myora
oracle 2709 1 0 17:03 ? 00:00:08 ora_mmnl_myora
oracle 2713 1 0 17:03 ? 00:00:00 ora_d000_myora
oracle 2715 1 0 17:03 ? 00:00:01 ora_mark_myora
oracle 2717 1 0 17:03 ? 00:00:00 ora_s000_myora
oracle 2807 1 0 17:03 ? 00:00:00 ora_qmnc_myora
oracle 2822 1 0 17:03 ? 00:00:06 ora_cjq0_myora
oracle 2843 1 0 17:03 ? 00:00:00 ora_q000_myora
oracle 2845 1 0 17:03 ? 00:00:00 ora_q001_myora
oracle 2938 2937 0 17:04 pts/1 00:00:00 -bash
oracle 3060 1 0 17:08 ? 00:00:00 ora_smco_myora
oracle 4698 2938 0 18:19 pts/1 00:00:00 sqlplus as sysdba
oracle 4699 4698 0 18:19 ? 00:00:00 oraclemyora (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
oracle 8092 1 0 20:48 ? 00:00:00 ora_w000_myora
oracle 8892 1 0 21:19 ? 00:00:00 ora_j000_myora
oracle 8894 1 0 21:19 ? 00:00:00 ora_j001_myora