Friday, December 28, 2012

Query to track session generating redo


set lin 180
set pagesize 2000
col INST_ID format 999
col PROGRAM format A35
col MODULE format A35
col USERNAME format A25

select s.inst_id, s.sid, serial#, program, module, username, value redo_size
from gv$session s, gv$sesstat ss, v$statname sn
where s.sid = ss.sid
and ss.statistic# = sn.statistic#
and sn.name = 'redo size'
and s.inst_id = ss.inst_id
order by redo_size ;

Tuesday, December 18, 2012

Manual (slient) 12c agent installation


-bash-3.2$ ./emcli login -username=sysman -password=****
Login successful
-bash-3.2$ ./emcli sync
Synchronized successfully
-bash-3.2$ ./emcli get_supported_platforms
Getting list of platforms ...
Check the logs at /pkgmnoms/oms/oracle/12.1.0.2/oms/bin/agent.log
About to access self-update code path to retrieve the platforms list..
Getting Platforms list  ...
-----------------------------------------------
Version = 12.1.0.1.0
Platform = Linux x86-64
-----------------------------------------------
Version = 12.1.0.1.0
Platform = HP-UX PA-RISC (64-bit)
-----------------------------------------------
Version = 12.1.0.1.0
Platform = HP-UX Itanium
-----------------------------------------------
Version = 12.1.0.1.0
Platform = Oracle Solaris on SPARC (64-bit)
-----------------------------------------------
Platforms list displayed successfully.
-bash-3.2$
-bash-3.2$

Once done with checking of agent, we will extract agent software to any location (/tmp in our case) and transfer the software to target machine where we need to install the agent.

-bash-3.2$ ./emcli get_agentimage -destination=/tmp -platform="Oracle Solaris on SPARC (64-bit)" -version="12.1.0.1.0"
Platform:Oracle Solaris on SPARC (64-bit)
Destination:/tmp
=== Partition Detail ===
Space free : 2 GB
Space required : 1 GB
Check the logs at /tmp/get_agentimage_2012-07-17_08-16-35-AM.log
Setting property ORACLE_HOME to:/pkgmnoms/oms/oracle/12.1.0.2/oms
calling pulloneoffs with arguments:/pkgmnoms/oms/oracle/12.1.0.2/oms/pkgmnoms/oms/oracle/12.1.0.2/updates/55/C4191F66D29C0B40E0436D2028188B2212.1.0.1.0solaris
Check this logs for more information: /pkgmnoms/oms/oracle/12.1.0.2/oms/sysman/prov/agentpush/logs
-bash-3.2$ cd /tmp
-bash-3.2$ ls -lart 12.1.0.1.0*.zip
-rw-r----- 1 oracle oinstall 286075811 Jul 17 08:16 12.1.0.1.0_AgentCore_23.zip
-bash-3.2$

Scp to target machine.

After software is copied to the AGENT_BASE location, it is needed to unzip.


At target machine:

had:/app/oracle/amddhome/agent] ls
12.1.0.1.0_AgentCore_23.zip
had:/app/oracle/amddhome/agent] ls -lart
total 558744
-rwxr-xr-x   1 oracle   dba      286075811 Jul 17 12:23 12.1.0.1.0_AgentCore_23.zip
drwxrwxrwx   2 oracle   dba           96 Jul 17 12:23 .
drwxr-xr-x   6 oracle   dba         1024 Jul 17 12:23 ..
had:/app/oracle/amddhome/agent] unzip 12.1.0.1.0_AgentCore_23.zip
Archive:  12.1.0.1.0_AgentCore_23.zip
  inflating: unzip
  inflating: agentDeploy.sh
  inflating: agentimage.properties
  inflating: agent.rsp
extracting: agentcoreimage.zip
extracting: 12.1.0.1.0_PluginsOneoffs_23.zip
had:/app/oracle/amddhome/agent]


To install the agent all needed is to agent base directory, OMS_HOST, any free port and agent registration password. In case password is not known it can be changed from OEM CONSOLE SETUP -> SECURITY -> REGISTRATION PASSWORD. Once done with all the information, script is needed to execute as below.

suzan:/app/oracle/amddhome/agent] ./agentDeploy.sh AGENT_BASE_DIR=/app/oracle/amddhome/agent OMS_HOST=devd1.come.com EM_UPLOAD_PORT=4902 AGENT_REGISTRATION_PASSWORD=oracle123

