Vous êtes sur la page 1sur 13

What is a deadlock? Explain.

Deadlock is critical condition, it is a restriction or locking of putting on data in table when one transaction is being under operation on a record. Suppose We are inserting a record into the table that table is being put under lock. This does not mean that no one can see the record from the table but this means no one can apply any Data Manipulation Work to that table. Same time any changes made to that table will not be seen until the record have been committed or finished. Once the record is Committed the Deadlock is released from that table. Can objects of the same schema reside in different tablespaces Yes, schema objects can stored in different tablespace. You can mentioned the tablespace name while you creating an object in order to store the table in different tablespace. If you don not mention the tablespace name while you creating an object, that object will be stored in default tablespace. What is ORA-1555? Its an snapshot too old error. If the data requested by the user is not in the undo segment then the oracle throws an ora-1555 . This can be avoided by increasing the undo_retention parameter. Can we decrease the Datafile size? You can reduce the size of the datafile till the high watermark of the datafile. IF we have to bring down the high watermark then we have to check the extents in the file and reorganize objects as required.

You can decrease the size of datafile by using the below command. alter database datafile 'datafile name' resize size;

Whats the difference between indexes,views,synonyms? An index is a method of allowing faster retrieval of records. A view is an virtual table formed using a single table or one or more tables.

A synonym is an alternative name for objects such as tables, views, sequences, stored procedures, and other database objects Do you need a commit after DDL statements? DDL commands are auto commited commands, after DDL job execution no need to commit again What are the basic element of base configuration of an Oracle database It consists of one or more data files. one or more control files. two or more redo log files. The Database contains multiple users/schemas one or more rollback segments one or more tablespaces Data dictionary tables User objects (table,indexes,views etc.,) The server that access the database consists of SGA (Database buffer, Dictionary Cache Buffers, Redo log buffers, Shared SQL pool) SMON (System MONito) PMON (Process MONitor) LGWR (LoG Write) DBWR (Data Base Write) ARCH (ARCHiver) CKPT (Check Point) RECO Dispatcher User Process with associated PGS How do you handle exceptions / errors in stored procedures? Exceptions can be handled in various ways in the stored procedures. Method (1) could be using EXCEPTION block in theprocedure within which use WHEN <exceptionname> THEN. Method (2) could be declare a variable in DECLARE section as EXCEPTION type, raise it wherever required using RAISE <exception variable name> and handle it in EXCEPTION part using WHEN clause. Method (3) could be using the keywords SQLCODE & SQLERRM to display error no and error code.. What does a control file contains information about the database,redologfile and datafile,archivelog file location and current scn no and redo log file

1. 2. 3. 4. 5. 6. 7. 8. 9.

Database name and identifier. Time stamp of database creation. Tablespace names. Backup information. Checkpoint information. Current online redo log file sequence number. Name and locations of datafiles and redolog files. Begin and end of undo segments. Redolog archive information.

What is the use of control file Control file is binary file which is having all the information realted to database. db_name, maxlogfiles, maxdatafiles, tablespaces information. Without this u cannot open your database. Init.ora parameter file showing the location of the controlfile.

1.Control file is a binary file. 2.Control file containing information necessary to maintain and verify database integrity. 3.Defines current state of physical database. 4.Required at mount state during database startup. What are Schema Objects A schema is a collection of database objects. A schema is owned by a database user and has the same name as that user.Schema objects are logical structures created by users. Objects may define areas of the database to hold data, such as tables or indexes, or may consist just of a definition, such as a views or synonyms. There is no relationship between a tablespace and a schema. Objects in the same schema can use storage in different tablespaces, and a tablespace can contain data from different schemas. Schema objects can be created and manipulated using SQL. As an administrator, you can create and manipulate schemaobjects, just as you do with the logical and physical structures of your database using Oracle Enterprise Manager. The underlying SQL is generated for you by Oracle Enterprise Manager. What are the different types of segments Different types of segment in oracle >data segments. >index segments. >temporary segments. >undo segments. What rule optimizations are possible in SQL query tuning?

FIRST_ROWS LAST_ROWS FIRST_ROWS_10 FIRST_ROWS_100 FIRST_ROWS_1000 ALL_ROWS What are the components of physical database structure of Oracle database physical components of oracle database are control files,redo log files and datafiles. Control file: control file is read in the mount state of database. control file is a small binary file which records the physicalstructure of database which includes database name names and locations of datafiles and online redo log files. timestamp of database creation check point information current log sequence number. Redo log files: This files saves all the changes that are made to the database as they occur. This plays a great role in thedatabase recovery. Datafiles:datafiles are the physicalfiles which stores data of all logical structure. What is a cursor? Why do you need them? What are the different kinds of cursor? oracle uses private sql area to execute sql queries and store the information.pl/sql uses cursors to name these private sql area and access its stored information there r two types of cursors implicit explicit implicit cursors are used for all dml and single row queries.these are system defined explicit cursors are used for queries which return multiple row .these are user defined. What are the types of synonyms A synonym is an alternative name for objects such as tables, views, sequences, stored procedures, and other database objects. A synonym (synonym-name) is an alias for an object (such as a table). The object does not need to exist at the time of its creation. Synonyms can't be used in a drop and truncate statements. If this is tried, it results in a ORA-00942: table or view does not exist The syntax for creating a synonym is:

