Oracle Database 23ai Free on Oracle Linux 9: Quick Command Reference
Aaron Rose
Software Engineer & Technology Writer
Introduction
Installing Oracle Database 23ai Free on Oracle Linux 9 is straightforward with the right commands. This quick reference provides all the essential commands in order, perfect for experienced users or as a companion to our complete installation guide.
Prerequisites
- Oracle Linux 9 system with 1GB+ RAM and 10GB+ storage
- Internet connection for downloads
- sudo access
Installation Commands
# Update system packages
sudo dnf update -y
# Restart after updates
sudo reboot
# Install Oracle prerequisites automatically
sudo dnf install -y oracle-database-preinstall-23ai
# Change to temporary directory
cd /tmp
# Download Oracle Database RPM
wget https://download.oracle.com/otn-pub/otn_software/db-free/oracle-database-free-23ai-23.8-1.el9.x86_64.rpm
# Install Oracle Database package
sudo dnf localinstall -y oracle-database-free-23ai-*.rpm
# Configure database (save passwords!)
sudo /etc/init.d/oracle-free-23ai configure
# Enable auto-start
sudo systemctl enable oracle-free-23ai
# Start database service
sudo systemctl start oracle-free-23ai
# Check service status
sudo systemctl status oracle-free-23ai
Post-Installation Setup
# Switch to oracle user
sudo su - oracle
# Connect as database administrator
sqlplus / as sysdba
-- Change SYS password
ALTER USER SYS IDENTIFIED BY YourNewSysPassword;
-- Change SYSTEM password
ALTER USER SYSTEM IDENTIFIED BY YourNewSystemPassword;
-- Switch to pluggable database
ALTER SESSION SET CONTAINER = FREEPDB1;
-- Change PDBADMIN password
ALTER USER PDBADMIN IDENTIFIED BY YourNewPdbAdminPassword;
-- Create application user
CREATE USER appdev IDENTIFIED BY YourAppPassword;
-- Grant basic privileges
GRANT CONNECT, RESOURCE TO appdev;
-- Grant view creation
GRANT CREATE VIEW TO appdev;
-- Grant storage access
GRANT UNLIMITED TABLESPACE TO appdev;
-- Exit SQL*Plus
EXIT;
Network Configuration (Optional)
# Navigate to network config
cd $ORACLE_HOME/network/admin
# Edit listener configuration
vi listener.ora
# Stop listener
lsnrctl stop
# Start listener
lsnrctl start
# Check listener status
lsnrctl status
Backup Setup
# Create backup directory
mkdir -p /opt/oracle/backup
# Connect to database
sqlplus / as sysdba
-- Create DB directory object
CREATE DIRECTORY DATA_PUMP_DIR AS '/opt/oracle/backup';
-- Grant directory access (replace 'appdev' with your username)
GRANT READ, WRITE ON DIRECTORY DATA_PUMP_DIR TO appdev;
-- Exit SQL*Plus
EXIT;
Verification Commands
# Test user connection
sqlplus appdev/YourAppPassword@localhost:1521/FREEPDB1
-- Check database version
SELECT banner FROM v$version;
-- Check storage usage
SELECT tablespace_name, ROUND(bytes/1024/1024, 2) AS "Size (MB)" FROM dba_data_files;
-- Exit SQL*Plus
EXIT;
Quick Connection Info
- Database Service: FREEPDB1
- Default Port: 1521
- Admin Users: SYS, SYSTEM
- Service Control:
sudo systemctl [start|stop|status] oracle-free-23ai
Next Steps
Once installed, you can connect using SQL Developer, build applications, or explore Oracle's advanced features. The database is limited to 2GB RAM and 12GB storage but provides full Oracle Database functionality for development and learning.
For detailed explanations, troubleshooting tips, and security configuration, see our complete installation guide.
Aaron Rose is a software engineer and technology writer at tech-reader.blog.
Comments
Post a Comment