Showing posts with label Oracle DBA Interview Questions. Show all posts
Showing posts with label Oracle DBA Interview Questions. Show all posts

July 1, 2024

30 Top Oracle DBA Performance Interview Questions with Answers [2023]

Oracle Database Admin (Performance) Interview Questions for experienced - Part 1

1. What is direct path read?
Answer :
A direct path read is where the data is read directly from the data files into the PGA rather than into the buffer cache in the SGA. The direct path read is available only when the Oracle optimizer chooses a full table scan.

2. What are the index related things you will check in explain plan ?
Answer :
Index range scan
Index fast full scan
Index unique scan
BITMAP INDEX SINGLE VALUE

3. What is the cache buffer chains wait event in Oracle Database?
Answer :
A user process acquires the CACHE BUFFERS CHAINS latch to scan the System Global Area (SGA) for database cache buffers. Blocks in the buffer cache are placed on linked lists (cache buffer chains). Blocks are put on the hash chain according to their DBA (data block address) and CLASS of the block. Each hash chain is protected by a single child latch. The latch allows a process to scan a hash chain without having the linked list change while it scans.
Hot blocks are a common cause of cache buffers chains latch contention.

4. What are Scattered read and sequential read ?
Answer :
A db file sequential read is an event that shows a wait for a foreground process while doing a sequential read from the database. This is most commonly used for single block reads. Single block reads are most commonly seen for index block access or table block access by a rowid.
A db file scattered read will read multiple data blocks. Multi-block reads are typically used on full table scans. The "scattered read" refers to the fact that multiple blocks are read into DB block buffers that are 'scattered' throughout memory. 

5. What is the difference between Hash join and nested loop join?
Answer :
Hash join uses a hash-table based lookup mechanism while nested loop doesn't or 
the hash join can use cursor work-area memory (allocated in UGA) for buffering rows, while nested loops join can not.

6. What is cursor sharing ?
Answer :
A cursor is a name to a specific private SQL area. The cursor contains session-specific state information such as bind variable values and result sets. you can think of a cursor as a pointer on the client side and as a state on the server side.
Exact means exactly use my cursor and don’t do any changes. In this state, Oracle searches different execution plans for every query.
Force means force to cursor sharing. In this state, the database engine replaces every literal with bind variables. One child cursor is used for every SQL.
Similar means use cursor sharing but take advantage of histograms. If no histogram exists for one of the replaced literals, similar is the same as force state and an already existing cursor will be used. If a histogram exists, a new child cursor is created.

7. What is the parent and child cursor in oracle?
Answer :
PARENT CURSOR stores the SQL text of the cursor. When two statements are identical textually, they will share the same parent Cursor.
The Child Cursor holds other required information like the identity of the objects referenced by the SQL Cursor; the names, type and length of the bind variables used. Child cursors are also called versions.

8. What is bind peeking?
Answer :
One of the first drawbacks of bind variables is the explain plan. Oracle optimizer is able to peek the value of the bind variable and generate a plan like if the query where with a fixed value and so using histograms and statistics.
Bind variable peeking is used with SQL statements in the library cache to see if the value of a host variable is going to change the existing execution plan.

9. What is adaptive cursor sharing ?
Answer :
Oracle 11g uses Adaptive Cursor Sharing to solve bind peeking problem by allowing the server to compare the effectiveness of execution plans between executions with different bind variable values.

10. What is cardinality? What is high & low cardinality?
Answer :

11. What is the cardinality feedback init parameter ?
Answer :

12. What is dynamic_sampling?
Answer :

13. What are histograms in the database?
Answer :
Histograms are a feature of the cost-based optimizer (CBO) that allows the Oracle engine to determine how data is distributed within a column. They are most useful for a column that is included in the WHERE clause of SQL and the data distribution is skewed.
Histograms provide improved selectivity estimates in the presence of data skew, resulting in optimal execution plans with non-uniform data distributions.

14. What are the hints? give some examples?
Answer :

15. What is a reverse key index ?
Answer :

16. What is enq: hw contention ?
Answer :
The enq: HW - contention occurs when competing processing is inserting into the same table and are trying to increase the high watermark of a table simultaneously. HW enqueues are acquired in Exclusive mode before updating HWM (High Water Mark) and essentially HW enqueues operate as a serializing mechanism for HWM updates.

