ITPub博客

首页 > 数据库 > Oracle > 11GR2 RAC 搭建(三)

11GR2 RAC 搭建(三)

原创 Oracle 作者:sambatuzi 时间:2021-08-03 10:02:52 0 删除 编辑
  • 开始安装数据库软件

#grid 用户检查安装环境
[grid@node1 ~]$ ./grid/runcluvfy.sh stage -pre dbinst -n node1,node2 -verbose -fixup
#安装数据库软件
[oracle@node1 database]$ ./runInstaller -silent -force -noconfig -IgnoreSysPreReqs -ignorePrereq -showProgress \
oracle.install.option=INSTALL_DB_SWONLY \
DECLINE_SECURITY_UPDATES=true \
UNIX_GROUP_NAME=oinstall \
INVENTORY_LOCATION=/u01/app/oraInventory \
SELECTED_LANGUAGES=en \
oracle.install.db.InstallEdition=EE \
oracle.install.db.isCustomInstall=false \
oracle.install.db.EEOptionsSelection=false \
oracle.install.db.DBA_GROUP=dba \
oracle.install.db.OPER_GROUP=asmoper \
oracle.install.db.isRACOneInstall=false \
oracle.install.db.BACKUPDBA_GROUP=dba \
oracle.install.db.DGDBA_GROUP=dba \
oracle.install.db.KMDBA_GROUP=dba \
oracle.install.db.rac.serverpoolCardinality=0 \
oracle.install.db.ConfigureAsContainerDB=false \
oracle.install.db.config.starterdb.memoryOption=false \
oracle.install.db.config.starterdb.installExampleSchemas=true \
oracle.install.db.config.starterdb.managementOption=DEFAULT \
oracle.install.db.config.starterdb.enableRecovery=false \
oracle.install.db.config.starterdb.type=GENERAL_PURPOSE \
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false \
oracle.installer.autoupdates.option=SKIP_UPDATES \
ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1 \
ORACLE_BASE=/u01/app/oracle \
oracle.install.db.CLUSTER_NODES=node1,node2 \
ORACLE_HOSTNAME=node1
######################################################################################################
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 120 MB.   Actual 34671 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 3950 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2021-08-02_02-41-08PM. Please wait ...[oracle@node1 database]$ 
 You can find the log of this install session at:
 /u01/app/oraInventory/logs/installActions2021-08-02_02-41-08PM.log
Prepare in progress.
..................................................   9% Done.
Prepare successful.
Copy files in progress.
..................................................   15% Done.
..................................................   20% Done.
..................................................   25% Done.
..................................................   30% Done.
..................................................   36% Done.
..................................................   41% Done.
..................................................   46% Done.
..................................................   51% Done.
..................................................   56% Done.
Copy files successful.
..........
Link binaries in progress.
Link binaries successful.
..................................................   77% Done.
Setup files in progress.
..................................................   94% Done.
Setup files successful.
The installation of Oracle Database 11g was successful.
Please check '/u01/app/oraInventory/logs/silentInstall2021-08-02_02-41-08PM.log' for more details.
Execute Root Scripts in progress.
As a root user, execute the following script(s):
	1. /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Execute /u01/app/oracle/product/11.2.0/dbhome_1/root.sh on the following nodes: 
[node1, node2]
..................................................   100% Done.
Execute Root Scripts successful.
Successfully Setup Software.
######################################################################################################
#双节点执行/u01/app/oracle/product/11.2.0/dbhome_1/root.sh 
[root@node1 ~]# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Check /u01/app/oracle/product/11.2.0/dbhome_1/install/root_node1_2021-08-02_15-02-02.log for the output of root script
[root@node1 ~]# tail -100f /u01/app/oracle/product/11.2.0/dbhome_1/install/root_node1_2021-08-02_15-02-02.log
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
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...
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.
Finished product-specific root actions
[root@node2 lib64]# cat /u01/app/oracle/product/11.2.0/dbhome_1/install/root_node2_2021-08-02_15-02-03.log 
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
   Copying dbhome to /usr/local/bin ...
   Copying oraenv to /usr/local/bin ...
   Copying coraenv to /usr/local/bin ...
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.
Finished product-specific root actions.


  • 创建磁盘组