AGENT_BASE_DIR=/app/oracle/amddhome/agent

-e Validating the OMS_HOST & EM_UPLOAD_PORT
Executing command : /app/oracle/amddhome/agent/core/12.1.0.1.0/jdk/bin/java -classpath /app/oracle/amddhome/agent/core/12.1.0.1.0/jlib/agentInstaller.jar:/app/oracle/amddhome/agent/core/12.1.0.1.0/oui/jlib/OraInstaller.jar oracle.sysman.agent.installer.AgentInstaller /app/oracle/amddhome/agent/core/12.1.0.1.0 /app/oracle/amddhome/agent /app/oracle/amddhome/agent -prereq

Validating oms host & port with url: http://pacdcorwdevd1.cable.comcast.com:4902/empbs/genwallet
Validating oms host & port with url: https://pacdcorwdevd1.cable.comcast.com:4902/empbs/genwallet
Return status:3
Unzipping the agentcoreimage.zip to /app/oracle/amddhome/agent ....
12.1.0.1.0_PluginsOneoffs_23.zip
Executing command : /app/oracle/amddhome/agent/unzip -o /app/oracle/amddhome/agent/12.1.0.1.0_PluginsOneoffs_23.zip -d /app/oracle/amddhome/agent
-e
Checking the ownership of agent base directory:/app/oracle/amddhome/agent
Checking for proper ownership on the agent base directory.
Checks whether the agent base directory is owned by the agent user oracle  and that its parent directory is owned by either the agent user or root.
....
Login name is : oracle & file owner is : oracle
............
Agent Base directory verification completed Successfully.
-e
Ownership check completed.
Executing command : /app/oracle/amddhome/agent/core/12.1.0.1.0/jdk/bin/java  -d64 -classpath /app/oracle/amddhome/agent/core/12.1.0.1.0/oui/jlib/OraInstaller.jar:/app/oracle/amddhome/agent/core/12.1.0.1.0/oui/jlib/xmlparserv2.jar:/app/oracle/amddhome/agent/core/12.1.0.1.0/oui/jlib/srvm.jar:/app/oracle/amddhome/agent/core/12.1.0.1.0/oui/jlib/emCfg.jar:/app/oracle/amddhome/agent/core/12.1.0.1.0/jlib/agentInstaller.jar:/app/oracle/amddhome/agent/core/12.1.0.1.0/oui/jlib/share.jar oracle.sysman.agent.installer.AgentInstaller /app/oracle/amddhome/agent/core/12.1.0.1.0 /app/oracle/amddhome/agent /app/oracle/amddhome/agent AGENT_BASE_DIR=/app/oracle/amddhome/agent AGENT_BASE_DIR=/app/oracle/amddhome/agent OMS_HOST=devd1.come.com EM_UPLOAD_PORT=4902 AGENT_REGISTRATION_PASSWORD=oracle123


Executing agent install prereqs...
Executing command: /app/oracle/amddhome/agent/core/12.1.0.1.0/oui/bin/runInstaller -ignoreSysPrereqs -prereqchecker -silent -ignoreSysPrereqs -waitForCompletion  -prereqlogloc /app/oracle/amddhome/agent/core/12.1.0.1.0/cfgtoollogs/agentDeploy -entryPoint oracle.sysman.top.agent_Complete -detailedExitCodes PREREQ_CONFIG_LOCATION=/app/oracle/amddhome/agent/core/12.1.0.1.0/prereqs
Prereq Logs Location:/app/oracle/amddhome/agent/core/12.1.0.1.0/cfgtoollogs/agentDeploy/prereq.log
Agent install prereqs completed successfully

Cloning the agent home...
Executing command: /app/oracle/amddhome/agent/core/12.1.0.1.0/oui/bin/runInstaller -ignoreSysPrereqs -clone -forceClone -silent -waitForCompletion -nowait ORACLE_HOME=/app/oracle/amddhome/agent/core/12.1.0.1.0   AGENT_BASE_DIR=/app/oracle/amddhome/agent AGENT_BASE_DIR=/app/oracle/amddhome/agent OMS_HOST=devd1.come.com EM_UPLOAD_PORT=4902 AGENT_REGISTRATION_PASSWORD=oracle123 -noconfig  ORACLE_HOME_NAME=agent12g2 -force AGENT_PORT=-1
Clone Action Logs Location:/oravl01/oracle/oraInventory/logs/cloneActions.log
Cloning of agent home completed successfully

