Pages

Sunday, February 23, 2014

Installing Oracle Restart

Download the software from My Oracle Support.

From the file download window, click the file name to download the selected software.
$ cd /u01/app/oracle
$ mkdir software
$ cd software
$ unzip p13390677_112040_Linux-x86-64_3of7.zip

$ ./runInstaller
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 1884 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 4063 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2014-01-07_08-33-29PM. Please wait ...

On Download Software Updates screen, select Skip software updates.

On Select Installation Option screen, select Install Oracle Grid Infrastructure Software Only.

The Selected Language is English. Click Next to continue.

On Privileged Operation System Groups screen, select the Privileged Operating System Groups. Click Next.

As dba group is selected for all, this group will not allow job role separation. A warning will appear. Click Yes.

On Specify Installation Location screen, the Oracle Base path appears by default. Accept the default values or enter the Grid Infrastructure home directory path in which you want to install Oracle Restart. The directory path should not contain spaces.

This screen checks that the system meets the minimum requirements for the installation and configuration.

Correct any errors that Oracle Universal Installer may have found. If there are no issues, you will directly move to the Summary screen.

Review the Summary screen. Click Install button if the information seems OK.

The Install Product page provides status so that you can monitor installation progress as Installer continues.

As root, execute the configuration scripts.
 
# /u01/app/11.2.0/grid/root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/11.2.0/grid

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.

To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:
/u01/app/11.2.0/grid/perl/bin/perl -I/u01/app/11.2.0/grid/perl/lib -I/u01/app/11.2.0/grid/crs/install /u01/app/11.2.0/grid/crs/install/roothas.pl

To configure Grid Infrastructure for a Cluster execute the following command:
/u01/app/11.2.0/grid/crs/config/config.sh
This command launches the Grid Infrastructure Configuration Wizard. The wizard also supports silent operation, and the parameters can be passed through the response file that is available in the installation media.

Click on Close to exit from Installer.

# /u01/app/11.2.0/grid/perl/bin/perl -I/u01/app/11.2.0/grid/perl/lib -I/u01/app/11.2.0/grid/crs/install /u01/app/11.2.0/grid/crs/install/roothas.pl
Using configuration parameter file: /u01/app/11.2.0/grid/crs/install/crsconfig_params
User ignored Prerequisites during installation
LOCAL ADD MODE
Creating OCR keys for user 'oracle', privgrp 'dba'..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user 'root', privgrp 'root'..
Operation successful.
CRS-4664: Node orarac1 successfully pinned.
Adding Clusterware entries to upstart

orarac1     2014/01/07 21:28:46     /u01/app/11.2.0/grid/cdata/orarac1/backup_20140107_212846.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server

Disable HAS
Disable automatic startup of Oracle High Availability Services when server boots up.
# crsctl disable has

Enable HAS
Enable automatic startup of Oracle High Availability Services when server boots up.
# crsctl enable has

Check HAS Status
# crsctl config has

Add Listener to HAS
$ srvctl add listener -l LISTENER -p 1521 -o /u01/app/11.2.0/grid

Start Listener
$ srvctl start listener -l LISTENER

Stop Listener
$ srvctl stop listener -l LISTENER

Remove Listener from HAS
$ srvctl remove listener -l LISTENER

Add Database to HAS
$ srvctl add database -d orcl -o /u01/app/oracle/product/11.2.0/dbhome_1 -m example.com

Start Database
$ srvctl start database -d orcl

Start Database in nomount mode
$ srvctl start database -d orcl -o nomount

Start Database in mount mode
$ srvctl start database -d orcl -o mount

Stop Database
$ srvctl stop database -d orcl

Remove Database from HAS
$ srvctl remove database -d orcl


Configuring Data Guard to HAS

Primary:


$ srvctl add listener -p tcp:1521 -o /u01/app/11.2.0/grid
$ srvctl add database -d  orcl  -o /u01/app/oracle/product/11.2.0/dbhome_1 -n oradg1  -i orcl -s OPEN -t IMMEDIATE -r PRIMARY -y AUTOMATIC
$ srvctl add database -d  orcl  -o /u01/app/oracle/product/11.2.0/dbhome_1 -n oradg1  -i orcl -s MOUNT -t IMMEDIATE -r PHYSICAL_STANDBY  -y AUTOMATIC
$ srvctl add service -d orcl -s orcl_prim  -l  PRIMARY -y AUTOMATIC -q TRUE -e SELECT -m BASIC -w 10 -z 150


Standby:

$ srvctl add listener -p tcp:1521 -o
/u01/app/11.2.0/grid
$ srvctl add database -d  orcls  -o /u01/app/oracle/product/11.2.0/dbhome_1 -n oradg2  -i orcl -s MOUNT -t IMMEDIATE -r PHYSICAL_STANDBY -y AUTOMATIC
$ srvctl add service -d orcls -s orcl_prim  -l PRIMARY -y AUTOMATIC -q TRUE -e SELECT -m BASIC -w 10 -z 150

Saturday, February 22, 2014

Creating Real Application Clusters Database


Login as oracle and start Database Configuration Assistant to create the database.

$ cd $ORACLE_HOME/bin
$ dbca

On the Welcome screen, select Oracle Real Application Clusters (RAC) database.

On Operations screen, select Create a Database.

On Database Templates screen, select General Purpose or Transaction Processing.

On Database Identification screen, Admin-Managed is selected by default for Configuration Type. When you enter Global Database Name, Database Configuration Assistant automatically populates SID field with database name. Click on Select All to select all the nodes in the cluster for the cluster database creation.                                                   

On Management Options - Enterprise manager screen, uncheck Configure Enterprise Manager. You can register this database with Cloud Control 12c later for centralized management.

