Relocate a SCAN listener

Posted: September 30, 2013 in RAC

Steps to relocate a scan listener

oracle@test01 /export/home/oracle $ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node test02
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node test02
SCAN VIP scan3 is enabled
SCAN VIP scan3 is running on node test02
oracle@test01 /export/home/oracle $ srvctl relocate scan -i 1 -n test01
oracle@test01 /export/home/oracle $ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node test01
SCAN VIP scan2 is enabled
SCAN VIP scan2 is running on node test02
SCAN VIP scan3 is enabled
SCAN VIP scan3 is running on node test02
oracle@test01 /export/home/oracle $

The following is the steps needed to clear down a failed 11.2.0.3 RAC install, the root.sh part of the install can cause numerious issue so these steps have been used on several occasions

Run the rootcrs.pl to deconfig the cluster

Run on the first node

root@testnode1)$ ./rootcrs.pl -deconfig -verbose -force
Using configuration parameter file: ./crsconfig_params
Network exists: 1/172.23.72.0/255.255.248.0/bond0, type static
VIP exists: /testnode1-vip/172.23.72.23/172.23.72.0/255.255.248.0/bond0, hosting node testnode1
GSD exists
ONS exists: Local port 6100, remote port 6200, EM port 2016
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on ‘testnode1’
CRS-2673: Attempting to stop ‘ora.crsd’ on ‘testnode1’
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on ‘testnode1’
CRS-2673: Attempting to stop ‘ora.oc4j’ on ‘testnode1’
CRS-2673: Attempting to stop ‘ora.DATA.dg’ on ‘testnode1’
CRS-2677: Stop of ‘ora.oc4j’ on ‘testnode1’ succeeded
CRS-2677: Stop of ‘ora.DATA.dg’ on ‘testnode1’ succeeded
CRS-2673: Attempting to stop ‘ora.asm’ on ‘testnode1’
CRS-2677: Stop of ‘ora.asm’ on ‘testnode1’ succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on ‘testnode1’ has completed
CRS-2677: Stop of ‘ora.crsd’ on ‘testnode1’ succeeded
CRS-2673: Attempting to stop ‘ora.mdnsd’ on ‘testnode1’
CRS-2673: Attempting to stop ‘ora.crf’ on ‘testnode1’
CRS-2673: Attempting to stop ‘ora.ctssd’ on ‘testnode1’
CRS-2673: Attempting to stop ‘ora.evmd’ on ‘testnode1’
CRS-2673: Attempting to stop ‘ora.asm’ on ‘testnode1’
CRS-2677: Stop of ‘ora.mdnsd’ on ‘testnode1’ succeeded
CRS-2677: Stop of ‘ora.crf’ on ‘testnode1’ succeeded
CRS-2677: Stop of ‘ora.evmd’ on ‘testnode1’ succeeded
CRS-2677: Stop of ‘ora.asm’ on ‘testnode1’ succeeded
CRS-2673: Attempting to stop ‘ora.cluster_interconnect.haip’ on ‘testnode1’
CRS-2677: Stop of ‘ora.cluster_interconnect.haip’ on ‘testnode1’ succeeded
CRS-2677: Stop of ‘ora.ctssd’ on ‘testnode1’ succeeded
CRS-2673: Attempting to stop ‘ora.cssd’ on ‘testnode1’
CRS-2677: Stop of ‘ora.cssd’ on ‘testnode1’ succeeded
CRS-2673: Attempting to stop ‘ora.gipcd’ on ‘testnode1’
CRS-2677: Stop of ‘ora.gipcd’ on ‘testnode1’ succeeded
CRS-2673: Attempting to stop ‘ora.gpnpd’ on ‘testnode1’
CRS-2677: Stop of ‘ora.gpnpd’ on ‘testnode1’ succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on ‘testnode1’ has completed
CRS-4133: Oracle High Availability Services has been stopped.
Successfully deconfigured Oracle clusterware stack on this node

Run on the last node