17. What is Ora-4031?
Answer :
ORA-04031: unable to allocate string bytes of shared memory

ORA-04031 is an error message related to the lack of available SGA memory components.
While ORA-04030 is related to the lack of available memory in the PGA area.
*  Heavy fragmentation of the shared pool - This can be fixed by increasing the shared_pool_size or doing a "alter system flush shared pool" or bouncing the instance.
* Too many pinned packages - If you have pinned lots of packages with dbms_shared_pool.keep, they have not left enough room for new work.

18. how to reduce index contention (en: TX - index contention) in oracle?
Answer :
The most probable reasons are:
  • Indexes on the tables which are being accessed heavily from the application.
  • Indexes on table columns which are monotonically growing. In other words, most of the index insertions occur only on the right edge of an index.
  • Large data purge has been performed, followed by high concurrent insert
  • Solutions:
  • Rebuild or shrink associated index after huge amount of data purge
  • Rebuild the index  as reverse key indexes or hash partition the indexes which are listed in the 'Segments by Row Lock Waits' of the AWR reports
  • Increase PCT_FREE for the index
  • Consider increasing the CACHE size of the sequences

19. What is the difference between locks, latches, enqueues and semaphores?
Answer :
Semaphores: Inside Oracle database there are many processes or threads are running and for successful running they need to communicate with each other. The process through which they communicate with each other is known as semaphores. It is just like a signal which tells the thread that when to run and stop. There is a semaphore for every Oracle server process.

Locks and Latches: There are several processes inside Oracle SGA (System Global Area) that need to be accessed concurrently by many different database processes. And it is very important that only one process is able to modify a particular data structure at a time. Oracle does this with the help of Locks and Latches.

Latches: Latches are the more restrictive mechanism, because they do not allow multiple processes to inspect the protected data structure at the same time. Latches do not support queuing. Oracle uses latch for the data is accessed in detail.

Locks: Locks allow for better concurrency, because they may be held in a shared mode when the data structure is simply being inspected. Queuing is supported by Latch. Locks are used by Oracle for performance tuning.

Enqueues: Many of the Locks in Oracle are known as Enqueues locks. To enqueue a lock request is to place that request on the queue for its resource.

20. How to find out whether the query has run with RBO or CBO?
Answer :

Related Oracle Interview Articles: Oracle Database Admin Interview Questions/FAQs – Part1   Oracle DBA Interview Questions/FAQs – Part4


January 4, 2023

Top 50 real-time Oracle GoldenGate (OGG) Interview Questions And answers 2023

OGG (Oracle Golden Gate) Interview Questions for experienced Part2

26. Why is Supplemental logging required for Replication in Golden Gate? is it mandatory?
Answer:
The process of adding these additional columns into redo log files is called supplemental logging.
Supplemental logging makes sure that enough information is captured, into the redo log file, during the update that can be used by any method based on log miner technology.
Supplemental logging can be enabled at the table level or at the Database level.

27. Does DDLs are supported by OGG ?
Answer:

28. List the minimum parameters that can be used to create the OGG extract process?
Answer:

29. What parameters can be used to configure Oracle GoldenGate to extract data from Archived Redo log files only?
Answer:

30. What type of Encryption is supported in OGG?
Answer:

31. What were some of the new features of GoldenGate (OGG) 19c/21c?
Answer:

32. What is a Credential Store in OGG 12c? How to configure Credential Store in OGG 12c?
Answer:

33. How do the Replicat works in a Coordinated Mode?
Answer:

34. What is the advantage of the collector process (in classic architecture)?
Answer:

35. List a few parameters which you used to improve the OGG replicat process performance?
Answer:

36. How do you see the contents of trail files ?
Answer:

37. What is the use of the DEFGEN utility?
Answer:

38. What is the best practice to delete old extract files in OGG?
Answer:

39. Is SCN and CSN are same ?
Answer:
Yes, they are the same

40. What is the difference between classic architecture and MA (Microservices Architecture) of OGG ?
Answer:

41. What is Oracle GoldenGate Microservice Architecture (MA)  (OGG 12c Release 3 onwards)?
Answer:

