Linux interview questions for DBA


1.       How do you see how many instances are running?
In unix, you can use the command line
% ps -ef|grep ora_

2.       How do you automate starting and shutting down of databases in Unix?
Automatic startup can be done with /etc/oratab/ entyr of the linux machine.
Automatic shutdown we can't configure in the entry.

3.       You have written a script to take backups. How do you make it run automatically every week?
corntab
4.       What is OERR utility?
The oerr utility (Oracle Error) is provided only with Oracle databases on  UNIX  platforms.  oerr is not an executable, but instead, a shell script that retrieves messages from installed message files. Oerr is an Oracle utility that extracts error messages with suggested actions from the standard Oracle message files. This utility is very useful as it can extract OS-specific errors that are not in the generic Error Messages and Codes Manual.
5.       How do you see Virtual Memory Statistics in Linux?
vmstat reports information about processes, memory, paging, block IO, traps, and cpu activity.
6.       How do you see how much hard disk space is free in Linux?
df -lh
7.       What is SAR?
The sar command writes to standard output the contents of selected cumulative activity counters in the operating system
8.       What is SHMMAX?
SHMMAX is the maximum size of a shared memory segment on a Linux system
9.       Swap partition must be how much the size of RAM?
Your swap partition should be at least as big as your RAM size. However it should be double the size of RAM
10.   What is DISM in Solaris?
DISM Dynamic Intimate Shared memory which is used to support oracle in Solaris Envirnoment DISM is only supported from Solaris 9 and above version. On Solaris 9 systems, dynamic/pageable ISM (DISM) is available. This enables Oracle Database to share virtual memory resources between processes sharing the segment, and at the same time, enables memory paging. The operating system does not have to lock down physical memory for the entire shared memory segment.

11.   How do you see how many memory segments are acquired by Oracle Instances?
sga
pga
Db_buffer_cache
Log_buffer_cache
12.   How do you see which segment belongs to which database instances?

13.   What is VMSTAT?
vmstat reports information about processes, memory, paging, block IO, traps, and cpu activity.

14.   How do you set Kernel Parameters in Red Hat Linux, AIX and Solaris?
There are two methods to configure the Kernel parameters in RHEL
1. by using the command "sysctl -w <parameter_name>= <value>
The above command will change the kernel parameters on the fly but the changes are not persistent with system reboots. That is why people always choose the second method to make changes to kernel parameters
2. By editing the file "/etc/sysctl.conf" file
 A. Edit the file "/etc/sysctl.conf" by adding the parameters along with values
B. execute "/sbin/sysctl -p" to make sure that the changes are made using the values inside the above mentioned file.
The advantage with the second method is that the changes are persistent with system reboots.

15.   How do you remove Memory segments?
To remove the shared memory segment, you could copy/paste shmid and execute:
$ ipcrm shm 32768
Another approach to remove shared memory is to use Oracle's sysresv utility.
What is the difference between Soft Link and Hard Link?Soft link:-This is a Symbolic link between files. The actual file or directory must be residing at any available partitions of the harddisk Soft Link is just a shortcut (in windows terms) or link created with a new file name at the working directory or at current working partition of hard disk. Even when you don't require it you can confidently delete this soft link as it doesn't remove the actual file or directory. The reason is the actual file or diretcory's inode is different from the softlink created file's inode in any unix system. Hard link:-It is the replica of the actual file or directory which must be residing at any available partitions. This is a duplicate file copy of it's orginal which can be created at current working partition.When we remove or delete this hardlink it removes the original file or directory too.The reson is they share the same inode in any unix file system.

16.   What is stored in oratab file?
This file is used by ORACLE utilities.  It is created by root.sh and updated by the Database Configuration Assistant when creating a database.
A colon, ':', is used as the field terminator.  A new line terminates the entry.  Lines beginning with a pound sign, '#', are comments.
Entries are of the form:
                $ORACLE_SID:$ORACLE_HOME:<N|Y>:
The first and second fields are the system identifier and home directory of the database respectively.  The third filed indicates to the dbstart utility that the database should , "Y", or should not, "N", be brought up at system boot time.
Multiple entries with the same $ORACLE_SID are not allowed.
17.   How do you see how many processes are running in Unix?
ps -e|cut -d " " -fname|wc -l
18.   How do you kill a process in Unix?
Linux and all other UNIX like oses comes with kill command. The command kill sends the specified signal (such as kill process) to the specified process or process group. If no signal is specified, the TERM signal is sent.  Kill process using kill command under Linux/UNIX. kill command works under both Linux and UNIX/BSD like operating systems.
19.   Can you change priority of a Process in Unix?
As system administrator you can use the renice command to change the priority of a process all processes of a user or all processes belong to a group of users. The renice command has the form
/etc/renice priority [ [ -p ] pid ... ] [ [ -g ] pgrp ... ] [ [ -u ] user

3 comments:

  1. I really love reading and following your post as I find them extremely informative and interesting. This post is equally informative as well as interesting . Thank you for information you been putting on making your site such an interesting. I gave something for my information. Interview Preparation

    ReplyDelete
  2. Thank you. This is very useful info.

    ReplyDelete

Note: Only a member of this blog may post a comment.