root@testnode2)$ ./rootcrs.pl -deconfig -verbose -force -lastnode
Using configuration parameter file: ./crsconfig_params
CRS-2672: Attempting to start ‘ora.mdnsd’ on ‘testnode2’
CRS-5017: The resource action “ora.mdnsd start” encountered the following error:
Start action for daemon aborted. For details refer to “(:CLSN00107:)” in “/u01/app/11.2.0.3/grid/log/testnode2/agent/ohasd/oraagent_oracle/oraagent_oracle.log”.
CRS-2674: Start of ‘ora.mdnsd’ on ‘testnode2’ failed
CRS-2679: Attempting to clean ‘ora.mdnsd’ on ‘testnode2’
CRS-2681: Clean of ‘ora.mdnsd’ on ‘testnode2’ succeeded
CRS-2672: Attempting to start ‘ora.gpnpd’ on ‘testnode2’
CRS-5017: The resource action “ora.gpnpd start” encountered the following error:
Start action for daemon aborted. For details refer to “(:CLSN00107:)” in “/u01/app/11.2.0.3/grid/log/testnode2/agent/ohasd/oraagent_oracle/oraagent_oracle.log”.
CRS-2674: Start of ‘ora.gpnpd’ on ‘testnode2’ failed
CRS-2679: Attempting to clean ‘ora.gpnpd’ on ‘testnode2’
CRS-2681: Clean of ‘ora.gpnpd’ on ‘testnode2’ succeeded
CRS-4000: Command Start failed, or completed with errors.
CSS startup failed with return code 1
PRCR-1068 : Failed to query resources
Cannot communicate with crsd
PRCR-1068 : Failed to query resources
Cannot communicate with crsd
PRCR-1068 : Failed to query resources
Cannot communicate with crsd
PRCR-1068 : Failed to query resources
Cannot communicate with crsd
PRCR-1119 : Failed to look up CRS resources of ora.cluster_vip_net1.type type
PRCR-1068 : Failed to query resources
Cannot communicate with crsd
PRCR-1070 : Failed to check if resource ora.gsd is registered
Cannot communicate with crsd
PRCR-1070 : Failed to check if resource ora.ons is registered
Cannot communicate with crsd

CRS-4689: Oracle Clusterware is already stopped
CRS-2672: Attempting to start ‘ora.mdnsd’ on ‘testnode2’
CRS-5017: The resource action “ora.mdnsd start” encountered the following error:
Start action for daemon aborted. For details refer to “(:CLSN00107:)” in “/u01/app/11.2.0.3/grid/log/testnode2/agent/ohasd/oraagent_oracle/oraagent_oracle.log”.
CRS-2674: Start of ‘ora.mdnsd’ on ‘testnode2’ failed
CRS-2679: Attempting to clean ‘ora.mdnsd’ on ‘testnode2’
CRS-2681: Clean of ‘ora.mdnsd’ on ‘testnode2’ succeeded
CRS-2672: Attempting to start ‘ora.gpnpd’ on ‘testnode2’
CRS-5017: The resource action “ora.gpnpd start” encountered the following error:
Start action for daemon aborted. For details refer to “(:CLSN00107:)” in “/u01/app/11.2.0.3/grid/log/testnode2/agent/ohasd/oraagent_oracle/oraagent_oracle.log”.
CRS-2674: Start of ‘ora.gpnpd’ on ‘testnode2’ failed
CRS-2679: Attempting to clean ‘ora.gpnpd’ on ‘testnode2’
CRS-2681: Clean of ‘ora.gpnpd’ on ‘testnode2’ succeeded
CRS-4000: Command Start failed, or completed with errors.
CSS startup failed with return code 1
Unable to communicate with the Cluster Synchronization Services daemon.
CRS-4000: Command Delete failed, or completed with errors.
crsctl delete for vds in DATA … failed
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on ‘testnode2’
CRS-2673: Attempting to stop ‘ora.cssdmonitor’ on ‘testnode2’
CRS-2677: Stop of ‘ora.cssdmonitor’ on ‘testnode2’ succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on ‘testnode2’ has completed
CRS-4133: Oracle High Availability Services has been stopped.
Successfully deconfigured Oracle clusterware stack on this node

