Tuesday, November 28, 2017

Runlevel Change


$ runlevel 
$ vi /etc/inittab
$ reboot

Installation scripts

If Oracle Installation is first time on the server then it creates /etc/oraInst.loc file which will be having information about oracle central inventory and it's group by default oinstall.

Do not put the oraInventory directory under the Oracle base directory for a new installation, because that can result in user permission errors for other installations.

If oraInventory group i.e. oinstall doesn't exists then installer uses the primary group of the software owner who is installing software.

Creating oinstall group if oraInvenotry doesn't exists

/usr/sbin/groupadd -g 54321 oinstall

grep oinstall /etc/groups

In Oracle documentation, a user created to own only Oracle Grid Infrastructure software installations is called the Grid user (grid). This user owns both the Oracle Clusterware and Oracle Automatic Storage Management binaries. A user created to own either all Oracle installations, or one or more Oracle database installations, is called the Oracle user (oracle). You can have only one Oracle Grid Infrastructure installation owner, but you can have different Oracle users to own different installations.

Can we have multiple owners for GI installations? No
Can we have multiple owners for DB installations? Yes, different versions of DB installations can be owned by different users.

Oracle software owners (grid and oracle) should have oinstall or Oracle Inventory group as their primary group so that each software installation  owner can able to write to the central inventory and OCR and Oracle clusterware resource permissions are set correctly.

The database software owner must also have osdba group and also osoper, osbackupdba, osdgdba, osracdba, oskmdba groups as secondary groups if they are created for role seperation duties.

oracle : 54321
grid : 54331

oinstall:54321
dba:54322
oper:54323
backupdba:54324
dgdba:54325
kmdba:54326
racdba:54330
asmdba:54327
asmoper:54328
asmadmin:54329

Oracle user can be in assigned with asmdba to manage asm instances.


$ grep "oinstall" /etc/group
oinstall:x:54321:grid,oracle

$ id oracle
uid=54321(oracle) gid=54321(oinstall) groups=54321(oinstall),54322(dba), 
54323(oper),54324(backupdba),54325(dgdba),54326(kmdba),54327(asmdba),54330(racdba)
$ id grid
uid=54331(grid) gid=54321(oinstall) groups=54321(oinstall),54322(dba),
54327(asmdba),54328(asmoper),54329(asmadmin),54330(racdba)

For Oracle Restart installations, to successfully install Oracle Database, ensure that the grid user is a member of the racdba group.


We need to run the below scripts as root user.

/u01/app/oraInstroot.sh


It creates the oraInventory.

Revokes read, write and execute permissions on the inventory from the world.
Grants read and write permission to the group oinstall.
creates /etc/oraInst.loc file which will be having information about location of the inventory as well as it's group.

/u01/app/oracle/product/12.1.0/dbhome_1/root.sh


Copies oraenv, coraenv to local bin directory i.e. /usr/local/bin

Creates oratab file and entries will be added to it when database is created DBCA.
If we manually create a database then the database entry will not be added to oratab, We need to add the new database to oratab manually.

If Central inventory/Global inventory is lost/corrupted then we can recreate it by attachhome method.


If Oracle installation is first time on the server then there wouldn't be any Oracle Inventory until we run /u01/app/oraInstroot.sh script as root user. We can register any number installations with one Oracle central inventory, Lets say if a server is running with 10g, 11g and 12c installations there would be only one Oracle Inventory for multiple installations.


oracle preinstall RPM


Oracle 12c R1 and R2 is certified to install on Oracle Linux 6 or 7 and use Oracle RPM, This RPM installs all required packages, sets kernel parameters for the installation of Oracle database and grid infrastructure. oracle-database-server-12cR2-preinstall is the RPM configures server ready for the installation of database and grid infrastructure.

Steps to install  oracle preinstall RPM

Download the Oracle linux 6 or 7 from edelivery.oracle.com
Once downloaded, start the installation with the appropriate selections for your environment.
During the installation process, Select customize now option in the software selection window.
On Oracle Linux, Select servers on the left pane of the screen and system administration on the right pane of the screen and then packages in system tools window will open.
Select Oracle Preinstallation RPM package box from the package list.
For Oracle Linux 7 select package similar to oracle-database-server-12cR2-preinstall-1.0-4.el7.x86_64.rpm
Close the optional package window and go with next steps.

