Thursday, May 5, 2011

Why need to use RMAN a Recovery Catalog in oracle database 10g ?

Why need to use RMAN a Recovery Catalog in oracle database 10g ?

RMAN maintains metadata about the target database and its backup and recovery operations in the RMAN repository. Among other things, RMAN stores information about its own configuration settings, the target database schema, archived redo logs, and all backup files on disk or tape. RMAN's LIST, REPORT, and SHOW commands display RMAN repository information.

The primary store for RMAN repository data is always the control file of the target database. The CONTROL_FILE_RECORD_KEEP_TIME initialization parameter controls how long backup records are kept in the control file before those records are re-used to hold information about more recent backups.

Another copy of the RMAN repository data can also be saved in the recovery catalog.

Using a recovery catalog preserves RMAN repository information if the control file is lost, making it much easier to restore and recover following the loss of the control file. (A backup control file may not contain complete information about recent available backups.) The recovery catalog can also store a much more extensive history of your backups than the control file, due to limits on the number of control file records.

In addition to RMAN repository records, the recovery catalog can also hold RMAN stored scripts, sequences of RMAN commands for common backup tasks. Centralized storage of scripts in recovery catalog can be more convenient than working with command files.

Except for stored scripts, all of RMAN's features work equally well with or without a recovery catalog.

Benefit of using Flash Recovery Area for Archive log in oracle database 10g

Benefit of using Flash Recovery Area for Archive log in oracle database 10g


It is recommended that you take advantage of the FRA to store as many backup and recovery-related files as as possible, including disk backups and archived redo logs.

Some features of Oracle database backup and recovery, such as Oracle Flashback Database and guaranteed restore points, require the use of an FRA. However, having an FRA for use by these features does not force you to use it to store all recovery-related files.

Even when its use is not required, however, the FRA offers a number of advantages over other on-disk backup storage methods. Backups moved to tape from the flash recovery area (via RMAN and media manager) are retained on disk until space is needed for other required files, reducing the need to restore backups from tape. At the same time, obsolete files no longer needed to meet your recoverability goals and files backed up to tape become eligible for deletion and are deleted when space is needed. These deletions are managed by Oracle when space is required. The DBA no longer has to manually delete old backups, and, it is less likely that a DBA accidentally deletes redundancy set files. Note that if backups written to the FRA are not copied via RMAN and media manager to tape, the automatic deletion of obsolete backups does not occur and pre-Oracle10g cleanup methods are required.

Oracle Database RMAN Commands

All RMAN Commands (recovery manager Commands)

Command
Purpose

"@"

Run a command file.

"@@"

Run a command file in the same directory as another command file that is currently running. The @@ command differs from the @ command only when run from within a command file.

"ALLOCATE CHANNEL"

Establish a channel, which is a connection between RMAN and a database instance.

"ALLOCATE CHANNEL FOR MAINTENANCE"

Allocate a channel in preparation for issuing maintenance commands such as DELETE.

"allocOperandList"

A subclause that specifies channel control options such as PARMS and FORMAT.

"ALTER DATABASE"

Mount or open a database.

"archivelogRecordSpecifier"

Specify a range of archived redo logs files.

"BACKUP"

Back up database files, copies of database files, archived logs, or backup sets.

"BLOCKRECOVER"

Recover an individual data block or set of data blocks within one or more datafiles.

"CATALOG"

Add information about file copies and user-managed backups to the repository.

"CHANGE"

Mark a backup piece, image copy, or archived redo log as having the status UNAVAILABLE or AVAILABLE; remove the repository record for a backup or copy; override the retention policy for a backup or copy.

"completedTimeSpec"

Specify a time range during which the backup or copy completed.

"CONFIGURE"

Configure persistent RMAN settings. These settings apply to all RMAN sessions until explicitly changed or disabled.

"CONNECT"

Establish a connection between RMAN and a target, auxiliary, or recovery catalog database.

"connectStringSpec"

Specify the username, password, and net service name for connecting to a target, recovery catalog, or auxiliary database. The connection is necessary to authenticate the user and identify the database.

"CONVERT"

Converts datafile formats for transporting tablespaces and databases across platforms.

"CREATE CATALOG"

Create the schema for the recovery catalog.

"CREATE SCRIPT"

Create a stored script and store it in the recovery catalog.

"CROSSCHECK"

