Oracle 19c on ARM processors
Oracle has announced Oracle Database for Arm Architectures and it is now available. Let's test it.
A VM in the Cloud (Ampere processor)
On the Oracle Cloud you can create a free ARM instance:
I Choose the following image and shape:
which was configured as:
I've added my public key for SSH:
And just hit create.
When done, I ssh
to it and I'm ready to install Oracle 19c
Install Oracle 19c for aarch64
Preinstall
sudo dnf update -y
sudo dnf -y install -y oracle-database-preinstall-19c git
Add oracle
in sudoers and connect as oracle
sudo su
grep "oracle" /etc/sudoers || echo "oracle ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
sudo su - oracle
Create the directories for software and database
sudo mkdir -p mkdir -p /u01/oradata /u01/fast_recovery_area /u01/app/oracle/product
sudo chown -R oracle:dba /u01/app/oracle /u01/fast_recovery_area /u01/oradata
Get the software (you must go to https://www.oracle.com/database/technologies/oracle-database-software-downloads.html#db_ee in your browser, download Oracle Database 19c for LINUX ARM (aarch64)
, accept the license agreement and you will get the URL with a temporary AuthParam
)
wget -O LINUX.ARM64_1919000_db_home.zip https://download.oracle.com/otn/linux/oracle19c/1919000/LINUX.ARM64_1919000_db_home.zip?AuthParam=1688078278_8ad5e9f7685ef0f3c89ab680fd709b53
mkdir -p /u01/app/oracle/product/DB1919
unzip -d /u01/app/oracle/product/DB1919 LINUX.ARM64_1919000_db_home.zip
Setup the install:
cat > DB1919.rsp <<END
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v19.0.0
oracle.install.option=INSTALL_DB_SWONLY
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/u01/app/oraInventory
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/DB1919
oracle.install.db.InstallEdition=EE
oracle.install.db.OSDBA_GROUP=dba
oracle.install.db.OSOPER_GROUP=oper
oracle.install.db.OSBACKUPDBA_GROUP=backupdba
oracle.install.db.OSDGDBA_GROUP=dgdba
oracle.install.db.OSKMDBA_GROUP=kmdba
oracle.install.db.OSRACDBA_GROUP=dba
oracle.install.db.rootconfig.executeRootScript=false
oracle.install.db.rootconfig.configMethod=SUDO
oracle.install.db.rootconfig.sudoPath=/bin/sudo
oracle.install.db.rootconfig.sudoUserName=oracle
END
/u01/app/oracle/product/DB1919/runInstaller -silent -responseFile $PWD/DB1919.rsp
sudo /u01/app/oraInventory/orainstRoot.sh
sudo /u01/app/oracle/product/DB1919/root.sh
ORACLE_HOME=/u01/app/oracle/product/DB1919
Create a database
Create a Wallet to store the passwords:
$ORACLE_HOME/bin/mkstore -wrl dbc_wallet -create <<MKSTORE
oracle19
oracle19
MKSTORE
$ORACLE_HOME/bin/mkstore -wrl dbc_wallet -createEntry oracle.dbsecurity.sysPassword <<MKSTORE
oracle
oracle
oracle19
MKSTORE
Create a Database named CDB1 with standby logs in case it is part of a Data Guard configuration:
cat > add_standby_log.sql <<'SQL'
exec for i in (select t,g+rownum g,s from (select thread# t,max(bytes) s,count(*)+1 c from v$log group by thread#),(select rownum n from xmltable('1 to 100')),(select max(group#) g from v$log) where n<=c) loop execute immediate 'alter database add standby logfile thread '||i.t||' group '||i.g||' size '||i.s; end loop;
exit
SQL
$ORACLE_HOME/bin/dbca -silent \
-createDatabase -gdbName CDB1 -sid CDB1A \
-createAsContainerDatabase true -numberOfPdbs 1 -pdbName PDB1 \
-useWalletForDBCredentials true -dbCredentialsWalletLocation $PWD/dbc_wallet \
-sysPassword oracle -systemPassword oracle \
-pdbAdminPassword oracle \
-datafileDestination /u01/oradata -useOMF true -storageType FS \
-recoveryAreaDestination /u01/fast_recovery_area \
-recoveryAreaSize 3072 -enableArchive true \
-memoryMgmtType AUTO_SGA -totalMemory 2048 \
-createListener LISTENER1A:1521 \
-emConfiguration EMEXPRESS -emExpressPort 5501 \
-templateName General_Purpose.dbc \
-databaseType OLTP -sampleSchema true -redoLogFileSize 100 \
-customScripts $PWD/add_standby_log.sql \
-initParams \
db_unique_name=CDB1A,dg_broker_start=true,shared_pool_size=600M
grep oraenv ~/.bash_profile || echo '. oraenv <<<CDB1A' >> ~/.bash_profile
I've added oraenv
to my bash profile to get the right environment (ORACLE_SID
and ORACLE_HOME
) and can connect with sqlplus
That's all.
Geek stuff
I also wanted to check which ARM instructions are used:
objdump -d $ORACLE_HOME/bin/oracle | awk '/\t(ldxr|ldaxr|stxr|stlxr)/{print $3"\t(load and store exclusives)"}/\t(cas|casp|swp|ldadd|stadd|ldclr|stclr|ldeor|steor|ldset|stset|ldsmax|stsmax|ldsmin|stsmin|ldumax|stumax|ldumin|stumin)/{print $3"\t(large-system extensions)"}' | sort -k2 | uniq -c
If you test the performance and compare between aarch64 and x86_64 please let me know the result. I'll probably test that on AWS Graviton 3 - follow on Twitter if you want to be notified on new blog posts.
Subscribe to my newsletter
Read articles from Franck Pachot directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by