Based on the documentation, I'll help guide you through installing Oracle Database Free on Oracle Linux 9. Here are the steps:
-
First, log in as the root user.
-
Install the Oracle Database Preinstallation RPM:
dnf -y install oracle-database-preinstall-23ai
-
Go to the Oracle Database Free software download page: https://www.oracle.com/database/technologies/free-downloads.html
-
Download this specific RPM file:
oracle-database-free-23ai-1.0-1.el9.x86_64.rpm
-
Install the database software:
dnf -y install oracle-database-free-23ai-1.0-1.el9.x86_64.rpm
- After installation, create and configure the database:
- Log in as root:
sudo -s
- Run the configuration script:
/etc/init.d/oracle-free-23ai configure
- When prompted, you'll need to set a password for the SYS, SYSTEM, and PDBADMIN accounts
- Password must be at least 8 characters long
- Include at least 1 uppercase letter
- Include at least 1 lowercase letter
- Include at least 1 digit [0-9]
The installation will:
- Create a container database named 'FREE'
- Create a pluggable database named 'FREEPDB1'
- Configure the listener on the default port (1521)
- Use approximately 9 GB of disk space under /opt
Important notes:
- Make sure you have sufficient disk space (at least 9 GB) under /opt
- The installation doesn't support symbolic links for /opt/oracle
- If you have any existing Oracle Database XE or Free version with SID 'XE' or 'FREE', you need to uninstall it first
Would you like me to explain any specific part of the installation process in more detail?
Based on the provided information, I'll guide you through the post-installation steps to set up your Oracle Database 23c Free. Here's what you need to do:
- First, set up your environment variables. Log in as the Oracle user and run:
export ORACLE_SID=FREE
export ORAENV_ASK=NO
. /opt/oracle/product/23ai/dbhomeFree/bin/oraenv
- Connect to your pluggable database as SYSDBA:
sqlplus sys@localhost:1521/FREEPDB1 as sysdba
When prompted, enter the password you set during installation.
- Once connected, you can set up a sample user and database:
-- Create a new user
CREATE USER sampleuser IDENTIFIED BY "YourStrongPassword123"
QUOTA UNLIMITED ON USERS;
-- Grant necessary privileges
GRANT CREATE SESSION TO sampleuser;
GRANT CREATE TABLE TO sampleuser;
GRANT CREATE VIEW TO sampleuser;
GRANT CREATE SEQUENCE TO sampleuser;
GRANT CREATE PROCEDURE TO sampleuser;
- Now you can connect as the new user and create sample tables:
-- Connect as the new user
CONNECT sampleuser/YourStrongPassword123@localhost:1521/FREEPDB1
-- Create sample employees table
CREATE TABLE employees (
employee_id NUMBER PRIMARY KEY,
first_name VARCHAR2(50),
last_name VARCHAR2(50),
email VARCHAR2(100),
hire_date DATE,
salary NUMBER(8,2)
);
-- Create sample departments table
CREATE TABLE departments (
department_id NUMBER PRIMARY KEY,
department_name VARCHAR2(100),
location VARCHAR2(100)
);
- Insert some sample data:
-- Insert department data
INSERT INTO departments VALUES (1, 'IT', 'New York');
INSERT INTO departments VALUES (2, 'Sales', 'Chicago');
INSERT INTO departments VALUES (3, 'Marketing', 'Los Angeles');
-- Insert employee data
INSERT INTO employees VALUES (1, 'John', 'Smith', '[email protected]', DATE '2023-01-15', 75000);
INSERT INTO employees VALUES (2, 'Mary', 'Johnson', '[email protected]', DATE '2023-02-20', 65000);
INSERT INTO employees VALUES (3, 'Robert', 'Brown', '[email protected]', DATE '2023-03-10', 70000);
COMMIT;
Important notes:
- Replace "YourStrongPassword123" with a strong password that meets Oracle's requirements
- The default listener port is 1521
- The main container database is named 'FREE'
- The pluggable database is named 'FREEPDB1'
- Database files are located in
/opt/oracle/oradata/FREE
- Alert logs are in
/opt/oracle/diag/rdbms/free/FREE/trace/alert_FREE.log
Would you like me to explain any specific part in more detail or help you with additional setup tasks?
It seems you're encountering several issues, mainly related to the
EMPLOYEES
table not existing, even though theSAMPLEUSER
user exists. Let's go through the problems and provide solutions.1. ORA-00942: "EMPLOYEES" table or view does not exist
The error indicates that the
EMPLOYEES
table doesn't exist in theSYS
schema, which is expected because you likely created the table in theSAMPLEUSER
schema (or intended to do so).Solution:
You need to connect to the correct schema (in this case, the
SAMPLEUSER
schema) to access theEMPLOYEES
table, assuming you created it there.You can try the following:
SAMPLEUSER
:EMPLOYEES
table inSAMPLEUSER
schema:If the table doesn't exist in the
SAMPLEUSER
schema, you can create it under the correct user by following these steps:SAMPLEUSER
schema:If you're connected as
SYSDBA
and want to perform actions onSAMPLEUSER
, you'll need to useALTER SESSION
to switch schemas.EMPLOYEES
table (if it doesn’t already exist):EMPLOYEES
:Once the table is created and populated, you should be able to query it successfully.
2. Error while creating a view: "EMPLOYEES" table does not exist
You encountered the same issue when trying to create a view on the
EMPLOYEES
table. This is because the view creation is being attempted under theSYS
schema, where theEMPLOYEES
table doesn't exist.Solution:
You need to ensure that the view is created in the correct schema (
SAMPLEUSER
). After connecting toSAMPLEUSER
, run theCREATE VIEW
command again.3. The sequence
EMPLOYEE_SEQ
was created successfullyYou successfully created the
EMPLOYEE_SEQ
sequence. You can use this sequence for generating uniqueemployee_id
values if needed.You can check its values with:
Recap of next steps:
SAMPLEUSER
), either by logging in directly as that user or by usingALTER SESSION
.EMPLOYEES
table under the correct schema if it doesn’t exist.EMPLOYEES_VIEW
view and use it to verify the data.Let me know if you encounter any further issues!