Determine whether files managed by RMAN, such as archived logs, datafile copies, and backup pieces, still exist on disk or tape.

"datafileSpec"

Specify a datafile by filename or absolute file number.

"DELETE"

Delete backups and copies, remove references to them from the recovery catalog, and update their control file records to status DELETED.

"DELETE SCRIPT"

Delete a stored script from the recovery catalog.

"deviceSpecifier"

Specify the type of storage device for a backup or copy.

"DROP CATALOG"

Remove the schema from the recovery catalog.

"DROP DATABASE"

Deletes the target database from disk and unregisters it.

"DUPLICATE"

Use backups of the target database to create a duplicate database that you can use for testing purposes or to create a standby database.

"EXECUTE SCRIPT"

Run an RMAN stored script.

"EXIT"

Quit the RMAN executable.

"fileNameConversionSpec"

Specify patterns to transform source to target filenames during BACKUP AS COPY, CONVERT and DUPLICATE.

"FLASHBACK"

Returns the database to its state at a previous time or SCN.

"formatSpec"

Specify a filename format for a backup or copy.

"HOST"

Invoke an operating system command-line subshell from within RMAN or run a specific operating system command.

"keepOption"

Specify that a backup or copy should or should not be exempt from the current retention policy.

"LIST"

Produce a detailed listing of backup sets or copies.

"listObjList"

A subclause used to specify which items will be displayed by the LIST command.

"maintQualifier"

A subclause used to specify additional options for maintenance commands such as DELETE and CHANGE.

"maintSpec"

A subclause used to specify the files operated on by maintenance commands such as CHANGE, CROSSCHECK, and DELETE.

"obsOperandList"

A subclause used to determine which backups and copies are obsolete.

"PRINT SCRIPT"

Display a stored script.

"QUIT"

Exit the RMAN executable.

"recordSpec"

A subclause used to specify which objects the maintenance commands should operate on.

"RECOVER"

Apply redo logs and incremental backups to datafiles restored from backup or datafile copies, in order to update them to a specified time.

"REGISTER"

Register the target database in the recovery catalog.

"RELEASE CHANNEL"

Release a channel that was allocated with an ALLOCATE CHANNEL command.

"releaseForMaint"

Release a channel allocated with an ALLOCATE CHANNEL FOR MAINTENANCE command.

"REPLACE SCRIPT"

Replace an existing script stored in the recovery catalog. If the script does not exist, then REPLACE SCRIPT creates it.

"REPORT"

Perform detailed analyses of the content of the recovery catalog.

"RESET DATABASE"

Inform RMAN that the SQL statement ALTER DATABASE OPEN RESETLOGS has been executed and that a new incarnation of the target database has been created, or reset the target database to a prior incarnation.

"RESTORE"

Restore files from backup sets or from disk copies to the default or a new location.

"RESYNC"

Perform a full resynchronization, which creates a snapshot control file and then copies any new or changed information from that snapshot control file to the recovery catalog.

"RUN"

Execute a sequence of one or more RMAN commands, which are one or more statements executed within the braces of RUN.

"SEND"

Send a vendor-specific quoted string to one or more specific channels.

"SET"

Sets the value of various attributes that affect RMAN behavior for the duration of a RUN block or a session.

"SHOW"

Displays the current CONFIGURE settings.

"SHUTDOWN"

Shut down the target database. This command is equivalent to the SQL*Plus SHUTDOWN command.

"SPOOL"

Write RMAN output to a log file.

"SQL"

Execute a SQL statement from within Recovery Manager.

"STARTUP"

Start up the target database. This command is equivalent to the SQL*Plus STARTUP command.

"SWITCH"

Specify that a datafile copy is now the current datafile, that is, the datafile pointed to by the control file. This command is equivalent to the SQL statement ALTER DATABASE RENAME FILE as it applies to datafiles.

"tempfileSpec"

Specifies a tempfile by path or by file number.

"TRANSPORT TABLESPACE"

Creates transportable tablespace sets from backup for one or more tablespaces.

"UNREGISTER DATABASE"

Unregisters a database from the recovery catalog.

untilClause

A subclause specifying an upper limit by time, SCN, or log sequence number. This clause is usually used to specify the desired point in time for an incomplete recovery.

"UPGRADE CATALOG"

Upgrade the recovery catalog schema from an older version to the version required by the RMAN executable.

