오라클 DB 19C를 GUI 기반이 아닌 CLI 로 설치 해보겠습니다.
부득이하게 GUI가 안되는 환경에서 설치하는 방법입니다
Oracle DB 19c는 아래에서 받으시면 됩니다 .
https://raynee.tistory.com/476
설치 환경
NAME | 내용 |
SDI | ORADB |
USER | oracle(1001) |
GROUP | dba(1001), oinstall(1002) |
ORACLE_BASE | /u01/app/oracle/ |
ORACLE_HOME | /u01/app/oracle/product/19.0.0/dbhome_1 |
DB_File | LINUX.X64_193000_db_home.zip |
OS 환경 설정
HOST 파일 변경
[root@oradb ~]# vi /etc/hosts
192.168.56.50 oradb
방화벽 해제
[root@oradb ~]# vi /etc/selinux/config
SELINUX=enforcing => disabled
[root@oradb ~]# shutdown -r now
[root@oradb ~]# sestatus
SELinux status: disabled
Localrepo 설정
`/localrepo` 디렉토리를 만들고 CD-ROM을 Mount 하여 Localrepo를 잡아준다.
실장비의 경우 파일을 옮겨준다.
`/etc/yum.repos.d/` 의 `oracle-linux-ol7.repo` `uek-ol7.repo` `virt-ol7.repo` 기존 repo파일을 열어 `enable=0` 으로 바꾸어 repolist 갱신이 안되게 해준다. 혹은 기존 파일 전부를 삭제 한다.
[root@oradb ~]# mkdir /localrep
[root@oradb ~]# mount /dev/sr0 /localrepo
[root@oradb ~]# vi /etc/yum.repos.d/localrepo.repo
[ol7_localrepo]
name=ol7_localrepo
baseurl=file:///localrepo
gpgcheck=0
enabled=1
Repolist update를 해준다.
[root@oradb yum.repos.d]# yum clean all
[root@oradb yum.repos.d]# yum repolist all
Selinux Disable 설정
selinux 설정 값을 `disabled` 로 변경.
설정값은 rebooting 후 적용 이된다.
[root@oradb ~]# vi /etc/selinux/config
SELINUX=enforcing => disabled
[root@oradb ~]# shutdown -r now
[root@oradb ~]# sestatus
SELinux status: disabled
DB 관련 환경 변수 설정
`/etc/sysctl.conf`의 kernel Parameter 값 조절 하기 .
Meminfo 값은 kbyte이고, sysctl 값은 byte값이라 kbyte를 byte로 변경 후 값 계산(byte=kbyte*1024)
SHMMAX매개변수는 공유 메모리 세그먼트의 최대 크기(바이트 단위)를 정의하는데 사용됩니다. 오라클 SGA는 공유 메모리로 구성되며, SHMMAX가 올바르게 설정되지 않은 경우 SGA의 크기가 제약될 수도 있습니다. 따라서 SGA의 크기보다 작지 않도록 SHMMAX를 설정해야 합니다. SHMMAX 매개변수가 잘못 설정된 경우에는 다음과 같은 에러가 발생합니다
> ORA-27123: unable to attach to shared memory segment
SHMMAX 매개변수의 설정값을 확인하려면 아래와 같이 명령을 수행합니다:
> cat /proc/sys/kernel/shmmax
→shmmax =(physical memory in bytes)/2 = 2059091968
`shmmax`는 Phsical memory의 절반
`cat /proc/meminfo | grep MemTotal` * 1024 혹은 `free -b` 명령어로 확인
[root@oradb ~]# cat /proc/meminfo | grep MemTotal
MemTotal: 4021664 kB
4021664 * 2 = 4118183936
[root@oradb ~]# free -b
total used free shared buff/cache available
Mem: 4118183936 414703616 3292246016 11919360 411234304 3441049600
Swap: 17179865088 0 17179865088
[root@oradb ~]# (free -b | sed -n '2p' | awk '{print $2}')
270479736832
SHMALL 커널 매개변수는 특정 시점에 시스템에서 사용 가능한 공유 메모리의 최대 크기(페이지 단위)를 설정하는데 사용됩니다.
따라서 이 매개변수는 최소한 아래 값보다 커야 합니다
→shmall=max/pagesize=502708
`shmall`는 `shmmax`값에서 shmmni(pagesize) 나눈 값
SMMNI 매개변수는 공유 메모리 세그먼트의 최대 숫자를 설정하는데 사용되며, 디폴트 값은 4096입니다.
이 값은 일반적으로 충분하며 변경될 필요가 없습니다.
[root@oradb ~]# cat /proc/sys/kernel/shmmni
4096
[root@oradb ~]# getconf PAGE_SIZE
4096
[root@oradb ~]# vi /etc/sysctl.conf
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1005426
kernel.shmmax = 4118224896
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
[root@oradb ~]# sysctl -p
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1005426
kernel.shmmax = 4118224896
kernel.panic_on_oops = 1
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
```
User Limit 설정
리소스 제한인 /etc/security/limits.conf
memlock값은 totalmemory 값에 0.9를 곱한다.
4021664*0.9=637732.8
[root@oradb ~]# cat /proc/meminfo | grep MemTotal
MemTotal: 4021664 kB
[root@oradb ~]# vi /etc/security/limits.conf
oracle soft nofile 1024
oracle hard nofile 65536
oracle soft nproc 16384
oracle hard nproc 16384
oracle soft stack 10240
oracle hard stack 32768
oracle hard memlock 3619498
oracle soft memlock 3619498
grid soft nofile 1024
grid hard nofile 65536
grid soft nproc 16384
grid hard nproc 16384
grid soft stack 10240
grid hard stack 32768
grid hard memlock 3619498
grid soft memlock 3619498
필요 패키지 설치
yum install -y binutils
yum install -y compat-libcap1
yum install -y compat-libstdc++-33
yum install -y glibc
yum install -y glibc-devel
yum install -y kmod-20
yum install -y kmod-libs-20
yum install -y ksh
yum install -y libaio
yum install -y libaio-devel
yum install -y libgcc
yum install -y libstdc++
yum install -y libstdc++-devel
yum install -y libX11
yum install -y libXau
yum install -y libxcb
yum install -y libXi
yum install -y libXtst
yum install -y make
yum install -y net-tools
yum install -y nfs-utils
yum install -y smartmontools
yum install -y sysstat
oracle 계정 및 profile 설정
Oracle 계정을 설정 한다.
[root@oradb ~]# groupadd -g 1001 dba
[root@oradb ~]# groupadd -g 1002 oinstall
[root@oradb ~]# useradd -u 1001 -g oinstall -G dba oracle
[root@oradb ~]# passwd oracle
root 및 oracle 계정의 profile를 설정 한다.
[root@oradb ~]# vi .bash_profile
unset USERNAME
export ORACLE_HOME=/u01/app/oracle/product/19.0.0.0/dbhome_1
export PATH=$PATH:$GI_HOME/bin:$ORACLE_HOME/bin
export PS1='\u@\h:$PWD# '
set -o vi
[root@oradb ~]# vi /home/oracle/.bash_profile
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
export PS1='[$ORACLE_SID]\u@\h:$PWD# '
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.0.0.0/dbhome_1
export ORACLE_UNQNAME=ORADB
export ORACLE_UNQNAME_LOWER=`echo $ORACLE_UNQNAME | tr A-Z a-z`
export ORACLE_SID=${ORACLE_UNQNAME}
export PATH=$PATH:$ORACLE_HOME/bin:$GI_HOME/bin:$GI_HOME/OPatch:$ORACLE_HOME/OPatch
Oracle DB 설치 하기
디렉토리 생성
[root@oradb ~]# mkdir -p /u01/app/oracle
[root@oradb ~]# chown -R oracle:oinstall /u01
[root@oradb ~]# chmod -R 775 /u01
[root@oradb ~]# su - oracle
마지막 로그인: 금 1월 6 13:17:20 KST 2023 일시 pts/0
[ORADB]oracle@oradb:/home/oracle# mkdir -p $ORACLE_HOME
Oracle DB 엔진 unzip
DB 엔진 업로드 및 `$ORACLE_HOME`에 압축 해제
root@oradb:/root# su - oracle
마지막 로그인: 일 1월 8 22:01:13 KST 2023 일시 pts/0
[ORADB]oracle@oradb:/home/oracle# ls
LINUX.X64_193000_db_home.zip
[ORADB]oracle@oradb:/home/oracle# echo $ORACLE_HOME
/u01/app/oracle/product/19.0.0.0/dbhome_1
[ORADB]oracle@oradb:/home/oracle# mkdir -p $ORACLE_HOME
[ORADB]oracle@oradb:/home/oracle# unzip LINUX.X64_193000_db_home.zip -d $ORACLE_HOME
Oracle DB Install
[ORADB]oracle@oradb$ cd $ORACLE_HOME
[ORADB]oracle@oradb$ vi ./install/response/db_install.rsp
29 oracle.install.option=INSTALL_DB_SWONLY
34 UNIX_GROUP_NAME=dba
41 INVENTORY_LOCATION=/u01/app/oraInventory
45 ORACLE_HOME=/u01/app/oracle/product/19.0.0/dbhome_1
50 ORACLE_BASE=/u01/app/oracle
62 oracle.install.db.InstallEdition=EE
79 oracle.install.db.OSDBA_GROUP=dba
85 oracle.install.db.OSOPER_GROUP=dba
90 oracle.install.db.OSBACKUPDBA_GROUP=dba
95 oracle.install.db.OSDGDBA_GROUP=dba
100 oracle.install.db.OSKMDBA_GROUP=dba
105 oracle.install.db.OSRACDBA_GROUP=dba
[ORADB]oracle@oradb$ ./runInstaller -silent -responseFile ./install/response/db_install.rsp -waitForCompletion
Launching Oracle Database Setup Wizard...
[WARNING] [INS-13014] Target environment does not meet some optional requirements.
CAUSE: Some of the optional prerequisites are not met. See logs for details. installActions2022-06-28_06-10-10PM.log
ACTION: Identify the list of failed prerequisite checks from the log: installActions2022-06-28_06-10-10PM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
The response file for this session can be found at:
/u01/app/oracle/product/19.0.0/dbhome_1/install/response/db_2022-06-28_06-10-10PM.rsp
You can find the log of this install session at:
/tmp/InstallActions2022-06-28_06-10-10PM/installActions2022-06-28_06-10-10PM.log
As a root user, execute the following script(s):
1. /u01/app/oraInventory/orainstRoot.sh
2. /u01/app/oracle/product/19.0.0/dbhome_1/root.sh
Execute /u01/app/oraInventory/orainstRoot.sh on the following nodes:
[oradb]
Execute /u01/app/oracle/product/19.0.0/dbhome_1/root.sh on the following nodes:
[oradb]
Successfully Setup Software with warning(s).
Moved the install session logs to:
/u01/app/oraInventory/logs/InstallActions2022-06-28_06-10-10PM
설치 중간에 `root` 계정으로 스크립트 실행
[root@oradb ~]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to dba.
The execution of the script is complete.
[root@oradb ~]# /u01/app/oracle/product/19.0.0/dbhome_1/root.sh
Check /u01/app/oracle/product/19.0.0/dbhome_1/install/root_oradb_2022-06-28_18-16-30-601017385.log for the output of root script
Oracle DB Create
Config 파일 수정
[ORADB]oracle@oradb$ cd $ORACLE_HOME
[ORADB]oracle@oradb$ vi ./assistants/dbca/dbca.rsp
32 gdbName=oradb.exadata.co.kr
42 sid=ORADB
52 databaseConfigType=SI
223 templateName=General_Purpose.dbc
233 sysPassword=welcome1
243 systemPassword=welcome1
273 emExpressPort=
411 datafileDestination=/u01/oradata/{DB_UNIQUE_NAME}
431 storageType=FS
468 characterSet=KO16MSWIN949
604 totalMemory=1024
DB Silent Install
[ORADB]oracle@oradb$ dbca -silent -createDatabase -responseFile ./assistants/dbca/dbca.rsp
[WARNING] [DBT-11209] Current available memory is less than the required available memory (1,024MB) for creating the database.
CAUSE: Following nodes do not have required available memory :
Node:oradb Available memory:591.0977MB (605284.0KB)
[WARNING] [DBT-06208] The 'SYS' password entered does not conform to the Oracle recommended standards.
CAUSE:
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
[WARNING] [DBT-06208] The 'SYSTEM' password entered does not conform to the Oracle recommended standards.
CAUSE:
a. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit [0-9].
b.The password entered is a keyword that Oracle does not recommend to be used as password
ACTION: Specify a strong password. If required refer Oracle documentation for guidelines.
Prepare for db operation
10% complete
Copying database files
....
100% complete
Database creation complete. For details check the logfiles at:
/u01/app/oracle/cfgtoollogs/dbca/oradb.
Database Information:
Global Database Name:oradb.exadata.co.kr
System Identifier(SID):ORADB
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/oradb/oradb.log" for further details.
Oracle DB 19C 설치 확인
[ORADB]oracle@oradb$ ps -ef | grep pmon
oracle 14035 1 0 21:41 ? 00:00:00 ora_pmon_ORADB
oracle 14441 10423 0 21:42 pts/0 00:00:00 grep --color=auto pmon
[ORADB]oracle@oradb$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Jun 28 21:42:33 2022
Version 19.11.0.0.0
Copyright (c) 1982, 2020, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0
SQL> select instance_name, status from v$instance;
INSTANCE_NAME STATUS
---------------- ------------
ORADB OPEN
SQL> exit
'★━Oracle ExaData〃 > 3. Oracle DB' 카테고리의 다른 글
Oracle 19c HOME 디렉토리 변경하기(runinstall) (0) | 2023.08.07 |
---|---|
Oracle 19c HOME 디렉토리 변경하기 (0) | 2023.08.07 |
오라클 데이터베이스 시작 (0) | 2022.05.24 |
[DBA]Oracle DB Download (0) | 2021.07.27 |
댓글