1.1 Operating Systems
It is important to note that a 64-bit Linux version of Oracle will not be installed on a 32-bit Linux or 64-bit Windows systems. Oracle Release Notes provide information about where to find the compatibility matrix and the system requirements for the server.
The disk space requirements depend on the components installed. However, the base product alone requires more disk space for 64-bit operating systems. We can use the following command-line option to run the installer with parameters to perform just the system prerequisites check, without continuing to install Oracle:
E:\Oracle11gR2\database> setup.exe –executeSysPrereqs
The result can be viewed in the prerequisite_results.xml file, which will be in the oraInventory/logs directory.
Go for this in-depth job-oriented Oracle DBA Training now!
There are many advantages of installing Oracle on the Windows platform. One is that as a SQL Server administrator, we are already working with a Windows system. Another is that some tasks that must be done manually on the Linux platform are taken care of by Windows automatically. For example, the environment variables are set up, and Windows handles the startup and shutdown of services.
1. Oracle Home
SQL Server tends to have a default location for binaries, and Oracle will set up this default: the Oracle home directory. This directory location can be set during the installation process, or it can be specified by setting the ORACLE_HOME environment variable before running the installer.
Although the environment variables are set by the Oracle Installer for Windows, there might be more than one Oracle home on a server. If this is the case, when using a command line, we will need to set the variable ORACLE_HOME, first, or fully qualify the path to the correct Oracle home.
C:\> set ORACLE_HOME=d:\oracle\product\11.2.0\db_1
C:\> set ORACLE_SID=orcl
2. User Account for Installation
The installer creates the ORA_DBA group automatically on the Windows platform. A standard practice with SQL Server is to create another user that has administrator privileges to install the software and be the owner of the SQL Server services.
By default, Oracle services will use the local service account, by having a separate domain account to manage these services and perform the installation.
3. File System
The database software should be installed on the NTFS file system as the security available for the Oracle home directory will contain trace files and database files.
4. Network Connectivity
The database is not really meant to be a stand-alone machine; it needs network connectivity. Clustering will have different requirements, but the database server needs to have a primary IP address that is accessible (it doesn’t need to be a static IP unless our environment requires it).
If we are using a dynamic configuration (DHCP), the test conducted during the Oracle Installer’s prerequisites check will fail when Microsoft Loopback Adapter is not the primary network adapter on the system. Here is a quick check for this adapter:
C:\> ipconfig /all
Ethernet adapter Local Area Connection 2:
Connection-specific DBS Suffix . . . . :
Description . . . . . . . . . . . . . .: Microsoft Loopback Adapter
Physical Address . . . . . . . . . . . : 7A-80-4C-9F-57-5D
DHCP Enabled . . . . . . . . . . .. . .: Yes
Autoconfiguration Enabled . . . . . . .: Yes
If Microsoft Loopback Adapter is not configured, we can set it up by clicking on Add/Remove Hardware in the Control Panel. There, we will select Network Adapters and add it as a new network adapter.
5. Windows Platform Checklist
For Windows installation:
- Check whether the operating system version and the Oracle version and edition are appropriate.
- Verify that the hardware requirements are met.
- Create an Oracle account with administrator permissions to perform installation.
- Run the prerequisite check and correct issues, if any.
Following are some useful Linux commands:
- pwd: Shows the current directory
- echo $ORACLE_HOME: Shows the value of a variable
- whoami: Shows the current user
- ps -ef: Shows the list of current processes running on the server
- grep: Searches for a name/value in a file/list/process
- chmod: Changes permissions for a file/directory
- chgrp: Changes the group for permission of a file/directory
- chown: Changes the owner of a file/directory
The manual pages (man pages) provide parameter options and examples of how to use commands. To access the man page for a command, just type ‘man’ followed by the command in the prompt as in the below example:
> man grep
When we download files for a Linux system, such as patches or software, they might come in a couple of formats, with filenames ending in .Z, .gz, .zip, .cpio, or .tar. These are compressed files. We’ll need to uncompress these files so that they are usable. Following are the commands to uncompress various formats:
> uncompress *.Z
> unzip *.zip
> gunzip *.gz
> tar -xvf file.tar
> cpio -idmv < file_name>
Wish to be certified in Oracle DBA? Learn Oracle DBA from top Oracle DBA experts and excel in your career with Intellipaat’s Oracle DBA Certification!
For a Linux system, we need to set up users, adjust permissions and kernel parameters, and make sure that the required packages are installed.
1. Users and Groups
Although we can install Oracle and own the services for Oracle as an administrator on the server, this is not recommended, particularly for Linux systems where the administrator account is the root account.
We should create a user and group for the Oracle installation. Oracle processes will also run under this user. Additionally, if we are installing certain Oracle components, such as Automatic Storage Management and Clusterware, we should create separate users and groups to own every different piece of the software.
The following example demonstrates creating the oinstall (Oracle installation), dba (database administrator), asmdba (Automatic Storage Management administrator), and crs (Clusterware) groups:
# /usr/sbin/groupadd g 501 oinstall
# /usr/sbin/groupadd g 502 dba
# /usr/sbin/groupadd g 504 asmdba
# /usr/sbin/groupadd g 505 crs
Users for the above are added as follows:
# /usr/sbin/useradd u 502 g oinstall G dba oracle
# /usr/sbin/useradd u 503 g oinstall G asmdba osasm
# /usr/sbin/useradd u 504 g oinstall G crs crs
2. Required Packages
The Oracle installation guide lists the required packages for various Linux flavors. Some of the packages are already existing on our system since they are included in the Linux installation. However, we should verify that they are installed by using the command, rpm –q package_name. Then, we will need to install any of the required packages that has not been installed by default.
3. Kernel Parameters
We may need to adjust the kernel parameters if our Oracle system needs high memory. Kernel parameters are in the /etc/sysctl.conf file, which can be edited to make the necessary modifications.
kernel.shmall = physical RAM size / pagesize
kernel.shmmax = ½ of physical RAM, but < 4GB
kernel.sem = 250 32000 100 128
fs.file-max = 512 x processes
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.mem_max = 4194304
net.core.wmem_default = 262144
net.core_wmem_max = 1048576
After this file is edited, we must activate the changes by running the following at the command prompt as root:
We will use the following command to view the current settings for a kernel parameter:
> /sbin/sysctl -a | grep <param-name>
1.2 Storage Requirements
There are many storage options available with hardware, configurations, and file systems, along with new hardware developments. In designing the storage layout, striping and mirroring play a definite part. Databases need to be highly available and users will always be happier with faster access, so building fault-tolerant systems at the storage level is a necessity.
To set up storage for a particular system properly, a DBA needs to understand these different pieces: files, I/O events, and backups. We need to know which are the typical events for databases and which are not, which databases are heavy on reads and writes of the disk, and how each of these can affect the disk storage.
- Under Windows, we would at least hope for two additional drives besides the C: drive. For example, we might set up disk storage on Windows as follows:
D:\oracle #Base directory for software and server logs
D:\oradata #For datafiles and one control file
E:\orabackup #For backups
E:\oraarch #For archive logs
E:\oraexp #For data dump files and exports
E:\oradata #Another location for control files
- Under Linux, we might set up disk storage as follows (where, /u0n is a typical naming convention):
/u01/oracle #Base directory for software, server logs, and control files
/u02/oracle/SID #For exports, archives, backups, and control files
/u03/oracle/SID #For datafiles (number can continue to increase) and control files
Alternatively, we can use another naming convention, /ora0n, as follows:
/ora01/oracle #Base directory for software
/ora01/SID #For datafiles and control files
/ora02 and subdirectories #For exports, backups, control files, and so on
Storage Management with ASM
ASM (Automatic Storage Management) makes managing datafiles simple. With Oracle Database 11g R2, ASM can manage all files—database files, nonstructured binary files, and external files, including text files. ASM handles managing the disk, adding disk storage, and tuning I/O performance with rebalancing while the storage is up and available to the Oracle databases on that server.
Starting with Oracle Database 11g R2, ASM is a separate installation using the Grid Infrastructure. We use a different home directory, than the database home directory, for the installation of ASM and perform the installation as another user, e.g., an asmadm user. The home directory for ASM contains other pieces, e.g., Clusterware, which are part of the ASM installation.
If we are installing an Oracle version earlier than 11g R2, we will start the installation process of the database software.
After we choose the ASM installation, the Database Configuration Assistant will start creating the instance that is used by ASM.
If we are installing Oracle Database 11g R2, ASM will have a Grid Infrastructure installation. With this installation, the creation of the ASM instance, disk groups, and volumes is done by the ASM Configuration Assistant, instead of the Database Configuration Assistant.
We can also use the ASM command-line utilities ASMCMD and ACFSUTIL to create and manage disks. Here’s an example of creating a volume group from the operating system command line:
ASMCMD > volcreate -d DISKGRPDATA -s 20G volume1
ASMCMD can help manage the instance, with startup and shutdown, disk group, and disk failure management.
The setup of ASM disks needs to be done even before installing the ASM instance. Disk groups can be created so that they are available for the software installation. If we are using the file manager for the regular files, such as create scripts and parameter files, as well as the data files for the database, these disks and storage areas will need to be available for the installation process.
The data files that make up the tablespaces in Oracle are the most similar to the .mdf files of SQL Server, and the redo logs could be considered similar to the .ldf files. Also, if the database is not running, these files can be copied for a cold backup, similar to SQL Server when taking a database offline or if the instance service has been stopped to take a copy of the .mdf file and .ldf files.
Oracle tends to use the same extension for all datafiles. It is typical to use the tablespace name in the datafile name. For example, the SYSTEM tablespace may have system01.dbf, and the SYSAUX tablespace may have sysaux01.dbf.
The location of the control files is set at the time of database creation and the parameter CONTROL_FILES has the values for the location.
CONTROL_FILES = (/u02/oracle/SID/control01.ctl,
Oracle Database Components
The following are some of the components that are part of the database installation:
|Oracle Advanced Security
||Oracle Label Security
||COM Automation Feature
||RDBMS Database Extensions for .NET
||Real Application Testing
|Oracle Net Services
||Oracle Net Listener
|Oracle Connection Manager
||Oracle Call Interface
||XML Development Kit
|Oracle Configuration Manager
Also, as part of the Windows installation, the following components are available:
- Services for Microsoft Transaction Server
- Administration Assistant for Windows
- Counters for Windows Performance Monitor
- OLE, ODBC, and .NET drivers
Wish to crack Oracle DBA interviews? Intellipaat’s Top Oracle DBA Interview Questions are meant only for you!
1.3 Oracle Software Installation
- Operating system configurations—check
On Windows, we will start the installation process by executing setup.exe to run the Oracle Universal Installer (OUI).
On Linux, on the other hand, a couple of environment variables need to be set up first, and then the installer program can run.
> export DISPLAY = ip address:0.0
> export ORACLE_BASE = /u01/oracle
> export ORACLE_HOME = /u01/oracle/product/11.2.0
> export PATH = $PATH:$ORACLE_HOME/bin
> export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
> cd ../oracle/Disk1
The advanced installation allows for the following:
- Installs the software first without creating any database
- Chooses which software components to install. (as noted earlier, this is part of the secure configuration of the environment; knowing which pieces have been installed will help with patching and upgrading)
- Configures passwords for the system users different for each user
- Installs RAC
- Configures ASM
- Uses a different template or configuration for the database
- Selects a character set
- Upgrades an existing database
- Uses a different file system for the database files to separate them from the Oracle home
Using a Response File
A response file can be recorded; at the same time, a template can be used and edited. To record a response file, we will run the installer with the parameters of the record and the destination of the response file:
E:\oracle\Disk1> setup -record -destinationFile
To run the installation with the response file, we have to enter the following:
E:\oracle\Disk1> setup -silent -nowelcome -noconfig –nowait-responseFile
Removing the Software
Even though we can add and remove components after installing Oracle, it might take a couple of attempts to get everything right. We may need to reinstall the software or components to develop a clean installation. The OUI can handle all this.
- After opening OUI, click on Installed Products
- We will see a list of Oracle homes and installed software. Select a home or component to remove. This will remove the software, but some of the file structures will remain. They can be removed manually.
On Windows, the information is written to the registry, which could be cleaned up, depending on if we want to reuse the Oracle home. Services can also be removed.
Upgrading a Database
As part of the installation, if an Oracle database already exists on the server, there will be an option to upgrade the database. Oracle Database Upgrade Assistant (DBUA) is also available after the installation of the software to perform upgrades.
Come to Intellipaat’s Oracle DBA Community if you have more queries on Oracle DBA!
Patches are nothing new to DBAs. SQL Server has hotfixes, security updates, and service packs for patching the base release. Patches have one-off fixes for bugs or a group of fixes or security releases.
Oracle also has different types of patches:
- Critical Patch Update (CPU) has the latest security updates for the database.
- Patch Set Update (PSU) includes the security patches and the recommended and proactive patches.
Oracle Configuration Manager provides help in managing patches through My Oracle Support.