DB/Oracle
[RAC][INSTALL] 4_Oracle 엔진 및 DB 설치
밍구멍구
2023. 1. 3. 15:05
엔진 설치 파일 압축 해제 (1번기에서 진행)
oracle@ol79rac1[RACDB1]:/ora_engine/12c/dbhome_1$ unzip Oracle\ Database\ 12.2.0.1.0\ for\ Linux\ x86-64\,\ 3.2\ GB.zip
Archive: Oracle Database 12.2.0.1.0 for Linux x86-64, 3.2 GB.zip
creating: database/
creating: database/sshsetup/
inflating: database/sshsetup/sshUserSetup.sh
creating: database/rpm/
inflating: database/rpm/cvuqdisk-1.0.10-1.rpm
creating: database/response/
inflating: database/response/dbca.rsp
inflating: database/response/netca.rsp
inflating: database/response/db_install.rsp
creating: database/install/
inflating: database/install/detachHome.sh
extracting: database/install/addLangs.sh
creating: database/install/images/
inflating: database/install/images/billboards.gif
inflating: database/install/unzip
inflating: database/install/runInstaller.sh
inflating: database/install/clusterparam.ini
..
ssh 설정
경로 : $ORACLE_HOME/database/sshsetup
[root@ol79rac1 sshsetup]# pwd
/ora_engine/database/sshsetup
[root@ol79rac1 sshsetup]# ll
total 36
-rwxr-xr-x. 1 oracle dba 33333 Jan 7 2015 sshUserSetup.sh
[root@ol79rac1 sshsetup]# ./sshUserSetup.sh -user oracle -hosts "ol79rac1 ol79rac2" -noPromptPassphrase -advanced
The output of this script is also logged into /tmp/sshUserSetup_2023-01-03-14-57-33.log
Hosts are ol79rac1 ol79rac2
user is oracle
Platform:- Linux
Checking if the remote hosts are reachable
PING ol79rac1 (192.168.56.101) 56(84) bytes of data.
64 bytes from ol79rac1 (192.168.56.101): icmp_seq=1 ttl=64 time=0.019 ms
64 bytes from ol79rac1 (192.168.56.101): icmp_seq=2 ttl=64 time=0.050 ms
64 bytes from ol79rac1 (192.168.56.101): icmp_seq=3 ttl=64 time=0.033 ms
64 bytes from ol79rac1 (192.168.56.101): icmp_seq=4 ttl=64 time=0.035 ms
64 bytes from ol79rac1 (192.168.56.101): icmp_seq=5 ttl=64 time=0.041 ms
--- ol79rac1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4099ms
rtt min/avg/max/mdev = 0.019/0.035/0.050/0.012 ms
PING ol79rac2 (192.168.56.102) 56(84) bytes of data.
64 bytes from ol79rac2 (192.168.56.102): icmp_seq=1 ttl=64 time=0.355 ms
64 bytes from ol79rac2 (192.168.56.102): icmp_seq=2 ttl=64 time=0.375 ms
64 bytes from ol79rac2 (192.168.56.102): icmp_seq=3 ttl=64 time=0.519 ms
64 bytes from ol79rac2 (192.168.56.102): icmp_seq=4 ttl=64 time=0.482 ms
64 bytes from ol79rac2 (192.168.56.102): icmp_seq=5 ttl=64 time=0.359 ms
--- ol79rac2 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4093ms
rtt min/avg/max/mdev = 0.355/0.418/0.519/0.068 ms
Remote host reachability check succeeded.
The following hosts are reachable: ol79rac1 ol79rac2.
The following hosts are not reachable: .
All hosts are reachable. Proceeding further...
firsthost ol79rac1
numhosts 2
The script will setup SSH connectivity from the host ol79rac1 to all
the remote hosts. After the script is executed, the user can use SSH to run
commands on the remote hosts or copy files between this host ol79rac1
and the remote hosts without being prompted for passwords or confirmations.
NOTE 1:
As part of the setup procedure, this script will use ssh and scp to copy
files between the local host and the remote hosts. Since the script does not
store passwords, you may be prompted for the passwords during the execution of
the script whenever ssh or scp is invoked.
NOTE 2:
AS PER SSH REQUIREMENTS, THIS SCRIPT WILL SECURE THE USER HOME DIRECTORY
AND THE .ssh DIRECTORY BY REVOKING GROUP AND WORLD WRITE PRIVILEGES TO THESE
directories.
Do you want to continue and let the script make the above mentioned changes (yes/no)?
yes
The user chose yes
User chose to skip passphrase related questions.
Creating .ssh directory on local host, if not present already
Creating authorized_keys file on local host
Changing permissions on authorized_keys to 644 on local host
Creating known_hosts file on local host
Changing permissions on known_hosts to 644 on local host
Creating config file on local host
If a config file exists already at /root/.ssh/config, it would be backed up to /root/.ssh/config.backup.
Removing old private/public keys on local host
Running SSH keygen on local host with empty passphrase
Generating public/private rsa key pair.
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
SHA256:FtObVpAlq0oztzNzP1xv5bmyphUVpwtjR+Lb/R4CL5Y root@ol79rac1
The key's randomart image is:
+---[RSA 1024]----+
| ooo ...|
| ..= o .o|
| o o * o. |
| + = *.o |
| + S +...o .|
| . * o + o o|
| . = .E = ++|
| =..=o.o=|
| .+oooo|
+----[SHA256]-----+
Creating .ssh directory and setting permissions on remote host ol79rac1
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR oracle. THIS IS AN SSH REQUIREMENT.
The script would create ~oracle/.ssh/config file on remote host ol79rac1. If a config file exists already at ~oracle/.ssh/config, it would be backed up to ~oracle/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host ol79rac1.
Warning: Permanently added 'ol79rac1,192.168.56.101' (ECDSA) to the list of known hosts.
oracle@ol79rac1's password:
Done with creating .ssh directory and setting permissions on remote host ol79rac1.
Creating .ssh directory and setting permissions on remote host ol79rac2
THE SCRIPT WOULD ALSO BE REVOKING WRITE PERMISSIONS FOR group AND others ON THE HOME DIRECTORY FOR oracle. THIS IS AN SSH REQUIREMENT.
The script would create ~oracle/.ssh/config file on remote host ol79rac2. If a config file exists already at ~oracle/.ssh/config, it would be backed up to ~oracle/.ssh/config.backup.
The user may be prompted for a password here since the script would be running SSH on host ol79rac2.
Warning: Permanently added 'ol79rac2,192.168.56.102' (ECDSA) to the list of known hosts.
oracle@ol79rac2's password:
Done with creating .ssh directory and setting permissions on remote host ol79rac2.
Copying local host public key to the remote host ol79rac1
The user may be prompted for a password or passphrase here since the script would be using SCP for host ol79rac1.
oracle@ol79rac1's password:
Done copying local host public key to the remote host ol79rac1
Copying local host public key to the remote host ol79rac2
The user may be prompted for a password or passphrase here since the script would be using SCP for host ol79rac2.
oracle@ol79rac2's password:
Done copying local host public key to the remote host ol79rac2
Creating keys on remote host ol79rac1 if they do not exist already. This is required to setup SSH on host ol79rac1.
Creating keys on remote host ol79rac2 if they do not exist already. This is required to setup SSH on host ol79rac2.
Generating public/private rsa key pair.
Your identification has been saved in .ssh/id_rsa.
Your public key has been saved in .ssh/id_rsa.pub.
The key fingerprint is:
SHA256:w3fs5CBXRHBJZjpcV4yPzio7ughfpbTuOwmDIYMrGRM oracle@ol79rac2
The key's randomart image is:
+---[RSA 1024]----+
| .+O..+.|
|E . B... .|
| o + . o |
|+ o . . + . .|
| = o o S = +o |
|+ . o. O * o |
|. . o+. o. |
| o +o o . |
| o.*=.+ |
+----[SHA256]-----+
Updating authorized_keys file on remote host ol79rac1
Updating known_hosts file on remote host ol79rac1
Updating authorized_keys file on remote host ol79rac2
Updating known_hosts file on remote host ol79rac2
SSH setup is complete.
------------------------------------------------------------------------
Verifying SSH setup
===================
The script will now run the date command on the remote nodes using ssh
to verify if ssh is setup correctly. IF THE SETUP IS CORRECTLY SETUP,
THERE SHOULD BE NO OUTPUT OTHER THAN THE DATE AND SSH SHOULD NOT ASK FOR
PASSWORDS. If you see any output other than date or are prompted for the
password, ssh is not setup correctly and you will need to resolve the
issue and set up ssh again.
The possible causes for failure could be:
1. The server settings in /etc/ssh/sshd_config file do not allow ssh
for user oracle.
2. The server may have disabled public key based authentication.
3. The client public key on the server may be outdated.
4. ~oracle or ~oracle/.ssh on the remote host may not be owned by oracle.
5. User may not have passed -shared option for shared remote users or
may be passing the -shared option for non-shared remote users.
6. If there is output in addition to the date, but no password is asked,
it may be a security alert shown as part of company policy. Append the
additional text to the <OMS HOME>/sysman/prov/resources/ignoreMessages.txt file.
------------------------------------------------------------------------
--ol79rac1:--
Running /usr/bin/ssh -x -l oracle ol79rac1 date to verify SSH connectivity has been setup from local host to ol79rac1.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
Tue Jan 3 14:57:56 KST 2023
------------------------------------------------------------------------
--ol79rac2:--
Running /usr/bin/ssh -x -l oracle ol79rac2 date to verify SSH connectivity has been setup from local host to ol79rac2.
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL. Please note that being prompted for a passphrase may be OK but being prompted for a password is ERROR.
Tue Jan 3 14:57:56 KST 2023
------------------------------------------------------------------------
------------------------------------------------------------------------
Verifying SSH connectivity has been setup from ol79rac1 to ol79rac1
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL.
Tue Jan 3 14:57:56 KST 2023
------------------------------------------------------------------------
------------------------------------------------------------------------
Verifying SSH connectivity has been setup from ol79rac1 to ol79rac2
IF YOU SEE ANY OTHER OUTPUT BESIDES THE OUTPUT OF THE DATE COMMAND OR IF YOU ARE PROMPTED FOR A PASSWORD HERE, IT MEANS SSH SETUP HAS NOT BEEN SUCCESSFUL.
Tue Jan 3 14:57:57 KST 2023
------------------------------------------------------------------------
-Verification from complete-
SSH verification complete.
엔진 설치
경로 : $ORACLE_HOME/database
파일 : runInstaller
oracle@ol79rac1[RACDB1]:/ora_engine/12c/dbhome_1/database$ ls
install response rpm runInstaller sshsetup stage welcome.html
oracle@ol79rac1[RACDB1]:/ora_engine/12c/dbhome_1/database$ ./runInstaller
Starting Oracle Universal Installer...
Checking Temp space: must be greater than 500 MB. Actual 66856 MB Passed
Checking swap space: must be greater than 150 MB. Actual 5048 MB Passed
Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2023-03-01_03-13-22AM. Please wait ...
[node1]
[root@ol79rac1 ~]# /ora_engine/12c/dbhome_1/root.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /ora_engine/12c/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 contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.
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.
-------------------------------------------------------------------------
[node2]
[root@ol79rac2 ~]# /ora_engine/12c/dbhome_1/root.sh
Performing root user operation.
The following environment variables are set as:
ORACLE_OWNER= oracle
ORACLE_HOME= /ora_engine/12c/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 contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.
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.
DB 설치 (node 1에서 진행)
oracle@ol79rac1[RACDB1]:/home/oracle$ dbca
cf) Storage Location Customize
cf) All initialztion parameters 확인
리스너 확인 (rac의 리스너는 grid가 제어)
[node 1]
grid@ol79rac1[+ASM1]:/home/grid$ lsnrctl status
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 02-MAR-2023 17:47:20
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 02-MAR-2023 17:45:47
Uptime 0 days 0 hr. 1 min. 34 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /grid_engine/12c/grid/network/admin/listener.ora
Listener Log File /grid_engine/base/diag/tnslsnr/ol79rac1/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.10)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.13)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "+ASM_DATA" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "+ASM_MGMT" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "+ASM_OCR_VOTE" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "+ASM_RECO" has 1 instance(s).
Instance "+ASM1", status READY, has 1 handler(s) for this service...
Service "RACDB" has 1 instance(s).
Instance "RACDB1", status READY, has 1 handler(s) for this service...
Service "RACDBXDB" has 1 instance(s).
Instance "RACDB1", status READY, has 1 handler(s) for this service...
The command completed successfully
[node 2]
grid@ol79rac2[+ASM2]:/home/grid$ lsnrctl status
LSNRCTL for Linux: Version 12.2.0.1.0 - Production on 02-MAR-2023 17:50:03
Copyright (c) 1991, 2016, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=LISTENER)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 12.2.0.1.0 - Production
Start Date 02-MAR-2023 17:48:45
Uptime 0 days 0 hr. 1 min. 18 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /grid_engine/12c/grid/network/admin/listener.ora
Listener Log File /grid_engine/base/diag/tnslsnr/ol79rac2/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=LISTENER)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.11)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=192.168.100.14)(PORT=1521)))
Services Summary...
Service "+ASM" has 1 instance(s).
Instance "+ASM2", status READY, has 1 handler(s) for this service...
Service "+ASM_DATA" has 1 instance(s).
Instance "+ASM2", status READY, has 1 handler(s) for this service...
Service "+ASM_MGMT" has 1 instance(s).
Instance "+ASM2", status READY, has 1 handler(s) for this service...
Service "+ASM_OCR_VOTE" has 1 instance(s).
Instance "+ASM2", status READY, has 1 handler(s) for this service...
Service "+ASM_RECO" has 1 instance(s).
Instance "+ASM2", status READY, has 1 handler(s) for this service...
Service "RACDB" has 1 instance(s).
Instance "RACDB2", status BLOCKED, has 1 handler(s) for this service...
DB기동 확인
--DBNAME으로 한번에 확인
srvctl status database -d [DBNAME]
[root@ol79rac1 ~]# srvctl status database -d RACDB
Instance RACDB1 is running on node ol79rac1
Instance RACDB2 is running on node ol79rac2
--------------------------------------------------------------
--------------------------------------------------------------
--instance 별로 확인
srvctl status instance -d [DBNAME] -i [INSTANCENAME]
[root@ol79rac1 ~]# srvctl status instance -d RACDB -i RACDB1
Instance RACDB1 is running on node ol79rac1
[root@ol79rac1 ~]# srvctl status instance -d RACDB -i RACDB2
Instance RACDB2 is running on node ol79rac2