Oracle Database XE Quick Start

If you are experienced at installing software then use the steps provided below.

For more information and full step-by-step instructions please review the installation guides for Linux or Windows.

Want to get hands-on with Oracle AI Database 26ai—absolutely free?

Here's your chance to explore the powerful database trusted by enterprises worldwide for their most critical workloads. Oracle AI Database 26ai Free lets you use up to 2 CPUs, 2 GB of RAM, and 12 GB of storage for your data—all wrapped up in a simple, ready-to-go package. Just download, install, and start building your next big project today.

Installing Oracle Database XE

PlatformDetails
Oracle Linux
Red Hat compatible Linux distribution
Windows
  • Log into Windows with a user that is a direct member of the Administrators group.
  • If the ORACLE_HOME or TNS_ADMIN environment variable has been set, unset it first.
  • Download OracleXE213_Win64.zip
  • Extract zip file to a local temporary directory and run setup.exe.
  • When prompted by the installer, provide the install location, the database password, and begin the installation.
  • When the installation is complete, note the provided connection strings on the final screen.
Docker
VirtualBoxA Linux VirtualBox VM can be built using the Vagrant scripts provided under https://github.com/oracle/vagrant-boxes. You can also install into a Windows VirtualBox VM providing the version of Windows is supported. See the Oracle Database XE Windows Installation Guide.

Connecting to Oracle Database XE

Language / PlatformConnection / Code details
SQL-- Connect string format: [username]/[password]@//[hostname]:[port]/[DB service name] [AS SYSDBA] -- To connect to the Container Database (CDB) use: sqlplus sys/[Password]@//localhost:1521/XE as sysdba -- To connect to the first Pluggable Database (PDB) use: sqlplus sys/[Password]@//localhost:1521/XEPDB1 as sysdba
JavaOracleDataSource ods = new OracleDataSource(); ods.setURL("jdbc:oracle:thin:@//localhost:1521/XEPDB1"); // jdbc:oracle:thin@//[hostname]:[port]/[DB service name] ods.setUser("[Username]"); ods.setPassword("[Password]"); Connection conn = ods.getConnection(); PreparedStatement stmt = conn.prepareStatement("SELECT 'Hello World!' FROM dual"); ResultSet rslt = stmt.executeQuery(); while (rslt.next()) { System.out.println(rslt.getString(1)); }
Pythonimport cx_Oracle # Connect string format: [username]/[password]@//[hostname]:[port]/[DB service name] conn = cx_Oracle.connect("[Username]/[Password]@//localhost:1521/XEPDB1") cur = conn.cursor() cur.execute("SELECT 'Hello World!' FROM dual") res = cur.fetchall() print(res)
Node.jsvar oracledb = require('oracledb'); async function run() { let connection = await oracledb.getConnection( { user : "[Username]", password : "[Password]", connectString : "localhost:1521/XEPDB1" // [hostname]:[port]/[DB service name] }); let result = await connection.execute( "SELECT 'Hello World!' FROM dual"); console.log(result.rows[0]); } run();
C# / .NET// Connection string format: User Id=[username];Password=[password];Data Source=[hostname]:[port]/[DB service name]; OracleConnection con = new OracleConnection("User Id=[Username];Password=[Password];Data Source=localhost:1521/XEPDB1;"); con.Open(); OracleCommand cmd = con.CreateCommand(); cmd.CommandText = "SELECT \'Hello World!\' FROM dual"; OracleDataReader reader = cmd.ExecuteReader(); reader.Read(); Console.WriteLine(reader.GetString(0));
PHP// [username], [password], //[hostname]:[port]/[DB service name] $c = oci_pconnect("[Username]", "[Password]", "//localhost:1521/XEPDB1"); $s = oci_parse($c, "SELECT 'Hello World!' FROM dual"); oci_execute($s); oci_fetch_all($s, $res); echo "<pre>\n" var_dump($res); echo "</pre>\n";
Rubyrequire 'oci8' // "[username]/[password]@//[hostname]:[port]/[DB service name]" con = OCI8.new("[Username]/[Password]@//localhost:1521/XEPDB1") statement = "SELECT 'Hello World!' FROM dual" cursor = con.parse(statement) cursor.exec cursor.fetch do |row| print row end
Gopackage main import ( "fmt" "log" "database/sql" _ "github.com/godror/godror" ) func main() { // connectString format: [hostname]:[port]/[DB service name] dsn := `user="[Username]" password="[Password]" connectString="localhost:1521/XEPDB1"` db, err := sql.Open("godror", dsn) if err != nil { panic(err) } defer db.Close() rows, err := db.Query("SELECT 'Hello World!' FROM dual") if err != nil { panic(err) } defer rows.Close() var strVal string for rows.Next() { err := rows.Scan(&strVal) if err != nil { log.Fatal(err) } fmt.Println(strVal) } err = rows.Err() if err != nil { log.Fatal(err) } }