Attaching sbin home...
Executing command: /app/oracle/amddhome/agent/core/12.1.0.1.0/oui/bin/runInstaller -ignoreSysPrereqs -attachHome -waitForCompletion -nowait ORACLE_HOME=/app/oracle/amddhome/agent/sbin ORACLE_HOME_NAME=sbin12g2 -force
Attach Home Logs Location:/app/oracle/amddhome/agent/core/12.1.0.1.0/cfgtoollogs/agentDeploy/AttachHome.log
Attach home for sbin home completed successfully.

Updating home dependencies...
Executing command: /app/oracle/amddhome/agent/core/12.1.0.1.0/oui/bin/runInstaller -ignoreSysPrereqs -updateHomeDeps -waitForCompletion HOME_DEPENDENCY_LIST="/app/oracle/amddhome/agent/sbin:/app/oracle/amddhome/agent/core/12.1.0.1.0" -invPtrLoc /app/oracle/amddhome/agent/core/12.1.0.1.0/oraInst.loc -force
Update Home Dependencies Location:/app/oracle/amddhome/agent/core/12.1.0.1.0/cfgtoollogs/agentDeploy/UpdateHomeDeps.log
Update home dependency completed successfully.

Performing the agent configuration...
Executing command: /app/oracle/amddhome/agent/core/12.1.0.1.0/oui/bin/runConfig.sh ORACLE_HOME=/app/oracle/amddhome/agent/core/12.1.0.1.0 RESPONSE_FILE=/app/oracle/amddhome/agent/core/12.1.0.1.0/agent.rsp ACTION=configure MODE=perform COMPONENT_XML={oracle.sysman.top.agent.11_1_0_1_0.xml} RERUN=true
Configuration Log Location:/app/oracle/amddhome/agent/core/12.1.0.1.0/cfgtoollogs/cfgfw/CfmLogger.log
Agent Configuration completed successfully

The following configuration scripts need to be executed as the "root" user.
#!/bin/sh
#Root script to run
/app/oracle/amddhome/agent/core/12.1.0.1.0/root.sh
To execute the configuration scripts:
1. Open a terminal window
2. Log in as "root"
3. Run the scripts
Agent Deployment Successful.
Agent deployment log location:
/app/oracle/amddhome/agent/core/12.1.0.1.0/cfgtoollogs/agentDeploy/agentDeploy_.log
Agent deployment completed successfully.

suzan:/app/oracle/amddhome/agent]

Agent hostname should be what is pinable from OMS server. If needed we can use ORACLE_HOSTNAME vaiable.

suzan:/app/oracle/amddhome/agent] ./agentDeploy.sh AGENT_BASE_DIR=/app/oracle/amddhome/agent OMS_HOST=devd1.come.com EM_UPLOAD_PORT=4902 AGENT_REGISTRATION_PASSWORD=oracle123 ORACLE_HOSTNAME=suzan.sys.come.net

Friday, December 14, 2012

Oracle Enterprise Manager Database Control on Windows 7


Installing Oracle Enterprise Manager Database Control on localhost machine (Windows 7).

Prerequisites:

SYS and DBSNMP password must be known, listener port and ORACLE HOME should be known.

Database should not have SYSMAN, MGMT_VIEW scheman with MGMT_USER role.

Also drop all the public synonyms for which table owner is sysman.

drop user sysman cascade;
drop role MGMT_USER;
drop user MGMT_VIEW cascade;

select 'drop public synonym ' || SYNONYM_NAME || ';' from dba_synonyms where owner='PUBLIC' and table_owner='SYSMAN';

Once done with all below.

C:\Windows\system32>emca -config dbcontrol db -repos create

STARTED EMCA at Dec 13, 2012 9:16:28 PM
EM Configuration Assistant, Version 11.2.0.0.2 Production
Copyright (c) 2003, 2005, Oracle.  All rights reserved.

Enter the following information:
Database SID: oracle
Listener port number: 1521
Listener ORACLE_HOME [ C:\app\JAYVA\product\11.2.0\dbhome_1 ]:
Password for SYS user:
Password for DBSNMP user:
Password for SYSMAN user:
Password for SYSMAN user: Email address for notifications (optional):
Outgoing Mail (SMTP) server for notifications (optional):
-----------------------------------------------------------------

You have specified the following settings

Database ORACLE_HOME ................ C:\app\JAYVA\product\11.2.0\dbhome_1

Local hostname ................ localhost
Listener ORACLE_HOME ................ C:\app\JAYVA\product\11.2.0\dbhome_1
Listener port number ................ 1521
Database SID ................ oracle
Email address for notifications ...............
Outgoing Mail (SMTP) server for notifications ...............

-----------------------------------------------------------------
Do you wish to continue? [yes(Y)/no(N)]: Y
Dec 13, 2012 9:16:52 PM oracle.sysman.emcp.EMConfig perform
INFO: This operation is being logged at C:\app\JAYVA\cfgtoollogs\emca\oracle\emca_2012_12_13_21_16_28.log.
Dec 13, 2012 9:16:53 PM oracle.sysman.emcp.EMReposConfig createRepository
INFO: Creating the EM repository (this may take a while) ...
Dec 13, 2012 9:23:32 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Repository successfully created
Dec 13, 2012 9:23:42 PM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository
INFO: Uploading configuration data to EM repository (this may take a while) ...
Dec 13, 2012 9:24:46 PM oracle.sysman.emcp.EMReposConfig invoke
INFO: Uploaded configuration data successfully
Dec 13, 2012 9:24:59 PM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib
INFO: Software library configured successfully.
Dec 13, 2012 9:24:59 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Deploying Provisioning archives ...
Dec 13, 2012 9:25:34 PM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary
INFO: Provisioning archives deployed successfully.
Dec 13, 2012 9:25:34 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Securing Database Control (this may take a while) ...
Dec 13, 2012 9:25:42 PM oracle.sysman.emcp.util.DBControlUtil secureDBConsole
INFO: Database Control secured successfully.
Dec 13, 2012 9:25:42 PM oracle.sysman.emcp.util.DBControlUtil startOMS
INFO: Starting Database Control (this may take a while) ...
Dec 13, 2012 9:26:48 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: Database Control started successfully
Dec 13, 2012 9:26:49 PM oracle.sysman.emcp.EMDBPostConfig performConfiguration
INFO: >>>>>>>>>>> The Database Control URL is https://localhost:5500/em <<<<<<<<<<<
Dec 13, 2012 9:26:51 PM oracle.sysman.emcp.EMDBPostConfig invoke
WARNING:
************************  WARNING  ************************

Management Repository has been placed in secure mode wherein Enterprise Manager
data will be encrypted.  The encryption key has been placed in the file: C:/app/JAYVA/product/11.2.0/dbhome_1/localhost_oracle/sysman/config/emkey.ora.  
Please ensure this file is backed up as the encrypted data will become unusable if this file is lost.

***********************************************************
Enterprise Manager configuration completed successfully
FINISHED EMCA at Dec 13, 2012 9:26:51 PM

C:\Windows\system32>

In case of any issue, please check log on location:

ORACLE_BASE\cfgtoollogs\emca\\ emca_repos_create_.log.

In case you get error for ORACLE_UNQNAME as below:

C:\Users\jayva>emctl status dbconsole
Environment variable ORACLE_UNQNAME not defined. Please set ORACLE_UNQNAME to database unique name.

C:\Users\jayva>

Check for file at location ORACLE_HOME\ oc4j\j2ee\ OC4J_DBConsole_localhost_oracle

Here localhost is the hostname & oracle is unqname. Might be differ in your environment.

Wednesday, November 7, 2012

ORA-01555 Snapshot Too Old


Actual Undo Size

SELECT SUM(a.bytes) "UNDO_SIZE"
  FROM v$datafile a,
       v$tablespace b,
       dba_tablespaces c
 WHERE c.contents = 'UNDO'
   AND c.status = 'ONLINE'
   AND b.name = c.tablespace_name
   AND a.ts# = b.ts#;


Undo Blocks per Second

SELECT MAX(undoblks/((end_time-begin_time)*3600*24))
      "UNDO_BLOCK_PER_SEC"
  FROM v$undostat;



DB Block Size

SELECT TO_NUMBER(value) "DB_BLOCK_SIZE [KByte]"
 FROM v$parameter
WHERE name = 'db_block_size';