Clear down the install files

Node 1

root@testnode1)$ pwd
/u01/app
root@testnode1)$ rm -rf 11.2.0.3 oraInventory oracle
root@testnode1)$ rm -R /etc/oracle
root@testnode1)$ rm /etc/oraInst.loc
root@testnode1)$ rm /etc/oratab
root@testnode1)$ rm /usr/local/bin/dbhome
root@testnode1)$ rm /usr/local/bin/oraenv
root@testnode1)$ rm /usr/local/bin/coraenv
root@testnode1)$ chown oracle:dba /u01/app

Node 2

root@testnode2)$ cd /u01/app
root@testnode2)$ rm -rf 11.2.0.3 oraInventory oracle
root@testnode2)$ rm -R /etc/oracle
root@testnode2)$ rm /etc/oraInst.loc
root@testnode2)$ rm /etc/oratab
root@testnode2)$ rm /usr/local/bin/dbhome
root@testnode2)$ rm /usr/local/bin/oraenv
root@testnode2)$ rm /usr/local/bin/coraenv
root@testnode2)$ chown oracle:dba /u01/app

Clear the header from the disk that was used in the ASM disk group

oracle@testnode2.vcint.com /export/home/oracle $ dd if=/dev/zero of=/dev/asmdisk2_udev bs=1024 count=10000
10000+0 records in
10000+0 records out
10240000 bytes (10 MB) copied, 2.2165 s, 4.6 MB/s

Useful ASM Queries

Posted: March 5, 2013 in ASM

Disk Group Information

set pages 1000 lines 120
col NAME for a15
select GROUP_NUMBER DG#, name, ALLOCATION_UNIT_SIZE AU_SZ, STATE,
TYPE, TOTAL_MB, FREE_MB, OFFLINE_DISKS from v$asm_diskgroup;

DG# NAME                 AU_SZ STATE       TYPE     TOTAL_MB    FREE_MB OFFLINE_DISKS
———- ————— ———- ———– —— ———- ———- ————-
1 DATA               1048576 MOUNTED     EXTERN       5114       3353             0
2 FRA                1048576 MOUNTED     EXTERN       5114       2613             0

Disk Information

set pages 1000 lines 120
col PATH for a30
select DISK_NUMBER,MOUNT_STATUS,HEADER_STATUS,MODE_STATUS,STATE,
PATH FROM V$ASM_DISK;

DISK_NUMBER MOUNT_S HEADER_STATU MODE_ST STATE    PATH
———– ——- ———— ——- ——– ——————————
0 CACHED  MEMBER       ONLINE  NORMAL   /dev/asmdisk1
0 CACHED  MEMBER       ONLINE  NORMAL   /dev/asmdisk2

Rebalancing Information

select GROUP_NUMBER, OPERATION, STATE, ACTUAL, SOFAR, EST_MINUTES from v$asm_operation;

GROUP_NUMBER OPERA STAT    ACTUAL  SOFAR      EST_MINUTES
———— —– —- ———- ———- ———–
2            REBAL RUN           1         49          16

To install a Management Agent using the agentDeploy script, follow these steps:

1.       On the OMS host, from the OMS home, log in to the EMCLI client. EMCLI Client is available by default with every OMS installation, so you need not install the client separately.

oracle@oms-1 /u01/app/oracle/product/12.0.2/midware/oms/bin $ ./emcli login -username=sysman -password=xxxxxx

2.       Synchronize EMCLI:

oracle@oms-1 /u01/app/oracle/product/12.0.2/midware/oms/bin $ ./emcli sync

Synchronized successfully

3.       Identify the platforms for which the Management Agent software is available on the OMS host:

oracle@metaxa /u01/app/oracle/product/12.0.2/midware/oms/bin $ ./emcli get_supported_platforms

Getting list of platforms …

Check the logs at /u01/app/oracle/product/12.0.2/midware/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/agent.log

About to access self-update code path to retrieve the platforms list..

Getting Platforms list  …

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

Version = 12.1.0.2.0

Platform = Oracle Solaris on SPARC (64-bit)

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

