How to setup Oracle Database 11g XE on Windows and unlock the "HR" user
Tags: database, beginners, tutorial, computerscience
Published: 2021-01-06 21:14:19

For [Database Management System](https://en.wikipedia.org/wiki/Database#Database_management_system), Oracle’s position is very strong and also popular among the developers and companies. The version of Oracle Database 11g Express Edition is widely used among the students and database beginners. It’s very lightweight and unlike the previous version 10g, it’s improved in many ways. However, today you will be learning how to install the Oracle Database 11g XE version on Windows PC and unlocking the ‘HR’ account.

> Download the Oracle Database 11g Express Edition from the official link [**here**](https://www.oracle.com/database/technologies/xe-prior-releases.html). It’s a zip file that is about 350 MB more or less.

### **Extracting the ZIP**

After finishing the downloading extract the zip file and for extracting a popular opensource program called [**7-Zip**](https://7-zip.org/) can be used or you can use any proprietory programs like WinRAR, WinZip, etc.

After extracting there is a folder named **[DISK1]** and inside that folder, there’s a [**setup.exe**] file and that’s needed for the installation.

![Screenshot of extracted folder and setup files](https://dev-to-uploads.s3.amazonaws.com/i/7dp1tkax9k7qjs6jllh9.png)

![Screenshot of extracted folder and setup files](https://dev-to-uploads.s3.amazonaws.com/i/o4z6j5qna6n1zmf1f1vv.png)

---

### **Installation**

To begin the installation, double click on the **"setup.exe"** file, and a window like the below screenshot will appear.

![Starting Window](https://dev-to-uploads.s3.amazonaws.com/i/v6sy7x4bmimlzgya9mqu.png)

Accept the license and click on the **"Next"** button like below.

![License Window](https://dev-to-uploads.s3.amazonaws.com/i/fo23dxacxgfunaffak2m.png)

If you wish to install it in another directory you can do so but I’m leaving it as default. I suggest unless you’re running out of space in the **"C"** drive, follow the program’s suggestion like below. 

![Destination Location Window](https://dev-to-uploads.s3.amazonaws.com/i/cs8qlafi4fn25za2jlic.png)

You need to set a password for the database system user which is used for the **"SYS"** & **"SYSTEM"** user account in the Oracle DBMS environment.

![Database Password Window](https://dev-to-uploads.s3.amazonaws.com/i/httflbiti0atiww14wor.png)

In this step, check whether all the information is correct or not. If negative you can go back and make changes. It’s important to remember the port information showed on this window.

![Final Configuration Checking Window](https://dev-to-uploads.s3.amazonaws.com/i/i2ni0jne0g3q702qeksi.png)

Now the installation has begun, you can grab a cup of coffee as a waiting material. 

![Installation Progress Window](https://dev-to-uploads.s3.amazonaws.com/i/o7wuja1hzb8werg82hwz.png)

After a couple of minutes, if the below window appears then **Congratulations**. You have installed the database successfully. 

![Installation Complete Window](https://dev-to-uploads.s3.amazonaws.com/i/revwoxq5dd8iv96jfti6.png)

Although the installer won’t tell you about the restarting of pc. But it’s very important. After restarting, you can start exploring the database and also be able to follow the further procedure of unlocking the “HR” user account.

---

> By default **Oracle Database XE** comes with a sample user named **"HR"** and under this user’s territory there are several database tables in a sample schema. These pre-given databases and tables are playgrounds for beginners. However, for security reasons, the **"HR"** account is locked by default.

---

### **Unlocking the "HR" user**

To unlock the account you need to go through some commands in CMD ([**Command Prompt**](https://en.wikipedia.org/wiki/Cmd.exe)). Also, you can use programs like [**PowerShell**](https://en.wikipedia.org/wiki/PowerShell) for this procedure.

So, Open up your CMD and execute the below command for connecting to the Oracle Database with CMD.

```powershell
SQLPLUS / AS SYSDBA;
```

![Command Prompt Connecting Database](https://dev-to-uploads.s3.amazonaws.com/i/bt8qe3zdpl9uimx8kpmm.png)

Alter the **HR** user to unlock,

```powershell
ALTER USER HR ACCOUNT UNLOCK;
```

Finally, unlock the user and assign a password,

```powershell
ALTER USER HR IDENTIFIED BY <password>;
```

Replace **"<password>"** with your desired one and the changes will be made for the **"HR"** account only.


![Command Prompt "HR" Unlocked](https://dev-to-uploads.s3.amazonaws.com/i/70g5qko0gfs07w7cujpv.png)

Type the exit command for exiting from the database environment. You can use this same command for exiting from [**Command Prompt**](https://en.wikipedia.org/wiki/Cmd.exe), [**PowerShell**](https://en.wikipedia.org/wiki/PowerShell), and similar applications also.

```powershell
exit
```

---

![Best of Luck](https://dev-to-uploads.s3.amazonaws.com/i/qm2u6bsds1vjr1ci47b4.png)

*Share your opinion in the discussion section below and of course the questions if any.* Don't forget to follow us.

💡 ***AND SUBSCRIBING to our YouTube*** [**TechLearnersInc**](https://www.youtube.com/c/TechLearnersInc) ***and Telegram*** [**t.me/TechLearners**](https://t.me/TechLearners) ***will be amazing.***