Optimal Undo Retention

SELECT d.undo_size/(1024*1024) "ACTUAL UNDO SIZE [MByte]",
       SUBSTR(e.value,1,25) "UNDO RETENTION [Sec]",
       ROUND((d.undo_size / (to_number(f.value) *
       g.undo_block_per_sec))) "OPTIMAL UNDO RETENTION [Sec]"
  FROM (
       SELECT SUM(a.bytes) undo_size
          FROM v$datafile a,
               v$tablespace b,
               dba_tablespaces c
         WHERE c.contents = 'UNDO'
           AND c.status = 'ONLINE'
           AND b.name = c.tablespace_name
           AND a.ts# = b.ts#
       ) d,
       v$parameter e,
       v$parameter f,
       (
       SELECT MAX(undoblks/((end_time-begin_time)*3600*24))
              undo_block_per_sec
         FROM v$undostat
       ) g
WHERE e.name = 'undo_retention'
  AND f.name = 'db_block_size'

Optimal undo retention

SELECT d.undo_size/(1024*1024) "ACTUAL UNDO SIZE [MByte]",
       SUBSTR(e.value,1,25) "UNDO RETENTION [Sec]",
       (TO_NUMBER(e.value) * TO_NUMBER(f.value) *
       g.undo_block_per_sec) / (1024*1024)
      "NEEDED UNDO SIZE [MByte]"
  FROM (
       SELECT SUM(a.bytes) undo_size
         FROM v$datafile a,
              v$tablespace b,
              dba_tablespaces c
        WHERE c.contents = 'UNDO'
          AND c.status = 'ONLINE'
          AND b.name = c.tablespace_name
          AND a.ts# = b.ts#
       ) d,
      v$parameter e,
       v$parameter f,
       (
       SELECT MAX(undoblks/((end_time-begin_time)*3600*24))
         undo_block_per_sec
         FROM v$undostat
       ) g
 WHERE e.name = 'undo_retention'
  AND f.name = 'db_block_size'

Recommended unto_rentention :-
select BEGIN_TIME,END_TIME , TUNED_UNDORETENTION from v$undostat;

Number of time snapshot too old error found :-
select begin_time,ssolderrcnt from v$undostat;

Maximum time of query in Undo, clue is to set undo retention higher to this value :-
select begin_time,maxquerylen from v$undostat;

Tuesday, October 30, 2012

OCR recovery from CRS internal backup and export backup

Recovery case of OCR disk from ocr own backup.

$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.ibm.db     application    ONLINE    ONLINE    labtest02
ora....m1.inst application    ONLINE    ONLINE    labtest01
ora....m2.inst application    ONLINE    ONLINE    labtest02
ora....SM1.asm application    ONLINE    ONLINE    labtest01
ora....01.lsnr application    ONLINE    ONLINE    labtest01
ora....t01.gsd application    ONLINE    ONLINE    labtest01
ora....t01.ons application    ONLINE    ONLINE    labtest01
ora....t01.vip application    ONLINE    ONLINE    labtest01
ora....SM2.asm application    ONLINE    ONLINE    labtest02
ora....02.lsnr application    ONLINE    ONLINE    labtest02
ora....t02.gsd application    ONLINE    ONLINE    labtest02
ora....t02.ons application    ONLINE    ONLINE    labtest02
ora....t02.vip application    ONLINE    ONLINE    labtest02
$
$
$ ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     307112
         Used space (kbytes)      :       3812
         Available space (kbytes) :     303300
         ID                       :  992671071
         Device/File Name         : /dev/rhdiskpower1
                                    Device/File integrity check succeeded
         Device/File Name         : /dev/rhdiskpower2
                                    Device/File integrity check succeeded

         Cluster registry integrity check succeeded

$ orcconfig -showbackup
ksh: orcconfig:  not found
$ ocrconfig -showbackup

labtest02     2010/02/06 11:40:44     /u01/app/oracle/product/10.2.0/crs/cdata/crs

labtest02     2010/02/06 07:40:44     /u01/app/oracle/product/10.2.0/crs/cdata/crs

labtest02     2010/02/06 03:40:43     /u01/app/oracle/product/10.2.0/crs/cdata/crs

labtest02     2010/02/05 07:40:41     /u01/app/oracle/product/10.2.0/crs/cdata/crs

