Posts

Showing posts from October, 2016

Oracle Interview Questions&Answers Part 4

Image
How does one see the uptime for a database? (for DBA ) Look at the following SQL query: SELECT to_char (startup_time,'DD-MON-YYYY HH24: MI: SS') "DB Startup Time" FROM sys.v_$instance; Marco Bergman provided the following alternative solution: SELECT to_char (logon_time,'Dy dd Mon HH24: MI: SS') "DB Startup Time" FROM sys.v_$session WHERE Sid=1 /* this is pmon */ / Users still running on Oracle 7 can try one of the following queries: Column STARTED format a18 head 'STARTUP TIME' Select C.INSTANCE, to_date (JUL.VALUE, 'J') || to_char (floor (SEC.VALUE/3600), '09') || ':' -- || Substr (to_char (mod (SEC.VALUE/60, 60), '09'), 2, 2) || Substr (to_char (floor (mod (SEC.VALUE/60, 60)), '09'), 2, 2) || '.' || Substr (to_char (mod (SEC.VALUE, 60), '09'), 2, 2) STARTED from SYS.V_$INSTANCE JUL, SYS.V_$INSTANCE SEC, SYS.V_$THREAD C Where JUL.KEY like '%JULIAN%' and SEC.KEY like '%

Oracle Interview Questions&Answers Part 3

Image
Define Transaction ? A Transaction is a logical unit of work that comprises one or more SQL statements executed by a single user. What is Read-Only Transaction ? A Read-Only transaction ensures that the results of each query executed in the transaction are consistant with respect to the same point in time. What is a deadlock ? Explain . Two processes waiting to update the rows of a table which are locked by the other process then deadlock arises. In a database environment this will often happen because of not issuing proper row lock commands. Poor design of front-end application may cause this situation and the performance of server will reduce drastically. These locks will be released automatically when a commit/rollback operation performed or any one of this processes being killed externally. What is a Schema ? The set of objects owned by user account is called the schema. What is a cluster Key ? The related columns of the tables are called the cluster key. The cluste

Oracle Interview Questions&Answers Part 2

Image
Can a view based on another view? Yes. What are the advantages of views? - Provide an additional level of table security, by restricting access to a predetermined set of rows and columns of a table. - Hide data complexity. - Simplify commands for the user. - Present the data in a different perspective from that of the base table. - Store complex queries. What is an Oracle sequence? A sequence generates a serial list of unique numbers for numerical columns of a database's tables. What is a synonym? A synonym is an alias for a table, view, sequence or program unit. What are the types of synonyms? There are two types of synonyms private and public. What is a private synonym? Only its owner can access a private synonym. What is a public synonym? Any database user can access a public synonym. What are synonyms used for? - Mask the real name and owner of an object. - Provide public access to an object - Provide location transparency for tables, views or program units of a remote dat

Oracle Interview Questions&Answers Part 1

Image
What are the components of physical database structure of Oracle database? Oracle database is comprised of three types of files. One or more datafiles, two are more redo log files, and one or more control files. What are the components of logical database structure of Oracle database? There are tablespaces and database's schema objects. What is a tablespace? A database is divided into Logical Storage Unit called tablespaces. A tablespace is used to grouped related logical structures together. What is SYSTEM tablespace and when is it created? Every Oracle database contains a tablespace named SYSTEM, which is automatically created when the database is created. The SYSTEM tablespace always contains the data dictionary tables for the entire database. Explain the relationship among database, tablespace and data file ? Each databases logically divided into one or more tablespaces one or more data files are explicitly created for each tablespace. What is schema? A schema is

.Net and Com Interview Questions&Answers

Image
Describe the advantages of writing a managed code application instead of unmanaged one. What’s involved in certain piece of code being managed? The advantages include automatic garbage collection, memory management, support for versioning and security. These advantages are provided through .NET FCL and CLR, while with the unmanaged code similar capabilities had to be implemented through third-party libraries or as a part of the application itself. Are COM objects managed or unmanaged? Since COM objects were written before .NET, apparently they are unmanaged. Any code not written in the Microsoft .NET framework environment is UNMANAGED. So naturally COM+ is unmanaged because it is written in Visual Basic 6. So can a COM object talk to a .NET object? Yes, through Runtime Callable Wrapper (RCW) or PInvoke. How do you generate an RCW from a COM object? Use the Type Library Import utility shipped with SDK. tlbimp COMobject.dll /out:.NETobject.dll or reference the COM library