"VALIDATE"

Examine a backup set and report whether its data is intact. RMAN scans all of the backup pieces in the specified backup sets and looks at the checksums to verify that the contents can be successfully restored.

How to change the database to archive log mode from noarchive log mode in oracle 10G or 11g ?

How to change the database to archive log mode from noarchive log mode in oracle 10G ?
====================================================================================

Steps are:-

SQL>create pfile='c:\temp\init.ora' from spfile;
SQL>created;
SQL>shutdown immediate;

edit the init.ora file by adding the following information:
NOTE: You can add upto 10 archive log destination:

*.LOG_ARCHIVE_DEST_1='LOCATION=C:\oracle10GDB\arc_1'
NOTE: directory should be changed to your specific location:

*.LOG_ARCHIVE_DEST_2='LOCATION=C:\oracle10GDB\arc_2'
NOTE: directory should be changed to your specific location:

*.LOG_ARCHIVE_FORMAT='%t_%s_%r.dbf'

sql>startup mount pfile='c:\temp\init.ora'
ORACLE instance started.

SQL> alter database archivelog;
Database altered.

SQL> alter database open;
Database altered.

SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination C:\oracle10GDB\arc_2
Oldest online log sequence 3
Next log sequence to archive 4
Current log sequence 4

SQL> create spfile from pfile='c:\temp\init.ora';
File created.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.

SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination C:\oracle10GDB\arc_2
Oldest online log sequence 3
Next log sequence to archive 4
Current log sequence 4



NOte:-[LOG_ARCHIVE_START parameter is no longer required to be set in order to run the database in ARCHIVELOG mode. This parameter is deprecated in Oracle 10g.
Also, LOG_ARCHIVE_FORMAT must be in the format: %s,%t,%r. %s log sequence number, %t thread number, %r resetlogs ID that ensures unique names are constructed for the archived log files across multiple incarnations of the database
]

Tuesday, May 3, 2011

SRVCTL Commands in oracle RAC 11g ?

SRVCTL Commands in oracle RAC 11g ?


Command Description

srvctl add

Adds the node applications, database, database instance, ASM instance, or service.

srvctl remove

Removes the node applications, database, database instance, ASM instance, or service.

srvctl config

Lists the configuration for the node applications, database, ASM instance, or service.

srvctl enable

Enables the database, database instance, ASM instance, or service.

srvctl disable

Disables the database, database instance, ASM instance, or service.

srvctl start

Starts the node applications, database, database instance, ASM instance, or service.

srvctl stop

Stops the node applications, database, database instance, ASM instance, or service.

srvctl modify

Modifies the node applications, database, database instance, or service configuration.

srvctl relocate

Relocates the service from one instance to another.

srvctl status

Obtains the status of the node applications, database, database instance, ASM instance, or service.

srvctl getenv

Displays the environment variable in the configuration for the node applications, database, database instance, or service.

srvctl setenv and unsetenv

Sets and unsets the environment variable in the configuration for the node applications, database, database instance, or service.

How to Change Public and Virtual IP Address in Oracle RAC 11g ?

How to Change Public and Virtual IP Address in Oracle RAC 11g ?

Steps are follows:-

(A)

Take the Services, Database, ASM Instances and nodeapps down on both the Nodes in Cluster. Also disable the nodeapps, asm and database instances to prevent them from restarting in case if this node gets rebooted during this process.

srvctl stop service -d test
srvctl stop database -d test
srvctl stop asm -n node1-pub
srvctl stop asm -n node2-pub

srvctl stop nodeapps -n node1-pub,node1-pub2
srvctl disable instance -d test -i test1,test2
srvctl disable asm -n node1-pub
srvctl disable asm -n node2-pub

srvctl disable nodeapps -n node1-pub
srvctl disable nodeapps -n node2-pub


(B)
Modify the /etc/hosts and/or DNS, ifcfg-eth0 (local node) with the new IP values
on All the Nodes

(C)
Restart the specific network interface in order to use the new IP.

ifconfig eth0 down
ifconfig eth0 up


Or, you can restart the network.
CAUTION: on NAS, restarting entire network may cause the node to be rebooted.

(D)
Update the OCR with the New Public IP.
In case of public IP, you have to delete the interface first and then add it back with the new IP address.

As oracle user, Issue the below command:

oifcfg delif -global eth0
oifcfg setif -global eth0/192.168.10.0:public


