티스토리 뷰
Linux 서버에 Oralce 을 설치해본게 너무 오랜만이어서 약간의 시간이 걸렸고,
이번에 설치하면서 기록을 해본다
우선 ubuntu 20.04 에 해당 버전을 설치하려고 했더니, 안된다는 내용이 있었고
CentOS는 더이상 사용하기에는 이슈가 있어서, rocky linux 를 선택했고, 여기에 설치해봤다
구성환경
OS : Rocky Linux release 8.4 (Green Obsidian)
Hostname : oracle-db-19c.linux.com
사전에 필요한 패키지 설정
[root@oracle-db-19c ~]# yum -y groupinstall 'Development Tools'
[root@oracle-db-19c ~]# yum install -y libnsl
[root@oracle-db-19c ~]# yum -y install bc \
binutils \
elfutils-libelf \
elfutils-libelf-devel \
fontconfig-devel \
glibc \
glibc-devel \
ksh \
libaio \
libaio-devel \
libXrender \
libXrender-devel \
libX11 \
libXau \
libXi \
libXtst \
libgcc \
librdmacm-devel \
libstdc++ \
libstdc++-devel \
libxcb \
make \
net-tools \
smartmontools \
sysstat \
unzip \
libnsl \
libnsl2
DNS 설정
[root@oracle-db-19c ~]# echo "192.168.5.183 oracle-db-19c.linux.com oracle-db-19c" >> /etc/hosts
Disable Transparent HugePages in Rocky Linux 8:
[root@oracle-db-19c ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
[always] madvise never
[root@oracle-db-19c ~]# vim /etc/default/grub
##transparent_hugepage=never 추가
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="crashkernel=auto resume=/dev/mapper/rl-swap rd.lvm.lv=rl/root rd.lvm.lv=rl/swap transparent_hugepage=never"
GRUB_DISABLE_RECOVERY="true"
GRUB_ENABLE_BLSCFG=true
[root@oracle-db-19c ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
done
[root@oracle-db-19c ~]# systemctl reboot
[root@oracle-db-19c ~]# cat /sys/kernel/mm/transparent_hugepage/enabled
always madvise [never]
Create Linux users and groups as required by Oracle Database 19c.
[root@oracle-db-19c ~]# groupadd -g 1501 oinstall
[root@oracle-db-19c ~]# groupadd -g 1502 dba
[root@oracle-db-19c ~]# groupadd -g 1503 oper
[root@oracle-db-19c ~]# groupadd -g 1504 backupdba
[root@oracle-db-19c ~]# groupadd -g 1505 dgdba
[root@oracle-db-19c ~]# groupadd -g 1506 kmdba
[root@oracle-db-19c ~]# groupadd -g 1507 racdba
[root@oracle-db-19c ~]# useradd -u 1501 -g oinstall -G dba,oper,backupdba,dgdba,kmdba,racdba oracle
[root@oracle-db-19c ~]# echo "oracle" | passwd oracle --stdin
Changing password for user oracle.
passwd: all authentication tokens updated successfully.
Set Security limits for Oracle user:
[root@oracle-db-19c ~]# vi /etc/security/limits.d/30-oracle.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 134217728
oracle soft memlock 134217728
Adjust Kernel Parameters in Rocky Linux 8:
[root@oracle-db-19c ~]# vi /etc/sysctl.d/98-oracle.conf
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
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@oracle-db-19c ~]# sysctl -p
Create Directories for Oracle Database 19c:
[root@oracle-db-19c ~]# mkdir -p /u01/app/oracle/product/19.3.0/dbhome_1
[root@oracle-db-19c ~]# mkdir -p /u02/oradata
[root@oracle-db-19c ~]# chown -R oracle:oinstall /u01 /u02
[root@oracle-db-19c ~]# chmod -R 775 /u01 /u02
/u01 은 Oracle DBMS 디렉토리 , /u02 는 Racle Databases 디렉토리이다
Configure Linux Environment for Oracle User:
[root@oracle-db-19c ~]# su - oracle
[oracle@oracle-db-19c ~]$
[oracle@oracle-db-19c ~]$ vi ~/.bash_profile
# Oracle Settings
export TMP=/tmp
export TMPDIR=$TMP
export ORACLE_HOSTNAME=oracle-db-19c.linux.com
export ORACLE_UNQNAME=cdb1
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/19.3.0/dbhome_1
export ORA_INVENTORY=/u01/app/oraInventory
export ORACLE_SID=cdb1
export PDB_NAME=pdb1
export DATA_DIR=/u02/oradata
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
[oracle@oracle-db-19c ~]$ source ~/.bash_profile
Oracle 파일 다운로드 는 아래에서 할 수 있다
https://www.oracle.com/database/technologies/oracle-database-software-downloads.html#19c
[oracle@oracle-db-19c ~]$ unzip LINUX.X64_193000_db_home.zip -d $ORACLE_HOME
[oracle@oracle-db-19c ~]$ export CV_ASSUME_DISTID=RHEL8.0
[oracle@oracle-db-19c ~]$ cd $ORACLE_HOME
[oracle@oracle-db-19c dbhome_1]$ ./runInstaller -ignorePrereq -waitforcompletion -silent \
oracle.install.option=INSTALL_DB_SWONLY \
ORACLE_HOSTNAME=${ORACLE_HOSTNAME} \
UNIX_GROUP_NAME=oinstall \
INVENTORY_LOCATION=${ORA_INVENTORY} \
ORACLE_HOME=${ORACLE_HOME} \
ORACLE_BASE=${ORACLE_BASE} \
oracle.install.db.InstallEdition=EE \
oracle.install.db.OSDBA_GROUP=dba \
oracle.install.db.OSBACKUPDBA_GROUP=backupdba \
oracle.install.db.OSDGDBA_GROUP=dgdba \
oracle.install.db.OSKMDBA_GROUP=kmdba \
oracle.install.db.OSRACDBA_GROUP=racdba \
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false \
DECLINE_SECURITY_UPDATES=true
Launching Oracle Database Setup Wizard...
The response file for this session can be found at:
/u01/app/oracle/product/19.3.0/dbhome_1/install/response/db_2020-04-28_02-44-19PM.rsp
You can find the log of this install session at:
/tmp/InstallActions2020-04-28_02-44-19PM/installActions2020-04-28_02-44-19PM.log
As a root user, execute the following script(s):
1. /u01/app/oraInventory/orainstRoot.sh
2. /u01/app/oracle/product/19.3.0/dbhome_1/root.sh
Execute /u01/app/oraInventory/orainstRoot.sh on the following nodes:
[oracle-db-19c]
Execute /u01/app/oracle/product/19.3.0/dbhome_1/root.sh on the following nodes:
[oracle-db-19c]
[root@oracle-db-19c ~]# /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 oinstall.
The execution of the script is complete.
[root@oracle-db-19c ~]# /u01/app/oracle/product/19.3.0/dbhome_1/root.sh
Check /u01/app/oracle/product/19.3.0/dbhome_1/install/root_oracle-db-19c.linux.com_2020-04-28_15-01-30-090367646.log for the output of root script
[oracle@oracle-db-19c ~]$ lsnrctl start
[oracle@oracle-db-19c ~]$ dbca -silent -createDatabase \
> -templateName General_Purpose.dbc \
> -gdbname ${ORACLE_SID} -sid ${ORACLE_SID} \
> -responseFile NO_VALUE \
> -characterSet AL32UTF8 \
> -sysPassword V3ryStr@ng \
> -systemPassword V3ryStr@ng \
> -createAsContainerDatabase true \
> -numberOfPDBs 1 \
> -pdbName ${PDB_NAME} \
> -pdbAdminPassword V3ryStr@ng \
> -databaseType MULTIPURPOSE \
> -automaticMemoryManagement false \
> -totalMemory 800 \
> -storageType FS \
> -datafileDestination "${DATA_DIR}" \
> -redoLogFileSize 50 \
> -emConfiguration NONE \
> -ignorePreReqs
Prepare for db operation
8% complete
Copying database files
31% complete
Creating and starting Oracle instance
32% complete
36% complete
40% complete
43% complete
46% complete
Completing Database Creation
51% complete
53% complete
54% complete
Creating Pluggable Databases
58% complete
77% complete
Executing Post Configuration Actions
100% complete
Database creation complete. For details check the logfiles at:
/u01/app/oracle/cfgtoollogs/dbca/cdb1.
Database Information:
Global Database Name:cdb1
System Identifier(SID):cdb1
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/cdb1/cdb1.log" for further details.
[oracle@oracle-db-19c ~]$ su -
Password:
[root@oracle-db-19c ~]# sed -i 's/:N$/:Y/g' /etc/oratab
[oracle@oracle-db-19c ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Tue Apr 28 15:57:06 2020
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL>
SQL> ALTER SYSTEM SET DB_CREATE_FILE_DEST='/u02/oradata' SCOPE=BOTH;
System altered.
SQL> ALTER PLUGGABLE DATABASE PDB1 SAVE STATE;
Pluggable database altered.
Create SystemD Service for Oracle Database 19c on Rocky Linux 8:
[Unit]
Description=Oracle Database Service
After=network.target
[Service]
Type=forking
ExecStart=/u01/app/oracle/product/19.3.0/dbhome_1/bin/dbstart /u01/app/oracle/product/19.3.0/dbhome_1
ExecStop=/u01/app/oracle/product/19.3.0/dbhome_1/bin/dbshut /u01/app/oracle/product/19.3.0/dbhome_1
User=oracle
TimeoutSec=300s
[Install]
WantedBy=multi-user.target
[root@oracle-db-19c ~]# systemctl daemon-reload
[root@oracle-db-19c ~]# systemctl enable --now dbora.service
Created symlink /etc/systemd/system/multi-user.target.wants/dbora.service â /usr/lib/systemd/system/dbora.service
[root@oracle-db-19c ~]# systemctl status dbora.service
● dbora.service - Oracle Database Service
Loaded: loaded (/usr/lib/systemd/system/dbora.service; enabled; vendor preset: disabled)
Active: active (running) since Sat 2021-09-04 13:56:01 KST; 3min 3s ago
Process: 2734 ExecStop=/u01/app/oracle/product/19.3.0/dbhome_1/bin/dbshut /u01/app/oracle/product/19.3.0/dbhome_1 (code=exited, status=0/SUCCESS)
Process: 14294 ExecStart=/u01/app/oracle/product/19.3.0/dbhome_1/bin/dbstart /u01/app/oracle/product/19.3.0/dbhome_1 (code=exited, status=0/SUCCESS)
Tasks: 70 (limit: 100771)
Memory: 975.7M
CGroup: /system.slice/dbora.service
├─14404 ora_pmon_neo
├─14406 ora_clmn_neo
├─14408 ora_psp0_neo
├─14411 ora_vktm_neo
├─14415 ora_gen0_neo
├─14417 ora_mman_neo
├─14421 ora_gen1_neo
├─14424 ora_diag_neo
├─14426 ora_ofsd_neo
├─14429 ora_dbrm_neo
├─14431 ora_vkrm_neo
├─14433 ora_svcb_neo
├─14435 ora_pman_neo
├─14437 ora_dia0_neo
├─14439 ora_dbw0_neo
├─14441 ora_lgwr_neo
├─14443 ora_ckpt_neo
├─14445 ora_lg00_neo
├─14447 ora_smon_neo
├─14449 ora_lg01_neo
├─14451 ora_smco_neo
├─14453 ora_reco_neo
├─14455 ora_w000_neo
사용자 추가하기
sqldeveloper 툴을 통하여 system 계정으로 로그인한다
로그인 후 사용자 추가
alter session set "_ORACLE_SCRIPT"=true;
create user aaa IDENTIFIED BY "aaa!!";
GRANT CONNECT, RESOURCE, DBA TO aaa;
참고)
https://www.centlinux.com/2020/04/install-oracle-database-19c-on-centos-8.html
'기록남기기' 카테고리의 다른 글
redmine4 설치 (0) | 2022.05.18 |
---|---|
YAML 문법 검사 사이트 (0) | 2021.11.09 |
kafka on kubernetes (with Strimzi) (0) | 2021.08.19 |
mariadb Galera Cluster on kubernetes (0) | 2021.08.18 |
k8s log monitoring Loki (0) | 2021.08.10 |
- Total
- Today
- Yesterday
- MySQL
- ㅗ험
- 평생학습원
- 성수
- 하안동
- 성수동
- 구글홈
- 인시그니아
- 광명동굴
- redis
- 우루과이
- 오후전략 완료~ 신일전자 2100원/에스트래픽 4180원/분할매수/가치를 믿자!
- 검단
- 비트코인
- 영화
- 이자카야
- 스시
- ㅐ
- ISA #연금저축펀드 #IRP
- 축구평가전
- 신천역
- confluent #kafka # control center
- centos7 #docker
- k8s #kubernetes
- 마라탕#하안동
- 오징어청춘
- ㅅ음
- 인터파크 티켓팅
- 먼 훗날 우리
- 빗썸
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |