INSTANCE_NUMBER - Set Oracle RAC Instance Identity
INSTANCE_NUMBER
Section titled “INSTANCE_NUMBER”Overview
Section titled “Overview”INSTANCE_NUMBER assigns a unique numeric identity to each instance in an Oracle RAC cluster. This number determines which undo tablespace and redo thread an instance uses, influences object allocation for reverse-key indexes and partitions, and serves as the instance’s identifier in cluster-wide operations such as GCS (Global Cache Service) resource mastering, GES (Global Enqueue Service) affinity, and instance recovery. Each instance in a RAC cluster must have a distinct value between 1 and CLUSTER_DATABASE_INSTANCES.
When CLUSTER_DATABASE=FALSE (single instance), INSTANCE_NUMBER defaults to 1 and has no operational significance. In a RAC environment, incorrect or duplicate instance numbers will prevent the cluster from starting properly. Instance numbers also map to default undo tablespace names (typically UNDOTBS1, UNDOTBS2, etc.) and to redo thread numbers, making this parameter a foundational identity setting for every RAC instance.
Parameter Type: Static (requires instance restart to change) Default Value: 1 Valid Range: 1 to value of CLUSTER_DATABASE_INSTANCES (or 1 to 255 maximum) Available Since: Oracle 9i RAC Modifiable: No — SCOPE=SPFILE only; takes effect on next startup PDB Modifiable: No (CDB-level setting)
Configuration
Section titled “Configuration”Viewing Current Value
Section titled “Viewing Current Value”-- Check current INSTANCE_NUMBER settingSELECT name, value, isdefault, ismodified, descriptionFROM v$parameterWHERE name = 'instance_number';
-- Check SPFILE valueSELECT name, value, isspecifiedFROM v$spparameterWHERE name = 'instance_number';
-- View instance identity parameters togetherSELECT name, valueFROM v$parameterWHERE name IN ( 'instance_number', 'instance_name', 'thread', 'undo_tablespace', 'cluster_database', 'cluster_database_instances')ORDER BY name;
-- Confirm instance identity at runtimeSELECT instance_number, instance_name, host_name, thread#, status, database_statusFROM v$instance;
-- View all instances in the clusterSELECT inst_id, instance_number, instance_name, host_name, statusFROM gv$instanceORDER BY inst_id;Setting the Parameter
Section titled “Setting the Parameter”-- Set instance number for RAC instance 1 (in instance-specific SPFILE section)-- Typically done via SRVCTL or in a per-instance pfile/SPFILE
-- Using SRVCTL to set instance-specific parameters (recommended method)-- srvctl modify instance -db mydb -instance mydb1 -stopoption immediate
-- Directly in SPFILE for instance-specific settingALTER SYSTEM SET instance_number = 1 SCOPE=SPFILE SID='mydb1';ALTER SYSTEM SET instance_number = 2 SCOPE=SPFILE SID='mydb2';ALTER SYSTEM SET instance_number = 3 SCOPE=SPFILE SID='mydb3';
-- View instance-specific SPFILE valuesSELECT sid, name, valueFROM v$spparameterWHERE name = 'instance_number'ORDER BY sid;
-- Verify after restartSELECT instance_number, instance_nameFROM v$instance;Tuning Guidance
Section titled “Tuning Guidance”Recommended Values
Section titled “Recommended Values”| Cluster Configuration | Instance Number Assignment |
|---|---|
| 2-node RAC | Instance 1 = 1, Instance 2 = 2 |
| 4-node RAC | Instances numbered 1 through 4 sequentially |
| RAC One Node | Always 1 (single active instance) |
| Extended clusters | Numbers must be unique and contiguous from 1 |
| Policy-managed databases | Oracle assigns numbers automatically via SRVCTL |
Instance numbers should be assigned sequentially starting at 1 and match the corresponding undo tablespace and thread numbers. Gaps in numbering (e.g., 1, 3, 5) are supported but complicate administration and should be avoided.
How to Size
Section titled “How to Size”INSTANCE_NUMBER is an identity parameter, not a performance parameter. Sizing decisions involve CLUSTER_DATABASE_INSTANCES, undo tablespace pre-creation, and redo thread enablement.
-- Verify undo tablespace assignment matches instance numberSELECT i.instance_number, p.value AS undo_tablespaceFROM v$instance i, v$parameter pWHERE p.name = 'undo_tablespace';
-- Check that redo thread is enabled for each instanceSELECT thread#, status, enabled, groups, instanceFROM v$threadORDER BY thread#;
-- Confirm all undo tablespaces exist and are properly sizedSELECT tablespace_name, status, contents, initial_extent, next_extentFROM dba_tablespacesWHERE contents = 'UNDO'ORDER BY tablespace_name;
-- Check object affinity and reverse-key index usage per instanceSELECT inst_id, COUNT(*) AS object_countFROM gv$bhGROUP BY inst_idORDER BY inst_id;Monitoring
Section titled “Monitoring”-- Monitor instance recovery assignments (each instance recovers its own undo)SELECT recovery_status, standby_became_primary_scnFROM v$database;
-- Check which instance is mastering which resources (GCS)SELECT inst_id, gc_cr_block_receive_time, gc_current_block_receive_timeFROM gv$instance_cache_transferORDER BY inst_id;
-- View active session distribution across instancesSELECT inst_id, COUNT(*) AS active_sessionsFROM gv$sessionWHERE status = 'ACTIVE'GROUP BY inst_idORDER BY inst_id;
-- Check instance-specific wait eventsSELECT inst_id, event, total_waits, time_waitedFROM gv$system_eventWHERE event NOT LIKE 'SQL*Net%' AND event NOT IN ('Streams AQ: waiting for messages in the queue', 'wait for unread message on broadcast channel')ORDER BY inst_id, time_waited DESCFETCH FIRST 20 ROWS ONLY;Common Issues
Section titled “Common Issues”Issue 1: Duplicate Instance Numbers Prevent Cluster Startup
Section titled “Issue 1: Duplicate Instance Numbers Prevent Cluster Startup”If two instances have the same INSTANCE_NUMBER, the second instance to start will fail because the cluster registry already has that number registered.
Resolution: Set unique instance numbers in the SPFILE using instance-specific SID qualifiers. Use SRVCTL to manage RAC instance configurations to avoid manual errors.
-- Check for duplicate assignments in SPFILESELECT sid, name, valueFROM v$spparameterWHERE name = 'instance_number'ORDER BY TO_NUMBER(value), sid;
-- Correct a duplicate using SRVCTL (preferred)-- srvctl modify instance -db mydb -instance mydb2 -stopoption immediate-- Then update instance number via SRVCTL parameter managementIssue 2: Instance Number Mismatch with Undo Tablespace
Section titled “Issue 2: Instance Number Mismatch with Undo Tablespace”If INSTANCE_NUMBER=2 but UNDO_TABLESPACE=UNDOTBS1 (which belongs to instance 1), the instance will use the wrong undo tablespace. This causes contention when both instances run simultaneously.
Resolution: Align instance numbers with dedicated undo tablespaces. Each RAC instance should have its own undo tablespace named consistently (e.g., UNDOTBS1 for instance 1, UNDOTBS2 for instance 2).
-- Create a dedicated undo tablespace if missingCREATE UNDO TABLESPACE undotbs2DATAFILE '+DATA' SIZE 2G AUTOEXTEND ON NEXT 500M;
-- Assign the correct undo tablespace for instance 2ALTER SYSTEM SET undo_tablespace = 'UNDOTBS2' SCOPE=SPFILE SID='mydb2';Issue 3: Redo Thread Not Enabled for Instance
Section titled “Issue 3: Redo Thread Not Enabled for Instance”Each RAC instance requires its own redo thread. If the thread corresponding to the instance number is not enabled, the instance cannot start.
Resolution: Enable the required redo thread and add redo log groups for it.
-- Check thread statusSELECT thread#, status, enabled, groupsFROM v$threadORDER BY thread#;
-- Enable a thread (requires exclusive database access)ALTER DATABASE ENABLE PUBLIC THREAD 2;
-- Add redo log groups to the threadALTER DATABASE ADD LOGFILE THREAD 2 GROUP 5 ('+DATA/mydb/redo05.log', '+FRA/mydb/redo05b.log') SIZE 500M;Related Parameters
Section titled “Related Parameters”- CLUSTER_DATABASE — Must be TRUE for INSTANCE_NUMBER to have cluster significance
- CLUSTER_DATABASE_INSTANCES — Defines the expected total instance count; INSTANCE_NUMBER must be within this range
- PARALLEL_MAX_SERVERS — Parallel query resource limit per instance; set consistently across all instances
- UNDO_TABLESPACE — Each RAC instance’s dedicated undo tablespace; must align with INSTANCE_NUMBER
Related Errors
Section titled “Related Errors”- ORA-01034: Oracle Not Available — Startup failures when instance number conflicts or redo thread issues prevent startup
- ORA-01555: Snapshot Too Old — Undo tablespace misassignment causes undo contention and premature undo overwrite
- ORA-00600: Internal Error — Cache Fusion and GCS resource mastering errors can surface as internal errors when instance identity is misconfigured
Version Notes
Section titled “Version Notes”| Version | Notes |
|---|---|
| Oracle 9i | INSTANCE_NUMBER introduced with RAC |
| Oracle 10g | Grid infrastructure improvements made instance number management more automated |
| Oracle 11g R2 | Policy-managed databases introduced; Oracle can assign instance numbers automatically |
| Oracle 12c+ | CDB/PDB architecture; INSTANCE_NUMBER remains a CDB-level identity parameter |
| Oracle 19c+ | No functional changes; SRVCTL remains the recommended tool for managing instance-specific parameters |
| Oracle 21c / 23ai | Behavior unchanged; applies to all RAC configurations including Exadata and Cloud RAC |