Oracle Architecture Flashcards

1
Q

What is the relationship between tablespace and datafiles?

A

Each tablespace is divided into one or more datafiles. It has a one to many relationship.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What constitutes an Oracle database?

A

Permanent files that are stored on a disk.

Files are organized into three types:

  • Datafiles: hold user or system data.
  • Online Redo Log Files: hold changes made to the datafile.
  • Controlfiles: hold information about the physical structure of the DB.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What makes up an Oracle instance?

A
  • Made up of a shared memory region on RAM called the SGA and background processes.
  • SGA is accessible by multiple processes and stores data that is required in order to operate the instance.
  • Background processes are operating system processes that have a specific responsibility within the instance.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is SQL Plus? How can one acquire it and what kind of operations can be performed with it?

A

SQL Plus is a freely distributed command line tool developed by Oracle. It is used to connect to an Oracle database and can execute Oracle commands or SQL queries against the database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Advantages of a Controlfile

A

The controlfile is mandatory for writing by the Oracle DB server whenever the DB is open. Without it, the DB cannot be mounted and recovery is impaired. In addition, you would need to create control files if you want to change particular setting within the control files.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Differentiate between a cluster and a grid.

A
  • Clustering is one technology in which a grid infrastructure can be created.
  • Simple clusters have static resources for specific applications by specific owners.
  • Grids are dynamic resource pools shareable among many different applications and users.
  • Grids have a one to many relationship with clusters.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Explain the architecture of Oracle Grid.

A
  • Pools large numbers of servers, storage, and networks into flexible, on-demand computing resources for enterprise computing needs.
  • The grid computing infrastructure continually analyzes the demand for resources and adjusts the supply accordingly.
  • It also makes it possible for applications to share resources across many servers.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is a password file and why is it needed?

A

Password file is a separate operating system file that is stored on the disk outside of the database. This stores the usernames and passwords for the users who have SYSDBA and SYSOPER privileges. This allows administrators to logon even when the database is closed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Explain the difference between shared server and dedicated server architecture.

A
  • Dedicated Server: the instance creates on server process for each connected user.
  • Shared Server: a single server process will serve multiple clients.
  • Certain operations can only be performed on a dedicated server.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Explain how shared server architecture works.

A

The user connects to a dispatcher process which is responsible for delivering SQL requests to the request queue. The incoming requests will be executed and the results will be placed in the response queue. The dispatcher will also monitor the response queue and deliver the results to the relevant client. There are multiple shared server processes and dispatcher process in this architecture.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What are the instance parameters that are used for configuring shared server architecture?

A
  • Dispatchers: astring value used to configure dispatchers.
  • Shared_Servers: minimum # of shared server processes that will be present. Created during startup.
  • Max Shared_Servers: max # of shared server processes.
  • Shared_Server Sessions: max # of sessions that can exist simultaneously.
  • Circuits: max # of virtual circuits that can exist.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Explain how the DBWn process works.

A

Responsible for writing dirty buffers to the disk. This occurs when a server process wants to update a data block. It will read the block from the disk to the buffer cache if it is not already in the buffer cache and then update the copy in the buffer cache.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Explain the properties of datafiles.

A

Datafiles and databases have a one to one relationship. Once they are created, the size cannot be altered.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What do you mean by redo log?

A

The redo log is the most crucial for recovery operations. It consists of two or more pre-allocated files that store all changes made to the database.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Main function(s) of the redo log.

A

The main function of the redo log is to store all changes made to the DB in real time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What are the contents of the control file?

A

The control file records the physical structure of the DB which includes:

  • DB Name
  • Name & location of datafiles and online redo log files.
  • Timestamp of DB creation.
  • Current log sequence number.
  • Checkpoint information.
17
Q

What do you mean by datafile?

A

An Oracle datafile is a big unit of physical storage that is used to store tables and indexes allocated to the database.

18
Q

What are the logfile states?

A
  • Invalid: file is inaccessible.
  • Stale: file’s contents are incomplete.
  • Deleted: file is no longer used.
  • Null: file is in use.
19
Q

What is the use of the large pool?

A

The large pool is an optional memory area intended for memory allocations that are larger than is appropriate for the shared pool.

20
Q

What happens when we fire a SQL statement in Oracle?

A

The server process receives the statement and checks the shared pool in the SGA for any shared SQL area that contains an identical SQL statement. If shared SQL area is found, the server process checks the user’s access privileges and the statement is processed. If not found, a new shared SQL area is allocated for the statement so that it can be parsed and processed.

21
Q

What is the main purpose of checkpoint in oracle database? How do you automatically force oracle to perform a checkpoint?

A
  • CKPT forces all modified data in the SGA to be written to a datafile.
  • Updates the datafile and controlfile headers with SCN.
  • It helps reduce the amount of time needed to perform instance recovery.

LOG_CHECKPOINT_TIMEOUT=___ # Every Hour
LOG_CHECKPOINT_INTERVAL=___ # of OS Blocks

22
Q

What is a system change number? (SCN)

A

It’s a logical, internal time stamp used by the database. They order events that occur within the database.

23
Q

What are PMON processes?

A

1) Performs automatic process recovery.
2) Restarts failed shared server and dispatcher processes.
3) Detects both user and server aborted processes.
4) Cleans up client-side failures.
5) Automatically resolves aborted processes.

24
Q

What are SMON processes?

A

1) Perform automatic instance recovery.
2) Reclaim space used by temporary segments no longer in use (deallocate temporary segments).
3) Merges contiguous areas of free space in the datafiles.
4) Recovers transactions marked as DEAD within the instance.
5) Primarily cleans up server-side failures.

25
Q

What is the difference between Oracle SID and Oracle Service Name?

A

Oracle SID is the unique name that identifies your instance/database where as the service name is the TNS alias and can be the same of different as SID.

26
Q

What are the steps to install Oracle on Linux system? List two kernel parameters that effect Oracle installation.

A

Initially set up disks and kernel parameters. Then create Oracle user and DBA group. Finally run installer to start the installation process.

SHMMAX & SHMMNI are two kernel parameters required to set before installation process.

27
Q

What are bind variables?

A

With bind variables in SQL, Oracle can cache queries in a single time in the SQL cache area. This avoids a hard parse each time, which saves on various locking and latching resource we use to check object existence and so on.

28
Q

What is the difference between data block/extent/segment?

A

A data block is the smallest unit of logical storage for a database object. Extents are groupings of contiguous data blocks. Segments are groupings of extents.

29
Q

What is the difference between PGA and UGA?

A

Dedicated server process information is stored in the Program/Process Global Area (PGA) shared server process information is stored inside the User Global Area (UGA).

30
Q

What is SGA?

A

The system global area are implemented shared memory segments provided by the O/S. It is shared across all background and foreground processes. It has three mandatory data structures which are the DB buffer cache, log buffer, and shared pool. It may optionally contain a large pool, java pool, and streams pool.

31
Q

Define the structure of the shared pool component of SGA.

A

There are four major components:

1) Library Cache: shared SQL area.
2) Data Dictionary Cache: stores recently used object definitions (aka row cache).
3) PL/SQL Area
4) SQL Query and PL/SQL Function Result Cache