Version = 12.1.0.2.0

Platform = Linux x86-64

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

Version = 12.1.0.2.0

Platform = Oracle Solaris on x86-64 (64-bit)

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

Version = 12.1.0.2.0

Platform = Linux x86

4.       Download the Management Agent software from Oracle Software Library to a temporary directory on the OMS host:

$<oms_home>/bin/emcli get_agentimage -destination=<download_directory> -platform=”” -version=

oracle@oms-1 /u01/app/oracle/product/12.0.2/midware/oms/bin $ ./emcli get_agentimage -destination=/tmp -platform=”Oracle Solaris on SPARC (64-bit)” -version=12.1.0.2.0

Platform:Oracle Solaris on SPARC (64-bit)

Destination:/tmp

=== Partition Detail ===

Space free : 21 GB

Space required : 1 GB

Check the logs at /u01/app/oracle/product/12.0.2/midware/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/get_agentimage_2012-10-12_11-15-56-AM.log

Setting property ORACLE_HOME to:/u01/app/oracle/product/12.0.2/midware/oms

calling pulloneoffs with arguments:/u01/app/oracle/product/12.0.2/midware/oms/u01/app/oracle/product/12.0.2/midware/oms/sysman/agent/12.1.0.2.0_AgentCore_23.zip12.1.0.2.0solaris

Check this logs for more information: /u01/app/oracle/product/12.0.2/midware/oms/sysman/prov/agentpush/logs

5.       Transfer the downloaded ZIP file to a temporary directory (/tmp) on the destination host where you want to install the Management Agent.

6.       On the destination host, extract the contents of the ZIP file using the unzip utility

7.       Edit the response file agent.rsp

<software_extract_location>/agent.rsp

The following values will go in the response file replacing the # out version; we will need to add the hostname of the host we are installing on in ORACLE_HOSTNAME

OMS_HOST=oms-1

EM_UPLOAD_PORT=1159

AGENT_REGISTRATION_PASSWORD=xxxxxxx

AGENT_INSTANCE_HOME=/u01/app/oracle/product/agent/12.1.0.2

AGENT_PORT=3872

b_startAgent=true

ORACLE_HOSTNAME=test-2

s_agentHomeName=agent_12c

8.       Invoke the deployment script and pass the response file:

<software_extract_location>/agentDeploy.sh AGENT_BASE_DIR=<absolute_path_to_agentbasedir> RESPONSE_FILE=<absolute_path_to_responsefile>

oracle@test-2 /u01/app/oracle/product/stage $ ./agentDeploy.sh AGENT_BASE_DIR=/u01/app/oracle/product/agent/12.1.0.2 RESPONSE_FILE=/u01/app/oracle/product/stage/agent.rsp

9.       Run the root scripts when you are prompted

10.  The ports that need opening if you get issues with the install are 1521, 3872 & 1159 between the OMS and the agent host

Description of Figure 10-1 follows

  • The direction of the arrows specify the direction of ports.
  • Port 1159, 4898-4989 indicates that 1159 is the default. If this port is not available, the Oracle Management Service will search in the specified range (4889 – 4897).
  • To clone between two target hosts separated by a firewall, the agents will need to communicate to each other on the agent ports. The initiating Management Agent will make the call.

VIP showing INTERMEDIATE

Posted: February 28, 2013 in RAC

In a 11gR2 RAC cluster a VIP was showing as INTERMEDIATE and the listener was running fine on both node the actions i took to move the resource back to the correct node

Checking the status

The output from crsctl status resource -t

ora.rac2.vip
1        ONLINE  INTERMEDIATE rac1                     FAILED OVER

Moving the VIP back to the correct node

[oracle@rac1 ~]$ crsctl status resource ora.rac2.vip
NAME=ora.rac2.vip
TYPE=ora.cluster_vip_net1.type
TARGET=ONLINE
STATE=INTERMEDIATE on rac1

[oracle@rac1 ~]$ crsctl stop resource ora.rac2.vip
CRS-2673: Attempting to stop ‘ora.rac2.vip’ on ‘rac1’
CRS-2677: Stop of ‘ora.rac2.vip’ on ‘rac1’ succeeded

