Shell scripting interview questions


Shell scripting has emerged from automation of normal day to day operational task of system administrator, network administrator, database administrator all the way upto bigdata these days. Shell scripting interview questions are going to be integral part of DBA interview, sys admin interview, bigdata interview, netwrk admin interview, production support interview, build script creation team interview, upgrade script creation team interview and many more. Start preparing for the upcoming interview using our shell scripting interview questions and answers
1) What does $# mean in shell environment?
In a shell script mainly bash shell it is common to see if a parameter has been passed to the code. To check this $# eq command is used. Eg: if [$# eq 2]; then means is two positional parameters have been passed during script execution
2) How does a bach script start?
#!/bin/bash
3) What does $0 mean in bash shell script?
In bash shell environment $0 is a special parameter that means the name of the shell if used in command prompt, name of shell script if used within shell script
4) How will you exit a bash shell?
Using command exit 1

Free Oracle Database Articles, Tips, Jobs :

Delivered by FeedBurner


Oracle startup command parameter and its usage


Oracle startup command is the basic and essentially important command that starts your oracle database in-turn your DBA career internally. Lets see many different parameters that can be used with oracle startup command
startup – Normal mode that starts the oracle instance and brings up the database
startup pfile – If the parameter file is in a location that is not default location then it becomes mandatory to specify the pfile location. This file contains parameters needed to create and start an oracle instance, mount and open an oracle database
startup spfile – If the parameter file is binary file instead of normal parameter file specify spfile location
startup force – This force parameter is typically used to troubleshoot startup issues. Once force is issued the instance is shutdown with ABORT option and instance is restarted
startup quiet – Typically when an instance is started with a parameter other than quiet SGA informaiton including buffer allocated for many different parameters are displayed. If quiet parameter is used the SGA informaiton displayed will be supressed during system startup
startup restrict – During maintenance users with special privilege called as restricted session privilege can access database. To make this happen bring up database using restrict option
startup upgrade – Once an oracle home binary is upgraded in os level the next step is to upgrade a database. Ideally database would have been in earlier version. To bring it up the database should be opened in startup upgrade mode. In most cases catalog upgrade script catupgrd.sql is run after database is started in upgrade mode
startup downgrade – Used to bring up a database during downgrading of database
startup open – In most cases open parameter need not be specified as startup is equivalent to startup open command. The functionality is going to be starting of background processes, memory allocation followed by control file access based on which online redo log files and datafiles are checked for consistency and opened
startup open readonly – This option is typically used in dataguard setup. The functionality is opening database for read only reporting, backup purposes. This database is not accessible for DML transactions
startup open recover – IF the instance had crashed earlier the next time an instance is opened this needs a media recovery. For this purpose recover option with startup command comes handy
startup mount – This startup command option brings up oracle database instance including allocation of memory, starts background processes, reads control files. The database is not opened. Typically to enable archived redo log mode the database should be in archived redo log mode. Once the archiving is enabled database can be opened . For maintenance operations database is opened in mount mode
startup nomount – The background processes are started, memory is allocated but control files are not opened or read
As with startup command used for starting and normal functioning of database operations, a database can be brought own using shutdown command. Following are list of parameter options that are used with shutdown command
normal
transactional
transactional local
immediate
abort

Free Oracle Database Articles, Tips, Jobs :

Delivered by FeedBurner

FRM Exam Preparation AIM Series 1

FRM AIM: Differentiate between an open outcry system and electronic trading
FRM AIM: Differentiate between an open outcry system and electronic trading

Properties Open Outcry System Electronic Trading
Definition Trading done through actual shouting and hand signals Trading done via computers
Physical Exchange location Yes No
Example CBOT NASDAQ

FRM AIM; Within operational risk (a)describe the potential relationships between operational, market and credit risk (b)describe model risk and its sources (c)describe people risk (d)describe legal risk and its sources
Relationship between operational, market and credit risk:

Operational risk occurs because of poor management decisions, poor management control, rogue traders, wrong model usage in analyzing risk
Because of losses arising out of operational risk credit ratings of the firm may be hit that causes credit risk
Because of the credit risk for the firm its value of the securities in the market will decrease resulting in market risk
Model Risk:

Arises because of application of wrong models in assessing risk
Ex: Prices used in assessing risk in a model may be wrong which might lead to an indication of lower risk for a particular security where the actual risk of security performance is quite low
People Risk:

Risk because of rogue traders who may have falsified reports about the financial status of the company during audit
Risk because of powerful people in the company using their position to sufficiently expose the firm by buying underperforming derivatives
Legal Risk:

Loss in value of the firm caused by fighting lawsuits, penalties/damage claims etc
Ex: Samsung payment of more than 1 billion dollar for infringing the patent held by apple
Drug companies settlement to patients because of the drug introduced by these companies causing side effects to the patients
FRM AIM: Within market risk: (a)Describe and differentiate between absolute and relative risk (b)Describe and differentiate between directional and non- directional market risk (c)Describe basis risk and its sources (d)Describe volatility risk and its sources
Absolute vs Relative Risk:

Properties Absolute Risk Relative Risk
Definition Focus on Volatility of Total Returns Focus on volatility of returns relative to portfolio or a benchmark index
Advantages Gives total losses Gives relative losses and there is risk comparison to other risk (Tracking error relative to benchmark index)
Disadvantages There is no risk comparison to other risk Tells nothing about actual risk

 