labtest02     2010/01/26 04:53:33     /u01/app/oracle/product/10.2.0/crs/cdata/crs
##################

Now we format ocr disk...

$ sudo su -
Password:
#
# pwd
/
# dd if=/dev/zero of=/dev/rhdiskpower1 bs=8192 count=25000
25000+0 records in
25000+0 records out
# dd if=/dev/zero of=/dev/rhdiskpower1 bs=8192 count=25000
25000+0 records in
25000+0 records out
# dd if=/dev/zero of=/dev/rhdiskpower2 bs=8192 count=25000
25000+0 records in
25000+0 records out
######################


$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.ibm.db     application    ONLINE    ONLINE    labtest02
ora....m1.inst application    ONLINE    ONLINE    labtest01
ora....m2.inst application    ONLINE    ONLINE    labtest02
ora....SM1.asm application    ONLINE    ONLINE    labtest01
ora....01.lsnr application    ONLINE    ONLINE    labtest01
ora....t01.gsd application    ONLINE    ONLINE    labtest01
ora....t01.ons application    ONLINE    ONLINE    labtest01
ora....t01.vip application    ONLINE    ONLINE    labtest01
ora....SM2.asm application    ONLINE    ONLINE    labtest02
ora....02.lsnr application    ONLINE    ONLINE    labtest02
ora....t02.gsd application    ONLINE    ONLINE    labtest02
ora....t02.ons application    ONLINE    ONLINE    labtest02
ora....t02.vip application    ONLINE    ONLINE    labtest02
$ uname -n
labtest01
$ srvctl stop listener -n labtest01
PRKH-1010 : Unable to communicate with CRS services.
  [OCR Error(Native: prsr_initCLSS:[21])]
$ crs_stat -t
CRS-0184: Cannot communicate with the CRS daemon.

$ ocrconfig -restore /u01/app/oracle/product/10.2.0/crs/cdata/crs/day.ocr
PROT-20: Insufficient permission to proceed. Require privileged user

###################
 with root privilage:-

# cd /u01/app/oracle/product/10.2.0/crs
# cd bin
# ./ocrconfig -restore /u01/app/oracle/product/10.2.0/crs/cdata/crs/day.ocr
# echo $?
0
# ./crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly

######################

$ crs_stat -t
CRS-0184: Cannot communicate with the CRS daemon.

$  crs_stat -t
CRS-0184: Cannot communicate with the CRS daemon.

$ crs_stat -t
CRS-0184: Cannot communicate with the CRS daemon.

$ crs_stat -t
CRS-0184: Cannot communicate with the CRS daemon.

$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.debs.db    application    ONLINE    ONLINE    labtest02
ora....debs.cs application    ONLINE    ONLINE    labtest01
ora....bs1.srv application    ONLINE    OFFLINE
ora....s1.inst application    ONLINE    OFFLINE
ora....s2.inst application    ONLINE    OFFLINE
ora....SM1.asm application    ONLINE    ONLINE    labtest01
ora....01.lsnr application    ONLINE    ONLINE    labtest01
ora....t01.gsd application    ONLINE    ONLINE    labtest01
ora....t01.ons application    ONLINE    ONLINE    labtest01
ora....t01.vip application    ONLINE    ONLINE    labtest01
ora....SM2.asm application    ONLINE    ONLINE    labtest02
ora....02.lsnr application    ONLINE    ONLINE    labtest02
ora....t02.gsd application    ONLINE    ONLINE    labtest02
ora....t02.ons application    ONLINE    ONLINE    labtest02
ora....t02.vip application    ONLINE    ONLINE    labtest02
ora....andh.db application    ONLINE    ONLINE    labtest01
ora....h1.inst application    ONLINE    OFFLINE
ora....h2.inst application    ONLINE    OFFLINE
$ ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     307112
         Used space (kbytes)      :       5128
         Available space (kbytes) :     301984
         ID                       :  992671071
         Device/File Name         : /dev/rhdiskpower1
                                    Device/File integrity check succeeded
         Device/File Name         : /dev/rhdiskpower2
                                    Device/File integrity check succeeded

         Cluster registry integrity check succeeded

$ sqlplus

SQL*Plus: Release 10.2.0.1.0 - Production on Sat Feb 6 14:44:27 2012

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

Enter user-name: / as sysdba

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

SQL> select open_mode from v$database;