[oracle@rac1 ~]$ crsctl start resource ora.rac2.vip
CRS-2672: Attempting to start ‘ora.rac2.vip’ on ‘rac2’
CRS-2676: Start of ‘ora.rac2.vip’ on ‘rac2’ succeeded

[oracle@rac1 ~]$ crsctl status resource ora.rac2.vip
NAME=ora.rac2.vip
TYPE=ora.cluster_vip_net1.type
TARGET=ONLINE
STATE=ONLINE on rac2

Possible Resource States

The possible resource states from the oracle documentation

State Description
ONLINE The resource is running.
OFFLINE The resource is not running.
UNKNOWN An attempt to stop the resource has failed. Oracle Clusterware does not actively monitor resources that are in this state. You must perform an application-specific action to ensure that the resource is offline, such as stop a process, and then run the crsctl stop resource command to reset the state of the resource to OFFLINE.
INTERMEDIATE A resource can be in the INTERMEDIATE state because of one of two events:

  1. Oracle Clusterware cannot determine the state of the resource but the resource was either attempting to go online or was online the last time its state was precisely known. Usually, the resource transitions out of this state on its own over time, as the conditions that impeded the check action no longer apply.
  2. A resource is partially online. For example, the Oracle Database VIP resource fails over to another server when its home server leaves the cluster. However, applications cannot use this VIP to access the database while it is on a non-home server. Similarly, when an Oracle Database instance is started and not open, the resource is partially online: it is running but is not available to provide services.

Oracle Clusterware actively monitors resources that are in the INTERMEDIATE state and, typically, you are not required to intervene. If the resource is in the INTERMEDIATE state due to the preceding reason 1, then as soon as the state of the resource is established, Oracle Clusterware transitions the resource out of the INTERMEDIATE state.

If the resource is in the INTERMEDIATE state due to the preceding reason 2, then it stays in this state if it remains partially online. For example, the home server of the VIP must rejoin the cluster so the VIP can switch over to it. A database administrator must issue a command to open the database instance.

In either case, however, Oracle Clusterware transitions the resource out of the INTERMEDIATE state automatically as soon as it is appropriate.Use the STATE_DETAILS resource attribute to explain the reason for a resource being in the INTERMEDIATE state and provide a solution to transition the resource out of this state.

Useful 11gR2 RAC Commands

Posted: July 17, 2012 in RAC

Check the status of the cluster

[oracle@rac1 ~]$ crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online

[oracle@rac1 ~]$ crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online

[oracle@rac1 ~]$ crsctl check cluster -all
**************************************************************
rac1:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************

Check the status of the services on the cluster

[oracle@rac1 ~]$ crsctl status resource -t
——————————————————————————–
NAME TARGET STATE SERVER STATE_DETAILS
——————————————————————————–
Local Resources
——————————————————————————–
ora.DATA.dg
ONLINE ONLINE rac1
ora.LISTENER.lsnr
ONLINE ONLINE rac1
ora.asm
ONLINE ONLINE rac1
ora.gsd
OFFLINE OFFLINE rac1
ora.net1.network
ONLINE ONLINE rac1
ora.ons
ONLINE ONLINE rac1
ora.registry.acfs
ONLINE ONLINE rac1
——————————————————————————–
Cluster Resources
——————————————————————————–
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE rac1
ora.cvu
1 ONLINE ONLINE rac1
ora.oc4j
1 ONLINE ONLINE rac1
ora.rac1.vip
1 ONLINE ONLINE rac1
ora.rac2.vip
1 OFFLINE OFFLINE
ora.scan1.vip
1 ONLINE ONLINE rac1
ora.testrac.db
1 OFFLINE OFFLINE Instance Shutdown

Stop crs on all nodes (only one node up in this example)