[grid@node1 ~]$ sqlplus / as sysasm 
col name format a10
set line 9999
col path format a15
SQL> select GROUP_NUMBER,path,name,disk_number,total_mb,free_mb,CREATE_DATE,MOUNT_STATUS,MOUNT_DATE
from v$asm_disk order by GROUP_NUMBER desc,disk_number;  2  
GROUP_NUMBER PATH	     NAME	DISK_NUMBER   TOTAL_MB	  FREE_MB CREATE_DA MOUNT_S MOUNT_DAT
------------ --------------- ---------- ----------- ---------- ---------- --------- ------- ---------
	   1 /dev/asm-diskab OCR_0000		  0	 10240	     9932 02-AUG-21 CACHED  02-AUG-21
	   1 /dev/asm-diskac OCR_0001		  1	 10240	     9931 02-AUG-21 CACHED  02-AUG-21
	   1 /dev/asm-diskad OCR_0002		  2	 10240	     9931 02-AUG-21 CACHED  02-AUG-21
	   0 /dev/asm-diskaa			  1	     0		0	    CLOSED
SQL> select name,state,free_mb,required_mirror_free_mb,usable_file_mb from v$asm_diskgroup;
NAME	   STATE	  FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB
---------- ----------- ---------- ----------------------- --------------
OCR	   MOUNTED	    29794		    10240	    9777
SQL> CREATE DISKGROUP DATA external redundancy DISK '/dev/asm-diskaa' ATTRIBUTE 'compatible.rdbms' ='11.2', 'compatible.asm' = '11.2';
Diskgroup created.
SQL> SQL>  select name,state,free_mb,required_mirror_free_mb,usable_file_mb from v$asm_diskgroup;
NAME	   STATE	  FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB
---------- ----------- ---------- ----------------------- --------------
OCR	   MOUNTED	    29794		    10240	    9777
DATA	   MOUNTED	     5068			0	    5068
--节点二挂载
alter diskgroup data mount;


  • 静默创建数据库

dbca -silent -createDatabase -templateName General_Purpose.dbc -responseFile NO_VALUE \
-gdbname doc -sid doc \
-sysPassword oracle -systemPassword oracle -serviceUserPassword oracle \
-datafileDestination 'DATA/' \
-recoveryAreaDestination 'FRA/' \
-storageType ASM -asmsnmpPassword ps_oracle -diskGroupName 'DATA' \
-characterset ZHS16GBK -nationalCharacterSet AL16UTF16 \
-sampleSchema true \
-memoryPercentage 30 \
-databaseType OLTP \
-emConfiguration NONE \
-nodeinfo node1,node2
Copying database files
1% complete
3% complete
9% complete
15% complete
21% complete
27% complete
30% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
44% complete
45% complete
48% complete
50% complete
Creating cluster database views
52% complete
70% complete
Completing Database Creation
73% complete
76% complete
85% complete
94% complete
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/doc/doc.log" for further details. 
[oracle@node1 database]$ crsctl stat res -t 
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       node1                                        
               ONLINE  ONLINE       node2                                        
ora.LISTENER.lsnr
               ONLINE  ONLINE       node1                                        
               ONLINE  ONLINE       node2                                        
ora.OCR.dg
               ONLINE  ONLINE       node1                                        
               ONLINE  ONLINE       node2                                        
ora.asm
               ONLINE  ONLINE       node1                    Started             
               ONLINE  ONLINE       node2                    Started             
ora.gsd
               OFFLINE OFFLINE      node1                                        
               OFFLINE OFFLINE      node2                                        
ora.net1.network
               ONLINE  ONLINE       node1                                        
               ONLINE  ONLINE       node2                                        
ora.ons
               ONLINE  ONLINE       node1                                        
               ONLINE  ONLINE       node2                                        
ora.registry.acfs
               ONLINE  ONLINE       node1                                        
               ONLINE  ONLINE       node2                                        
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       node1                                        
ora.cvu
      1        ONLINE  ONLINE       node1                                        
ora.doc.db
      1        ONLINE  ONLINE       node1                    Open                
      2        ONLINE  ONLINE       node2                    Open                
ora.node1.vip
      1        ONLINE  ONLINE       node1                                        
ora.node2.vip
      1        ONLINE  ONLINE       node2                                        
ora.oc4j
      1        ONLINE  ONLINE       node1                                        
ora.scan1.vip
      1        ONLINE  ONLINE       node1                                        
sqlplus 提示符设置
在 oracle 和 grid 用户下,编辑$ORACLE_HOME/sqlplus/admin/glogin.sql
set linesize 9999 pagesize 9999
set sqlprompt "_USER'@'_CONNECT_IDENTIFIER> "


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31519308/viewspace-2784874/,如需转载,请注明出处,否则将追究法律责任。

下一篇: 没有了~
请登录后发表评论 登录
全部评论

注册时间:2018-01-30

  • 博文量
    24
  • 访问量
    11286