42. What is Admin client (after Golden Gate 12.3) ?
Answer:

43. What is OGG Service Manager (from 12c Release 3)?
Answer:

44. How to find out the overhead of Supplemental logging ?
Answer:

45. What is the difference between Supplemental logging of Min/UI/PK/FK/ALL ?
Answer:
At the least, minimal database-level supplemental logging must be enabled for any Change Data Capture source database.

46. Why is force logging required for Replication in OGG? is it mandatory?
Answer:

47. How to do a bidirectional Golden Gate setup ?
Answer:

48. How you will check whether replication is bidirectional (active-active setup) or not?
Answer:

49. 

50.

Related Oracle Interview Articles: Oracle GoldenGate (OGG) Interview Questions/FAQs Part1


December 25, 2022

Top 80+ Oracle DBA Interview Questions and Answers Part4

Oracle DBA (DataBase Admin) Interview Questions with Answers Part4

61. What is the use of root.sh & oraInstRoot.sh?
Answer :
Changes ownership & permissions of oraInventory
Creating oratab file in the /etc directory
In RAC, starts the Clusterware stack

62. What is transportable tablespace (and across platforms)?
Answer :

63. How can you transport tablespaces (TTS) across platforms with different endian formats?
Answer :
RMAN

64. What is XTSS (cross platform transportable tablespace)?
Answer :

65. What is the difference between restore point & guaranteed restore point?
Answer :

66. What is the difference between 10g/11g OEM Grid control and 12c Cloud control?
Answer :

67. What are the components of Grid control (OEM)?
Answer :
OMS (Oracle Management Server)
OMR (Oracle Management Repository)
OEM Agent

68. What were the new features of 12c Cloud control?
Answer :

69. How to find if your Oracle database is 32 bit or 64 bit?
Answer :
execute the command "file $ORACLE_HOME/bin/oracle", for 
64 bit oracle, you should see output like 
/u01/db/bin/oracle: ELF 64-bit MSB executable SPARCV9 Version 1

If your oracle is 32 bit you should see output like below
oracle: ELF 32-bit MSB executable SPARC Version 1

70. How to find opatch version ?
Answer :
opatch is utility to apply database/RDBMS patch, in order to find opatch version execute"$ORACLE_HOME/OPatch/opatch version"

71. What are histograms?
Answer :

72. How many types of histograms are there in Oracle 11g & in Oracle 12c?
Answer :

73. What is Oracle Transparent Data Encryption (TDE)?
Answer :

74. What is Data Redaction and how it will protect data?
Answer :

75. What is the difference between instance recovery and crash recovery ?
Answer :
Crash recovery is done automatically by SMON, in case of abnormal shutdown such as shutdown abort or any such reason.

Instance recovery refers to the case where a surviving instance recovers a failed instance in an Oracle Real Application Clusters (RAC) database.

76. What is ORA-04031 and ORA-04030 and what is the difference between ORA-04030 and ORA-04031 ?
Answer :
ORA-04031: unable to allocate nn bytes of shared memory
ORA-04030: out of process memory when trying to allocate nn bytes


77. What were the new features in Oracle 12c (release 2)?
Answer :

78. What were the new features in Oracle 18c?
Answer :

79. What were the new features in Oracle 19c?
Answer :

80. What were the new features in Oracle 21c?
Answer :


Related Oracle Interview Articles:  Oracle DBA Interview Questions/FAQs – Part5   Oracle DBA Interview Questions/FAQs – Part3

February 10, 2022

50 Top OGG (Oracle GoldenGate) Interview Questions

Oracle Golden Gate (OGG) Interview Questions/answers Part 1


1. What is GoldenGate and how to set up Golden Gate?

Answer:

2. What are the processes/components in OGG (Oracle Golden Gate)?

Answer:
Manager, Extract, Replicat, Data Pump

3. What is the use of (Data) Pump process in Golden Gate (GG)?
Answer:

4. What is the command-line utility in Oracle GoldenGate (or) what is ggsci?

Answer:

5. What is the default port for Golden Gate Manager process?

Answer:
7809

6. What are the important files of Oracle Golden Gate (OGG)?

Answer:
GLOBALS, ggserr.log, dirprm, etc ...

7. What is a checkpoint table?

Answer:

