本文共 4257 字,大约阅读时间需要 14 分钟。
一:开始安装数据库软件之前,需要先确定先前安装好的grid infrastructure是否正常
[grid@node1 ~]$ crs_stat -t -v Name Type R/RA F/FT Target State Host ---------------------------------------------------------------------- ora.CRS.dg ora....up.type 0/5 0/ ONLINE ONLINE node1 ora....ER.lsnr ora....er.type 0/5 0/ ONLINE ONLINE node1 ora....N1.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE node2 ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE node1 ora.cvu ora.cvu.type 0/5 0/0 ONLINE ONLINE node2 ora.gsd ora.gsd.type 0/5 0/ OFFLINE OFFLINE ora....network ora....rk.type 2/5 0/ ONLINE ONLINE node1 ora....SM1.asm application 0/5 0/0 ONLINE ONLINE node1 ora....E1.lsnr application 0/5 0/0 ONLINE ONLINE node1 ora.node1.gsd application 0/5 0/0 OFFLINE OFFLINE ora.node1.ons application 0/3 0/0 ONLINE ONLINE node1 ora.node1.vip ora....t1.type 0/0 0/0 ONLINE ONLINE node1 ora....SM2.asm application 0/5 0/0 ONLINE ONLINE node2 ora....E2.lsnr application 0/5 0/0 ONLINE ONLINE node2 ora.node2.gsd application 0/5 0/0 OFFLINE OFFLINE ora.node2.ons application 0/3 0/0 ONLINE ONLINE node2 ora.node2.vip ora....t1.type 0/0 0/0 ONLINE ONLINE node2 ora.oc4j ora.oc4j.type 0/1 0/2 ONLINE ONLINE node1 ora.ons ora.ons.type 0/3 0/ ONLINE ONLINE node1 ora....ry.acfs ora....fs.type 0/5 0/ ONLINE ONLINE node1 ora.scan1.vip ora....ip.type 0/0 0/0 ONLINE ONLINE node2 [grid@node1 ~]$ crsctl check crs CRS-4638: Oracle High Availability Services is online CRS-4537: Cluster Ready Services is online CRS-4529: Cluster Synchronization Services is online CRS-4533: Event Manager is online [grid@node1 ~]$ olsnodes -n node1 1 node2 2 [grid@node1 ~]$ crsctl query css votedisk ## STATE File Universal Id File Name Disk group -- ----- ----------------- --------- --------- 1. ONLINE ae63de1fb2ae4fc8bf67d9b132ec65d5 (ORCL:CRS2) [CRS] 2. ONLINE 064d6bc958814fe8bf29c7301ae7b40d (ORCL:CRS1) [CRS] 3. ONLINE 6d499c6f22a14f41bff437487c6dc2f1 (ORCL:CRS3) [CRS] Located 3 voting disk(s). [root@node1 ~]# ip a show eth0 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 52:54:00:69:e8:f7 brd ff:ff:ff:ff:ff:ff inet 192.168.1.51/24 brd 192.168.1.255 scope global eth0 inet 192.168.1.151/24 brd 192.168.1.255 scope global secondary eth0:2 inet6 fe80::5054:ff:fe69:e8f7/64 scope link valid_lft forever preferred_lft forever [root@node2 ~]# ip a show eth0 2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 1000 link/ether 52:54:00:be:bc:58 brd ff:ff:ff:ff:ff:ff inet 192.168.1.52/24 brd 192.168.1.255 scope global eth0 inet 192.168.1.50/24 brd 192.168.1.255 scope global secondary eth0:1 inet 192.168.1.152/24 brd 192.168.1.255 scope global secondary eth0:2 inet6 fe80::5054:ff:febe:bc58/64 scope link valid_lft forever preferred_lft forever |
二:新建2个ASM磁盘组,DATA和FRA
[grid@node1 ~]$ asmca三:安装数据库软件
[root@node1 ~]# su - oracle [oracle@node1 ~]$ cd database/ [oracle@node1 database]$ ./runInstaller
在rac各个节点上以root用户身份运行下面的脚本
四:创建数据库
[oracle@node1 ~]$ dbca
五:连接集群数据库
[root@node1 ~]# su - oracle [oracle@node1 ~]$ sqlplus /nolog SQL*Plus: Release 11.2.0.3.0 Production on Sun Jan 22 22:20:16 2012 Copyright (c) 1982, 2011, Oracle. All rights reserved. SQL> conn /as sysdba Connected. SQL> select name,open_mode from gv$database; NAME OPEN_MODE --------- -------------------- NODE READ WRITE NODE READ WRITE SQL> select host_name,instance_name,thread#,status,archiver from gv$instance; HOST_NAME INSTANCE_NAME THREAD# STATUS ARCHIVE -------------------- ---------------- ---------- ------------ ------- node1.yang.com node1 1 OPEN STARTED node2.yang.com node2 2 OPEN STARTED [oracle@node1 ~]$ sqlplus as sysdba SQL*Plus: Release 11.2.0.3.0 Production on Sun Jan 22 23:17:14 2012 Copyright (c) 1982, 2011, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options SQL> show user; USER is "SYS" SQL> archive log list; Database log mode Archive Mode Automatic archival Enabled Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 1 Next log sequence to archive 1 Current log sequence 1 本文转自斩月博客51CTO博客,原文链接http://blog.51cto.com/ylw6006/768076如需转载请自行联系原作者
ylw6006 |