20. Install oracle database into Linux Virtual Machine - Agnivo102/Database_Architect GitHub Wiki
Install oracle in Linux Virtual Machine
Before installing a 3rd party software its to set up some pre requisites like set up some kernel parameters like in windows we have to download some dll files. In linux we also have to do that. Those pre-requisites are called rpm files in Linux.
Lets set up the pre-requisites:
Step 1: Enter into the system as root.
Step 2: Go to the upper right corner of the screen and click on according to the images ( wired, connect)
Step 2: To test whether the network working or not got to terminal and type ping www.google.com. If you get a output then the network is working. Then type Ctrl + z to stop it.
Step 3: Now type yum list oracle*. Thsi will display the pre-requisites required to install oracle into your system.
Step 4: Now we will use oracle version 19c. So install the prerequisites for that version.
Step 5: Now this installing pre-requisites has automatically created an user oracle into the linux system with the user group oinstall. We need to change the pssword for that user. For that type passwd oracle.
All the pre-requisites are done setting up. Now lets install oracle inside the system.
Step 1: Create the folder path where the software will be installed. This is the folder structure used as a standard with oracle.
Step 2: Download the oracle dbms software from here https://drive.google.com/file/d/1FochsJ7O82yRyDuE1sAz043ostSbkCqy/view. Then put the file in the shared folder.
Step 3: Go into the location and unzip the file. Type unzip filepath to unzip it.
Step 4: No change the permission for every sub directories under u01 to give everyone at least read and execute permission. Also change their owner to oracle from root.
Step 5: Now edit a file. vi /etc/selinux/config. Change the enforcing to permisive.
This change that so that other user can connect to the database. with enforcing others user cannot connect to the database. with permissive they can
Step 5: Now logout as root and login as oracle user. Go to the location where the file is unziped.
Step 6: Run the command ./runInstaller
Step 7: Follow the process in the wizard according to the images. Click on next.
Also this is the path where the logs will be stored.
Here a pre-requisite check will be done. If the pre-requisites are not set then cannot proceed.
Click on install.
The installation has started. It will take some time.
Step 8: Login as root in another terminal.
Step 9: Run the scripts shown in the wizard.
Press enter when the option to select bin comes.
Step 10: After that exit the extra terminal and click on ok on the setup wizard. Close the wizard.
The oracle application has been installed. Now lets create the database.
2 ways to create them. One is from wizard and other is manually. The wizard is called database configureation assistant(bdca)
Step 1: Run the command ./dbca on the bin location where the unzipped files are there.
Step 2: Follow the process in the wizard according to the images. Click on next.
Click on advanced configuration and then next
Change the database name(database global name) to prod. SID is system identification. In any system we can multiple databases. Multiple Databases can have same global name but their SID should be different. If there are multiple databases with same global name make sure to change their SID.
Uncheck the container database and click on next
Click on the option sample schema. Then check thee option add sample schema.
This adds the hr sample schema (we used to run sql queries as hr user and the tables they were sample schema. This will add them to our database.
Click on yes
Set the password as yu wish for these users. The database can have multiple users but it will always have this sys user. Click on yes if another box appears.
The database is created. We can run sql statements in them.
Step 3: Login into sql prompt using sys user. Command is sqlplus sys/(sys password) as sysdba. This sys user is like the root user in linux (super user) of database.
Step 4: Now when we added the sample schema that is added as locked.The first step after loogging in as sys will be to unlock that. So type alter user hr identified oracle account unlock;
To change the user. The password for sample schema user is oracle by default.