Oracle DBA Flashcards
What is PGA or Private Global Area?
Any work inside a system or server is done through background processes. These processes need some memory to store basic information. On database server, we have one server process created for every user connection. These server process also takes some memory. This memory is known as PGA.
What is SGA?
SGA is shared global area. It is one of the parts of Oracle database instance and resides on RAM. Anything placed in SGA is shared with all the users
What do you understand by In-Memory sort?
All the small data filtering happens in PGA. This is known as In-Memory sort. If the data is big, sorting is done under temp tablespace
Can you explain how an update statement is executed in the database?
In an update statement, we need the old value as the user might rollback the transaction. Hence, undo tablespace comes into the picture. The user data and a free undo block are copied into the LRU list. These blocks are then copied to PGA where data swapping happens. Redo entries are generated and the dirty blocks are placed in the write list. LGWR writes redo entries and then DBWR writes dirty blocks to the database.
Explain about SCN and checkpoint number
- SCN is a unique transaction number assigned to a set of redo logs generated. This identifies that OK, these all redo entries are part of one transaction.
- A checkpoint is a database event, which synchronizes the database blocks in memory with the data files on disk. It has two main purposes – To establish a data consistency and enable faster database Recovery.
Which groups are assigned to the oracle user for installation and administration purposes?
oinstall and dba
Why run orainstRoot.sh and root.sh scripts at the end of installation?
orainstRoot.sh will change the permissions for oraInventory and
root.sh will create the oratab file.
Explain Oracle installation pre-requisite steps
Create oinstall& dba groups, modify kernel parameters, check disk space for installation, create oracle user and provide permissions on installation location to oracle user
Why wouldn’t you be able to use the SQLPLUS utility?
Environment variables aren’t set (ORACLE_HOME, PATH) or .bash_profile is not executed immediately after making changes to it.
How can I check environment variables are set properly?
Using env | grep ORA.
Using echo command like echo $ORACLE_HOME.
How would you determine what databases are running on an instance?
ps -ef|grep pmon
Can we change the database block size after creation?
No
You’ve been tasked with decommissioning a database, what are your steps?
- Check to see what is actively connecting to the DB
- Shutdown the Listener for a period of time to determine no users are accessing it still
- Shutdown the DB and take a backup
- Drop the Database
How do I determine who is connected to the DB?
V$SESSION
How do I terminate a user session?
alter system kill session ‘SID, Serial#’;
What is the difference between a pfile and an spfile?
Pfile is human readable file and spfile is binary file. We can start database instance with either of the files but first preference is given to spfile.
Both reside under $ORACLE_HOME/dbs location and are used to allocate instance memory
If I only have an spfile how do I create a pfile?
create pfile from spfile;
What are the stages of starting a database?
NOMOUNT: Starts the instance by reading the initialization file but does not open the database.
MOUNT: Associates the instance with the database and reads control files.
OPEN: Fully opens the database, making it accessible for users and applications.
How do you resize redo log files?
You have to create a new group and then drop the old one.
What is OMF?
Oracle Managed Files. Oracle will do a fair amount of the work for you but the naming conventions are generally system generated. They are used with ASM.
What is a trace file and how does one make one?
A trace file is created for each server and backend process. When a process or user process detects an operational fault, it spills data about the bugs to its trace.
What happens when you run a SQL Statement in Oracle?
First, it validates the syntax, if it finds the results in the buffer, it’ll return the results, else, it’ll generates an execution plan based on current info available to the engine, then it’ll return all the results
What type of files make up a Database?
Redo Log Files, Parameter Files, Control Files, Data Files, Password Files
What are the different types of Oracle Database Shutdown Modes?
Normal, Immediate, Transactional, Abort