[root@rac1 bin]# ./crsctl stop cluster -all
CRS-2673: Attempting to stop ‘ora.crsd’ on ‘rac1’
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on ‘rac1’
CRS-2673: Attempting to stop ‘ora.registry.acfs’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.DATA.dg’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.LISTENER.lsnr’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.cvu’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.oc4j’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.LISTENER_SCAN1.lsnr’ on ‘rac1’
CRS-2677: Stop of ‘ora.LISTENER.lsnr’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.rac1.vip’ on ‘rac1’
CRS-2677: Stop of ‘ora.LISTENER_SCAN1.lsnr’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.scan1.vip’ on ‘rac1’
CRS-2677: Stop of ‘ora.scan1.vip’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.rac1.vip’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.cvu’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.registry.acfs’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.oc4j’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.DATA.dg’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.asm’ on ‘rac1’
CRS-2677: Stop of ‘ora.asm’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.ons’ on ‘rac1’
CRS-2677: Stop of ‘ora.ons’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.net1.network’ on ‘rac1’
CRS-2677: Stop of ‘ora.net1.network’ on ‘rac1’ succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on ‘rac1’ has completed
CRS-2677: Stop of ‘ora.crsd’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.ctssd’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.evmd’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.asm’ on ‘rac1’
CRS-2677: Stop of ‘ora.asm’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.cluster_interconnect.haip’ on ‘rac1’
CRS-2677: Stop of ‘ora.evmd’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.cluster_interconnect.haip’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.ctssd’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.cssd’ on ‘rac1’
CRS-2677: Stop of ‘ora.cssd’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.diskmon’ on ‘rac1’
CRS-2677: Stop of ‘ora.diskmon’ on ‘rac1’ succeeded

Stop crs on specifc node

[root@rac1 bin]# ./crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on ‘rac1’
CRS-2673: Attempting to stop ‘ora.crsd’ on ‘rac1’
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on ‘rac1’
CRS-2673: Attempting to stop ‘ora.cvu’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.LISTENER.lsnr’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.registry.acfs’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.DATA.dg’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.LISTENER_SCAN1.lsnr’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.oc4j’ on ‘rac1’
CRS-2677: Stop of ‘ora.LISTENER.lsnr’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.rac1.vip’ on ‘rac1’
CRS-2677: Stop of ‘ora.rac1.vip’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.LISTENER_SCAN1.lsnr’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.scan1.vip’ on ‘rac1’
CRS-2677: Stop of ‘ora.scan1.vip’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.cvu’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.oc4j’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.registry.acfs’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.DATA.dg’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.asm’ on ‘rac1’
CRS-2677: Stop of ‘ora.asm’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.ons’ on ‘rac1’
CRS-2677: Stop of ‘ora.ons’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.net1.network’ on ‘rac1’
CRS-2677: Stop of ‘ora.net1.network’ on ‘rac1’ succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on ‘rac1’ has completed
CRS-2677: Stop of ‘ora.crsd’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.drivers.acfs’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.mdnsd’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.crf’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.ctssd’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.evmd’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.asm’ on ‘rac1’
CRS-2677: Stop of ‘ora.asm’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.cluster_interconnect.haip’ on ‘rac1’
CRS-2677: Stop of ‘ora.evmd’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.crf’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.mdnsd’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.cluster_interconnect.haip’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.drivers.acfs’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.ctssd’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.cssd’ on ‘rac1’
CRS-2677: Stop of ‘ora.cssd’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.gipcd’ on ‘rac1’
CRS-2673: Attempting to stop ‘ora.diskmon’ on ‘rac1’
CRS-2677: Stop of ‘ora.gipcd’ on ‘rac1’ succeeded
CRS-2673: Attempting to stop ‘ora.gpnpd’ on ‘rac1’
CRS-2677: Stop of ‘ora.diskmon’ on ‘rac1’ succeeded
CRS-2677: Stop of ‘ora.gpnpd’ on ‘rac1’ succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on ‘rac1’ has completed
CRS-4133: Oracle High Availability Services has been stopped.

Disable CRS from starting on reboot

[root@rac1 bin]# ./crsctl disable has
CRS-4621: Oracle High Availability Services autostart is disabled.

Enable CRS to start on reboot

[root@rac1 bin]# ./crsctl enable has
CRS-4622: Oracle High Availability Services autostart is enabled.

