Monday, July 30, 2007

Some Cooool fundermentral Questions .. ;) Part - 1


. Describe the difference between a procedure, function and anonymous pl/sql block.

Answer

Procedure:It does not return any value.Used to perform to execute mutiple sql statement for solving a particular business rule.

Function:It always returns a value.

Anonymous pl/sql block:pl/sql block which does not contain any name.consisting of declare,begin/end or exception section.Like

when u declare a cursor it does not required to give name for particular pl/sql block.

2. Describe the use of %ROWTYPE and %TYPE in PL/SQL

Answer

%Type:It determinies the datatype of the particular column for which the varible will be used.

%RowType:It inherits all the datatype of the all column for that particular row.

3. How can you find within a PL/SQL block, if a cursor is open?

Answer

Using attribute isopen If it return true value then u can determine that the cursor is open

DBA:

1. Give one method for transferring a table from one schema to another:

drop table t1 purge;

create table t1 as select * from t2 where 1=2;

2. What is the purpose of the IMPORT option IGNORE? What is its default setting?

Answer

Import:It basically use for transfering data from one database to anothe database or take one table's data and insert to another table.

Ignore:It basically use for at the time of performing pl/sql statement if an sql statement perform unwanted operation then using the ignore

statement with out rasing exception u can complete ur pl/sql operation

It is useful suppose u inser 1000000 rows into a table theninbetween them if some of rows violate insert operation then if u want except them to complete ur insert operation then using ignore operator u caneasily do that.

3. How can you tell if a database object is invalid?

Answer

select * from dba_object where name='object name'-----if it returns 0 result then object is invalid

SQL/ SQLPlus

1. How do you execute a host operating system command from within SQL?

Answer

2. What SQLPlus command is used to format output from a select?

set operator is used to format output from a select

3. What is the default ordering of an ORDER BY clause in a SELECT statement?

asending order

UNIX:

1. How can you determine the space left in a file system?

Answer

2. Can you remove an open file under UNIX?

Answer

using rm operator

3. What is the purpose of the grep command?

Answer

to search a data in that particular text.

Unix Shell Script

1. How to trap the error on the shell prompt.

2. How to pass the arguments to shell script

3. How to set the shell type in shell script

Friday, July 20, 2007

Give a bulletproof jacket to your DB ;) !

Guys! sorry I took a little more time to come back from hibernation...anyway from now let me try to continue with regular articles or knowledge transfer....


There are things that we, too, can do to lessen the possibility of data loss, minimize downtime and make our databases more bulletproof, such as those described below:

  1. Enable archivelog mode .
  2. Separate the archive logs from the redo logs
  3. Separate the redo logs and archive logs from the datafiles.
  4. Multiplex (mirror) the redo log groups and members.
  5. Multiplex (mirror) the control file.
  6. Multiplex (mirror) the archive log files.