Jonn Interview Questions and Answers
Jonn Interview Questions and Answers
8. While applying patches do you involve in any call? During downtime do you
start any bridge call? How do you manage downtime?
For non-prod instances we dont set up calls, simply
we will drop email to the respective team and check for
downtime, if they are okay with that downtime window then
we will stop the database and apply the patch.
If it's a production database then our Senior
DBA will schedule the downtime prior to a couple of
months. During downtime We will join the bridge call with
the DBA team and apply the patch, while applying patch
one of our colleagues/Team mate will monitor our screen.
10. On your server how many mounts or disks do you have and what is stored in
it?
We have 3 mount points, /d01, /d02 and /d04 - /d01
contains oracle homes, /d02 contains CRD files, /d04
contains backups and archive log files.
12. What are things will you consider before installing oracle software?
You need to verify if all prerequisite packages are
installed on the server, create required groups and
users, check the space on mount points and create
directory structure and change permissions and owners of
directories.
13. How to create database? What are the things which we will have to consider
before creating a database?
Using dbca or manually, Check the disk space, create
mandatory directory structure for storing CRD files and
backups, Check if any other databases are running on
servers (ps -ef |grep PMON) if yes check the listener
ports of currently running databases, so we have to use
different port for the listener.
17. At the time of shutdown immediate, what will happen to running transactions.
(N-RE)
It will get killed.
$ORACLE_HOME/network/admin
21. How will you find how many instances are there in the server? How many are
running. How will you get the home location of that database?
We will get all databases information from
/etc/oratab file.
22. How will you start the database, which parameter will you use in the
environment file. If you don't have an environment then how will you login to
the database?
33. What is parsing? When will oracle perform hard parsing and soft parsing?
Row Chaining - When the row is too large to fit into one
data block when it is first inserted. In this case,
Oracle stores the data for the row in a chain of data
blocks (one or more) reserved for that segment.
39. What are the states of redo logs? How does it work?
Current, Active, Inactive, unused.
Lgwr will write redo entries on current redo log,
once redo log is full the log switch will happen, then
lgwr will stop writing on current redo log and start
writing on next redo logs.
54. What is the max size of tablespace? How many datafiles can we add to
tablespace?
We can not set maxsize to tablespace, we can set maxsize
to datafile(32GB). We can add a maximum 1022 datafiles to
one tablespace.
59. How to add a redo log member in the redo log group. (N-RE)
61. How to find default temporary and default tablespace in database. (N-RE)
66. Why do you need to multiplex control file and how do you do it?
User Management
70. User is complaining that he is not able to connect to the database. What will be
your approach to solve the user problem?
First I will check if the database is up, then I
will check the listener status, then I will check if
users account status from dba_users view, if the user
account is locked then we will unlock it, If users
password is not working then we will reset users
password.
74. Client is asking for sysdba access. What is the command to give access?
It’s not a good idea to share the sysdba role to normal
user/client, I will ask client/user why he needs sysdba
grant, instead of providing sysdba role I will ask user/client
to provide us details, we will perform the task on behalf of
user.
Database auditing
86. Do you know about export imports? traditional or data pump? I want to export
only data from the table. Which parameter will you use?
Use content = data_only parameter.
94. Which parameter is used in expdp or impdp to fetch data from different remote
database. (N-CI)
network_link
95. In the database 10 years old table is there we have to export some particular
information from that table how you will export that information. (N-CI)
96. You have taken any logical backup, what is the size of the database. (N-RE)
97. What is the size of the schema which you have taken backups of? Then what is
the size of the backup? (N-RE)
99. Have you worked on expdp & impdp, which parameter you come across. If
there are two tables a, b remaps to c, d how will you write remap tables
parameter.
Local database
104. Which parameter is used in expdp or impdp to fetch data from different
remote databases.
Network_link
Physical Backup
105. Types of backups
Hot, cold and rman
106. How to check archive log mode and how to enable archive log mode?
Using archive log list command and v$database view
To enable archive log mode, start the database in
mount stage and run the alter database archivelog
command.
108. Can you tell me the difference between hot backup and cold backup?
What is the difference between a hot/online backup and a cold/offline
backup?
Hot backup is inconsistent whereas cold backup
is consistent.
To take a hot backup database must be in
archive log mode, We can take cold backup in both
conditions, archive log mode or noarchivelog mode.
Hot backup needs recovery to make it
consistent, cold backup doesn’t need recovery.
Cold backup needs downtime whereas hot backup
doesn’t need downtime.
113. We have a 7 days old backup. How do you restore it? What is the
command?
Restore database backup location ‘location of
backup’
118. What is the RMAN command to take control file and spfile backup?
Backup current controlfile
Backup spfile
125. What happens when we do DML and DDL statements when the database or
tablespace is in begin backup mode, User will be requesting data at that time can
he will fetch the data or not.
128. What happens when you execute alter database begin backup?
129. How will you check your database is in begin backup mode?
Cloning
131. How to clone/refresh the databases or how do you restore the database
on the dev/test server? How will you clone by using RMAN
132. What are the post clone steps have you performed?
a. Change sys, system and all important users password.
b. Create a password file.
c. Create temporary tablespace and add temp files.
d. Create db links ( depends on requirement)
e. Execute some project specific scripts.
f. If you have taken export of any table/schema before
clone then you can import it back.
g. Change dbid using nid utility if you have cloned an
instance from hot/cold manual backup.
134. How to clone from 19c to 12c (Cross Version Cloning) (N-FU)
As I know it’s not possible, If you know if we can
do it then please let me know.
135. How will you restore user managed backup in another server i.e., cloning
a. Copy the hot backup to DEV server.
b. Copy the controlfile backup from source.
c. Copy the required archive logs.
d. Configure oracle home and set pfile.
e. Create a controlfile using trace file, here you have
to set Noresetlogs to resetlogs and REUSE to SET and
change the database name and path of datafile.
f. Start recovery using command recover database using
backup controlfile until cancel;
g. Apply the archive logs.
136. How will you restore/clone the database without a duplicate command?
a. Copy the Full backup, incremental backup, archive
log backup, controlfile backup from production to
target database.
b. Configure Oracle home and pfile
(log_file_name_convert and db_file_name_convert,
keep same db name as source and change
db_unique_name to Non prod)
c. Start database in nomount stage.
d. Restore controlfile using restore controlfile
command.
e. Start database in mount stage.
f. Restore database using restore database backup
location command.
g. If you want to keep it the same then keep it or if
you want to change db name then you can change db
name using nid utility.
145. On Primary Current 10 archive logs are missing & current log sequence
is 50 what will you do?
Regenerate missing archive logs from rman backup,
then automatically archive logs will get transferred to
standby and mrp will apply those missing archive logs
or else
Then take incremental backup from missing log
sequence number to current log sequence number and
restore it to the standby database.
149. What is the standby file management parameter? Suppose I have added
a datafile to primary but it is not getting reflected/transferred to standby, how
will you solve this issue?
Standby file management parameter is used for
transferring datafiles from primary to standby. If the
datafile is not getting transferred to standby then I
will check the standby file management parameter it
should set to auto.
153. What is switchover activity? How will you in normal sql mode not in
DGMGRL. What are pre-activity checks before switchover.
159. How many Standbys are You Using in your current company?
4
Patching
163. What is a patch? Tell me about patching. (N-CI)
Oracle regularly makes patches available to upgrade
features, enhance security, or fix problems or to fix the
bugs with supported software.
OR
Opatch lsinventory
169. What happens when you apply the patch using the opatch apply
command?
172. What is the difference between CPU patch and PSU patch?
173. Patch is running slow? What will you check? What could be the
reasons?
Upgradation
177. How to upgrade the database from 12c to 19c steps?
Upgrade is mainly divided into 3 parts, Pre upgrade
steps, upgrade and post upgrade steps. In pre upgrade
steps we prepare the database for upgrade, we execute
some steps like purge recycle bin, compile invalid
objects, gather dictionary stats, run dbupgdiag.sql
script, run preupgrade.jar script which again creates two
scripts preupgrade_fixup.sql and post_upgrade_fixup.sql,
Check the size of system and sysaux tablespace and add
enough space, Stop dbms_scheduler jobs, take cold backup,
Install Oracle 19c binaries, apply latest security
patches, and then perform the upgrade using DBUA, upgrade
it self take care of compiling invalid objects, time zone
upgradation everything will be taken care by DBUA, as
post upgrade steps execute post_upgrade_fixup.sql,
configure listener and tns, create new password file.
178. What happens when you execute the preupgrade.jar file? What is the
location of the preupgrade.jar file?
Preupgrade.jar file creates 2 files
pre_upgrade_fixup.sql and post_upgrade_fixup.sql,
preupgrade script we have to execute prior to starting
database upgrade and post upgrade script we have to
execute after database upgrade.
preupgrade .jar file is under $ORACLE_HOME/rdbms/admin
179. What are the pre steps you performed before upgrading?
In pre upgrade steps we prepare the database for
upgrade, we execute some steps like purge recycle bin,
compile invalid objects, gather dictionary stats, run
dbupgdiag.sql script, run preupgrade.jar script which
again creates two scripts preupgrade_fixup.sql and
post_upgrade_fixup.sql, Check the size of system and
sysaux tablespace and add enough space, Stop
dbms_scheduler jobs, take cold backup, Install Oracle 19c
binaries, apply latest security patches, and then perform
the upgrade using DBUA.
181. Suppose if the Database upgrade fails, what will you do?
I will check the database upgrade logs and will take the
action accordingly, Why it is failed, IF upgrade is
failed during upgrade stage then we will try to fix the
issue or restore database from backup/restore point, If
upgrade fails in post upgrade steps then we will check
the logs and try to fix it, If we couldn’t able to fix
the issue then we will check with Oracle Support, we will
upload all required logs to Oracle Support and will try
to fix the upgrade.
182. What is the restore point? Which restore point will you use during
upgrade? What is the difference between Normal restore point and Guaranteed
Restore Point?
Restore point we create to restore the database till the
restore point of time. During database upgrade or
switchover we create the restore point to avoid failures.
Performance Tuning
183. Have you worked on Performance issues? Tell me any five wait events?
Yes sometimes I worked on the PT part but I do not
have expertise in PT, coming to wait events: Buffer busy
waits, free buffer waits, Library cache wait, Log buffer
space, db file sequential read.
185. How will you find which session is consuming more temp space?
Using view v$tempseg_usage and v$sort_usage
186. SQL query is running slow. What will you do?One session is running
well before 5 days. Currently it is performing slowly. What is your approach?
SQL query taking time to execute- how will you resolve the issue?
a. I will login to the database server and check load
and memory usages on the server using top, free -m,
vmstat, iostat commands. If load is high then I will
identify the process ID which is consuming more
resources and will try to troubleshoot on those
processes or sessions.
b. I will check the disk space if any disk or
archivelog destination or FRA is full then
accordingly I will take action, If FRA or archive
log destination is full then I will clean up old
files
c. If load is normal then check the alert log of the
database if we notice any error in alert log then we
will fix that.
d. I will go ahead and check if any blocking locks or
locks on objects or any long running inactive
sessions, if there are any then I will clean it.
e. I will check the stale stats on some important
schema/table, if gather is stale then I will run the
gather stats.
f. If any sql is in top sessions and consuming more
resources then we will try to tune those sql using
checking explain plan, if it’s using correct
execution plan, cost of the sql, table full scan,
recommendations from tuning advisor like to create
index or create profiles.
188. What do you check in alert logs? How do you resolve it?
It depends on the error. Normally whenever any
tablespace is full, or archive log destination or FRA is
full, database startup & shutdown message, if any
datafiles is missing all errors will be written to alert
log, So depending on error we will have to take action.
Eg. If tablespace is full then we will get an error like
Unable to extend tablespace that time we will add space
to tablespace, if archive log destination is full then
database will hang, you will get archival error then we
will clean up some old archive logs.
190. Your database is open. You don’t want to interrupt currently connected
users but you want to temporarily disable further logons. What would you do
to achieve this and how would you revert the database back to its normal state
after that?
Stop listener.
191. Temp/Undo tablespace utilisation is 100% full. What will you do?
What will you do if the temp/Undo tablespace is full?
First, I will try to identify if the issue is
permanent or intermittent. If it's intermittent, I will
check which session is blowing temp tablespace, then I
will check the cost and explain the plan for that session
if Cost is too high or if the session is doing full table
scan. I will check if the session is running with a good
plan or worst plan, if we have a better plan available
then I will try to pin the best plan, if only one plan
exists, I will run a tuning advisor on it and according
to tuning I will try to implement a solution.
If cost and plan is good and issues happen
frequently for many sessions then I will check AWR
report and will add tempfile / undo files to
temporary/undo tablespace.
192. If the database is up and running & you lost one of the control files
what will happen. (N-CI)
194. How to check blocking locks and how will you kill blocking locks?
We can check blocking locks using v$session and
v$lock, we can kill inactive blocking sessions using the
alter system kill session command.
195. A user is complaining that DB is running slow. What could be the issue?
(N-FU) or Database is hung. Old and new user connections alike hang on
impact. What do you do? Your SYS SQLPLUS session is able to connect
199. What is a snapshot too old error? What is the ora-01555 error?
200. I changed the oracle base folder and suddenly I live what would you do.
The Oracle base directory is the location where
Oracle software and configuration files are stored. I
will check the location and name of the oracle home in
oratab or inventory.xml and revert the directory to its
original name.
209. What kind of error have you noticed in the alert log file?
ORA-1652: unable to extend temp segment by 128 in
tablespace TEMP
ORA-1652: unable to extend temp segment by 128 in
tablespace TEMP
ORA-30036: unable to extend segment by 8 in undo
tablespace
ORA-1653: unable to extend table om.emp by 128 in
tablespace users
ORA-01555: snapshot too old: rollback segment number
184 with name "_SYSSMU184_2797134679$" too small
ORA-04301: unable to allocate x bytes of shared
memory
ORA-00257: archiver error, connect internal only,
until freed.
Shutdown, startup, log switch information...
ASM
210. What is ASM? How will you configure ASM?
Automatic Storage Management (ASM) is Oracle's
logical volume manager.
Prevents fragmentation of disks, Provides automatic load
balancing over all the available disks.
To Configure ASM,
1. Install all asm pre-requisite package and
configure asm using oracleasm configure -i
command and initiate oracleasm
2. Once you get raw disks from the storage team,
format the disk using fdisk command.
3. Create asm disks using oracleasm createdisk
DISK_NAME /dev/sdb1
4. As an oracle or grid user install the grid
software and create a diskgroup.
5. Once oracle asm is configured then create a
database.
212. When you drop a disk from diskgroup, what will be the status of that
dropped disk ?
Former means disk can be reused.
213. What are the stats of ASM disks?
PROVISIONED – Disk is not part of a disk group and
may be added to a disk group with the ALTER DISKGROUP
statement.
Or
Or
226. How to copy rman backups from ASM diskgroup to another server?
We can not copy any files directly from asm disks to
another server, first we have to copy to the local file
system and then we have to scp to another server.
RAC
227. What is the difference between RAC and Single Instance?
RAC has multiple instances with a shared database,
Cluster is a combination of one or more physical servers
whereas standalone/Single instance has one instance.
234. Purpose of SCAN listener? Why don’t we use VIP instead of SCAN?
No need to update tns details on the client side.
Suppose your database is running with 2 node RAC clusters
and after certain days, your organisation decided to add 3rd
node then you have to add 3rd VIP details in application side
tns details. So wherever they have added tns entries they have
to change it and they have to reconfigure the entire
application which will again need downtime. This is one
disadvantage of VIP, same while removing nodes, to overcome
this problem SCAN came into picture.
Client will connect to SCAN, and scan will pass
connections to node 1,2,3..4. Client and application team no
need to add those VIP’s in tns in application.
235. What is cache fusion in oracle RAC? and its benefits? GCS,GES,GRD
explain in deep?
Moving the data block from the buffer cache of one
instance to another instance’s buffer cache is called
cache fusion. If one instance reads a data block from the
disk and another instance needs the same block, then that
datablock will get transferred to another instance’s
buffer cache.
LMD – >
referred to as the GES (Global Enqueue Service) daemon
since its job is to manage the global enqueue and global
resource access.
ACMS:
Atomic Controlfile Memory Service.
ensuring a distributed SGA memory update is either
globally committed on success or globally aborted if a
failure occurs.
LMHB
Global Cache/Enqueue Service Heartbeat Monitor
LMHB monitors the heartbeat of LMON, LMD, and LMSn
processes to ensure they are running normally without
blocking or spinning
249. While the select statement is running, the node on which the select
statement is running crashed ?
So the select statement will be transparently failed
over to another node and the select statement will be
completed and results will be fetched.
Multitenant Architecture
258. Do you know about multitenant architecture? What is CDB PDB
259. Features 10g vs 11g vs 12c vs 18c vs 19c vs 21c?
Other
260. How would you edit your CRONTAB to schedule the running of
/test/test.sh to run every other day at 2 PM?
261. Have you raised any SR or Do you know about support?
262. What is an undo retention policy? How do you estimate the undo
retention policy?
263. What is database incarnation? What happens when the database goes
into a new incarnation? What happens when you run ALTER DATABASE
OPEN RESETLOGS?
264. Backup fails on a particular day? What could be the reason? What will
you do?
Most of the cases backup fails due to space issue,
we can delete old backups and start backup again in off
hours.