Oracle database is one of the stable and most used database in the world. It is a proprietary software, which is free to develop, deploy and distribute. So, why I am talking about Oracle Database? Well, Oracle Policy Automation has batch processing functionality which requires a database for processing. Let me show you how to install the Oracle database, configure it and how to use SQL Developer for managing the database. If you have 11g installed then you can skip this step.
Installing Oracle 11g Database
Like I said, the database is free to develop, deploy and distribute. You can download Oracle database from Oracle site for free.
Just click on ‘Accept Licence Agreement’ and select the version you want to install depending upon the type of OS you are using. You will be asked to login to Oracle account. Just create new one if you don’t have an account.
Once the download is finished, extract the zip file, double click setup.exe inside DISK1 folder.
Continue with the normal installation process. You will be asked to create/enter password for the default SYS and SYSTEM database. I am using root as the password, you can use anything you want. PS: Do Remember the Password.
Once the installation is done it go to Start -> Oracle Database 11g Express Edition -> Run SQL Command Line.
Enter the following commands as per the screenshot below.
This command is used to connect to the default database system. The ‘root’ is the password.
Next we are going to create a user for handling the database system.
create user sreeragnk identified by root;
Here ‘sreeragnk’ is the user name and ‘root’ is the password I have given to that user. Again, you can use anything you want as per your requirement. Now, you need to grant all permissions to the user you just created. Enter the command as per the screenshot shown below.
Unlock HR Database in Oracle 11g
HR database is a standard database with dummy data which comes along with the package. Many of the tutorials and example posts uses the tables in HR database. As default, the database is in locked state and you need to unlock it for using the tables. Go to Start -> Oracle Database 11g Express Edition -> Run SQL Command Line and enter following command.
alter user hr account unlock;
alter user hr identified by root;
What this three commands do is, first one will connect to the system account. Second one will change the status of hr database to unlocked. The third command will assign password ‘root’ to the hr database.
That’s all. You have successfully unlocked the HR database.
Installing SQL Developer
One more thing to do to unlock the full potential of the tool. You can create tables, views, procedures and more using the database you have installed now. But, to do this in an efficient and easy way, you need to install SQL Developer. This is also a free tool which lets you do browse, create, edit and delete database objects. Run sql queries, create scripts and more.
To get started, you need to download SQL developer from Oracle site and do some simple configurations. The installation is pretty straight forward and once you are done fire up the application.
As of now, the SQL developer is a standalone application. You need to create a connection between the SQL developer and the Oracle Database to do all the database operations.
On the connections pane on the left side of the screen, right click on connections. Select New Connection.
User the username and password of the user you have created using the SQL command line. I used ‘sreeragnk’ and ‘root’ as credentials. Click on connect button once you are done with the options in the pop up. This will create a connection ‘xe_sreeragnk’ and will expose all the database objects. This connection is managed by user ‘sreeragnk’ and the permissions depends upon the permissions you have granted for this particular user.
PS: I have grant all permissions to the user ‘sreeragnk’ during the user creation.
Now, for the sake of all the examples and tutorials which used HR database, let’s create a new connection for the user hr and manage the database through SQL Developer. Again, right click on the connections option and enter the following details.
The credentials are HR and root. This depends upon what you have given during the unlock time.
You have successfully installed Oracle 11g database, created a user, unlocked the HR database, installed and configured SQL Developer for managing the database. You are all set to do OPA Batch processing examples which comes along with the kit and more. More about OPA Batch processor will be covered in upcoming posts. Please like us on Facebook and subscribe to our free email newsletter to stay updated. Thank you for reading.