.Net Deployment Interview Questions&Answers

Image
What do you know about .NET assemblies? Assemblies are the smallest units of versioning and deployment in the .NET application. Assemblies are also the building blocks for programs such as Web services, Windows services, serviced components, and .NET remoting applications. What’s the difference between private and shared assembly? Private assembly is used inside an application only and does not have to be identified by a strong name. Shared assembly can be used by multiple applications and has to have a strong name. What’s a strong name? A strong name includes the name of the assembly, version number, culture identity, and a public key token. How can you tell the application to look for assemblies at the locations other than its own install? Use the directive in the XML .config file for a given application. should do the trick. Or you can add additional search paths in the Properties box of the deployed application. How can you debug failed assembly binds? Use the Assembl

.Net Database Interview Questions&Answers Part 2

Image
What is the purpose of using COLLATE in a query? Answer1. Collation refers to a set of rules that determine how data is sorted and compared. Character data is sorted using rules that define the correct character sequence, with options for specifying case-sensitivity, accent marks, kana character types and character width. Answer2. COLLATE is a clause that can be applied to a database definition or a column definition to define the collation, or to a character string expression to apply a collation cast. What is one of the first things you would do to increase performance of a query? For example, a boss tells you that “a query that ran yesterday took 30 seconds, but today it takes 6 minutes”? Answer1. Use Storedprocedure for any optimized result, because it is an compiled code. Answer2. One of the best ways to increase query performance is to use indexes. What is an execution plan? When would you use it? How would you view the execution plan? The Query Analyzer has a fe

.Net Database Interview Questions&Answers Part 1

Image
To test a Web Service you must create a windows application or web application to consume this service? It is True/False? FALSE How many classes can a single.NET DLL contain? Answer1: As many Answer2: One or more What are good ADO.NET object(s) to replace the ADO Recordset object? The differences includes In ADO, the in-memory representation of data is the recordset. In ADO.net, it is the dataset A recordset looks like a single table in ADO In contrast, a dataset is a collection of one or more tables in ADO.net ADO is designed primarily for connected access ADO.net the disconnected access to the database is used In ADO you communicate with the database by making calls to an OLE DB provider. In ADO.NET you communicate with the database through a data adapter (an OleDbDataAdapter, SqlDataAdapter, OdbcDataAdapter, or OracleDataAdapter object), which makes calls to an OLE DB provider or the APIs provided by the underlying data source. In ADO you cant update the database from

.Net Interview Questions&Answers Part 3

Image
53. Can you configure a .NET Remoting object via XML file? Yes, via machine.config and application level .config file (or web.config in ASP.NET). Application-level XML settings take precedence over machine.config. 54. How can you automatically generate interface for the remotable object in .NET with Microsoft tools? Use the Soapsuds tool. 55. What is Delegation? A delegate acts like a strongly type function pointer. Delegates can invoke the methods that they reference without making explicit calls to those methods. Delegate is an entity that is entrusted with the task of representation, assign or passing on information. In code sense, it means a Delegate is entrusted with a Method to report information back to it when a certain task (which the Method expects) is accomplished outside the Method's class. 56. What is "Microsoft Intermediate Language" (MSIL)? A .NET programming language (C#, VB.NET, J# etc.) does not compile into executable code; instead it

.Net Interview Questions&Answers Part 2

Image
18. What is a Strong Name? A strong name consists of the assembly's identity its simple text name, version number, and culture information (if provided) plus a public key and a digital signature. It is generated from an assembly file (the file that contains the assembly manifest, which in turn contains the names and hashes of all the files that make up the assembly), using the corresponding private key. Assemblies with the same strong name are expected to be identical. Strong names guarantee name uniqueness by relying on unique key pairs. No one can generate the same assembly name that you can, because an assembly generated with one private key has a different name than an assembly generated with another private key. When you reference a strong-named assembly, you expect to get certain benefits, such as versioning and naming protection. If the strong-named assembly then references an assembly with a simple name, which does not have these benefits, you lose the b