(E)
Update the OCR with the New Virtual IP.
Virtual IP is part of the nodeapps and so you can modify the nodeapps to update the Virtual IP information.

As privileged user (root), Issue the below commands:

srvctl modify nodeapps -n node1-pub -A 192.168.10.111/255.255.255.0/eth0 <-- for Node 1
srvctl modify nodeapps -n node1-pub -A 192.168.10.222/255.255.255.0/eth0 <-- for Node 2


(F)
Enable the nodeapps, ASM, database Instances for all the Nodes.

srvctl enable instance -d test -i test1,test2
srvctl enable asm -n node1-pub
srvctl enable asm -n node2-pub

srvctl enable nodeapps -n node1-pub
srvctl enable nodeapps -n node2-pub


(G)
Update the listener.ora file on each nodes with the correct IP addresses in case if it uses the IP address instead of the hostname.

(H)
Restart the Nodeapps, ASM and Database instance

srvctl start nodeapps -n node1-pub
srvctl start nodeapps -n node2-pub

srvctl start asm -n node1-pub
srvctl start asm -n node2-pub

srvctl start database -d test

How to Restoring OCR in Oracle 11g RAC?

How to Restoring OCR in Oracle 11g RAC?


The below command is used to restore the OCR from the physical backup. Shutdown CRS on all nodes.

ocrconfig -restore

Locate the avialable Backups

[root@node1-pub ~]# ocrconfig -showbackup

node2-pub 2007/09/03 17:46:47 /u01/app/crs/cdata/test-crs/backup00.ocr

node2-pub 2007/09/03 13:46:45 /u01/app/crs/cdata/test-crs/backup01.ocr

node2-pub 2007/09/03 09:46:44 /u01/app/crs/cdata/test-crs/backup02.ocr

node2-pub 2007/09/03 01:46:39 /u01/app/crs/cdata/test-crs/day.ocr

node2-pub 2007/09/03 01:46:39 /u01/app/crs/cdata/test-crs/week.ocr

node1-pub 2007/10/07 13:50:41 /u01/app/crs/cdata/test-crs/backup_20071007_135041.ocr


Perform Restore from previous Backup

[root@node2-pub ~]# ocrconfig -restore /u01/app/crs/cdata/test-crs/week.ocr

The above command restore the OCR from week old backup.
If you have logical backup of OCR (taken using export option), then You can import it with the below command.

ocrconfig -import /tmp/ocr_exp.dat



Restoring Votedisks

  • Shutdown CRS on all the nodes in Cluster.
  • Locate the current location of the Votedisks
  • Restore each of the votedisks using "dd" command from the previous good backup of Votedisk taken using the same "dd" command.
  • Start CRS on all the nodes.

crsctl stop crs
crsctl query css votedisk
dd if= of= <<-- do this for all the votedisks
crsctl start crs

How to Backing Up OCR file in oracle 11g RAC ?

How to Backing Up OCR file in oracle 11g RAC


Oracle performs physical backup of OCR devices every 4 hours under the default backup direcory $ORA_CRS_HOME/cdata/
and then it rolls that forward to Daily, weekly and monthly backup. You can get the backup information by executing below command.

ocrconfig -showbackup

[root@node1-pub ~]# ocrconfig -showbackup

node2-pub 2007/09/03 17:46:47 /u01/app/crs/cdata/test-crs/backup00.ocr

node2-pub 2007/09/03 13:46:45 /u01/app/crs/cdata/test-crs/backup01.ocr

node2-pub 2007/09/03 09:46:44 /u01/app/crs/cdata/test-crs/backup02.ocr

node2-pub 2007/09/03 01:46:39 /u01/app/crs/cdata/test-crs/day.ocr

node2-pub 2007/09/03 01:46:39 /u01/app/crs/cdata/test-crs/week.ocr
[root@node1-pub ~]#


Manually backing up the OCR

ocrconfig -manualbackup <<--Physical Backup of OCR

The above command backs up OCR under the default Backup directory. You can export the contents of the OCR using below command (Logical backup).

ocrconfig -export /tmp/ocr_exp.dat -s online <<-- Logical Backup of OCR

How to Add/Remove Votedisk file in oracle 11g Cluster ?

How to Add/Remove Votedisk file in oracle 11g Cluster:


Adding Votedisk:

Get the existing Vote Disks associated into the cluster. To be safe, Bring crs cluster stack down on all the nodes
but one on which you are going to add votedisk from.

(1) Stop CRS on all the nodes in cluster but one.


[root@node2-pub ~]# crsctl stop crs

(2) Get the list of Existing Vote Disks


crsctl query css votedisk

[root@node1-pub ~]# crsctl query css votedisk
0. 0 /u02/ocfs2/vote/VDFile_0
1. 0 /u02/ocfs2/vote/VDFile_1
2. 0 /u02/ocfs2/vote/VDFile_2
Located 3 voting disk(s).

(3) Backup the VoteDisk file

Backup the existing votedisks as below as oracle:

dd if=/u02/ocfs2/vote/VDFile_0 of=$ORACLE_BASE/bkp/vd/VDFile_0

[root@node1-pub ~]# su - oracle
[oracle@node1-pub ~]$ dd if=/u02/ocfs2/vote/VDFile_0 of=$ORACLE_BASE/bkp/vd/VDFile_0
41024+0 records in
41024+0 records out
[oracle@node1-pub ~]$

(4) Add an Extra Votedisk into the Cluster:

If it is a OCFS, then touch the file as oracle. On raw devices, initialize the raw devices using "dd" command

touch /u02/ocfs2/vote/VDFile_3 <<-- as oracle
crsctl add css votedisk /u02/ocfs2/vote/VDFile_3 <<-- as oracle
crsctl query css votedisks

[root@node1-pub ~]# su - oracle
[oracle@node1-pub ~]$ touch /u02/ocfs2/vote/VDFile_3
[oracle@node1-pub ~]$ crsctl add css votedisk /u02/ocfs2/vote/VDFile_3
Now formatting voting disk: /u02/ocfs2/vote/VDFile_3.
Successful addition of voting disk /u02/ocfs2/vote/VDFile_3.

(5) Confirm that the file has been added successfully:

[root@node1-pub ~]# ls -l /u02/ocfs2/vote/VDFile_3
-rw-r----- 1 oracle oinstall 21004288 Oct 6 16:31 /u02/ocfs2/vote/VDFile_3
[root@node1-pub ~]# crsctl query css votedisks
Unknown parameter: votedisks
[root@node1-pub ~]# crsctl query css votedisk
0. 0 /u02/ocfs2/vote/VDFile_0
1. 0 /u02/ocfs2/vote/VDFile_1
2. 0 /u02/ocfs2/vote/VDFile_2
3. 0 /u02/ocfs2/vote/VDFile_3
Located 4 voting disk(s).
[root@node1-pub ~]#

Removing Votedisk:

Removing Votedisk from the cluster is very simple. Tthe below command removes the given votedisk from cluster configuration.

crsctl delete css votedisk /u02/ocfs2/vote/VDFile_3

[root@node1-pub ~]# crsctl delete css votedisk /u02/ocfs2/vote/VDFile_3
Successful deletion of voting disk /u02/ocfs2/vote/VDFile_3.
[root@node1-pub ~]#

[root@node1-pub ~]# crsctl query css votedisk
0. 0 /u02/ocfs2/vote/VDFile_0
1. 0 /u02/ocfs2/vote/VDFile_1
2. 0 /u02/ocfs2/vote/VDFile_2
Located 3 voting disk(s).
[root@node1-pub ~]#

How to Add/Remove OCR file in Oracle 11g RAC ?

How to Add/Remove OCR file in Oracle 11g RAC:


Removing OCR File

(1) Get the Existing OCR file information by running ocrcheck utility.