On Management Options - Automatic Maintenance Tasks screen, enable automatic maintenance tasks is checked by default. Click Next to continue.

Enter the same Administrative password for SYS and SYSTEM.

On Database File Locations screen, Cluster File System is selected as Storage Type by default. Select Use Common Location for All Database Files and specify Database Files Location.

Click on File Location Variables to display the variables used for the database.

On Recovery Configuration screen, check Specify Fast Recovery Area and enter path for Fast Recovery Area and size for Fast Recovery Area Size. Check Enable Archiving.

Click on Edit Archive Mode Parameters to see or modify the Archive Log Format.

On Database Content – Sample Schemas screen, Sample Schemas are not needed.

On Database Content - Custom Scripts screen, no need to run any custom scripts.

On Initialization Parameters - Memory screen, Automatic Memory Management in enabled by default. Enter Memory Size.

Click on All Initialization Parameters to display the values.

On Initialization Parameters - Sizing screen, enter processes.

On Initialization Parameters - Character Sets screen, select Use Unicode (AL32UTF8) which is Oracle recommended characterset.

On Initialization Parameters - Connection Mode screen, Dedicated Server Mode is selected by default. Click Next.

On Database Storage screen, enter controlfile, Datafiles, Redo Log Groups locations.

Enter Data file locations are under /u02 and Temp file location is under /u04 to improve the performance.

Enter two redo log members for redundancy.

Change thread # to 2 for Redo Log Group 4. Add redo log groups 5 and 6 for thread 2.

On creation Options, click Finish for Summary page.

On Summary page, Click OK to start database creation.

The Database Configuration Assistant screen provides status so that you can monitor the progress for database creation as DBCA continues.

Click on Exit to exit from DBCA.

$ srvctl config database -d orac
Database unique name: ORAC
Database name: ORAC
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: /u02/oradata/ORAC/spfileORAC.ora
Domain: example.com
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: ORAC
Database instances: ORAC1,ORAC2
Disk Groups:
Mount point paths:
Services:
Type: RAC
Database is administrator managed

$ srvctl status database -d orac
Instance ORAC1 is running on node orarac1
Instance ORAC2 is running on node orarac2

$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Tue Jan 7 13:48:19 2014

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> select * from v$active_instances;

INST_NUMBER
-----------
INST_NAME
--------------------------------------------------------------------------------
              1
orarac1.localdomain:ORAC1

              2
orarac2.localdomain:ORAC2

Check status of the resources on cluster.

$ crsctl status resource -t
--------------------------------------------------------------------------------
NAME           TARGET  STATE        SERVER                   STATE_DETAILS       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       orarac1                                      
               ONLINE  ONLINE       orarac2                                     
ora.asm
               OFFLINE OFFLINE      orarac1                  Instance Shutdown  
               OFFLINE OFFLINE      orarac2                                      
ora.gsd
               OFFLINE OFFLINE      orarac1                                     
               OFFLINE OFFLINE      orarac2                                     
ora.net1.network
               ONLINE  ONLINE       orarac1                                     
               ONLINE  ONLINE       orarac2                                     
ora.ons
               ONLINE  ONLINE       orarac1                                     
               ONLINE  ONLINE       orarac2                                     
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       orarac2                                     
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       orarac1                                     
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       orarac1                                     
ora.cvu
      1        ONLINE  ONLINE       orarac1                                     
ora.oc4j
      1        ONLINE  ONLINE       orarac1                                     
ora.orac.db
      1        ONLINE  ONLINE       orarac1                  Open               
      2        ONLINE  ONLINE       orarac2                  Open               
ora.orarac1.vip
      1        ONLINE  ONLINE       orarac1                                     
ora.orarac2.vip
      1        ONLINE  ONLINE       orarac2                                     
ora.scan1.vip
      1        ONLINE  ONLINE       orarac2                                     
ora.scan2.vip
      1        ONLINE  ONLINE       orarac1                                      
ora.scan3.vip
      1        ONLINE  ONLINE      

Saturday, February 15, 2014

Installing Oracle Software for Real Application Clusters



Log in as oracle and start Oracle Universal Installer.
$ cd database
$ ./runInstaller
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 3092 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 4051 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2014-01-06_11-27-19PM. Please wait ...


On the Configure Security Updates screen, uncheck I wish to receive security updates via My Oracle Support.

Click Yes to remain uniformed of critical security issues.
On Download Software Updates page, select Sip software updates.


On Select Installation option screen, select Install database software only. It only installs Oracle Database binaries.

In Node Select screen, select Oracle Real Application Clusters database installation. Under Node Name, select all the nodes in the cluster.

The Selected Language is English. Click Next to continue.

On Select Database Edition screen, select Enterprise Edition.



Click on Select Options and Choose Components and then click OK.

The Oracle Base path appears by default. Accept the default values or enter the Oracle home directory path in which you want to install Oracle components. The directory path should not contain spaces.

It checks the specified location on remote node. Select the Privileged Operation System Groups. Click Next.

This screen checks that the system meets the minimum requirements for the installation.

Correct any errors that Oracle Universal Installer may have found, and then click Next. This is expected as SCAN is configured in /etc/hosts. It is supposed to be configured in DNS.

Review the Summary screen. Click Install button if the information seems OK.

The Install Product page provides status so that you can monitor installation progress as Installer continues.

As root, execute the configuration script.


# /u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/11.2.0/dbhome_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.


/u01/app/oracle/product/11.2.0/dbhome_1/root.sh
Performing root user operation for Oracle 11g

The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /u01/app/oracle/product/11.2.0/dbhome_1

Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.

Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.

Click on Close to exit Installer.