This is actually amazingly simple if you wish to have your own database to either play around in or use for home projects or prototyping projects at work.
Downloading and Installing On Windows 10:
Go to the download website https://www.oracle.com/database/technologies/xe-downloads.html, where you will need to create an account to download. Just an email you can access is needed and you can fill out fake details for the rest if you like.
Additionally I would recommend installing SQL developer as a very easy GUI interface (instead of SQL*plus) to manage the database.
The first steps are pretty basically installation steps, just run the setup and click next until you come to the following screen. Here you will enter the password for the admin accounts, so choose this carefully:
sqlplus / as sysdba
# create a new table space called mytablespace with a size of ~5GB. create tablespace mytablespace datafile 'mytablespace.dbf' size 5000M;
# hidden parameter to remove need for C## naming conventionsalter session set "_ORACLE_SCRIPT"=true;
# create our schema (or user) and use our new tablespacecreate user myuser identified by password default tablespace mytablespace;
# give the new user permissionsgrant connect, create session, create table to myuser;
Here is the code shown in the terminal:
Here is the connection set up for the new schema/user:
sqlplus / as sysdba
# alter the session to connect to the pluggable databasealter session set container=XEPDB1;
# create a new table space called mytablespace with a size of ~1GB. create tablespace mytablespace datafile 'mytablespace.dbf' size 5000M;
# create our schema (or user) and use our new tablespacecreate user myuser identified by password default tablespace mytablespace;
# give the new user permissionsgrant connect, create session, create table to myuser;
Here is the code shown in the terminal (I forgot to set new tablespace, so I altered the user later):
The connection in SQLDeveloper will now look like this, notice that we must use the service name of the plugable database now.
Finally you can see that we have set up a new user/schema called myuser for both the main container and the pluggable database with a separate connection as SYSDBA for admin purposes.