OPEN_MODE
----------
READ WRITE

SQL>

********************************************************************

From OCR export backup:

$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.debs.db    application    OFFLINE   OFFLINE
ora....debs.cs application    OFFLINE   OFFLINE
ora....bs1.srv application    ONLINE    OFFLINE
ora....s1.inst application    ONLINE    OFFLINE
ora....s2.inst application    ONLINE    OFFLINE
ora....SM1.asm application    ONLINE    ONLINE    labtest01
ora....01.lsnr application    ONLINE    ONLINE    labtest01
ora....t01.gsd application    ONLINE    ONLINE    labtest01
ora....t01.ons application    ONLINE    ONLINE    labtest01
ora....t01.vip application    ONLINE    ONLINE    labtest01
ora....SM2.asm application    ONLINE    ONLINE    labtest02
ora....02.lsnr application    ONLINE    ONLINE    labtest02
ora....t02.gsd application    ONLINE    ONLINE    labtest02
ora....t02.ons application    ONLINE    ONLINE    labtest02
ora....t02.vip application    ONLINE    ONLINE    labtest02
ora....andh.db application    OFFLINE   OFFLINE
ora....h1.inst application    ONLINE    OFFLINE
ora....h2.inst application    ONLINE    OFFLINE
$


$ ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :     307112
         Used space (kbytes)      :       5136
         Available space (kbytes) :     301976
         ID                       :  992671071
         Device/File Name         : /dev/rhdiskpower1
                                    Device/File integrity check succeeded
         Device/File Name         : /dev/rhdiskpower2
                                    Device/File integrity check succeeded

         Cluster registry integrity check succeeded

$ ls -lt /u01
total 0
drwxr-xr-x    2 oracle   oinstall        256 Jan 20 16:20 cron_script
drwxrwx---    3 oracle   oinstall        256 Jan 12 16:17 app
drwxr-xr-x    2 root     system          256 Jan  7 16:10 lost+found
$ cd /u01/app
$ ls
oracle
$ mkdir ocr
$ ls
ocr     oracle
$ ls -lt
total 0
drwxr-xr-x    2 oracle   oinstall        256 Feb  6 15:09 ocr
drwxrwx---    3 oracle   oinstall        256 Jan 12 16:17 oracle
$ cd ocr
$ pwd
/u01/app/ocr
$ ocrconfig -export /u01/app/ocr/ocr-export.dmp
PROT-20: Insufficient permission to proceed. Require privileged user
######################
# pwd
/u01/app/oracle/product/10.2.0/crs/bin
# ./ocrconfig -export /u01/app/ocr/ocr-export.dmp

# dd if=/dev/zero of=/dev/rhdiskpower1 bs=8192 count=25000
25000+0 records in
25000+0 records out
# dd if=/dev/zero of=/dev/rhdiskpower2 bs=8192 count=25000
25000+0 records in
25000+0 records out
# ./ocrconfig -import /u01/app/ocr/ocr-export.dmp
# ./crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly

#################
$ crs_stat -t
CRS-0184: Cannot communicate with the CRS daemon.

$ crs_stat -t
Name           Type           Target    State     Host
------------------------------------------------------------
ora.debs.db    application    OFFLINE   OFFLINE
ora....debs.cs application    OFFLINE   OFFLINE
ora....bs1.srv application    ONLINE    OFFLINE
ora....s1.inst application    ONLINE    OFFLINE
ora....s2.inst application    ONLINE    OFFLINE
ora....SM1.asm application    ONLINE    ONLINE    labtest01
ora....01.lsnr application    ONLINE    ONLINE    labtest01
ora....t01.gsd application    ONLINE    ONLINE    labtest01
ora....t01.ons application    ONLINE    ONLINE    labtest01
ora....t01.vip application    ONLINE    ONLINE    labtest01
ora....SM2.asm application    ONLINE    ONLINE    labtest02
ora....02.lsnr application    ONLINE    ONLINE    labtest02
ora....t02.gsd application    ONLINE    ONLINE    labtest02
ora....t02.ons application    ONLINE    ONLINE    labtest02
ora....t02.vip application    ONLINE    ONLINE    labtest02
ora....andh.db application    OFFLINE   OFFLINE
ora....h1.inst application    ONLINE    OFFLINE
ora....h2.inst application    ONLINE    OFFLINE