Oracle Architecture Interview
Oracle’s architecture has evolved to embrace a modular and adaptive framework that emphasizes cloud-native principles and AI-driven automation. This unique approach integrates Oracle’s extensive suite of cloud services, including databases, middleware, and applications, into a cohesive ecosystem. Leveraging cutting-edge technologies like machine learning and blockchain, Oracle’s architecture offers unparalleled scalability, security, and agility.
By employing microservices and containerization, it facilitates rapid development and deployment of applications across hybrid and multi-cloud environments. With a focus on simplicity and efficiency, Oracle’s architecture empowers organizations to innovate and compete in today’s dynamic digital landscape with unprecedented speed and resilience.
Question: What is the difference between an Oracle Database and an Instance?
Answer:
Database: A collection of logically related data, including tables, schemas, and other objects. It represents the actual information you store.
Instance: A set of background processes, memory structures, and files that manage a single database. You can have multiple databases on a single server, each with its own instance.
Question: What are the various components of a physical Oracle Database (data files, control files, etc.)?
Answer:
- Data files:Â Store the actual data (tables, indexes, etc.).
- Redolog files:Â Track changes made to the database for recovery purposes.
- Control file:Â Stores metadata about the database structure and location of data files.
- Initialization parameter file (SPFILE):Â Defines configuration settings for the instance.
- Password file:Â Stores user account passwords securely.
Question: What is the use of SGA and PGA in memory management?
Answer:
SGA (System Global Area):Â Shared memory region accessible by all user sessions. It holds crucial data like buffer cache (frequently accessed data), shared pool (parsed SQL statements), and redo log buffer.
PGA (Program Global Area):Â Private memory allocated for each user session. It holds temporary data specific to that session, like sort areas and variable storage.
Question: Describe the functionality of key background processes like SMON and PMON?
Answer:
SMON (System Monitor): Cleans up orphaned sessions and performs instance recovery in case of crashes.
PMON (Process Monitor): Monitors background processes and restarts failed ones automatically.
Question: How does Oracle manage user security and privileges?
Answer:
- Oracle manages user security through a system of roles, privileges, and schemas.
- Roles:Â Group related privileges that can be assigned to users.
- Privileges:Â Permissions to perform specific actions on database objects (e.g., SELECT, INSERT, DELETE).
- Schemas:Â Collections of database objects owned by a specific user.
Question: Can you explain the concept of normalization in database design?
Answer:
Normalization is a crucial process in database design aimed at minimizing redundancy and dependency within the database schema. It involves organizing the data in a relational database to eliminate data anomalies such as insertion, deletion, and update anomalies.
There are different levels of normalization, typically represented by normal forms (NF). The most commonly discussed normal forms are:
- First Normal Form (1NF): Ensures that each column in a table contains atomic (indivisible) values and that there are no repeating groups of columns.
- Second Normal Form (2NF): Builds upon 1NF by ensuring that every non-key attribute is fully functionally dependent on the primary key. This eliminates partial dependencies.
- Third Normal Form (3NF): Extends 2NF by eliminating transitive dependencies, ensuring that every non-key attribute is directly dependent on the primary key and not on other non-key attributes.
Further normal forms like Boyce-Codd Normal Form (BCNF) and Fourth Normal Form (4NF) address more complex scenarios to achieve higher levels of data integrity and structure.
Question: What are the benefits and considerations of using materialized views?
Answer:
Materialized views act as a double-edged sword for database performance. Here’s a detailed breakdown of their benefits and considerations:
Benefits:
- Faster Query Response: Materialized views pre-compute the results of complex queries, storing the outcome as a separate database object. This eliminates the need to re-run the same calculations every time a user executes the query. This can significantly improve response times, especially for frequently used analytical or reporting queries that involve joins, aggregations, or filtering.
- Reduced Processing Load: By offloading the computational burden from the main database tables, materialized views lessen the load on the server’s CPU and memory. This frees up resources for other critical tasks and improves overall database performance.
- Simplified Complex Queries: Materialized views can simplify intricate queries by pre-aggregating or transforming data. This allows users to interact with the data through a simpler view, reducing the need for writing complex SQL statements and improving query maintainability.
Considerations:
- Storage Overhead: Materialized views occupy additional storage space since they store a copy of the pre-computed data. This can be a significant concern for databases with massive datasets.
- Synchronization: Materialized views need to be synchronized with the underlying base tables to reflect updates or changes. This synchronization process can add overhead, especially for frequently updated tables. Techniques like refresh schedules or materialized view refresh triggers are crucial to maintain data consistency.
- Maintenance: Just like any database object, materialized views require maintenance. You need to decide on refresh intervals to balance data freshness with performance and avoid stale data. Additionally, as your database schema evolves, you might need to adjust or rebuild materialized views to ensure they remain relevant.
Question: What are Oracle Database triggers, and when are they typically used?
Answer:
Oracle Database triggers are PL/SQL programs that automatically run in response to table events (INSERT, UPDATE, DELETE). They’re ideal for:
- Data Integrity:Â Enforce data validation and referential integrity rules.
- Auditing:Â Track data changes for improved accountability.
- Automation:Â Automate tasks like inventory updates based on table modifications.
- Business Logic:Â Encapsulate complex business rules within the database.
Use triggers strategically to streamline data management while keeping an eye on potential performance implications.
Question: Compare and contrast Oracle RAC (Real Application Clusters) with a single-instance architecture?
Answer:
- RAC (Real Application Clusters):Â A high-availability solution where multiple servers share a single database. Provides redundancy, scalability, and fault tolerance.
- Single-Instance:Â A single server manages a single database. Less complex but offers limited scalability and availability.
Question: What is the use of Data Guard in disaster recovery scenarios.
Answer:
Data Guard allows replicating your database to a secondary server for disaster recovery. In case of a primary server outage, the secondary server can be used to minimize downtime.
Question: How can you leverage Oracle’s built-in features for performance tuning?Â
Answer:
Tune with Built-in Features:
- Optimize Queries:Â Analyze queries and create indexes on key filter columns to speed up data retrieval. Break down complex queries or consider materialized views.
- Partition Large Tables:Â Split massive tables into manageable segments for faster access with partition pruning.
- Monitor and Analyze:Â Utilize AWR, ASM reports, and execution plans to identify bottlenecks and optimize resource usage.
- Fine-tune Resources:Â Leverage caching, resource management, and database alerts for optimal performance.
Below, we have covered detailed answers to the Oracle Architecture Interview Questions Which will be helpful to freshers and experienced Professionals.Â
Â
Explain briefly about oracle database architecture?
Which background process is used during user connectivity?
What are base tables? when and how they will get created?
What are different views DBA uses? which script will create them?
Why to Execute Catproc.sql Script?
Explain the phases of SQL execution?
What is mean by semantic checking? which component helps in that?
What is server process?
What is the difference between physical and logical read?
Why to maintain a copy of data in database buffer cache?
Why server process will not start searching from MRU end?
What are the logical structures of the database?
What are the 4 mandatory tablespaces req to run the database?
Can I have a database without SYSAUX tablespace in 10g?
If we have physical structures, why do we need logical structures?
Explain the difference between a block, extent and segment?
What are redo entries? When and where they will be created?
What is different status for a block in database buffer cache?
Will there be any undo generated in case of DDL statement processing? If so why?
What is PGA?
What is the difference between memory allocation in 8i and 9i for PGA?
Which is correct? Sorting will take place in PGA or temp tablespace?
How you will define INSTANCE and DATABASE?
What is SGA?
What are the responsibilities of SMON?
Why oracle maintains 2 redolog files?
What is SCN and which process writes that?
What are the other new background processes in 10g that you know?
What information control file contains?
What is server parameter file and how it is different from parameter file?
What is Ifile and when it is used?
How to recover if I lost parameter pfile or spfile?
If we have both pfile and spfile in place, which file oracle will use during startup?
What are hidden parameters and their use?
What is the purpose of password file?
While creating password file, what is the use of ENTRIES?
What is ASMM? Which background process helps in that?
How database will behave when you have both ASMM and individual parameters are configured?
What is AMM in 11g?
My database size is 1 TB, how much SGA will you configure?
What is alert log? How it is helpful for DBA?
What are the contents of alert log file?
What happens if we remove alert log file when database is in use?
If we have alert log file to diagnose the problem, why we need trace files? What are they?
Which background process is responsible for writing into alert log file?
Which process will start first when instance is started?
Which file is req to place database in NOMOUNT state and what happens in that phase?
Which file is req to bring into MOUNT phase and what is the use of this phase?
What files are needed to open the database and How oracle knows the locations of them?
What could be reason for SHUTDOWN IMMEDIATE command hanging for long time?
What is server result cache? What benefit we get out of it?
Explain how a select statement will get the benefit by using server result cache?
What parameters to be used to make 11g database use server result cache?
How to increase the size of server result cache?
Where all the trace files located in 11g?
Which background process clears sessions and releases locks when system fails?
What is OFA? Do you recommend to implement it?
Why oracle recommends OFA? How it is related to OS?
What is DISPATCHER in shared server architecture?
What are the parameters you use to configure shared server architecture?
How many slave processes we can have for DBWR and SMON?