create [or replace] [public] synonym [schema .] synonym_name for [schema .] object_name [@ dblink]; The or replace phrase allows you to recreate the synonym (if it already exists) without having to issue a DROP synonym command. The public phrase means that the synonym is a public synonym and is accessible to all users. Remember though that the user must first have the appropriate privileges to the object to use the synonym. The schema phrase is the appropriate schema. If this phrase is omitted, Oracle assumes that you are referring to your own schema. The object_name phrase is the name of the object for which you are creating the synonym. It can be one of the following: table package view materialized view sequence java class schema object stored procedure user-defined object function synonym Is it possible to disable the connection sys as sysdba. If yes, does violates oracle 9i Any attempts would be appreciated There is no possibilities of disabling the connection as sysdba because sys is the owner of the database who has all the powers of the database so you can disable the account of sys what u can do is you can change the password and restrict the access of the password by the password file to the Server itself. What are the uses of rollback segment The use of RollBack Segment is >support for Rollback Operations >Support Read-consistent and flashback queries, >Recovery from failed transactions. What is a synonym Synonym, as the name suggests, is an alternative name for an object. It can be used for simplifying names that are lenghy or complex, for e.g you can use a simple synonym for accessing objects of other users, for which you had to prefix username to the object. What is Parallel Server ? Multiple instances accessing the same database (Only In Multi-CPU environments)

Different types of table join. -Cartesian Product or Cross Join -Inner Join -Equi Join or Natural Join -Non Equi Join -Self Join -Outer Join -Left Outer Join -Right Outer Join -Full Outer Join

What is the difference between DATABASE ADMINISTRATION & ORACLE? database administration is an act of organising and managing database whereas oracle is a software used to create a rdbms database Name some built-in functions that can be used in SQL queries? There are six basic types of built-in functions

Character functions analyze and modify the contents of CHAR and VARCHAR2 string variables. Numeric functions are a full range of operations that manipulate numbers, including trigonometric, logarithmic, and exponential functions. Date functions are utilities that allow programmers to perform high-level actions on date variables, including date arithmetic. Conversion functions convert from one datatype to another, often formatting the output data at the same time. LOB functions allow operations on LOB (large object) data. Miscellaneous functions perform operations that don't fall into any of the other categories.

Example of built in functions: 1. to_date - a convertion function that will convert a string date to a date datatype 2. sum - a group function that will return the summation of all values in the column 3. upper - a single row function that will return all characters in a column in upper case What is private database link

You can create a private database link in a specific schema of a database. Only the owner of a private database link or PL/SQL subprograms in the schema can use a private database link to access data and database objects in the corresponding remote database. A private database link is more secure than a public or global link, because only the owner of the private link, or subprograms within the same schema, can use the private link to access the specified remote database. To create a private database link, you specify: CREATE DATABASE LINK ...; What is public database link You can create a public database link for a database. All users and PL/SQL subprograms in the database can use a public database link to access data and database objects in the corresponding remote database. When many users require an access path to a remote Oracle database, an administrator can create a single public database link for all users in a database. CREATE PUBLIC DATABASE LINK ...; How can you find all the tables created by an user? This could be found through 1. select table_name from sys.dba_tables where owner='specified user' 2. select * from cat; 3.select * from sys.dba_objects where owner ='specified owner' What is row chaining When data in a table do not fit in single block,than oracle store that data in chain of block. This is what row chaining is actually. What are the components of logical database structure of Oracle database Tablespace, segments, extens, data Blocks. A logical unit of storage of databse is called Tablespace. Segments is a space alloocated for a specific logical storage structure within a tablespce. Extents: Space allocated to a segments. Datablocks: Oracle server manage the storage space in the datafiles in units is called

data blocks or oracle blocks. What is an index segment Oracle creates the index segment for an index or an index partition when you issue the CREATE INDEX statement. In this statement, you can specify storage parameters for the extents of the index segment and a tablespace in which to create the index segment. (The segments of a table and an index associated with it do not have to occupy the same tablespace.) Setting the storage parameters directly affects the efficiency of data retrieval and storage What are synonyms used for Synonyms are used to : 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 database. Simplify the SQL statements for database users. What is an extent An Extent is a collection of contagious blocks