8. How can you see Golden Gate errors?

Answer:
ggsci> VIEW GGSEVT
ggserr.log file

9. What is the difference between classical extract and integrated extract?

Answer:
Classic Capture/extract:      (deprecated in OGG 21c)
* The Classic Capture mode is the traditional Extract process that accesses the database redo logs (optionally archive logs) to capture the DML changes occurring on the objects specified in the parameter files.
* At the OS level, the GoldenGate user must be a part of the same database group which owns the database redo logs.
* This capture mode is available for other RDBMS as well.
* There are some data types that are not supported in Classic Capture mode.
* Classic capture can’t read data from the compressed tables/tablespaces.

Integrated Capture (IC)/Extract:
* In the Integrated Capture/Extract mode, GoldenGate works directly with the database log mining server to receive the data changes in the form of logical change records (LCRs).
* IC mode does not require any special setup for the databases using ASM, transparent data encryption, or Oracle RAC.
* This feature is only available for oracle databases in Version 11.2.0.3 or higher.
*  It also supports various object types which were previously not supported by Classic Capture.
* This Capture mode supports extracting data from source databases using compression.
* Integrated Capture can be configured in an online or downstream mode.

10. What is the difference between classical replicat and integrated replicat?
Answer:

11. What is the difference between classical replicat and coordinated replicat?
Answer:

12. What is the use assumetargetdefs in replicat parameter file?
Answer:
Use the ASSUMETARGETDEFS parameter when the source and target objects specified in a MAP statement have identical column structure, such as when synchronizing a hot site. It directs Oracle GoldenGate to assume that the data definitions of the source and target objects are identical, and to refer to the target definitions when metadata is needed for the source data.

13. Can you configure multiple extracts to write to the same exttrail file?
Answer:
Only one Extract process can write to one exttrail at a time. So you can’t configure multiple extracts to write to the same exttrail.

14. What is the use of PASSTHRU and NOPASSTHRU parameters ?
Answer:
parameter passthru indicates the source and target database tables structure are identical. In pass-through mode (configured by PASSTHRU), the Extract process does not lookup table definitions from the database or from a data-definitions file. To use pass-through mode, the source and target table names and structures must be identical.

15. What is a Handle collision in OGG?
Answer:
The Golden Gate HANDLECOLLISIONS parameter is configured on the target database in the Replicat process to enable processing of the data when there are duplicate data integrity issues in the destination database.
Use the HANDLECOLLISIONS and NOHANDLECOLLISIONS parameters to control whether or not Replicat tries to resolve duplicate-record and missing-record errors when applying SQL on the target.

16. List important considerations for bi-directional (active-active setup) replication?
Answer:
The customer should consider the following points in an active-active replication environment.
* Primary Key: Helps to identify conflicts and resolve them.
* Sequences: Are not supported. The workaround is used to use odd/even, range or concatenate sequences.
* Triggers: These should be disabled or suppressed to avoid using uniqueness issue
* Data Looping: This can easily be avoided using OGG itself
* LAG: This should be minimized. If a customer says that there will not be any LAG due to network or huge load, then we don’t need to deploy CDR. But this is not the case always as there would be some LAG and these can cause Conflicts.
* CDR (Conflict Detection & Resolution): OGG has built-in CDRs for all kinds of DMLs that can be used to detect and resolve them.
* Packaged Application: These are not supported as they may contain data types that are not supported by OGG or it might not allow the application modification to work with OGG.

17. What is the difference between Discard and Ignore (in RESOLVECONFLICT) ?
Answer:

18. How you will check whether replicat is classical replicat or coordinated replicat or integrated replicat?
Answer:

19. How to find out the RBA of a Golden Gate (OGG) process ? [or] Which command will you use to find out the RBA of extract/replicat ?
Answer:

20. What is the heartbeat table in OGG ? Who will insert data into the heartbeat table ?
Answer:

21. How to check whether the table is in OGG replication or not ?
Answer:

22. What is trace table? What is the use of trace table?
Answer:

23. What is the use of initial load ?
Answer:

24. 
What are the different OGG Initial load methods available?
Answer:

25. 
Answer:



Related Oracle Articles: Oracle DBA Interview Questions/FAQs – Part3   Oracle Performance related interview Questions/FAQs