Directional vs Non Directional Risk:

Properties Directional Risk Non-Directional Risk
Definition Linear exposure to economic or financial variables Non-Linear exposures to economic or financial variables
Example Interest rates Basis Risk, Volatilities

 

Basis Risk:

  • Arises because of the imperfect correlation between the price of the hedging instrument and the assets being hedged
  • Ex: Hedging of bonds against treasury bills

Volatility Risk:

  • Risk of loss arising from actual or implied volatility of market prices
  • Ex: Political instability, investor uncertainty, interest rate changes

FRM AIM: Compare and Contrast valuation and risk management, using VAR as an example
PropertiesValuationVARPurposeDetermine current price of assetDetermine possible future distributions of assetLooks atCurrent PriceFuture PriceFocus in distributionMean of distributionTail end of distributionsWhat Type of Distribution is usedCurrentHistoricalIs the Analysis preciseYesNo (As long as the model is not biased errors tend to offset each other)

No

NoYesYesCorrelation between risk factors

No

NoNoYesQuantify Risk Factors

No

NoNoYesEase of Calculation and Explanation

Yes

YesNoNoCan it be applied across assets

Yes

NoNoYes
FRM AIM: Define Value at Risk (VAR) and how it is used in risk management
Value at Risk (VAR) is defined as:
•  Measure of loss over a defined period of time at a particular confidence level in normal market conditions
•  VAR is used in financial control, financial reporting, regulatory capital

Methods of Calculating VAR:
•  Historical Method
•  Variance-Covariance Method
•  Monte Carlo Simulation”,”FRM AIM: Define Value at Risk (VAR) and how it is used in risk management
FRM AIM: Explain how expected return and returns variance are used to describe the return distribution for a security or portfolio of securities – Part I
FRM AIM : Within operational risk (a)describe the potential relationships between operational, market and credit risk (b)describe model risk and its sources (c)describe people risk (d)describe legal risk and its sources:
Exposure vs Recovery Rate:

Properties Exposure Recovery Rate
Definition Size or value of loss that would happen when credit event occurred Recovery of partial losses through sale of assets after loss has occurred
Value This will include full value of losses Fraction of the losses

Credit Event:

  • Changes in the counterparty ability to fulfill financial obligations that was previously agreed upon
  • Credit Event can occur because of market or credit risk
  • Sovereign risk that occur because of country specific actions can lead to credit event
  • Ratings agencies like Moody’s, Standard & Poor have ratings that issues guidelines on companies performance and position to meet the financial obligations from time to time

 Settlement Risk:

  • Counterparty fails to deliver its obligation after opposite party has made the delivery as agreed upon
  • Risk of full losses because of settlement risk
  • Pre settlement risk can mitigate the effects of the settlement risk because of payment before delivery

FRM AIM: Within credit risk (a) Describe and differentiate between exposure and recovery rate (b)describe credit event and how it may relate to market risk (c)describe sovereign risk and its sources (d) describe settlement risk and its sources:
Exposure vs Recovery Rate:

Properties Exposure Recovery Rate
Definition Size or value of loss that would happen when credit event occurred Recovery of partial losses through sale of assets after loss has occurred
Value This will include full value of losses Fraction of the losses

 

Credit Event:

  • Changes in the counterparty ability to fulfill financial obligations that was previously agreed upon
  • Credit Event can occur because of market or credit risk
  • Sovereign risk that occur because of country specific actions can lead to credit event
  • Ratings agencies like Moody’s, Standard & Poor have ratings that issues guidelines on companies performance and position to meet the financial obligations from time to time

 Settlement Risk:

  • Counterparty fails to deliver its obligation after opposite party has made the delivery as agreed upon
  • Risk of full losses because of settlement risk
  • Pre settlement risk can mitigate the effects of the settlement risk because of payment before delivery

FRM AIM: Within liquidity risk, describe and differentiate between asset and funding liquidity risk:
Asset vs Funding Liquidity Risk:

Properties Asset Liquidity Risk Funding Liquidity Risk
Definition Large size of transactions influence the price of securities Firms unable to raise cash to meet its debt requirements
Other Names of this type of risk Market or trading liquidity risk Cash Flow Risk
Mitigation Efforts Limiting the size of the transactions Rules/Regulations can be put in place to have sufficient cash deposit as a guarantee to mitigate this type of risk

Oracle Database RMAN Defaults List


Oracle database RMAN (Recovery Manager) has some default settings. To get to know details of RMAN defaults, use show all command. Connect to target database and issue the command
$rman target /
RMAN> show all;
using target database control file instead of recovery catalog
RMAN configuration parameters for database with db_unique_name onlinetutelage are:
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP OFF; # default
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO ‘%F’; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM ‘AES128’; # default
CONFIGURE COMPRESSION ALGORITHM ‘BASIC’ AS OF RELEASE ‘DEFAULT’ OPTIMIZE FOR LOA
D TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
CONFIGURE SNAPSHOT CONTROLFILE NAME TO ‘C:APPUSERPRODUCT11.2.0DBHOM
E_3DATABASESNCFlr.ORA’; # default
RMAN>
The output shows that control file of the target database is used instead of recovery catalog.