Oracle DBA Tips and Techniques

By Arjun Raja

Archive for October, 2013

Oracle Cloud Control 12c ( 12.1.0.2 with Plug-ins) Installation

Posted by Arjun Raja on October 10, 2013

OMS_12C_REL2_INSTALL

Posted in Oracle 12c Cloud Control, Uncategorized | Leave a Comment »

ORACLE RESTART ON STANDALONE SERVER

Posted by Arjun Raja on October 4, 2013

Oracle restart feature is available for databases of 11.2 and greater.

This feature can be installed without the need to configure ASM as a pre-req.

To enable this on a server with just a simple 11.2 oracle database running these are the steps.

1. Download GRID INFRASTRUCTURE software from J:\DtaDbase\Software\Oracle 11g\Oracle 11g Rel 2 AIX\AIX_11.2.0.3_Database_and_gridinfrastructure

Unzip the files in a staging area on server:

Ex:

cd /u02/oradata/stage/AIX_11.2.0.3_Database_and_gridinfrastructure/grid directory once all files are unzipped.

export DISPLAY

./runInstaller

Follow prompts.

2 important choices

1. Choose install Oracle Grid Infrastucture Software only

2. Make sure grid infrastructure home is installed in a separate home to the existing database home :

Ex – new GI home is – /u01/oracle/product/11.2.0.3/gridinfra

Once install is complete :

As root user run

1. root.sh

2. /u01/oracle/product/11.2.0.3/gridinfra/perl/bin/perl -I/u01/oracle/product/11.2.0.3/gridinfra/perl/lib -I/u01/oracle/product/11.2.0.3/gridinfra/crs/install

/u01/oracle/product/11.2.0.3/gridinfra/crs/install/roothas.pl

The second command above is the command that configures Oracle Grid Infrastructure for a Standalone Server.

This automatically ensures availability of oracle restart.

To check

export ORACLE_HOME to point to new GI home

export PATH as necessary too.

ORACLE_HOME=/u01/oracle/product/11.2.0.3/gridinfra; export ORACLE_HOME

PATH=/usr/bin:/etc:/usr/sbin:/usr/ucb:/u01/oracle/bin:/usr/bin/X11:/sbin:/usr/java6:/usr/java6/bin:usr/java6/jre/bin:/u01/oracle:/usr/bin:/etc:/usr/sbin:/usr/ucb:/usr/bin/X11:/sbin:/usr/java5/jre/bin:/usr/java5/bin:/u01/oracle/product/11.2.0.3/gridinfra/bin; export PATH

cd $ORACLE_HOME/bin

Check CRS

cpstest:/u01/oracle/product/11.2.0.3/gridinfra/bin> crsctl check has

CRS-4638: Oracle High Availability Services is online

cpstest:/u01/oracle/product/11.2.0.3/gridinfra/bin>

 

Check resources managed by oracle HAS.

cpstest:/u01/oracle/product/11.2.0.3/gridinfra/bin> crsctl status resource -t

——————————————————————————–

NAME TARGET STATE SERVER STATE_DETAILS

——————————————————————————–

Local Resources

——————————————————————————–

ora.ons

OFFLINE OFFLINE p520test1

——————————————————————————–

Cluster Resources

——————————————————————————–

ora.cssd

1 ONLINE ONLINE p520test1

ora.diskmon

1 OFFLINE OFFLINE

ora.evmd

1 ONLINE ONLINE p520test1

cpstest:/u01/oracle/product/11.2.0.3/gridinfra/bin>

No database yet being monitored.

Add

database to list of processes controlled by Oracle Restart

Run this command from ORACLE_HOME – not GRID INFRASTRUCTURE HOME

cpstest:/u01/oracle> . oraenv

ORACLE_SID = [cpstest] ? test11g

test11g:/u01/oracle> which srvctl

/u01/oracle/product/11.2.0.3/db_1/bin/srvctl – Points to database home.

Add existing database to list monitored by Oracle Restart

test11g:/u01/oracle> srvctl add database -d test11g -o /u01/oracle/product/11.2.0.3/db_1

Check if the addition was successful :

test11g:/u01/oracle> srvctl config database -d test11g

Database unique name: test11g

Database name:

Oracle home: /u01/oracle/product/11.2.0.3/db_1

Oracle user: oracle

Spfile:

Domain:

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Database instance: test11g

Disk Groups:

Services:

test11g:/u01/oracle>

Now test if ORACLE RESTART is working –

srvctl status database -d test11g

Database is running.

test11g:/u01/oracle>

Kill pmon process for test11g database.

test11g:/u01/oracle> ps -ef |grep pmon

oracle 20971724 1 0 13:12:29 – 0:00 ora_pmon_test11g – note time of start – 13:12

test11g:/u01/oracle> kill -9 20971724

After five seconds –

test11g:/u01/oracle> ps -ef|grep pmon

oracle 21627036 1 0 13:16:27 – 0:00 ora_pmon_test11g

Note time of start – 13:16 – So Oracle restart works !

From now on – if a new database is created, it is automatically configured with Oracle restart :

I create a new database called testhas.

test11g:/u01/oracle/product/11.2.0.3/db_1/bin> ps -ef |grep pmon

oracle 21627036 1 0 13:16:27 – 0:00 ora_pmon_test11g

oracle 26738744 1 0 13:55:24 – 0:00 ora_pmon_testhas

test11g:/u01/oracle/product/11.2.0.3/db_1/bin>

Check configuration for Oracle restart :

test11g:/u01/oracle/product/11.2.0.3/db_1/bin> srvctl status database -d testhas

Database is running.

test11g:/u01/oracle/product/11.2.0.3/db_1/bin> srvctl config database -d testhas

Database unique name: testhas

Database name: testhas

Oracle home: /u01/oracle/product/11.2.0.3/db_1

Oracle user: oracle

Spfile:

Domain: xxxxxxx.com

Start options: open

Stop options: immediate

Database role: PRIMARY

Management policy: AUTOMATIC

Database instance: testhas

Disk Groups:

Services:

Test Oracle restart works for new database :

ps -ef |grep pmon

oracle 26738744 1 0 13:55:24 – 0:00 ora_pmon_testhas

kill -9 26738744

test11g:/u01/oracle/product/11.2.0.3/db_1/bin> kill -9 26738744

No testhas pmon if I check within one second….

test11g:/u01/oracle/product/11.2.0.3/db_1/bin> ps -ef |grep pmon

oracle 21627036 1 0 13:16:27 – 0:00 ora_pmon_test11g

But after 5 seconds I check again :

test11g:/u01/oracle/product/11.2.0.3/db_1/bin> ps -ef |grep pmon

oracle 21627036 1 0 13:16:27 – 0:00 ora_pmon_test11g

oracle 26542206 1 2 14:00:49 – 0:00 ora_pmon_testhas

Check resources monitored by Oracle restart:

test11g:/u01/oracle/product/11.2.0.3/db_1/bin> crsctl status resource -t

——————————————————————————–

NAME TARGET STATE SERVER STATE_DETAILS

——————————————————————————–

Local Resources

——————————————————————————–

ora.ons

OFFLINE OFFLINE p520test1

——————————————————————————–

Cluster Resources

——————————————————————————–

ora.cssd

1 ONLINE ONLINE p520test1

ora.diskmon

1 OFFLINE OFFLINE

ora.evmd

1 ONLINE ONLINE p520test1

ora.test11g.db

1 ONLINE ONLINE p520test1 Open

ora.testhas.db

1 ONLINE ONLINE p520test1 Open

test11g:/u01/oracle/product/11.2.0.3/db_1/bin>

Posted in High Availability | Tagged: | Leave a Comment »