Start crs on specifc node

[root@rac1 bin]# ./crsctl start has
CRS-4123: Oracle High Availability Services has been started.

Check database status

[oracle@rac1 ~]$ srvctl status database -d RACDB
Instance RACDB1 is running on node rac1
Instance RACDB2 is running on node rac2

Stop an instance

[oracle@rac1 ~]$ srvctl stop instance -i RACDB1 -d RACDB
[oracle@rac1 ~]$ srvctl status database -d RACDB
Instance RACDB1 is not running on node rac1
Instance RACDB2 is running on node rac2

Start an instance

[oracle@rac1 ~]$ srvctl start instance -i RACDB1 -d RACDB
[oracle@rac1 ~]$ srvctl status database -d RACDB
Instance RACDB1 is running on node rac1
Instance RACDB2 is running on node rac2

Stop the database

[oracle@rac1 ~]$ srvctl stop database -d RACDB
[oracle@rac1 ~]$ srvctl status database -d RACDB
Instance RACDB1 is not running on node rac1
Instance RACDB2 is not running on node rac2

Start the database

[oracle@rac1 ~]$ srvctl start database -d RACDB
[oracle@rac1 ~]$ srvctl status database -d RACDB
Instance RACDB1 is running on node rac1
Instance RACDB2 is running on node rac2

Stop the listener on a Node

[oracle@rac1 ~]$ srvctl status listener -n rac1
Listener LISTENER is enabled on node(s): rac1
Listener LISTENER is not running on node(s): rac1

Start the listener on a Node

[oracle@rac1 ~]$ srvctl status listener -n rac1
Listener LISTENER is enabled on node(s): rac1
Listener LISTENER is running on node(s): rac1

 

Check the voting disk

[oracle@rac1 ~]$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
— —– —————– ——— ———
1. ONLINE 91b18024f9674f83bf5117d3c0996a05 (ORCL:VOL1) [DATA]
Located 1 voting disk(s).

Query the network addresses

[oracle@rac1 ~]$ oifcfg getif
eth0 192.168.245.0 global public
eth1 192.168.126.0 global cluster_interconnect

Show OCR backup – the voting file (disk) is also backed up with the OCR backup

[root@rac1 bin]# ./ocrconfig -showbackup

rac1 2012/07/17 07:47:17 /u01/app/11.2.0/grid/cdata/rac-cluster/backup00.ocr

rac1 2012/07/17 03:47:15 /u01/app/11.2.0/grid/cdata/rac-cluster/backup01.ocr

rac1 2012/07/16 23:47:13 /u01/app/11.2.0/grid/cdata/rac-cluster/backup02.ocr

rac1 2012/07/16 19:47:11 /u01/app/11.2.0/grid/cdata/rac-cluster/day.ocr

rac1 2012/07/16 19:47:11 /u01/app/11.2.0/grid/cdata/rac-cluster/week.ocr

rac1 2012/03/23 11:30:19 /u01/app/11.2.0/grid/cdata/rac-cluster/backup_20120323_113019.ocr

Take a manual backup of the OCR

[root@rac1 bin]# ./ocrconfig -manualbackup

rac1 2012/07/17 10:08:28 /u01/app/11.2.0/grid/cdata/rac-cluster/backup_20120717_100828.ocr

rac1 2012/07/17 10:07:39 /u01/app/11.2.0/grid/cdata/rac-cluster/backup_20120717_100739.ocr

rac1 2012/03/23 11:30:19 /u01/app/11.2.0/grid/cdata/rac-cluster/backup_20120323_113019.ocr

 

Get DDL for a view or table

Posted: July 12, 2012 in Objects

How to generate the DLL for a table or a view from sqlplus, useful if you’ve not got a GUI tool.

So as the schema owner connect and run the following, in this example the table is called TEST_TABLE

set long 1000

select DBMS_METADATA.GET_DDL(‘TABLE’,’TEST_TABLE’) from dual;

output

 

view example

set long 1000

select DBMS_METADATA.GET_DDL(‘VIEW’,’TEST_VIEW’)from dual;

output