Top C++ And Oracle Interview Questions Part – 3
What Are Background Processes In Oracle?
In order to enhance performance and accommodate many users, a multi-process Oracle system uses some additional Oracle processes called background processes.
What Server Processes Can Perform Created On Behalf Of Each User’s Application?
Server processes can perform one or more of the following:
Parses and executes SQL statements fired through the application.
Reads data blocks from datafiles on disk into the shared database buffers of the System Global Area, if the blocks are not already present in the System Global Area.
Return results in such a way that the application can process the information
What Are Server Processes In Oracle?
Oracle creates server processes to serve user processes requests, connected to the instance. In some situations, when the application and Oracle are on the same system, it is possible to combine the user process and corresponding server process into one process for reducing system overhead.
However, when the application and Oracle operate on different computers, a user process always talks to Oracle through a separate server process.
What Are Dedicated And Shared Server Process?
Server Configurations:
Dedicated server process
Shared server process
The server process created on behalf of each user process is called a dedicated server process (or shadow process).Shared server architecture removes the need for a dedicated server process for each connection.
A dispatcher routes multiple incoming network session requests to a pool of shared server processes.
An idle shared server process from a pool of shared server processes picks up a request from a common queue, which does mean a small number of shared servers can do the same amount of processing as many dedicated servers.
What Are The Contents Of Pga?
Content of the Program Global Area : The content of the Program Global Area memory varies, depending on whether the instance is running the shared server option. But in general, the PGA memory can be classified in the following manner.
Private SQL Area :
A private SQL area contains information such as bind information and runtime memory structures.
Cursors and SQL Areas : Session memory is the memory assigned to hold a session’s variables (logon information) and other session information. The session memory is shared and not private for a shared server.
SQL Work Areas:
For complex queries such as decision-support queries, a big portion of the runtime area is dedicated to work areas allocated by memory- intensive operators.
What Is Pga?
A PGA i.e Program Global Area is a memory region that contains data and control information for a server process.It is a memory created by Oracle when a server process is started and it is non shared. Access to it is exclusive to that server process and is read and written by Oracle code.
The total PGA memory allocated by each server process associated to an Oracle instance is also known as aggregated PGA memory allocated by the instance.
What Is Shared Pool?
The Shared Pool part of the System Global Area contains the library cache, the dictionary cache, buffers for parallel execution messages, and control structures.
What Is Redo Log Buffer?
The Redo Log Buffer is a circular buffer in the System Global Area that holds information about changes made to the database. Redo entries contain the information to reconstruct, or redo, changes made to the database by INSERT, UPDATE, DELETE, CREATE, ALTER, or DROP operations. Redo entries are used for database recovery, if necessary.
What Are Database Buffers?
It is the portion of the System Global Area that holds copies of data blocks read from datafiles. All user processes are connected to the instance concurrently and share access to the database buffer cache.
What Are The Data Structures Does Sga Contains?
The SGA contains the following data structures:
Database buffer cache
Redo log buffer
Shared pool
Java pool
Large pool (optional)
Streams pool
Data dictionary cache
Other miscellaneous information
What Is Difference Between C And C++?
C++ is Multi-Paradigm ( not pure OOP, supports both procedural and object oriented) while C follows procedural style programming.
In C data security is less, but in C++ you can use modifiers for your class members to make it inaccessible from outside.
C follows top-down approach ( solution is created in step by step manner, like each step is processed into details as we proceed ) but C++ follows a bottom-up approach ( where base elements are established first and are linked to make complex solutions ).
C++ supports function overloading while C does not support it.
C++ allows use of functions in structures, but C does not permit that.
C++ supports reference variables ( two variables can point to same memory location ). C does not support this.
C does not have a built in exception handling framework, though we can emulate it with other mechanism. C++ directly supports exception handling, which makes life of developer easy.
What Is A Class?
Class defines a datatype, it’s type definition of category of thing(s). But a class actually does not define the data, it just specifies the structure of data. To use them you need to create objects out of the class.
Class can be considered as a blueprint of a building, you can not stay inside blueprint of building, you need to construct building(s) out of that plan. You can create any number of buildings from the blueprint, similarly you can create any number of objects from a class.
class Vehicle
{
public:
int numberOfTyres;
double engineCapacity;
void drive(){
// code to drive the car
}
};
What Is An Object/instance?
Object is the instance of a class, which is concrete. From the above example, we can create instance of class Vehicle as given below Vehicle vehicleObject;
We can have different objects of the class Vehicle, for example we can have Vehicle objects with 2 tyres, 4tyres etc. Similarly different engine capacities as well.
What Do You Mean By C++ Access Specifiers?
Access specifiers are used to define how the members (functions and variables) can be accessed outside the class. There are three access specifiers defined which are public, private, and protected
private :
Members declared as private are accessible only with in the same class and they cannot be accessed outside the class they are declared.
public :
Members declared as public are accessible from any where.
protected :
Members declared as protected can not be accessed from outside the class except a child class. This access specifier has significance in the context of inheritance.