Installing and Creating an Oracle Database 19c on Linux 7 with ASM (Oracle Restart)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Hi everyone and welcome to this tutorial. In this tutorial, I will demonstrate the procedure to create an Oracle 19c Database with Asm on Oracle Linux This is a standalone non-cluster database. In a high level, the tutorial procedure goes through the following steps: First, we will change some basic settings of the tutorial appliance The tutorial appliance is an Oracle VirtualBox machine named as srv1 Second, we will add a couple of Virtual Harddisks to the appliance. Those disks will be used by ASM Third, we will make the machine IP address static Fourth, we will configure Putty to connect to the virtual machine Fifth, we will set up the environment variables for the OS Accounts: grid and oracle Sixth, we will install the ASM Packages and create the ASM disk volumes In the seventh step, we will change the kernel parameter values to the values recommended by Oracle after that, we will install some more packages in the operating system that are required by Oracle software after performing all those operations steps we will be ready to implement the good stuff. We will install Oracle Grid Infrastructure Software which is in our case is called Oracle Restart then we will create the ASM disk groups that will be used by the database and finally, We will install Oracle 19c database software and create the sample database Let's get started the pc that could be used to implement this tutorial should have free 8GB in its memory. This is practically means that the ram memory in your pc must be at least 12 Gigabytes In this tutorial the pc where the tutorial is implemented in it is referred to as the hosting pc Because it hosts all the environment components We will also need at least 50 Gigabyte free disk space It will be used to save the VM files and the software installation files Finally, the pc should be connected to the internet Because some packages will be installed directly from the internet The diagram in the screen demonstrates the architecture of the database that we will create in this tutorial the server name is srv1 It works with the operating system Linux 7.8 The database SID will be “oradb”. It will be a CDB database. Not a non-CDB database. Non-CDB database will not be supported in the Oracle releases that come after 19c so we should get ourselves ready to deal with cdb databases At the ASM side, we have two disk groups the size of the first one is 12 Gigabyte and it will be used to store the ASM OCR The size of the other disk is 40 GB and it will be used to store the database files. Following are the software products needed to implement this tutorial Oracle VirtualBox, Oracle Grid Infrastructure 19c Oracle Database 19c and Putty The tutorial document has the links to download those products Oracle VirtualBox: is the environment where the virtual machines are created in this tutorial in Oracle terms virtual machines created by oracle VirtualBooks are called Virtual Appliances. The tutorial uses VirtualBox version 6, specifically 6.0.22 After the VirtulaBox is installed, we need to create an Oracle Virtualbox appliance with an Oracle Linux 7.8 installed in it To save your time, you can download a pre-built VirtulaBox appliance from the link provided in the tutorial document the link is the URL of the download page on my website. Search for the required download and get it from there The next component that is used in this tutorial is the Oracle Grid Infrastructure 19c for Linux x86-64 installation files. This software will create the layer that controls the ASM controls the listener and manages the sequence of starting the services The installation compressed file can be downloaded from Oracle Site just search the internet for “oracle grid infrastructure 19c download” or click the link provided in the tutorial document the next required product is the Oracle Database 19c installation file for Linux x86 64-bit the installation file can be downloaded from Oracle Site just be careful to download the compressed zip file not the rpm file Finally, we need putty you must have used it several times in your life putty is a utility that provides a command line prompt to connect to a Linux server from Windows In the first step of this tutorial, we will make some simple changes on virtual appliance that will make our lives later easier on implementing the other tasks After the appliance is opened in the VirtualBox we need to configure a 'Shared Folder' in the appliance this shared folder will be used to exchange the files between the appliance and the hosting pc just open the setting page of the appliance go to a shared folder, click on the plus button, add the full path of the shared directory give it a name in this tutorial, I give it the name staging and mark the checkbox "Auto-mount". after that we want to make sure the network adapter type is Bridged Adapter and its name is the same as the network card for your PC This makes your VM appliance appears in your network as a separate host and will be assigned an IP address based on your network configuration in the next step, we need to create the disks that will be used by the ASM In our architecture, we will create two disks. One for the OCR, which its size should be 12 GB, and one for the database files which its size will be 40 GB. so i just click on the sata controller and click on the add hard disk button select create a new disk keep the first option selected keep the first option selected give the hard disk a name and set its size I will repeat the same steps to create the other disk after that, It is not a bad idea to set a meaningful name and description for the appliance in the next step, we will obtain the IP address assigned to the appliance and and make it static We need to make this step because we want to make sure that the machine will always have the same IP Address when it is rebooted first we will start the virtual machine and login to it as root open a terminal window and run the ifconfig command from there I can obtain the IP address in my case, it's 192.168.1.120. I will fix this IP address for this machine so I go to "Applications" system tools and settings from there i click on the network option in the left hand side Click on the gear button Go to the IPv4 tab change the first option to manual and enter the IP address information after that click on apply button and close the window let's ping the IP address to make sure that the chains are successful now I will edit the "/etc/hosts" file and add the hostname and the IP address to it then I will verify that the changes were registered in the NIC configuration file The network configuration is registered in the file now in the hosting pc, I will open a command-line window and make sure that I can ping srv1 IP address the ping is successful if it doesn't work in your case make sure the firewall in the hosting PC allows communication between the PC and the Oracle VirtualBox in the next step, I will configure putty to connect to srv1 open putty then enter the IP address of srv1 in the Host Name field then go to the connection option and set the seconds between keep lives to a value like 9 if you wish you can increase the font size just click on the appearance option under the window node Click on change button and increase the font size Finally, save the configuration as srv1 then open decision Login as root to the machine in the next step, we will configure the OS variables for the software owner accounts Oracle and grid Oracle is the software owner of the database software and grid is the software owner of the grid clusterware software first, we will make a backup copy of the the current bash profile file then we will add the code as demonstrated in the practice document to it The most important variables are the first three variables oracle base, oracle sid, and oracle home. Observe that oracle home is a subdirectory of the Oracle base. as we will see soon this will not be the case with the grid account I will switch the user to oracle create the bash profile file and add the code to it switch the current user back to root then run the code as demonstrated in step number 21 to create the required groups grid user and modify the accounts Add oracle andy grid accounts to vboxsf group this group was created by VirtualBox Guest Additions and it allows its members to access the shared folders in the hosting machine create oracle Clusterware home directories and change their access permissions to match the software Switch to grid user and modify its bash profile as shown in step No. 24 observe that oracle home in this case is outside the oracle base the values of those variables must be set this way because the installer will change the ownership of the oracle grid home if oracle home was under the oracle base the ownership of the oracle base will also be changed in the next step, we will install the ASM package then create ASM disk volumes change the current user to root user then install oracle ASMLib package run this command to configure and load the ASM kernel module the owner of the driver is grid the owner group is Oinstall and answer "Yes" to the questions run the following code to load the oracle ASM kernel module this command will list the disks as seen by the operating system we can see the disks created in the VirtualBox and attached to the appliance sda is the disk that hosts the operating system files sdb is the OCR disk sdc is the ASM data disk use fdisk to create partitions in the disk do the following for the disks respond to the utility by pressing on n, p, 1, Enter, Enter then w so if disk for the OCR disk n, p, 1, Enter, Enter and w We will do just the same for the second disk create the ASM disks Oracle software requires minimal values for the kernel parameters in the following step, we will change the kernel parameter values to the values recommended by oracle create the file as shown in step No.33 of the tutorial document then add the code that follows to it the file name starts with 97 so that we guarantee it will be the last to run by the system by the way this method of changing the kernel parameters is slightly different from changing them in Linux 6. after modifying the parameters reboot the system in the next step we will install further packages in srv1 they are required by oracle grid infrastructure and database software open putty and login to srv1 as root then run the code as demonstrated in step No. 37 to install a couple of packages required by oracle software by reaching to this point we are now ready to install oracle grid infrastructure software in srv1 the installation procedure automatically creates and start the clusterware services copy the oracle grid infrastructure software installation file to the staging folder in my environment, I have both the grid and oracle database installation files copied to the staging folder extract the installation file into the oracle grid infrastructure software home directory install the cvuqdisk in srv1 as root this package must be installed before installing clusterware software it is available in the grid extracted files themselves login to the VirtualBox window of srv1 as a grid Then open a terminal window change the current directory to the grid infrastructure software home directory and run the grid setup script observe that this is a new way of on installing the software in the older releases we used to extract the installation file in a staging directory and then install the software from there With release 19c, you can extract the installation files into the home directory itself and then run the installer from there this method saves a bit of disk space and a bit of the time I need to Login as grid open a terminal window and run the software installer in the first window select the option configure oracle grid infrastructure for a standalone server oracle restart in this window click on the change discovery path button enter the discovery path enter the disk group name select external for redundancy select the OCR disk and that's it enter a password for the ASM system accounts make sure this checkbox is unmarked the group names are successfully selected Oracle Base and Oracle Grid Home should automatically point to the values of their corresponding variables. the inventory directory is successfully selected mark the checkbox and enter the root password All the Prerequisite Checks should pass except the memory it complains that the available memory is 7.5 we can safely ignore this warning just select ignore all checkbox then click on next button If you see other warnings you should resolve them before you proceed and then click on install button when the installation reaches to nearly 11% it will display a confirmation message just click on yes button after the installation is done check the crs services status all the services should be stable after installing the clusterware software we need to create the disk group that will be used by oracle database to store its data files in it in real life scenario we might create more than one just disk group for example one for the data files and another one for the recovery area in the virtual box, window initiate ASM configuration assistant to create the Data Disk Group click on disk groups then click on create give the disk group a name set its redundancy to external select the disk and ok button and that's it is as simple as that after installing the clusterware and creating the ASM data Disk Group we are ready to install oracle database software and create the database in the putty session change the current user to oracle then extract the installation file into the oracle database software home directory then log out from the virtual box window and log in to it again as oracle open a terminal window and change the current directory to the oracle database home directory and run the installer script in the first window keep the option create and configure a single instance database in the system class window, select the server class option in the system class window select the option server class we are working on the “Enterprise Edition” the default values are correct keep the option general purpose database over here we have to enter the global database name the oracle sid and the pluggable database name do not mark the AMM checkbox set the memory to nearly 5 GB keep the character set to its default value and mark the checkbox install sample schemas in the database make sure the ASM is selected make sure the checkbox is not marked mark the checkbox enable recovery and make sure the asm is selected select the data disk set a password for the system accounts select the the “oinstall” group for all the options except the OSOPER keep it blank mark the checkbox and enter the root password all the prerequisite checks should pass click on the install button when the installation reaches to nearly 12 % it will display a confirmation message click on yes button click on close button after the installation and database creation are finished verify the database is up and running by logging to it as sysdba the login was successful I will now switch the user to grid and try to know the database status using the srvctl utility from the grid user I can know the status of the database using srvctl utility and the same command can be run by oracle let's try now starting the firefox browser and opening the EM express the browser returns the error secure connection failed this error is generated because the listener runs as a grid user and this user doesn't have the right access to the oracle xdb wallet folder before fixing this issue Let's verify that the xdb service is being registered in the listener let's check the status of the listener if we don't see this line in the output it means the listener is unable to receive connections to the EM express if this is the case in your environment restart the database using srvctl start command remember when oracle restart is configured do not use the sql plus command prompt to restart the database use the srvctl commands instead let's now fix the grid permission issue to access the oracle xdb wallet folder just run the code as demonstrated in the screen to grant the grid user the access permission to the xdb wallet folder now let's try accessing the EM express here you go the EM Express is accessible now we just have to allow the browser to open it Enter the username as s Enter its password and keep the container name blank and here we go we have the em express opened for us so here is the summary of this tutorial we learnt in this tutorial that we can build an oracle database 19c with ASM on a virtual box machine in a high level, the procedure goes through the following stages decide about the storage size and architecture prepare the machine and the operating system then install oracle grid infrastructure in this case, it's called oracle restart and finally, install Oracle Database software and the create oracle database and that's it for this tutorial thanks for watching Thank"s for watching, see you guys in another tutorial
Info
Channel: Ahmed Baraka
Views: 19,966
Rating: undefined out of 5
Keywords:
Id: 0nmZUTvrj1s
Channel Id: undefined
Length: 47min 17sec (2837 seconds)
Published: Mon Jul 20 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.