반응형
Oracle 19.7 HA(SE) Installation
#테스트 환경
NODE1 | NODE2 | 비고 | |
VM | Virtual Box 6 | Virtual Box 6 | |
OS | Oracle Linux 7.8 | Oracle Linux 7.8 | |
CORE | 3 | 3 | |
Memory | 8G | 8G | |
DISK | 100GB | 100GB | LOCAL 영역 |
Shared Disk | 50GB | ASM 영역 | |
Hostname | hase19c1 | hase19c1 | |
Network Interface |
Eth3 | Eth3 | |
Eth8 | Eth8 | ||
IP(Public) | 192.168.56.104(hase19c1) | 192.168.56.105(hase19c2) | VM Host Only |
IP(VIP) | 192.168.56.114(hase19c1-vip) | 192.168.56.115(hase19c1-vip) | |
IP(Private) | 10.0.3.15 | 10.0.3.16 | VM 내부 |
Scan-vip | 192.168.56.120(hase19c-cluster-scan) | ||
Database version | Oracle Grid Infrastructure Oracle 19c Standard edition (RU19.7) + ASM | ||
File | LINUX.X64_193000_db_home.zip LINUX.X64_193000_grid_home.zip Patch 31750108: GI RELEASE UPDATE 19.9.0.0.0 Patch 6880880 |
DB 설치파일 GRID 설치파일 Patch 파일 OPatch 최신파일 |
# 테스트 진행 |
1. DB서버1,DB서버2 OS구성 2. RPM 설치 3. Network 구성 4. Shared Storage ASM구성 5. Oracle Cluster 구성 6. Oracle DB 구성 7. Oracle Instance 구성 8. Oracle Patch 적용 9. Oracle Cluster 적용(HA) 10. Failover TEST |
# RPM설치 (NODE1, NODE2) |
# rpm -Uvh oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm # rpm –Uvh oracleasmlib-2.0.12-1.el7.x86_64.rpm # rpm –Uvh oracleasm-support-2.1.11-2.el7.x86_64.rpm # rpm –Uvh cvuqdisk-1.0.10-1.rpm |
# 계정 및 Password 설정 (NODE1, NODE2) |
#groupadd oinstall #useradd oracle -g oinstall #passwd oracle |
# 디렉토리 생성 (NODE1, NODE2) |
#mkdir -p /u01/app/19.0.0.0/grid #mkdir -p /u01/app/oracle/product/19.0.0.0/db_1 #chown -R oracle:oinstall /u01 #chmod -R 775 /u01 |
# hostname 등록 (NODE1, NODE2) |
cat /etc/hosts 127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4 192.168.56.104 hase19c1 192.168.56.105 hase19c2 192.168.56.114 hase19c1-vip 192.168.56.115 hase19c2-vip 10.0.3.15 hase19c1-priv 10.0.3.16 hase19c2-priv 192.168.56.120 hase19c-cluster-scan |
# OS 방화벽 및 SElinux (NODE1, NODE2) |
# /etc/selinux/config SELINUX=disabled # systemctl stop firewalld # systemctl disable firewalld |
#Bash_profile (NODE1, NODE2) |
vi .bash_profile |
# Oracle Settings export TMP=/tmp export TMPDIR=$TMP export ORACLE_BASE=/u01/app/oracle export ORACLE_HOME=$ORACLE_BASE/product/19.0.0.0/db_1 export ORA_INVENTORY=/u01/app/oraInventory export ORACLE_SID=orcl export PATH=/usr/sbin:/usr/local/bin:$PATH export PATH=$ORACLE_HOME/bin:$PATH export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib export GRID_HOME=/u01/app/19.0.0.0/grid export PATH=$PATH:$GRID_HOME/bin |
$. .bash_profile |
#SSH , PING TEST (NODE1, NODE2) |
#ping hase19c1 #ping hase19c2 #ping hase19c1-vip #ping hase19c2-vip #ping hase19c1-priv #ping hase19c2-priv |
# ssh hase19c1 # ssh hase19c2 |
#ASM Shared Storage 구성 |
#fdisk –l #fdisk /dev/sdb 디스크할당 # ls –alrt /dev/sdb* |
# oracleasm configure scandisk # oracleasm configure status # oracleasm init # oracleasm configure –i |
Default user to own the driver interface []: oracle Default group to own the driver interface []: oinstall Start Oracle ASM library driver on boot (y/n) [n]: y Scan for Oracle ASM disks on boot (y/n) [y]: y Writing Oracle ASM library driver configuration: done |
# oracleasm configure scandisk # oracleasm configure status |
# Createasm disk (NODE1) |
# oracleasm createdisk DATA /dev/sdb1 # oracleasm listdisks |
(NODE1, NODE2) # chown –R oracle:oinstall /dev/sdb1 # chmod –R 775 /dev/sdb1 # ls -alrt |
# Node1 Node2 재부팅 |
#Grid Installation |
NODE1 $ cd /u01/app/19.0.0.0/grid $ unzip LINUX.X64_193000_grid_home.zip |
./gridSetup. |
☑ Configure Oracle Grid Infrastructure for a New Cluster |
☑ Configure an Oracle Standalone Cluster |
☑ Create Local SCAN Cluster Name : hase19c SCAN Name : hase19c-cluster-scan SCAN Port : 1521 |
Cluster Node Information Add : hase19c2, hase19c2-vip 기입 OS Password : 입력 ☑ Test ☑ Setup |
☑ Use Oracle Flex ASM for storage |
Configure Grid Infrastructure Management Repository ☐ YES ☑ NO |
Disk group name : DATA Redundancy : External Allocation Unit Size : 4MB Change Discovery Path -> /dev/oracleasm/disks/ ☐ Configure Oracle ASM Filter Driver |
Use same passwords for these accounts Specify Password : Confirm Password: |
☑ Do not use Intelligent Platform Management Interface(IPMI) |
☐ Register with Enterprise Manager (EM) Cloud Control |
Oracle ASM Administrator (OSASM) Group : oinstall Oracle ASM DBA (OSDBA for ASM) Group : oinstall Oracle ASM Operator (OSOPER for ASM) Group (Optional) : oinstall |
Oracle base : /u01/app/oracle Software location : /u01/app/19.0.0.0/grid |
Prerequisite Checks |
☐ Automatically run configuration scripts |
Save Response File Install |
Node1, Node2 #/u01/app/oraIventory/oranstRoot.sh #/u01/app/19.0.0.0/grid/root.sh |
#./crsctl status res -t |
# DB engine Installation (NODE1,NODE2) |
NODE1 $ cd /u01/app/19.0.0.0/grid $./runInstaller |
☑ Set Up Software Only |
☑ Single instance database installation |
☑ Standard Edition2 |
Oracle base : /u01/app/oracle Software Location : /u01/app/oracle/product/19.0.0.0/db_1 |
Database Administrator (OSDBA) group: oinstall Database Operator (OSOPER) group (Optional) : oinstall Database Backup and Recovery (OSBACKUPDBA) group : oinstall Data Guard administrative (OSDGDBA) group : oinstall Encryption Key Management administrative (OSKMDBA) group : oinstall Real Application Cluster administrative (OSRACDBA) group : oinstall |
☐ Automatically run configuration scripts |
Prerequistie Check |
Save Response File Install |
#/u01/app/oracle/product/19.0.0.0/db_1/root.sh |
#./crsctl status res -t |
# Cluster 상태 확인 |
# ./crsctl status res -t |
-------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.LISTENER.lsnr ONLINE ONLINE hase19c1 STABLE ONLINE ONLINE hase19c2 STABLE ora.chad ONLINE ONLINE hase19c1 STABLE ONLINE ONLINE hase19c2 STABLE ora.net1.network ONLINE ONLINE hase19c1 STABLE ONLINE ONLINE hase19c2 STABLE ora.ons ONLINE ONLINE hase19c1 STABLE ONLINE ONLINE hase19c2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup) 1 ONLINE ONLINE hase19c1 STABLE 2 ONLINE ONLINE hase19c2 STABLE 3 ONLINE OFFLINE STABLE ora.DATA.dg(ora.asmgroup) 1 ONLINE ONLINE hase19c1 STABLE 2 ONLINE ONLINE hase19c2 STABLE 3 OFFLINE OFFLINE STABLE ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE hase19c1 STABLE ora.asm(ora.asmgroup) 1 ONLINE ONLINE hase19c1 Started,STABLE 2 ONLINE ONLINE hase19c2 Started,STABLE 3 OFFLINE OFFLINE STABLE ora.asmnet1.asmnetwork(ora.asmgroup) 1 ONLINE ONLINE hase19c1 STABLE 2 ONLINE ONLINE hase19c2 STABLE 3 OFFLINE OFFLINE STABLE ora.cvu 1 ONLINE ONLINE hase19c1 STABLE ora.hase19c1.vip 1 ONLINE ONLINE hase19c1 STABLE ora.hase19c2.vip 1 ONLINE ONLINE hase19c2 STABLE ora.orcl.db 1 OFFLINE OFFLINE STABLE ora.qosmserver 1 ONLINE ONLINE hase19c1 STABLE ora.scan1.vip 1 ONLINE ONLINE hase19c1 STABLE |
# Instance Installation |
NODE1 $ ./dbca |
☑ Create a database |
☑ Advanced configuration |
Database type : Oracle Single Instance database ☑ Custom Database |
Global database name : orcl SID : orcl ☐ Create as Container database |
☑ Use following for the database storage attributes Database files storage type: Automatic Storage Management(ASM) Database files location +DATA/{DB_UNIQUE_NAME} Use Oracle-Managed Files (OMF) |
☑ Specify Fast Recovery Area ☑ Enable archiving |
☑ LISTENER |
Database components |
Memory ☑ Use Automatic Shared Memory Management Character set ☑ |
☐ Configure Enterprise Manager (EM) database express ☐ Register with Enterprise Manager (EM) cloud control |
☑ Use the same administrative password for all accounts Password : Confirm password : |
☑ Create database |
Save Response File Finish |
# GRID PATCH RU19.7(NODE1,NODE2) |
# export GRID_HOME=/u01/app/19.0.0.0/grid # export ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/db_1 # export RU_HOME=/u01/app/RU/31750108 |
최신 OPatch 설치 # ./opatch version OPatch Version: 12.2.0.1.23 #unzip /u01/app/RU/p31750108_190000_Linux-x86-64.zip #chown -R oracle:oinstall 31750108 |
Node1 # $GRID_HOME/OPatch/opatchauto apply $RU_HOME -oh $GRID_HOME |
Node2 # $GRID_HOME/OPatch/opatchauto apply $RU_HOME -oh $GRID_HOME |
Patch 확인 $ $GRID_HOME/OPatch/opatch lspatches -oh $GRID_HOME 31780966;TOMCAT RELEASE UPDATE 19.0.0.0.0 (31780966) 31773437;ACFS RELEASE UPDATE 19.9.0.0.0 (31773437) 31772784;OCW RELEASE UPDATE 19.9.0.0.0 (31772784) 31771877;Database Release Update : 19.9.0.0.201020 (31771877) |
# DB PATCH RU19.7(NODE1,NODE2) |
# export GRID_HOME=/u01/app/19.0.0.0/grid # export ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/db_1 # export RU_HOME=/u01/app/RU/31750108 |
# ./opatch version # $GRID_HOME/crs/install/rootcrs.sh -prepatch |
NODE1 $RU_HOME/31772784/custom/scripts/prepatch.sh -dbhome $ORACLE_HOME $ORACLE_HOME/OPatch/opatch apply $RU_HOME/31772784 -oh $ORACLE_HOME -local -silent $ORACLE_HOME/OPatch/opatch apply $RU_HOME/31771877 -oh $ORACLE_HOME -local -silent $RU_HOME/31772784/custom/scripts/postpatch.sh -dbhome $ORACLE_HOME |
Node2 $RU_HOME/31772784/custom/scripts/prepatch.sh -dbhome $ORACLE_HOME $ORACLE_HOME/OPatch/opatch apply $RU_HOME/31772784 -oh $ORACLE_HOME -local -silent $ORACLE_HOME/OPatch/opatch apply $RU_HOME/31771877 -oh $ORACLE_HOME -local -silent $RU_HOME/31772784/custom/scripts/postpatch.sh -dbhome $ORACLE_HOME |
# $GRID_HOME/rdbms/install/rootadd_rdbms.sh # $GRID_HOME/crs/install/rootcrs.sh -postpatch |
NODE2 위 수행 작업 반복 |
NODE1 $ cd $ORACLE_HOME/OPatch $ ./datapatch –verbose |
# Cluster 상태 확인 |
[root@hase19c2 bin]# ./crsctl status res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.LISTENER.lsnr ONLINE ONLINE hase19c1 STABLE ONLINE ONLINE hase19c2 STABLE ora.chad ONLINE ONLINE hase19c1 STABLE ONLINE ONLINE hase19c2 STABLE ora.net1.network ONLINE ONLINE hase19c1 STABLE ONLINE ONLINE hase19c2 STABLE ora.ons ONLINE ONLINE hase19c1 STABLE ONLINE ONLINE hase19c2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup) 1 ONLINE ONLINE hase19c1 STABLE 2 ONLINE ONLINE hase19c2 STABLE 3 ONLINE OFFLINE STABLE ora.DATA.dg(ora.asmgroup) 1 ONLINE ONLINE hase19c1 STABLE 2 ONLINE ONLINE hase19c2 STABLE 3 OFFLINE OFFLINE STABLE ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE hase19c1 STABLE ora.asm(ora.asmgroup) 1 ONLINE ONLINE hase19c1 Started,STABLE 2 ONLINE ONLINE hase19c2 Started,STABLE 3 OFFLINE OFFLINE STABLE ora.asmnet1.asmnetwork(ora.asmgroup) 1 ONLINE ONLINE hase19c1 STABLE 2 ONLINE ONLINE hase19c2 STABLE 3 OFFLINE OFFLINE STABLE ora.cvu 1 ONLINE ONLINE hase19c1 STABLE ora.hase19c1.vip 1 ONLINE ONLINE hase19c1 STABLE ora.hase19c2.vip 1 ONLINE ONLINE hase19c2 STABLE ora.orcl.db 1 ONLINE ONLINE hase19c1 Open,HOME=/u01/app/o racle/product/19.0.0 .0/db_1,STABLE ora.qosmserver 1 ONLINE ONLINE hase19c1 STABLE ora.scan1.vip 1 ONLINE ONLINE hase19c1 STABLE |
#Cluster 구성확인 |
[root@hase19c1 bin]# ./srvctl config database -db orcl Database unique name: orcl Database name: orcl Oracle home: /u01/app/oracle/product/19.0.0.0/db_1 Oracle user: oracle Spfile: +DATA/ORCL/PARAMETERFILE/spfile.287.1056879845 Password file: Domain: Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Server pools: Disk Groups: DATA Mount point paths: Services: Type: SINGLE OSDBA group: oinstall OSOPER group: oinstall Database instance: orcl Configured nodes: hase19c1 CSS critical: no CPU count: 0 Memory target: 0 Maximum memory: 0 Default network number for database services: Database is administrator managed |
#Cluster Node2 추가 |
[root@hase19c1 bin]# ./srvctl modify database -db orcl -node hase19c1,hase19c2 PRKF-1125 : multiple values specified for the single value option "node": hase19c1,hase19c2 <- RU패치 전 #노드추가 [oracle@hase19c1 bin]$ ./srvctl modify database -d orcl -node hase19c1,hase19c2 <- RU패치적용 후 사용 가능한 명령어 |
[oracle@hase19c1 bin]$ ./srvctl config database -db orcl Database unique name: orcl Database name: orcl Oracle home: /u01/app/oracle/product/19.0.0.0/db_1 Oracle user: oracle Spfile: +DATA/ORCL/PARAMETERFILE/spfile.287.1056879845 Password file: Domain: Start options: open Stop options: immediate Database role: PRIMARY Management policy: AUTOMATIC Server pools: Disk Groups: DATA Mount point paths: Services: Type: SINGLE OSDBA group: oinstall OSOPER group: oinstall Database instance: orcl Configured nodes: hase19c1,hase19c2 CSS critical: no CPU count: 0 Memory target: 0 Maximum memory: 0 Default network number for database services: Database is administrator managed |
#NODE2 디렉토리 추가 및 파일 복제 |
#Node1 SQL> show parameter spfile; NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ spfile string +DATA/ORCL/PARAMETERFILE/spfil e.287.1056879845 SQL> show parameter audit /u01/app/oracle/admin/orcl/adump #디렉토리 추가 [oracle@hase19c2 admin]$ mkdir -p /u01/app/oracle/admin/orcl/adump [oracle@hase19c1 admin]$ pwd /u01/app/oracle/product/19.0.0.0/db_1/network/admin [oracle@hase19c1 admin]$ ls -alrt total 12 -rw-r--r--. 1 oracle oinstall 1536 Feb 14 2018 shrept.lst drwxr-xr-x. 2 oracle oinstall 64 Apr 17 2019 samples drwxr-xr-x. 10 oracle oinstall 4096 Apr 17 2019 .. -rw-r-----. 1 oracle oinstall 404 Nov 19 09:42 tnsnames.ora #오라클 Node1 Listener IP정보 수정 및 tnsnames.ora 파일전송 [oracle@hase19c1 admin]$ scp tnsnames.ora oracle@192.168.56.105:/u01/app/oracle/product/19.0.0.0/db_1/network/admin/ tnsnames.ora 100% 404 146.7KB/s 00:00 |
#Failover 테스트 | |
#1번노드 변경 | #2번노드 변경 |
[oracle@hase19c1 bin]$ ./srvctl relocate database -d orcl -n hase19c1 -w 1 -v [oracle@hase19c1 bin]$ ./crsctl status res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.LISTENER.lsnr ONLINE ONLINE hase19c1 STABLE ONLINE ONLINE hase19c2 STABLE ora.chad ONLINE ONLINE hase19c1 STABLE ONLINE ONLINE hase19c2 STABLE ora.net1.network ONLINE ONLINE hase19c1 STABLE ONLINE ONLINE hase19c2 STABLE ora.ons ONLINE ONLINE hase19c1 STABLE ONLINE ONLINE hase19c2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup) 1 ONLINE ONLINE hase19c1 STABLE 2 ONLINE ONLINE hase19c2 STABLE 3 ONLINE OFFLINE STABLE ora.DATA.dg(ora.asmgroup) 1 ONLINE ONLINE hase19c1 STABLE 2 ONLINE ONLINE hase19c2 STABLE 3 OFFLINE OFFLINE STABLE ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE hase19c1 STABLE ora.asm(ora.asmgroup) 1 ONLINE ONLINE hase19c1 Started,STABLE 2 ONLINE ONLINE hase19c2 Started,STABLE 3 OFFLINE OFFLINE STABLE ora.asmnet1.asmnetwork(ora.asmgroup) 1 ONLINE ONLINE hase19c1 STABLE 2 ONLINE ONLINE hase19c2 STABLE 3 OFFLINE OFFLINE STABLE ora.cvu 1 ONLINE ONLINE hase19c1 STABLE ora.hase19c1.vip 1 ONLINE ONLINE hase19c1 STABLE ora.hase19c2.vip 1 ONLINE ONLINE hase19c2 STABLE ora.orcl.db 1 ONLINE ONLINE hase19c1 Open,HOME=/u01/app/o racle/product/19.0.0 .0/db_1,STABLE ora.qosmserver 1 ONLINE ONLINE hase19c1 STABLE ora.scan1.vip 1 ONLINE ONLINE hase19c1 STABLE |
[oracle@hase19c1 bin]$ ./srvctl relocate database -d orcl -n hase19c2 -w 1 –v [root@hase19c2 bin]# ./crsctl status res -t -------------------------------------------------------------------------------- Name Target State Server State details -------------------------------------------------------------------------------- Local Resources -------------------------------------------------------------------------------- ora.LISTENER.lsnr ONLINE ONLINE hase19c1 STABLE ONLINE ONLINE hase19c2 STABLE ora.chad ONLINE ONLINE hase19c1 STABLE ONLINE ONLINE hase19c2 STABLE ora.net1.network ONLINE ONLINE hase19c1 STABLE ONLINE ONLINE hase19c2 STABLE ora.ons ONLINE ONLINE hase19c1 STABLE ONLINE ONLINE hase19c2 STABLE -------------------------------------------------------------------------------- Cluster Resources -------------------------------------------------------------------------------- ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup) 1 ONLINE ONLINE hase19c1 STABLE 2 ONLINE ONLINE hase19c2 STABLE 3 ONLINE OFFLINE STABLE ora.DATA.dg(ora.asmgroup) 1 ONLINE ONLINE hase19c1 STABLE 2 ONLINE ONLINE hase19c2 STABLE 3 OFFLINE OFFLINE STABLE ora.LISTENER_SCAN1.lsnr 1 ONLINE ONLINE hase19c1 STABLE ora.asm(ora.asmgroup) 1 ONLINE ONLINE hase19c1 Started,STABLE 2 ONLINE ONLINE hase19c2 Started,STABLE 3 OFFLINE OFFLINE STABLE ora.asmnet1.asmnetwork(ora.asmgroup) 1 ONLINE ONLINE hase19c1 STABLE 2 ONLINE ONLINE hase19c2 STABLE 3 OFFLINE OFFLINE STABLE ora.cvu 1 ONLINE ONLINE hase19c1 STABLE ora.hase19c1.vip 1 ONLINE ONLINE hase19c1 STABLE ora.hase19c2.vip 1 ONLINE ONLINE hase19c2 STABLE ora.orcl.db 1 ONLINE ONLINE hase19c2 Open,HOME=/u01/app/o racle/product/19.0.0 .0/db_1,STABLE ora.qosmserver 1 ONLINE ONLINE hase19c1 STABLE ora.scan1.vip 1 ONLINE ONLINE hase19c1 STABLE |
DB 인스턴스 ORA.ORCL.DB 가 페일오버 된것을 확인합니다.
반응형
'Oracle > Oracle Installation' 카테고리의 다른 글
OLE7.5 Oracle 19c Single ASM-2 (0) | 2021.11.09 |
---|---|
OLE7.5 Oracle 19c Single ASM-1 (0) | 2021.11.08 |
OLE7.5 Oracle ASM DISK Configuration (0) | 2021.10.28 |
Oracle Migration UPGRADE 11.2.0.4 TO 12.1.0.2 Manual(FIlesystem) (0) | 2020.12.09 |
Oracle 19c Silent Installation(Single Filesystem) 오라클 19c 사일런트 설치 (0) | 2020.12.03 |
댓글