Compactly build an Oracle database (19c) on Linux on VirtualBox

Compactly build an Oracle database (19c) on VirtualBox

If you build multiple virtual machines in VirtualBox, it will consume a lot of resources on your terminal's personal computer. If the purpose of creating a virtual machine is "operation check", you don't store a lot of data, and you don't run heavy processing, you don't want to spend too much resources. So I tried to wake it up in the procedure.

However, if the focus is on logical design and SQL operation check rather than DB physical design, It is recommended to easily create a DB from the VirtualBox image by referring to the following.

https://qiita.com/ora_gonsuke777/items/b41f37637e59319796b4

Constitution

Host OS Virtualization software Guest OS DB DB Remarks
Windows10 Pro VirtualBox6.1 Oracle Linux 7.8 Oracle Database 19c Non-CDB, Enterprise Edition

Download Oracle Linux

https://www.oracle.com/technetwork/jp/server-storage/linux/downloads/index.html

image.png

image.png

image.png

image.png

Build Oracle Linux (Create Virtual Machine)

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

yum -y update

image.png

image.png

image.png

image.png

image.png

image.png

#Stop
systemctl stop firewalld
#Status check
systemctl status firewalld
#Automatic start / stop
systemctl disable firewalld
#Check settings
systemctl is-enabled firewalld

image.png

Download Oracle Database

https://www.oracle.com/technetwork/jp/database/enterprise-edition/downloads/index.html

Pre-work

#Installation
sudo yum -y install oracle-database-preinstall-19c
#Run
export LANG=C
sudo oracle-database-preinstall-19c-verify
sudo passwd oracle
mkdir -p /u01/app/oracle/product/19.3.0/dbhome_1
chown -R oracle:oinstall /u01
chmod -R 775 /u01

mkdir -p /u01/app/oraInventory
chown -R oracle:oinstall /u01/app/oraInventory
chmod -R 775 /u01/app/oraInventory

Oracle Database installation

image.png

#Privilege
chmod 777 LINUX.X64_193000_db_home.zip
su oracle
unzip -d /u01/app/oracle/product/19.3.0/dbhome_1/ LINUX.X64_193000_db_home.zip
cd /u01/app/oracle/product/19.3.0/dbhome_1/
./runInstaller

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

Create database (using dbca) * Execute as oracle user

export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=/u01/app/oracle/product/19.3.0/dbhome_1
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/jdk/bin:${PATH}
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export NLS_LANG=JAPANESE_JAPAN.UTF8
export LANG=ja_JP.UTF-8
export ORACLE_SID=ora01
vi $HOME/.bash_profile

image.png

vi /etc/hosts
#Reboot for the time being
reboot
#Setting Example
# 192.168.XX.XXX dev01 dev01.XXX.XXX.XX
$ORACLE_HOME/bin/dbca

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

image.png

sqlplus / as sysdba
#After restarting linux, start DB
# startup
#Connect as system user
connect system/XXXX
#SQL execution
SELECT INSTANCE_NAME FROM V$INSTANCE;
#Check the status of the listener
#If it doesn't work, start it
lsnrctl status

image.png

#Connect
sqlplus / as sysdba
#Status quo confirmation
show parameter memory
show parameter sga
#Memory size change
alter system set memory_target = 0 scope = spfile;
alter system set memory_max_target = 0 scope = spfile;
alter system set sga_target = 512m scope = spfile;
alter system set pga_aggregate_target = 128m scope = spfile;
#DB restart (setting reflection)
shutdown immediate
startup
#Status quo confirmation
show parameter memory
show parameter sga
#This time, to change the Linux settings, stop the DB
shutdown immediate
#Listener stopped after exit from sqlplus
lsnrctl stop
#Stop linux * After su root
shutdown now

image.png

image.png

Connecting to EM Express

https://[OracleサーバのIPアドレス]:5500/em/login

User creation * Schema is also created at the same time

--See which tablespace the user uses by default
select property_value from database_properties where property_name ='DEFAULT_PERMANENT_TABLESPACE';
--Make sure it is created in the user tablespace
--User created
create user test identified by test;
--Check if it was created
--Names are managed in uppercase.
select username,default_tablespace,created from dba_users where username = 'TEST';

Granting authority * You do not even have the authority to connect just by creating a user

--DBA authorization
grant DBA to test;
--Permission confirmation
select * from dba_role_privs;

Reference URL

Install Oracle Linux on a VirtualBox virtual machine https://dbalone.com/oracle-linux-install

Install Oracle 12c R2 on Oracle Linux 7.5 https://qiita.com/mkyz08/items/945cdf72597b0e044b14

Install Oracle DB 19c on-premise https://infrasenavi.com/gijutsuroku/2266

How to stop the CentOS7 firewall https://www.server-memo.net/centos-settings/centos7/firewalld-stop.html

What is the difference between an Oracle schema and a user? https://sql-oracle.com/?p=110

Recommended Posts

Compactly build an Oracle database (19c) on Linux on VirtualBox
Build Oracle Database 19c on Oracle Linux 8.3 (DB Build Part 2)
Oracle Database 18c installation (Linux CentOS 7 edition)
Build an NFS server on Arch Linux
Build an LNPP environment on Amazon Linux 2
Build an Arch Linux environment on Raspberry Pi
Build Apache HTTP Server and Wildfly on Oracle Linux 8
[Linux] I installed CentOS on VirtualBox
[UE4] Build DedicatedServer on Windows and Linux
I created an SFTP-only user on Linux.
X86 assembler on Linux (linkage with C)
[C] [python] Read with AquesTalk on Linux
Build a Samba server on Arch Linux
Linux C / C ++ Build your own library creation environment
Set up an Objective-C 2.0 development environment on Linux
How to build Java environment on Ubuntu (Linux)