the second level of granuality of the storage in database is called extent.it is defined as the collectionof contagious datablocks. What is a database instance and Explain A database instance (Server) is a set of memory structure and background processes that access a set of database files. The process can be shared by all users. The memory structure that are used to store most queried data from database. This helps up to improve database performance by decreasing the amount of I/O performed against data file. What is network database link When an Oracle network uses Oracle Names, the names servers in the system automatically create and manage global database links for every Oracle database in the network. All users and PL/SQL subprograms in any database can use a global database link to access data and database objects in the corresponding remote database.

Do a view contain data A view does not contain any data of its own, but is like a window through which data from other tables can be viewed and changed. What is clusters ? Group of tables physically stored together because they share common columns and are often used together is called Cluster. What is a lookup table in database? where can we use these type of table? Lookup tables are like constraints which hold a value. The content in the lookup tables dosen't change often, hence refered as lookup (reference). Example : Countries table Countries are not added on regular bases hence one can consider the table as a lookup table. As and when needed in some other table the countries information can be fetched base on PK - Country-Code column. Eg - Emp_Per_Info.

look up table contains static data foreign key is best example of it What is a datafile Datafile is the physical storage unit of oracle database. It's contains actual data in the database. This is the repository for schema object data. Explain the relationship among database, tablespace and data file.What is schema Databases, tablespaces and datafiles are closely related, but they have important differences: --- A Oracle Database consists of one or more tablespaces --- Each Table space in an Oracle database consists of one or more files called datafiles. --- A database's data is collectively stored in the datafiles that constitute each tablespace of the database. What Is a Initialization Parameter File in Oracle? An initialization parameter file is a text file that contains a list of initialization parameters. The file should be written in the client's default character set. Sample initialization parameter files are provided on the Oracle distribution

medium for each operating system. A sample file is sufficient for initial use, but you will probably want to modify the file to tune the database for best performance. Any changes will take effect after you completely shut down and restart the instance. What Is a Dynamic Performance View in Oracle? Oracle contains a set of underlying views that are maintained by the database server and accessible to the database administrator user SYS. These views are called dynamic performance views because they are continuously updated while a database is open and in use, and their contents relate primarily to performance. Although these views appear to be regular database tables, they are not. These views provide data on internal disk structures and memory structures. You can select from these views, but you can never update or alter them.

Source : http://www.coolinterview.com/type.asp?order=3&iType=54&iDBLoc=40 What is a cluster key What is an index and How it is implemented in Oracle database What are the types of database links Whenever a DBA creates a user in which datafile that will be get created ? Is it advisable to force an index when you want to select mostof the entries in the table? How are the index updates What is the use of redo log information What is a Database instance ? Explain 1)What ll be in the redolog file after deleting the table ,will it stores the table or any thing else? 2)Can we resize the redolog files? What are clusters If you have an open cursor on a table, modify the same tableand commit, what would happen? What is index cluster What is Oracle table What is a Schema ? What is the function of redo log What is a cluster Key ? What is an Oracle view What is a deadlock and Explain When can hash cluster used What is an Oracle sequence

View Answer What is Parallel Server What is a temporary segment What is an Index ? How it is implemented in Oracle Database ? Can a tablespace hold objects from different schemes What is a tablespace What is the relation between free list and buffer busy wait? How is locking implemented? What is hash cluster What is Program Global Area (PGA) in Oracle? What is SYSTEM tablespace and when is it created How would you pass hints to the SQL processor? What is a public synonym What are the advantages of views What is database link How do you sort a table? What is data block What are clusters What is a private synonym What is a data segment What is System Global Area (SGA) in Oracle? View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View

Answer What is a segment How to define data block size What is DDL, DML? What are the characteristics of data files Can a view based on another view What are the basic element of Base configuration of an oracle Database ? What is a Database Schema in Oracle? What is an Oracle index What is rollback segment What is cluster key What is a redo log What Is SQL*Plus? An Oracle data file is a big unit of physical storage in the OS file system. One or many Oracle data files are organized together to provide physical storage to a single Oracle tablespace. What Is a Recycle Bin in Oracle? What Is a Database Table in Oracle? What Is an Oracle Tablespace? What Is a User Role in Oracle? What Is a Table Index in Oracle? What Is an Oracle Data File? What Is Oracle? View View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer View Answer

Answer What Is an Oracle Database? What Is the Relation of a User Account and a Schema in Oracle? What Is a User Account in Oracle? What Is an Oracle Instance? What Is a Parameter File in Oracle? What Is a Server Parameter File in Oracle? View Answer View Answer View Answer View Answer View Answer View Answer