[root@node1-pub ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 262120
Used space (kbytes) : 3852
Available space (kbytes) : 258268
ID : 744414276
Device/File Name : /u02/ocfs2/ocr/OCRfile_0 <-- OCR
Device/File integrity check succeeded
Device/File Name : /u02/ocfs2/ocr/OCRfile_1 <-- OCR Mirror
Device/File integrity check succeeded

Cluster registry integrity check succeeded

(2) The First command removes the OCR mirror (/u02/ocfs2/ocr/OCRfile_1). If you want to remove the OCR
file
(/u02/ocfs2/ocr/OCRfile_1) run the next command.

ocrconfig -replace ocrmirror
ocrconfig -replace ocr

[root@node1-pub ~]# ocrconfig -replace ocrmirror
[root@node1-pub ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 262120
Used space (kbytes) : 3852
Available space (kbytes) : 258268
ID : 744414276
Device/File Name : /u02/ocfs2/ocr/OCRfile_0 <<-- OCR File
Device/File integrity check succeeded

Device/File not configured <-- OCR Mirror not existed any more

Cluster registry integrity check succeeded

Adding OCR

You need to add OCR or OCR Mirror file in a case where you want to move the existing OCR file location to the different Devices.
The below command add ths OCR mirror file if OCR file alread exists.

(1) Get the Current status of OCR:


[root@node1-pub ~]# ocrconfig -replace ocrmirror
[root@node1-pub ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 262120
Used space (kbytes) : 3852
Available space (kbytes) : 258268
ID : 744414276
Device/File Name : /u02/ocfs2/ocr/OCRfile_0 <<-- OCR File
Device/File integrity check succeeded

Device/File not configured <-- OCR Mirror does not exist

Cluster registry integrity check succeeded

As You can see, I only have one OCR file but not the second file which is OCR Mirror.
So, I can add second OCR (OCR Mirror) as below command.


ocrconfig -replace ocrmirror

[root@node1-pub ~]# ocrconfig -replace ocrmirror /u02/ocfs2/ocr/OCRfile_1
[root@node1-pub ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 262120
Used space (kbytes) : 3852
Available space (kbytes) : 258268
ID : 744414276
Device/File Name : /u02/ocfs2/ocr/OCRfile_0
Device/File integrity check succeeded
Device/File Name : /u02/ocfs2/ocr/OCRfile_1
Device/File integrity check succeeded

Cluster registry integrity check succeeded

You can have at most 2 OCR devices (OCR itself and its single Mirror) in a cluster. Adding extra Mirror gives you below error message

[root@node1-pub ~]# ocrconfig -replace ocrmirror /u02/ocfs2/ocr/OCRfile_2
PROT-21: Invalid parameter
[root@node1-pub ~]#

How to view Votedisk Information in oracle 11g RAC ?

How to view Votedisk Information in oracle 11g RAC:


The below command is used to view the no. of Votedisks configured in the Cluster.

crsctl query css votedisk

[root@node1-pub ~]# crsctl query css votedisk
0. 0 /u02/ocfs2/vote/VDFile_0
1. 0 /u02/ocfs2/vote/VDFile_1
2. 0 /u02/ocfs2/vote/VDFile_2
Located 3 voting disk(s).
[root@node1-pub ~]#

[root@node1-pub ~]# crsctl check crs
Cluster Synchronization Services appears healthy
Cluster Ready Services appears healthy
Event Manager appears healthy
[root@node1-pub ~]#

How to View No. Of Nodes configured in oracle 11g RAC

How to View No. Of Nodes configured in oracle 11g RAC:


The below command can be used to find out the number of nodes registered into the cluster.
It also displays the node's Public name, Private name and Virtual name along with their numbers.


olsnodes -n -p -i

[root@node1-pub ~]# olsnodes -n -p -i
node1-pub 1 node1-prv node1-vip
node2-pub 2 node2-prv node2-vip

How to View Cluster name in Oracle 11g RAC ?


How to View Cluster version and name in Oracle 11g RAC :
---For Cluster version
--------------------------------------
[root@rac1 /]# cd /u01/app/11.2.0/grid/bin/
[root@rac1 bin]#
[root@rac1 bin]# ./crsctl query crs softwareversion
Oracle Clusterware version on node [rac1] is [11.2.0.1.0]
[root@rac1 bin]#
[root@rac1 bin]#
[root@rac1 bin]# ./crsctl query crs activeversion
Oracle Clusterware active version on the cluster is [11.2.0.1.0]
[root@rac1 bin]#
[root@rac1 bin]# 
For name:-
------------------
[root@rac1 /]# cd /u01/app/11.2.0/grid/bin/
[root@rac1 bin]# ./cemutlo -n
rac-scan
 
or
[root@rac1 bin]#
[root@rac1 bin]# srvctl config scan
SCAN name: rac-scan, Network: 1/10.11.201.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /rac-scan.localdomain/10.11.201.11
[root@rac1 bin]#
 

How to Check CRS Status in oracle RAC 11g

How to Check CRS Status in oracle RAC 11g:


The below two commands are generally used to check the status of CRS. The first command lists the status of CRS
on the local node where as the other command shows the CRS status across all the nodes in Cluster.


crsctl check crs <<-- for the local node
crsctl check cluster <<-- for remote nodes in the cluster

[root@node1-pub ~]# crsctl check crs
Cluster Synchronization Services appears healthy
Cluster Ready Services appears healthy
Event Manager appears healthy
[root@node1-pub ~]#

Checking Viability of CSS across nodes:

crsctl check cluster

For this command to run, CSS needs to be running on the local node. The "ONLINE" status for remote node says that CSS is running on that node.
When CSS is down on the remote node, the status of "OFFLINE" is displayed for that node.


[root@node1-pub ~]# crsctl check cluster
node1-pub ONLINE
node2-pub ONLINE

srvctl commands in oracle rac 11g Database

srvctl commands in oracle rac 11g Database

==============================


SRVCTL commands Chart


Commands Objects Comment

srvctl add
srvctl modify
srvctl remove

instance

database
service
nodeapps

The OCR is modified.

srvctl relocate

service

You can reallocate a service from one named instance to another named instance.

srvctl start
srvctl stop

srvctl status

instance

database
service
asm

nodeapps


srvctl disable
srvctl enable

instance

database
service
asm

enable = when the server restart the resource must be restarted

disable = when the server restart the resource must NOT be restarted

(perhaps we are working for some maintenance tasks)

srvctl config

database
service
asm

nodeapps

Lists configuration information from the OCR (Oracle Cluster Registry).

srvctl getenv
srvctl setenv
srvctl unsetenv

instance

database
service
nodeapps

srvctl getenv = displays the environment variables stored in the OCR for target.

srvctl setenv = allows these variables to be set

srvctl unsetenv = llows these variables to be unset

The most SRVCTL commands are:

=========================

srvctl start database -d DBname
srvctl stop database -d DBname

srvctl start instance -d DBname -i INSTANCEname
srvctl stop instance -d DBname -i INSTANCEname

srvctl start instance -d DBname -i INSTANCEname
srvctl stop instance -d DBname -i INSTANCEname

srvctl status database -d DBname

srvctl status instance -d DBname -i INSTANCEname

srvctl status nodeapps -n NODEname

srvctl enable database -d DBname

srvctl disable database -d DBname

srvctl enable instance -d DBname -i INSTANCEname

srvctl disable instance -d DBname -i INSTANCEname

srvctl config database -d DBname -> to get some information about the database from OCR.

srvctl getenv nodeaps

How To start, stop and manage services in oracle RAC 11g

How To start, stop and manage services in oracle RAC 11g
=========================================================

srvctl status service -d dbname
srvctl config service -d dbname
srvctl start service -d dbname -s servicename
srvctl stop service -d dbname -s servicename

srvctl relocate service -d dbname -s servicename -i instancename -t newinstancename [-f]

How To start and stop RAC instances in oracle 11g

How To start and stop RAC instances in oracle 11g
=====================================================

srvctl start instance -d dbname -i instancename

srvctl stop instance -d dbname -i instancename

How To check status and configurations of Oracle RAC in 11g

How To check status and configurations of Oracle RAC in 11g
===========================================================

Nodeapps:
srvctl status nodeapps -n nodename
srvctl config nodeapps -n nodename

ASM:
srvctl status asm -n nodename
srvctl config asm -n nodename

Database:
srvctl status database -d dbname
srvctl config database -d dbname (shows instances name, node and oracle home)

Instance:
srvctl status instance -d dbname -i instancename

Services:
srvctl status service -d dbname

How to Stop a rac database in oracle 11g released 2

How to Stop a rac database in oracle 11g released 2
==================================================

stopping orders:

database – asm – nodeapps

commands
=========

srvctl stop database -d dbname -o immediate

options are:
srvctl stop database -d dbname -o normal | -o transactional | -o immediate | -o abort

srvctl stop asm -n nodename

options are: srvctl stop asm -n nodename -o immediate

srvctl stop nodeapps -n nodename

How to Start a rac database in oracle 11g released 2

How to Start a rac database in oracle 11g released 2

starting orders:
1. nodeapps
2. asm
3. database

Commands
========

srvctl start nodeapps -n nodename
srvctl start asm -n nodename
srvctl start database -d dbname


options are:

srvctl start database -d dbname -o open | -o mount | -o nomount