Tuesday, September 26, 2017

Oracle Database Cloud Service Wizard

We will use create service wizard to create a service in oracle cloud.
The wizard takes you through below options.

Service Level

Oracle 12.2 is not available in oracle database cloud service virtual image service level.

Oracle Database Cloud Service - Virtual Image

It is a compute environment with pre-installed virtual machine that include all software needed to create and run an Oracle Database.
We connect to the virtual machine and run the DBCA to create database.
All maintenance operations like backup, patching and upgrades should be done manually, They are not automated.

Oracle Database Cloud Service

It is a Virtual machine plus database created according to specifications provided in the Create Service wizard.
It will have tools that provides automatic and on-demand backups, patching and upgrading, and point-in-time recovery for Oracle Databases.

Cloud Tools

bkup_api utility used to perform on-demand backups where as in RAC environments we use raccli. We can chnage the configuration of how backups are configured.

orec of dbaascli utility used to restore from backups where as in RAC environments we use raccli.

dbpatchm of dbaascli utility used for automatic patching where as in RAC environments we use raccli.

We use DBaaS Monitor web application to monitor Oracle databases and computing resources. It is not available on the Oracle RAC deployments on cloud.

Metering Frequency is of 2 types

Hourly  - Pay only for hours used during your billing period. We cannot switch the metering frequency from hourly to monthly once database has been deployed in cloud.

Monthly - Pay one price per month irrespective of number of hours used. We cannot switch the metering frequency from monthly to hourly once database has been deployed in cloud. Deployments that are created in middle of month the price is pro-rated. We only pay partial month amount from the start date.

Oracle Database Software Release

We can create Oracle database 11g R2, 12c R1 and 12c R2 deployments in cloud. Oracle 12.2 is not available in oracle database cloud service virtual image service level.

We can install following Oracle Database Software Editions.

Standard Edition
Enterprise Edition
Enterprise Edition - High Performance
Enterprise Edition - Extreme Performance

If we choose Enterprise Edition or Enterprise Edition - High Performance, all available database enterprise management packs and Enterprise Edition options are included in the database deployment.
The packs and options that are not part of the software edition you chose are available to you for use on a trial basis.

We can create following types of database deployments in Oracle cloud.

Single instance - Instance and database data store in a single compute node.
Database Clustering with RAC - A two node clustered database, Each compute node has one instance and two instances access the same shared database data store.
Single instance with dataguard standby - Two single-instance databases, one acting as the primary database and one acting as the standby database in an Oracle Data Guard configuration.
Database clustering with RAC and datagaurd standby - Two two-node Oracle RAC databases, one acting as the primary database and one acting as the standby database in an Oracle Data Guard configuration.
Dataguard standby fr hybrid DR - Single-instance database acting as the standby database in an Oracle Data Guard configuration. The primary database is on your own system.

Single instance is the only supported type for Oracle database cloud sevice - virtual image service level.
Single instance is the only supported type in standard edition.
The two RAC types are only supported in Enterprise Edition - Extreme Performance.


Oracle Database Cloud Service


Oracle database cloud service provides you the ability to deploy oracle databases in cloud.
Each deployment would have a single instance Oracle database.
We will be having full access to features and options in cloud with oracle provided computing power, storage and tools for database's routine and management operations.
It creates compute hosts to host the databases and provides access to these compute nodes using networking features provided by oracle database cloud services.

Two service levels are available with Oracle database cloud service.

Oracle Database Cloud Service - Virtual Image level

It includes Oracle database and supporting software.
We need to install the software and we are responsible for maintenance tasks.
We will be having root access/privilege and full administrative privilege to oracle database, So that we can load and run software in compute environment.

The Oracle Database Cloud Service level 

It includes Oracle Database and supporting software. 
The software is installed, Oracle database is created using values you provide when creating the database deployment and the database is started. We can set up automatic backups and it will be having tools for backup, recovery, patching and upgrade operations.
We will be having root privilege and full administrative privileges for the Oracle database, so you can load and run software in the compute environment.
We can make changes to the automated maintenance setup, and we are responsible for recovery operations in the event of a failure.