Oracle RAC and ASM Interview Questions
Oracle RAC Questions
What is Oracle RAC?
- Oracle RAC (Real Application Clusters) allows multiple instances running on different servers to access the same database. It provides high availability and scalability by distributing the load across multiple nodes.
What are the benefits of using Oracle RAC?
- High availability, scalability, load balancing, failover capabilities, and improved performance through parallel processing.
What components are part of Oracle RAC architecture?
- Oracle RAC architecture includes the following components: Oracle Clusterware, Oracle Automatic Storage Management (ASM), Oracle Database instances, and shared storage.
What is Oracle Clusterware?
- Oracle Clusterware is a cluster management software that enables the servers to operate as a single system, providing the infrastructure necessary to run Oracle RAC.
What is Oracle ASM?
- Oracle ASM (Automatic Storage Management) is a volume manager and a file system for Oracle databases. It simplifies database storage by managing disk groups and providing automatic striping and mirroring.
How does Oracle RAC provide high availability?
- Oracle RAC provides high availability by allowing multiple instances to run on different nodes. If one instance fails, the workload is redistributed to the remaining instances, ensuring continuous availability.
What is Cache Fusion in Oracle RAC?
- Cache Fusion is a mechanism in Oracle RAC that allows the sharing of data between instances by transferring data blocks directly through the interconnect, rather than writing to disk.
Explain the role of the SCAN (Single Client Access Name) in Oracle RAC.
- SCAN is a single name that provides access to Oracle RAC databases. It simplifies the connection string by providing a single point of access, which balances the connections across the cluster.
What is the purpose of the Voting Disk in Oracle RAC?
- The Voting Disk is used by Oracle Clusterware to determine cluster node membership and ensure that there is no split-brain condition. It stores information about node membership.
What is the OCR (Oracle Cluster Registry)?
- OCR is a file that contains the cluster configuration information. It stores details about cluster nodes, databases, and other resources managed by Oracle Clusterware.
What is a split-brain scenario in Oracle RAC, and how is it resolved?
- A split-brain scenario occurs when two or more nodes in a cluster lose communication but continue to function independently. Oracle Clusterware resolves it by determining the majority using the Voting Disk and shutting down the minority nodes.
How does load balancing work in Oracle RAC?
- Load balancing in Oracle RAC distributes the workload across all active instances. It can be achieved using client-side connection load balancing, server-side load balancing, or a combination of both.
What is a node eviction in Oracle RAC?
- Node eviction occurs when Oracle Clusterware forcibly removes a node from the cluster to maintain the integrity of the cluster, usually due to a communication failure or other critical issues.
What is the importance of the interconnect in Oracle RAC?
- The interconnect is the network link between nodes in an Oracle RAC cluster. It is crucial for communication and data block transfers (Cache Fusion) between instances.
What are the types of services that can be managed by Oracle Clusterware?
- Oracle Clusterware can manage various services, including database services, application services, and generic services.
Explain the concept of failover in Oracle RAC.
- Failover in Oracle RAC refers to the automatic transfer of workload from a failed instance to the remaining instances in the cluster, ensuring continuous availability.
What are Oracle RAC One Node and its use cases?
- Oracle RAC One Node is a single-instance Oracle RAC that allows failover to another node in the cluster. It is useful for applications that require high availability but do not need full RAC scalability.
What is a rolling upgrade in Oracle RAC?
- A rolling upgrade allows the database or clusterware software to be upgraded one node at a time without shutting down the entire cluster, thus minimizing downtime.
What are the different types of patches in Oracle RAC?
- The different types of patches include interim patches, bundle patches, Patch Set Updates (PSUs), and Critical Patch Updates (CPUs).
How do you monitor an Oracle RAC environment?
- Oracle RAC can be monitored using tools like Oracle Enterprise Manager (OEM), Cluster Health Monitor (CHM), Automatic Workload Repository (AWR), and various RAC-specific views and scripts.
What is a Virtual IP (VIP) in Oracle RAC?
- A VIP is an IP address that is assigned to a node in the RAC cluster. It allows client connections to failover to another node if the current node becomes unavailable.
What is the difference between active-passive and active-active configurations in Oracle RAC?
- In an active-passive configuration, only one instance is actively serving requests, while the other instances are on standby. In an active-active configuration, all instances are actively serving requests simultaneously.
What are the different network interfaces used in Oracle RAC?
- Oracle RAC uses public network interfaces, private interconnects, and VIPs. Public interfaces are used for client connections, private interconnects for communication between instances, and VIPs for failover.
What is the GES (Global Enqueue Service) in Oracle RAC?
- GES is responsible for managing non-blocking requests for resources across the cluster, ensuring data consistency and integrity.
What is the GCS (Global Cache Service) in Oracle RAC?
- GCS is responsible for managing the cache coherency of data blocks across all instances in the cluster.
How do you add a new node to an existing Oracle RAC cluster?
- To add a new node, you need to install the Grid Infrastructure software on the new node, configure the network interfaces, and use the
addNode.sh
script to add the node to the cluster.
- To add a new node, you need to install the Grid Infrastructure software on the new node, configure the network interfaces, and use the
What is the purpose of the Oracle Clusterware resource model?
- The resource model defines and manages various cluster resources, such as databases, listeners, and applications, ensuring their availability and failover capabilities.
How do you remove a node from an Oracle RAC cluster?
- To remove a node, you use the
rootcrs.sh -deconfig
script on the node to be removed and then update the cluster configuration usingsrvctl
andcrsctl
commands.
- To remove a node, you use the
What are some common issues faced in Oracle RAC environments?
- Common issues include node evictions, interconnect problems, split-brain scenarios, storage configuration issues, and performance bottlenecks.
How do you perform a backup in an Oracle RAC environment?
- Backups in Oracle RAC can be performed using RMAN (Recovery Manager), which supports coordinated backups across all instances. You can also use Oracle Secure Backup (OSB) for tape backups.
Oracle ASM Questions
What is Oracle ASM and why is it used?
- Oracle ASM (Automatic Storage Management) is a storage management solution that provides a simplified and high-performance storage environment. It eliminates the need for traditional file systems and volume managers.
What are ASM disk groups?
- ASM disk groups are a collection of disks that ASM manages as a single unit. Disks in a disk group are used to store the database files, and ASM automatically manages the striping and mirroring.
What are ASM instances and how do they differ from database instances?
- ASM instances are special Oracle instances that manage ASM disk groups and perform storage management tasks. They do not contain user data or use SQL for database operations like database instances.
What is ASM metadata?
- ASM metadata contains information about the ASM disk groups, disks, files, templates, and other ASM-related objects. It is stored within the ASM disk groups.
How does ASM handle disk failures?
- ASM provides redundancy through mirroring. If a disk fails, ASM automatically rebuilds the lost data on the remaining disks in the disk group, ensuring data availability.
What is ASM striping and how does it benefit performance?
- ASM striping is the process of spreading data across multiple disks in a disk group. It improves performance by balancing the I/O load and maximizing the use of available disks.
What are ASM templates?
- ASM templates define the attributes for files created in ASM, such as redundancy level, striping type, and allocation unit size. They ensure consistent file creation settings.
What are ASM allocation units?
- ASM allocation units are the fundamental units of storage in ASM disk groups. Each allocation unit is a fixed-size chunk of disk space, typically 1 MB in size.
How do you create an ASM disk group?
- You create an ASM disk group using the
CREATE DISKGROUP
SQL statement, specifying the disks to be included and the redundancy level (e.g., NORMAL, HIGH).
- You create an ASM disk group using the
What is ASM rebalance and when does it occur?
- ASM rebalance is the process of redistributing data across the disks in a disk group to maintain an even load. It occurs when disks are added, dropped, or when there is a disk failure.
What are the different types of redundancy levels in ASM?
- ASM supports three redundancy levels: EXTERNAL (no mirroring), NORMAL (two-way mirroring), and HIGH (three-way mirroring).
How do you monitor ASM performance?
- ASM performance can be monitored using tools like Oracle Enterprise Manager (OEM), ASMCMD commands, and various dynamic performance views (V$ASM_* views).
What is the role of the ASM instance parameter file (SPFILE)?
- The SPFILE for an ASM instance contains initialization parameters that control the behavior of the ASM instance. It is used to manage ASM instance configuration settings.
How do you migrate data from a non-ASM to an ASM environment?
- Data migration to ASM can be performed using tools like RMAN, Data Pump, or Oracle ASM Migration Assistant. You can also use the
ALTER DATABASE
command to move data files to ASM.
- Data migration to ASM can be performed using tools like RMAN, Data Pump, or Oracle ASM Migration Assistant. You can also use the
What is ASM Fast Mirror Resync?
- ASM Fast Mirror Resync is a feature that quickly resynchronizes ASM disks that were temporarily offline, without requiring a full rebalance operation.
What are ASM preferred read failure groups?
- Preferred read failure groups are a set of disks that ASM prioritizes for read operations. This feature is useful in extended clusters where disks are located in different sites.
How do you add or drop disks in an ASM disk group?
- You add or drop disks in an ASM disk group using the
ALTER DISKGROUP
command. ASM automatically initiates a rebalance operation to redistribute the data.
- You add or drop disks in an ASM disk group using the
What is ASM Flex Disk Group?
- ASM Flex Disk Group is an advanced ASM feature that allows the creation of disk groups with variable redundancy levels for different files within the same disk group.
How does ASM handle hot backups?
- ASM supports hot backups by allowing RMAN to back up database files while they are open and in use. ASM ensures data consistency during the backup process.
What are the advantages of using ASM over traditional file systems?
- ASM simplifies storage management, provides high performance, supports dynamic storage allocation, offers redundancy and striping, and integrates seamlessly with Oracle databases.
What is ASMLib and how is it used?
- ASMLib is a set of Oracle utilities that simplify the management of ASM disks by providing an alternative interface for identifying and accessing storage devices.
What are ASM Power Limit and Rebalance Power?
- ASM Power Limit controls the speed of the rebalance operation. Rebalance Power determines the amount of resources allocated for the rebalance process. Higher values result in faster rebalancing but may impact performance.
What is the difference between ASM and traditional LVM (Logical Volume Manager)?
- ASM is specifically designed for Oracle databases, offering integrated volume management and file system capabilities. Traditional LVMs provide generic volume management and require additional file systems for database storage.
How does ASM manage file creation and deletion?
- ASM automatically manages file creation and deletion based on the templates and disk group policies. It dynamically allocates and deallocates space as needed.
What is ASM Cluster File System (ACFS)?
- ACFS is a general-purpose file system that extends ASM capabilities to support non-database files. It provides advanced features like snapshots, replication, and tagging.
What are ASM disk failure groups?
- ASM disk failure groups are a set of disks that share a common failure characteristic. ASM uses failure groups to ensure data redundancy and availability.
How do you check the status of ASM disk groups?
- The status of ASM disk groups can be checked using the
V$ASM_DISKGROUP
view, ASMCMD commands, or Oracle Enterprise Manager (OEM).
- The status of ASM disk groups can be checked using the
What is ASM Automatic Storage Management (ASM) Dynamic Volume Manager (ADVM)?
- ADVM is a component of ASM that provides dynamic volume management for ACFS, allowing the creation of volumes that can be used by ACFS file systems.
How does ASM handle disk space reclamation?
- ASM automatically reclaims unused space when data files are deleted or shrunk. It updates the metadata and redistributes the free space across the disk group.
What is ASM Fast Disk Resync?
- ASM Fast Disk Resync quickly resynchronizes disks that were temporarily offline, without requiring a full rebalance operation, thus minimizing downtime and improving recovery times.
How do you configure ASM disk discovery paths?
- ASM disk discovery paths are configured using the
ASM_DISKSTRING
initialization parameter, which specifies the locations where ASM should search for disks.
- ASM disk discovery paths are configured using the
What is the role of the
asmcmd
utility?- The
asmcmd
utility is a command-line tool for managing ASM instances and disk groups. It allows administrators to perform tasks such as listing disks, creating disk groups, and checking disk status.
- The
How do you configure ASM disk group redundancy?
- ASM disk group redundancy is configured during the creation of the disk group using the
CREATE DISKGROUP
statement. You can specify redundancy levels such as EXTERNAL, NORMAL, or HIGH.
- ASM disk group redundancy is configured during the creation of the disk group using the
What is the
DB_CREATE_FILE_DEST
parameter in ASM?- The
DB_CREATE_FILE_DEST
parameter specifies the default location for Oracle-managed data files. When using ASM, it is set to the ASM disk group where new data files should be created.
- The
How do you manage ASM disk group attributes?
- ASM disk group attributes are managed using the
ALTER DISKGROUP
statement. Attributes such as compatibility, allocation unit size, and rebalance power can be modified.
- ASM disk group attributes are managed using the
What is the
ASM_PREFERRED_READ_FAILURE_GROUPS
parameter?- The
ASM_PREFERRED_READ_FAILURE_GROUPS
parameter specifies the failure groups that ASM should prioritize for read operations. It is used to optimize read performance in extended clusters.
- The
How does ASM handle storage capacity planning?
- ASM handles storage capacity planning by dynamically allocating space from disk groups as needed. Administrators can monitor disk group usage and add disks to increase capacity.
What is the
ASM_POWER_LIMIT
parameter?- The
ASM_POWER_LIMIT
parameter controls the speed of ASM rebalance operations. It specifies the maximum power for the rebalance operation, with higher values resulting in faster rebalancing.
- The
What is ASM Dynamic Volume Manager (ADVM)?
- ADVM is a component of ASM that provides dynamic volume management for Oracle ACFS. It allows the creation and management of volumes used by ACFS file systems.
What is the
ASM_DISKGROUPS
parameter?- The
ASM_DISKGROUPS
parameter specifies the list of ASM disk groups that the ASM instance should mount at startup. It can be set toALL
to mount all available disk groups.
- The
How do you perform ASM disk group checks?
- ASM disk group checks can be performed using the
ALTER DISKGROUP ... CHECK
command, which verifies the consistency and integrity of the disk group metadata and data.
- ASM disk group checks can be performed using the
What is the
V$ASM_DISK
view?- The
V$ASM_DISK
view provides information about the disks in ASM disk groups, including status, name, size, and failure group. It is useful for monitoring and managing ASM disks.
- The
How do you handle ASM disk group errors?
- ASM disk group errors can be diagnosed using the ASM alert log, trace files, and dynamic performance views (
V$ASM_*
). Administrators can take corrective actions such as adding or dropping disks.
- ASM disk group errors can be diagnosed using the ASM alert log, trace files, and dynamic performance views (
What is ASM rolling migration?
- ASM rolling migration allows the upgrade of ASM instances without downtime. It involves upgrading one ASM instance at a time while keeping the database and other instances operational.
What is ASM Preferred Read?
- ASM Preferred Read is a feature that allows specifying a preferred read disk for a mirrored copy of an extent. It is useful in extended clusters to optimize read performance by selecting the nearest copy.
RAC and ASM Combined Questions
What is the role of ASM in an Oracle RAC environment?
- ASM provides the shared storage management for Oracle RAC, simplifying storage allocation, striping, and mirroring across the RAC nodes.
How do you configure ASM for Oracle RAC?
- ASM for Oracle RAC is configured by creating ASM instances on each RAC node and setting up shared disk groups accessible by all nodes. Configuration files and parameters are synchronized across the nodes.
What are the steps to add a new disk to an ASM disk group in a RAC environment?
- To add a new disk, use the
ALTER DISKGROUP
statement to include the new disk, and ASM will initiate a rebalance operation to integrate the new disk into the disk group.
- To add a new disk, use the
How do you monitor ASM disk groups in an Oracle RAC environment?
- ASM disk groups can be monitored using tools like Oracle Enterprise Manager (OEM), ASMCMD commands, and dynamic performance views (
V$ASM_*
views).
- ASM disk groups can be monitored using tools like Oracle Enterprise Manager (OEM), ASMCMD commands, and dynamic performance views (
What is the impact of ASM rebalance operations on Oracle RAC performance?
- ASM rebalance operations can impact Oracle RAC performance by consuming CPU and I/O resources. The impact can be controlled using the
ASM_POWER_LIMIT
parameter to balance speed and resource usage.
- ASM rebalance operations can impact Oracle RAC performance by consuming CPU and I/O resources. The impact can be controlled using the
How do you manage ASM disk groups during a rolling upgrade of Oracle RAC?
- During a rolling upgrade, ASM disk groups continue to function, and data remains accessible. Upgrading one ASM instance at a time minimizes disruption and ensures continuous availability.
What are the benefits of using ASM Flex Disk Groups in Oracle RAC?
- ASM Flex Disk Groups allow flexible redundancy settings and scalable storage options within the same disk group, optimizing storage usage and performance in Oracle RAC environments.
How does ASM handle storage allocation for Oracle RAC databases?
- ASM dynamically allocates and manages storage for Oracle RAC databases, ensuring optimal performance and availability. It automatically distributes data across available disks and handles redundancy.
What are the best practices for ASM and Oracle RAC integration?
- Best practices include proper disk group configuration, regular monitoring, ensuring network and storage redundancy, using appropriate ASM templates, and setting optimal ASM and RAC parameters.
How do you troubleshoot ASM-related issues in an Oracle RAC environment?
- Troubleshoot ASM-related issues using logs, trace files, dynamic performance views, ASMCMD commands, and Oracle support tools like
adrci
andorclsh
.
- Troubleshoot ASM-related issues using logs, trace files, dynamic performance views, ASMCMD commands, and Oracle support tools like
How do you handle ASM disk group corruption in Oracle RAC?
- Handle ASM disk group corruption by identifying and isolating the corrupted disks, performing checks using the
ALTER DISKGROUP ... CHECK
command, and restoring data from backups if necessary.
- Handle ASM disk group corruption by identifying and isolating the corrupted disks, performing checks using the
What are the key considerations for ASM backup and recovery in Oracle RAC?
- Key considerations include using RMAN for coordinated backups, ensuring redundancy and consistency, regularly testing backup and recovery procedures, and monitoring ASM disk group health.
How does ASM ensure data consistency across Oracle RAC nodes?
- ASM ensures data consistency through its metadata management and redundancy features. It synchronizes changes across all RAC nodes and performs automatic recovery in case of disk failures.
What is the role of ASM templates in an Oracle RAC environment?
- ASM templates define the attributes for files created in ASM disk groups, ensuring consistent settings for redundancy, striping, and allocation units, which optimize performance and manageability.
How do you configure ASM disk discovery in an Oracle RAC environment?
- Configure ASM disk discovery using the
ASM_DISKSTRING
parameter to specify the search paths for ASM disks, ensuring all RAC nodes can access the shared storage.
- Configure ASM disk discovery using the
What is the significance of the ASM Cluster File System (ACFS) in Oracle RAC?
- ACFS extends ASM capabilities to support non-database files, providing advanced features like snapshots, replication, and tagging, which enhance Oracle RAC storage management.
How do you optimize ASM performance in an Oracle RAC environment?
- Optimize ASM performance by configuring appropriate striping and mirroring, balancing disk I/O, using preferred read settings, and tuning ASM and RAC parameters.
How does ASM handle dynamic storage management in Oracle RAC?
- ASM handles dynamic storage management by automatically allocating, rebalancing, and reclaiming disk space based on database needs, ensuring optimal storage utilization and performance.
What are the key differences between traditional storage management and ASM in Oracle RAC?
- ASM simplifies storage management with automatic striping, mirroring, and dynamic allocation, whereas traditional storage management requires manual configuration and management of file systems and volume managers.
How do you perform an ASM disk group migration in an Oracle RAC environment?
- Perform ASM disk group migration using RMAN, Data Pump, or ASM Migration Assistant, ensuring minimal downtime and consistent data transfer between disk groups.
What are the benefits of using ASM over traditional file systems in Oracle RAC?
- Benefits include simplified storage management, improved performance, automatic striping and mirroring, dynamic allocation, and seamless integration with Oracle databases.
How do you configure ASM and Oracle RAC for high availability?
- Configure ASM and Oracle RAC for high availability by setting up redundant network and storage paths, using appropriate redundancy levels, and implementing robust backup and recovery procedures.
What are the challenges of managing ASM in a large Oracle RAC environment?
- Challenges include handling disk group scalability, ensuring consistent performance, managing complex configurations, troubleshooting issues, and maintaining high availability and data integrity.
How do you ensure data security in an ASM-managed Oracle RAC environment?
- Ensure data security by implementing encryption, using secure ASM disk groups, configuring access controls, monitoring activity, and regularly auditing the environment.
What are the future trends and advancements in ASM and Oracle RAC? - Future trends include increased automation and integration with cloud services, enhanced performance and scalability features, improved management tools, and advancements in data security and availability.
RAC and ASM Technical Questions with Scripts and Scenarios
How do you configure a new ASM disk group? Provide a script. - To configure a new ASM disk group, you can use the following script: CREATE DISKGROUP data01 NORMAL REDUNDANCY DISK 'ORCL:DISK1', 'ORCL:DISK2', 'ORCL:DISK3' ATTRIBUTE 'au_size' = '4M', 'compatible.asm' = '12.1', 'compatible.rdbms' = '12.1';
Scenario: Adding a new node to an existing RAC cluster. What are the steps? - Steps to add a new node:
- Install the Oracle Grid Infrastructure software on the new node.
- Add the new node to the cluster using
addnode.sh
. - Extend the Oracle RAC database to the new node. ```bash # Add the node to the cluster $GRID_HOME/addnode.sh -silent -addnode -nodeName newnode1
crsctl status nodeapps
103. How do you check the status of an ASM instance? Provide a query.
sql SELECT INSTANCE_NAME, STATUS, SOFTWARE_VERSION, STARTUP_TIME FROM V$ASM_INSTANCE;
Scenario: Disk failure in ASM. How do you drop a disk from a disk group? Provide a script.
ALTER DISKGROUP data01 DROP DISK 'DISK1';
How do you add a new disk to an existing ASM disk group? Provide a script.
sql ALTER DISKGROUP data01 ADD DISK 'ORCL:DISK4' NAME data01_004;
Scenario: Migrating a database from non-ASM to ASM. What are the steps? - Steps to migrate:
- Backup the database using RMAN.
- Restore the database to ASM.
bash rman target / RMAN> BACKUP DATABASE PLUS ARCHIVELOG; RMAN> RUN { SET NEWNAME FOR DATAFILE 1 TO '+DATA'; RESTORE DATABASE; SWITCH DATAFILE ALL; RECOVER DATABASE; } RMAN> ALTER DATABASE OPEN;
How do you check the free space in an ASM disk group? Provide a query.
sql SELECT name, total_mb, free_mb, usable_file_mb, state FROM V$ASM_DISKGROUP;
Scenario: Resync a failed disk in ASM. What are the steps? - Steps to resync:
- Identify the failed disk.
- Bring the disk online.
sql ALTER DISKGROUP data01 ONLINE DISK data01_001;
How do you monitor ASM rebalance operations? Provide a query.
SELECT group_number, operation, state, power, est_minutes, sofar, est_work FROM V$ASM_OPERATION;
Scenario: Adding a new RAC database instance. What are the steps? - Steps to add a new instance:
- Create an Oracle Home on the new node.
- Add the new instance to the RAC database.
sql srvctl add instance -d mydb -i mydb3 -n newnode1
How do you check the status of Oracle RAC services? Provide a command.
bash srvctl status service -d mydb
Scenario: Configuring ASM disk group compatibility. What command would you use?
ALTER DISKGROUP data01 SET ATTRIBUTE 'compatible.asm' = '12.1';
How do you check the current rebalance power limit? Provide a query.
SELECT group_number, power FROM V$ASM_OPERATION;
Scenario: Recovering an ASM disk group. What steps would you take? - Steps to recover:
- Identify the corrupted disks.
- Use the
ALTER DISKGROUP
command to check and repair.sql ALTER DISKGROUP data01 CHECK ALL REPAIR;
How do you resize an ASM disk? Provide a script.
ALTER DISKGROUP data01 RESIZE DISK data01_001 SIZE 100G;
Scenario: Upgrading ASM instance version. What are the steps? - Steps to upgrade:
- Install the new version of ASM.
- Upgrade the ASM instance.
bash dbua -silent -upgradeASM
How do you enable autoextend for a tablespace in ASM? Provide a script.
ALTER TABLESPACE users AUTOEXTEND ON NEXT 10M MAXSIZE UNLIMITED;
Scenario: Managing ACFS snapshots. How do you create a snapshot?
bash acfsutil snap create my_snapshot /acfsmount/acfsvol
How do you verify the ASM instance alert log for errors?
bash tail -f $ORACLE_BASE/diag/asm/+asm/alert_+ASM.log
Scenario: Configuring ASM preferred read failure groups. Provide the steps.
ALTER SYSTEM SET ASM_PREFERRED_READ_FAILURE_GROUPS = 'data01.datafg1', 'data01.datafg2';
How do you list all the ASM templates? Provide a query.
SELECT group_number, name, redundancy, stripe, template_id FROM V$ASM_TEMPLATE;
Scenario: Performing an ASM rolling upgrade. What are the steps? - Steps for rolling upgrade:
- Upgrade the Grid Infrastructure on one node.
- Repeat for each node.
bash gridSetup.sh -upgrade
How do you check the ASM instance startup parameters? Provide a query.
SELECT name, value FROM V$ASM_PARAMETER;
Scenario: Adding a new disk to a Flex Disk Group. Provide the steps.
ALTER DISKGROUP flex_data ADD DISK 'ORCL:DISK5';
How do you change the allocation unit size of an ASM disk group? - Note: This requires recreating the disk group.
CREATE DISKGROUP data01 EXTERNAL REDUNDANCY DISK 'ORCL:DISK1' ATTRIBUTE 'au_size' = '16M';
Scenario: Migrating a database from ASM to non-ASM storage. What are the steps? - Steps to migrate:
- Backup the database using RMAN.
- Restore the database to the file system.
bash rman target / RMAN> BACKUP DATABASE PLUS ARCHIVELOG; RMAN> RUN { SET NEWNAME FOR DATAFILE 1 TO '/u01/app/oracle/oradata/mydb/system01.dbf'; RESTORE DATABASE; SWITCH DATAFILE ALL; RECOVER DATABASE; } RMAN> ALTER DATABASE OPEN;
How do you list the ASM spfile location? Provide a query.
SELECT name, value FROM V$PARAMETER WHERE name = 'spfile';
Scenario: Removing a RAC instance. What are the steps? - Steps to remove an instance:
- Use the
srvctl
command to remove the instance. - Update the database configuration.
bash srvctl remove instance -d mydb -i mydb3
- Use the
How do you find the ASM disk group usage history? Provide a query.
SELECT create_date, group_number, free_mb, usable_file_mb FROM V$ASM_DISKGROUP_STAT;
Scenario: Renaming an ASM disk. Provide the steps.
ALTER DISKGROUP data01 RENAME DISK data01_001 TO data01_renamed;
How do you change the ASM compatibility attributes? Provide a script.
ALTER DISKGROUP data01 SET ATTRIBUTE 'compatible.asm' = '12.1.0.0.0'; ALTER DISKGROUP data01 SET ATTRIBUTE 'compatible.rdbms' = '12.1.0.0.0';
Scenario: Creating a mirrored ASM disk group. What are the steps? - Steps to create a mirrored disk group:
sql CREATE DISKGROUP mirrored_data HIGH REDUNDANCY DISK 'ORCL:DISK1', 'ORCL:DISK2', 'ORCL:DISK3';
How do you convert a single-instance database to RAC? Provide the steps. - Steps to convert:
- Prepare the database for RAC.
- Use the
rconfig
tool or manually convert using RMAN.bash rconfig -convert
Scenario: Implementing ASM disk group rebalancing. What are the steps?
ALTER DISKGROUP data01 REBALANCE POWER 4;
How do you list the ASM cluster configuration? Provide a query.
SELECT cluster_name, cluster_interconnects FROM V$ASM_CLUSTER;
Scenario: Configuring ASM Fast Mirror Resync. What are the steps?
ALTER DISKGROUP data01 SET ATTRIBUTE 'disk_repair_time' = '3h';
How do you check the ASM disk header information? Provide a command.
bash kfed read /dev/oracleasm/disks/DISK1
Scenario: Creating a new RAC service. Provide the steps.
bash srvctl add service -d mydb -s myservice -r mydb1,mydb2
How do you list the ASM clients connected to an ASM instance? Provide a query.
SELECT instance_name, db_name, status, software_version FROM V$ASM_CLIENT;
Scenario: Changing the default template for an ASM disk group. What are the steps?
ALTER DISKGROUP data01 MODIFY TEMPLATE datafile ATTRIBUTES (redundancy HIGH, striping FINE);
How do you create an ASM volume for ACFS? Provide a script.
ALTER DISKGROUP data01 ADD VOLUME 'vol1' SIZE 10G;
Scenario: Configuring RAC listener on a new node. What are the steps?
bash srvctl add listener -l LISTENER -n newnode1 -o $ORACLE_HOME
How do you rename an ASM disk group? Provide a script. - Note: ASM disk groups cannot be renamed directly. You need to create a new disk group and move the data.
sql CREATE DISKGROUP new_data EXTERNAL REDUNDANCY DISK 'ORCL:DISK4', 'ORCL:DISK5';
Scenario: Changing the redundancy level of an ASM disk group. What are the steps? - Note: You must create a new disk group with the desired redundancy and migrate the data.
CREATE DISKGROUP new_data HIGH REDUNDANCY DISK 'ORCL:DISK4', 'ORCL:DISK5', 'ORCL:DISK6';
How do you configure ASM disk scrub operation? Provide a script.
ALTER DISKGROUP data01 SCRUB POWER LOW;
Scenario: Implementing ASM Disk Group Quotas. What are the steps?
ALTER DISKGROUP data01 SET ATTRIBUTE 'quota' = 'true'; ALTER DISKGROUP data01 SET QUOTA ON user1 LIMIT 100G;
How do you move a datafile to a different ASM disk group? Provide a script.
ALTER DATABASE MOVE DATAFILE '+DATA/datafile1.dbf' TO '+NEW_DATA';
Scenario: Decommissioning a RAC node. What are the steps? - Steps to decommission:
- Remove the node from the cluster.
- Update the database configuration.
bash srvctl remove nodeapps -n oldnode1
How do you enable disk group compatibility checks? Provide a script.
sql ALTER SYSTEM SET "_diskgroup_compat_check" = TRUE;
OLR (Oracle Local Repository)
What is OLR in Oracle RAC?
- Answer: The Oracle Local Repository (OLR) is a local registry that stores cluster node-specific information. It resides on each node in a cluster and is used by Oracle Clusterware to manage local node-specific resources.
Where is the OLR file located, and what is its typical name?
- Answer: The OLR file is typically located in the
$GRID_HOME/cdata/<hostname>
directory and is namedolr.loc
.
- Answer: The OLR file is typically located in the
How do you check the status of the OLR?
- Answer: You can check the status of the OLR using the following command:
$GRID_HOME/bin/ocrcheck -local
- Answer: You can check the status of the OLR using the following command:
How do you back up the OLR?
- Answer: You can back up the OLR using the following command:
$GRID_HOME/bin/ocrconfig -local -manualbackup
- Answer: You can back up the OLR using the following command:
How do you restore the OLR from a backup?
- Answer: To restore the OLR from a backup, use the following command:
$GRID_HOME/bin/ocrconfig -local -restore <backup_file>
- Answer: To restore the OLR from a backup, use the following command:
What command can you use to list OLR configuration details?
- Answer: Use the following command to list OLR configuration details:
$GRID_HOME/bin/ocrdump -local -stdout
- Answer: Use the following command to list OLR configuration details:
How do you change the location of the OLR file?
- Answer: To change the location of the OLR file, you need to update the
olr.loc
file with the new path and then restart the clusterware.
- Answer: To change the location of the OLR file, you need to update the
OCR (Oracle Cluster Registry)
What is the Oracle Cluster Registry (OCR)?
- Answer: The Oracle Cluster Registry (OCR) is a critical component in an Oracle RAC environment. It stores cluster configuration information, including information about cluster resources, such as databases, services, and nodes.
Where is the OCR stored, and what are its typical locations?
- Answer: The OCR is typically stored on shared storage, such as ASM (Automatic Storage Management) disk groups or shared file systems. The location is specified during the installation of Oracle Grid Infrastructure.
How do you check the status and health of the OCR?
- Answer: Use the following command to check the status and health of the OCR:
$GRID_HOME/bin/ocrcheck
- Answer: Use the following command to check the status and health of the OCR:
How do you list the OCR backup locations?
- Answer: Use the following command to list OCR backup locations:
$GRID_HOME/bin/ocrconfig -showbackup
- Answer: Use the following command to list OCR backup locations:
How do you manually back up the OCR?
- Answer: You can manually back up the OCR using the following command:
$GRID_HOME/bin/ocrconfig -manualbackup
- Answer: You can manually back up the OCR using the following command:
How do you restore the OCR from a backup?
- Answer: To restore the OCR from a backup, use the following command:
$GRID_HOME/bin/ocrconfig -restore <backup_file>
- Answer: To restore the OCR from a backup, use the following command:
How can you display the contents of the OCR?
- Answer: Use the following command to dump the contents of the OCR:
$GRID_HOME/bin/ocrdump -stdout
- Answer: Use the following command to dump the contents of the OCR:
What command is used to add a new OCR location?
- Answer: Use the following command to add a new OCR location:
$GRID_HOME/bin/ocrconfig -add +DGNAME
- Answer: Use the following command to add a new OCR location:
How do you remove an OCR location?
- Answer: Use the following command to remove an OCR location:
$GRID_HOME/bin/ocrconfig -delete +DGNAME
- Answer: Use the following command to remove an OCR location:
Cluster Registry Management
What are the primary functions of the Oracle Clusterware?
- Answer: Oracle Clusterware manages cluster resources, monitors the health of the cluster, starts and stops the Oracle Clusterware stack, and provides high availability and failover capabilities.
How do you start and stop Oracle Clusterware on a single node?
- Answer: Use the following commands to start and stop Oracle Clusterware on a single node:
# To stop $GRID_HOME/bin/crsctl stop crs # To start $GRID_HOME/bin/crsctl start crs
- Answer: Use the following commands to start and stop Oracle Clusterware on a single node:
How do you start and stop Oracle Clusterware across all nodes in a cluster?
- Answer: Use the following commands to start and stop Oracle Clusterware across all nodes:
# To stop $GRID_HOME/bin/crsctl stop cluster -all # To start $GRID_HOME/bin/crsctl start cluster -all
- Answer: Use the following commands to start and stop Oracle Clusterware across all nodes:
How do you check the status of cluster resources?
- Answer: Use the following command to check the status of cluster resources:
$GRID_HOME/bin/crsctl status resource -t
- Answer: Use the following command to check the status of cluster resources:
How do you relocate a resource in Oracle Clusterware?
- Answer: Use the following command to relocate a resource:
$GRID_HOME/bin/crsctl relocate resource <resource_name> -n <target_node>
- Answer: Use the following command to relocate a resource:
How do you add a new node to an existing Oracle RAC cluster?
- Answer: The process involves the following steps:
- Prepare the new node (networking, software installation).
- Add the node to the cluster using
addnode.sh
. - Extend the Oracle RAC database to the new node.
$GRID_HOME/addnode.sh -silent -addnode -nodeList newnode1
- Answer: The process involves the following steps:
How do you remove a node from an Oracle RAC cluster?
- Answer: Use the following commands:
$GRID_HOME/deinstall/deinstall -local $GRID_HOME/root.sh -deconfig -force
- Answer: Use the following commands:
What command is used to check the status of the Cluster Synchronization Services (CSS)?
- Answer: Use the following command:
$GRID_HOME/bin/crsctl check css
- Answer: Use the following command:
How do you check the status of the High Availability Service (HAS)?
- Answer: Use the following command:
$GRID_HOME/bin/crsctl check has
- Answer: Use the following command:
How do you change the redundancy level of the OCR?
- Answer: Changing the redundancy level involves adding or removing OCR locations, which indirectly affects redundancy.
$GRID_HOME/bin/ocrconfig -add +DGNAME $GRID_HOME/bin/ocrconfig -delete +DGNAME
- Answer: Changing the redundancy level involves adding or removing OCR locations, which indirectly affects redundancy.
How do you move OCR from a file system to ASM?
- Answer: Use the following command to add the new OCR location in ASM and then remove the old location from the file system:
$GRID_HOME/bin/ocrconfig -add +DGNAME $GRID_HOME/bin/ocrconfig -delete /u01/app/oracle/ocrfile
- Answer: Use the following command to add the new OCR location in ASM and then remove the old location from the file system:
How do you verify the integrity of the OCR?
- Answer: Use the following command:
$GRID_HOME/bin/ocrcheck
- Answer: Use the following command:
How do you check which node currently has the OCR master role?
- Answer: Use the following command:
$GRID_HOME/bin/ocrcheck -master
- Answer: Use the following command:
What is the purpose of the
ocrcheck
command?- Answer: The
ocrcheck
command verifies the integrity of the OCR, checks the accessibility of the OCR, and provides information on the OCR backups.
- Answer: The
Example Scenario-Based Questions
Scenario: You need to perform maintenance on the storage that houses the OCR. How do you ensure high availability during this maintenance?
- Answer: Add a new OCR location on a different storage before the maintenance and then remove the old location after the maintenance.
$GRID_HOME/bin/ocrconfig -add +NEW_DG
- Answer: Add a new OCR location on a different storage before the maintenance and then remove the old location after the maintenance.
Scenario: The OLR on one node is corrupted. How do you recover it?
- Answer: Restore the OLR from a backup using the
ocrconfig
command:$GRID_HOME/bin/ocrconfig -local -restore /path/to/backup
- Answer: Restore the OLR from a backup using the
Scenario: A node in the cluster fails, and the OCR needs to be restored. What steps do you take?
- Answer: Restore the OCR from a backup:
$GRID_HOME/bin/ocrconfig -restore /path/to/backup
- Answer: Restore the OCR from a backup:
Scenario: You need to move the OCR to a new ASM disk group. What are the steps?
- Answer:
- Add the new OCR location.
- Remove the old OCR location.
$GRID_HOME/bin/ocrconfig -add +NEW_DG $GRID_HOME/bin/ocrconfig -delete +OLD_DG
- Answer:
Scenario: The OLR is missing. What impact does this have on the RAC cluster, and how do you resolve it?
- Answer: The OLR is crucial for starting the local clusterware stack. To resolve this, restore the OLR from a backup or recreate it using the configuration stored in the OCR.
SCAN (Single Client Access Name)
What is SCAN in Oracle RAC?
- Answer: SCAN (Single Client Access Name) is a feature in Oracle RAC that provides a single hostname for clients to connect to the database. SCAN simplifies client configuration and enhances load balancing and failover capabilities.
How many SCAN IPs are recommended in Oracle RAC, and why?
- Answer: Oracle recommends three SCAN IPs for a RAC environment. This ensures high availability and load balancing, as SCAN listeners distribute connections across all available instances.
Where are the SCAN VIPs configured?
- Answer: SCAN VIPs are configured in the DNS (Domain Name System) or Grid Naming Service (GNS) and must resolve to the IP addresses allocated for SCAN.
How do you check the status of SCAN listeners?
- Answer: Use the following command to check the status of SCAN listeners:
srvctl status scan_listener
- Answer: Use the following command to check the status of SCAN listeners:
What command is used to start SCAN listeners?
- Answer: Use the following command to start SCAN listeners:
srvctl start scan_listener
- Answer: Use the following command to start SCAN listeners:
How do you stop SCAN listeners?
- Answer: Use the following command to stop SCAN listeners:
srvctl stop scan_listener
- Answer: Use the following command to stop SCAN listeners:
Can SCAN be used with dynamic IP addresses?
- Answer: No, SCAN requires static IP addresses to function correctly.
How do you change the SCAN name in a RAC environment?
- Answer: Use the following command to change the SCAN name:
srvctl modify scan -n newscanname
- Answer: Use the following command to change the SCAN name:
How do you add a new SCAN VIP?
- Answer: Use the following command to add a new SCAN VIP:
srvctl add scan -n newscan -i 1 -u
- Answer: Use the following command to add a new SCAN VIP:
What is the role of SCAN listeners in a RAC environment?
- Answer: SCAN listeners provide load balancing and failover for client connections. They listen on the SCAN IP addresses and route client connections to the appropriate database instances.
How do you verify SCAN name resolution in DNS?
- Answer: Use the following command to verify SCAN name resolution:
nslookup scanname
- Answer: Use the following command to verify SCAN name resolution:
What are the benefits of using SCAN in Oracle RAC?
- Answer: Benefits include simplified client connection strings, improved load balancing, automatic failover, and reduced configuration changes when adding or removing nodes in the cluster.
VIP (Virtual IP)
What is a Virtual IP (VIP) in Oracle RAC?
- Answer: A Virtual IP (VIP) is an IP address that is assigned to each node in an Oracle RAC cluster. VIPs are used to handle client connections and provide failover capabilities. If a node fails, its VIP is automatically moved to another node.
How does VIP failover work in Oracle RAC?
- Answer: If a node fails, the VIP assigned to that node is automatically relocated to another surviving node. This allows clients connected to the failed node to receive a fast failure notification and reconnect to a surviving node.
What command is used to check the status of VIPs?
- Answer: Use the following command to check the status of VIPs:
srvctl status vip
- Answer: Use the following command to check the status of VIPs:
How do you start a VIP on a specific node?
- Answer: Use the following command to start a VIP on a specific node:
srvctl start vip -n nodename
- Answer: Use the following command to start a VIP on a specific node:
How do you stop a VIP on a specific node?
- Answer: Use the following command to stop a VIP on a specific node:
srvctl stop vip -n nodename
- Answer: Use the following command to stop a VIP on a specific node:
How do you add a VIP to a RAC node?
- Answer: Use the following command to add a VIP to a RAC node:
srvctl add vip -n nodename -i vip_address -k subnet_mask -s interface_name
- Answer: Use the following command to add a VIP to a RAC node:
How do you remove a VIP from a RAC node?
- Answer: Use the following command to remove a VIP from a RAC node:
srvctl remove vip -n nodename
- Answer: Use the following command to remove a VIP from a RAC node:
What is the difference between SCAN VIP and node VIP in Oracle RAC?
- Answer: SCAN VIPs provide a single point of entry for client connections and load balancing, while node VIPs are associated with specific nodes and provide failover capabilities for client connections.
How do you configure VIPs during the installation of Oracle RAC?
- Answer: VIPs are configured during the Oracle Grid Infrastructure installation, where you specify the VIP addresses for each node in the cluster.
What happens if a VIP address is not configured properly in a RAC environment?
- Answer: If a VIP address is not configured properly, client connections may fail to connect to the RAC nodes, or failover may not work correctly, leading to potential downtime and connectivity issues.
How do you verify VIP configurations on all nodes in a RAC cluster?
- Answer: Use the following command to verify VIP configurations:
srvctl config vip
- Answer: Use the following command to verify VIP configurations:
What is the significance of the VIP in client TNS entries?
- Answer: VIPs in client TNS entries ensure that clients can quickly reconnect to a surviving node in case of node failure, providing high availability and failover capabilities.
Example Scenario-Based Questions
Scenario: You need to add a new node to an existing RAC cluster. How do you configure the SCAN and VIP for the new node?
- Answer: Adding a new node typically involves:
- Configuring the network for the new node.
- Ensuring that DNS or GNS is updated with the new SCAN and VIP entries.
- Extending the cluster configuration to include the new node using
addnode.sh
. - Verifying SCAN and VIP configurations on the new node.
$GRID_HOME/addnode.sh -silent -addnode -nodeList newnode1
- Answer: Adding a new node typically involves:
Scenario: A node in the RAC cluster fails. Describe the process that ensures client connections are rerouted to surviving nodes.
- Answer: When a node fails:
- The VIP associated with the failed node is relocated to a surviving node.
- Clients receive a fast failure notification (using Fast Application Notification, FAN) and are rerouted to the new location of the VIP.
- SCAN listeners continue to provide load balancing and redirect new connections to available instances.
srvctl status vip -n failednode
- Answer: When a node fails:
Scenario: You observe that client connections are not evenly distributed across RAC nodes. What steps would you take to investigate and resolve this issue?
- Answer:
- Check the status and configuration of SCAN listeners.
- Verify DNS/GNS entries for SCAN IPs.
- Check the load balancing configuration in client TNS entries.
- Review Oracle Net trace files for connection issues.
- Ensure all nodes are up and running.
srvctl status scan_listener nslookup scanname
- Answer:
Scenario: You need to change the VIP address of a node in a RAC cluster. What steps will you follow?
- Answer:
- Stop the VIP on the target node.
- Modify the VIP configuration to update the IP address.
- Start the VIP with the new configuration.
srvctl stop vip -n nodename srvctl modify vip -n nodename -i new_vip_address srvctl start vip -n nodename
- Answer:
Scenario: SCAN name resolution is failing. What diagnostic steps would you take to resolve this issue?
- Answer:
- Verify the SCAN configuration in DNS/GNS.
- Use
nslookup
to check SCAN name resolution. - Check network connectivity and firewall settings.
- Ensure that SCAN listeners are running and properly configured.
nslookup scanname ping scanname srvctl status scan_listener
- Answer:
Scenario: You need to add a third SCAN IP to an existing RAC cluster. What steps will you follow?
- Answer:
- Update the DNS/GNS to include the new SCAN IP.
- Add the new SCAN IP using the
srvctl
command.
srvctl add scan -i 3
- Answer:
RAC Background and Architecture
What is Oracle RAC?
- Answer: Oracle Real Application Clusters (RAC) is a clustered version of Oracle Database that allows multiple instances (database servers) to simultaneously access a single database stored in shared storage. It provides high availability, scalability, and performance benefits.
What are the key benefits of Oracle RAC?
- Answer: Benefits include:
- High availability through instance and node failure recovery.
- Scalability by adding or removing nodes dynamically.
- Improved performance via workload balancing across nodes.
- Flexibility in managing large databases with minimal downtime.
- Answer: Benefits include:
Explain the architecture of Oracle RAC.
- Answer: Oracle RAC architecture includes:
- Multiple database instances running on separate nodes.
- Shared storage (SAN, NAS, or Oracle ASM) accessible to all nodes.
- Oracle Clusterware for managing cluster resources, including SCAN, VIPs, and node memberships.
- Cluster interconnect for high-speed communication between instances.
- Clients connect through SCAN or VIPs for load balancing and failover.
- Answer: Oracle RAC architecture includes:
What is the role of Oracle Clusterware in Oracle RAC?
- Answer: Oracle Clusterware manages cluster resources and provides services such as node membership and communication, cluster integrity, and cluster-wide locking services. It ensures high availability and manages the infrastructure components of the cluster.
How does Oracle RAC achieve high availability?
- Answer: Oracle RAC achieves high availability through:
- Instance and Node Failover: Automatic relocation of services to surviving nodes in case of instance or node failure.
- Redundancy: Redundant components such as multiple instances, network paths, and shared storage prevent single points of failure.
- Fast Application Notification (FAN): Notifies clients and applications of failures for quick rerouting of connections.
- Answer: Oracle RAC achieves high availability through:
What is the purpose of the Global Cache Service (GCS) in Oracle RAC?
- Answer: GCS manages the distributed cache across instances, ensuring data consistency and coherency. It coordinates cache fusion to allow concurrent access to data blocks across instances without physical disk access.
Explain the concept of Cache Fusion in Oracle RAC.
- Answer: Cache Fusion allows data blocks to be accessed directly from instance memory caches across nodes. It uses the high-speed interconnect to transfer data blocks, maintaining data consistency and reducing disk I/O.
What is the purpose of SCAN (Single Client Access Name) in Oracle RAC?
- Answer: SCAN provides a single virtual hostname that clients use to connect to any database service in the Oracle RAC cluster. It simplifies client configuration and load balances client connections across available SCAN listeners.
Describe the network requirements for Oracle RAC.
- Answer: Oracle RAC requires:
- Private interconnect for high-speed communication between nodes (cluster interconnect).
- Public network for client connections to SCAN or VIPs.
- Proper network configuration to ensure low latency and high bandwidth for cluster synchronization and data transfer.
- Answer: Oracle RAC requires:
What are the different types of connections clients can use to connect to an Oracle RAC database?
- Answer: Clients can connect using:
- SCAN (Single Client Access Name): Single hostname for connecting to any service in the cluster.
- VIPs (Virtual IPs): Virtual IPs assigned to each node for client connections and failover.
- Direct connection to node VIPs: Directly connecting to a specific node's VIP for local instance access.
- Answer: Clients can connect using:
Technical Steps and Examples
How do you add a new node to an existing Oracle RAC cluster?
- Answer: Steps include:
- Prepare the new node:
- Install necessary hardware, OS, and Oracle Grid Infrastructure software.
- Extend Oracle RAC:
- Use
addnode.sh
(Linux/Unix) oraddnode.bat
(Windows) to add the new node to the cluster.
$GRID_HOME/addnode.sh -silent -addnode -nodeList newnode1
- Use
- Verify cluster synchronization:
- Ensure all services and resources are synchronized and available on the new node.
- Prepare the new node:
- Answer: Steps include:
How do you perform a rolling upgrade of Oracle Grid Infrastructure in an Oracle RAC environment?
- Answer: Steps include:
- Preparation:
- Backup Oracle Grid Infrastructure and database files.
- Upgrade one node at a time:
- Stop services on the node, apply the patch, and restart services.
srvctl stop nodeapps -n node1 $GRID_HOME/gridSetup.sh -silent -applyPSU srvctl start nodeapps -n node1
- Verify upgrade:
- Check Oracle Clusterware logs and services to ensure successful upgrade before moving to the next node.
- Preparation:
- Answer: Steps include:
How do you troubleshoot performance issues in Oracle RAC?
- Answer: Steps involve:
- Use AWR and ASH reports:
- Analyze performance metrics, SQL statements, and wait events.
SELECT * FROM dba_hist_active_sess_history WHERE ROWNUM <= 100;
- Monitor cluster interconnect:
- Check for latency, errors, and throughput using
crsctl
and network diagnostic tools.
$GRID_HOME/bin/crsctl stat res -t
- Check for latency, errors, and throughput using
- Review instance-specific metrics:
- Use
v$ views
andgv$ views
to monitor instance performance and resource usage.
SELECT * FROM gv$sysmetric WHERE metric_name = 'CPU Usage Per Sec';
- Use
- Use AWR and ASH reports:
- Answer: Steps involve:
How do you manage Oracle RAC services using
srvctl
?- Answer: Commands include:
- Create a service:
srvctl add service -db db_name -service service_name -preferred node_list -available node_list -network network_name
- Start a service:
srvctl start service -db db_name -service service_name
- Stop a service:
srvctl stop service -db db_name -service service_name
- Modify a service:
srvctl modify service -db db_name -service service_name -policy {AUTOMATIC | MANUAL} -preferred {node_list | ANY} -available {node_list | ANY}
- Create a service:
- Answer: Commands include:
How do you monitor and manage Oracle ASM (Automatic Storage Management) in Oracle RAC?
- Answer: Use
asmcmd
andsrvctl
commands:- Check ASM diskgroup status:
asmcmd lsdg
- Add disks to ASM:
asmcmd adddisk DATA_DISK_01 /dev/sdb
- Rebalance ASM diskgroups:
asmcmd rebalance DATA
- Start/stop ASM instance:
srvctl start asm -node node1
srvctl stop asm -node node1 -force
- Check ASM diskgroup status:
- Answer: Use
How do you configure and manage Oracle RAC backups?
- Answer: Use RMAN (Recovery Manager) and
srvctl
:- Configure RMAN for Oracle RAC:
- Set up centralized RMAN configuration file (
rman.conf
) for all nodes.
- Set up centralized RMAN configuration file (
- Backup database and ASM:
rman target / RMAN> BACKUP DATABASE PLUS ARCHIVELOG;
- Restore and recover database:
rman target / RMAN> RESTORE DATABASE; RMAN> RECOVER DATABASE;
- Configure RMAN for Oracle RAC:
- Answer: Use RMAN (Recovery Manager) and
How do you configure and manage SCAN and VIPs in Oracle RAC?
- Answer: Use
srvctl
commands:- Add SCAN:
srvctl add scan -n scan_name -vip vip_name
- Add VIP:
srvctl add vip -n node_name -vip vip_address -subnet subnet_name
- Modify SCAN:
srvctl modify scan -n new_scan_name
- Verify SCAN and VIP status:
srvctl status scan srvctl status vip
- Add SCAN:
- Answer: Use
How do you configure and manage Oracle RAC services for high availability?
- Answer: Use
srvctl
commands:- Create service:
srvctl add service -db db_name -service service_name -preferred node_list -available node_list -network network_name
- Start service:
srvctl start service -db db_name -service service_name
- Modify service:
srvctl modify service -db db_name -service service_name -policy AUTOMATIC -preferred node_list -available node_list
- Create service:
- Answer: Use
How do you handle node and instance failures in Oracle RAC?
- Answer: Automatic and manual steps:
- Automatic Failover:
- Oracle Clusterware automatically relocates services and VIPs to surviving nodes.
- Manual Failover:
- Use
srvctl relocate service
to manually move services to another node.
srvctl relocate service -db db_name -service service_name -node target_node
- Use
- Automatic Failover:
- Answer: Automatic and manual steps:
How do you troubleshoot Oracle Clusterware issues in Oracle RAC?
- Answer: Steps include:
- Check Clusterware status:
crsctl check cluster -all
- Review Clusterware logs:
- Check logs in
$GRID_HOME/log/hostname/crsd/
for errors and alerts.
- Check logs in
- Verify node and resource status:
crsctl status resource -t
- Check Clusterware status:
- Answer: Steps include:
Post a Comment
Post a Comment