Explore topic-wise InterviewSolutions in .

This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.

551.

What Is A Resource Consumer Group?

Answer»

A RESOURCE CONSUMER group is USED to group together similar users BASED on their resource NEEDS.

A resource consumer group is used to group together similar users based on their resource needs.

552.

What Are The Four Elements Of A Database Resource Manager?

Answer»

Database RESOURCE MANAGER is composed of the following FOUR elements : Resource consumer group, resource plan,resource allocation method,resource plan directive.

Database resource manager is composed of the following four elements : Resource consumer group, resource plan,resource allocation method,resource plan directive.

553.

Can We Switch Users Between Resource Consumer Groups/consumer Groups?

Answer»

DBA's can AUTOMATICALLY switch users from one RESOURCE group to another ,based on preset resource usage CRITERIA,and can LIMIT the amount of undo space a resource group can use.

DBA's can automatically switch users from one resource group to another ,based on preset resource usage criteria,and can limit the amount of undo space a resource group can use.

554.

What Are The Uses Of A Database Resource Manager?

Answer»

1) The database resource manager enables us to limit the length of time a user session can STAY idle and to automatically TERMINATE long-running SQL statements and user SESSIONS.
2) USING the database resource manager we can set initial login priorities for various consumer groups. 
3) By using the concept of active session pool,we can specify the maximum number of concurrent active sessions for a consumer group-the Database resource manager will automatically queue all the subsequent requests until the currently running sessions complete.

1) The database resource manager enables us to limit the length of time a user session can stay idle and to automatically terminate long-running SQL statements and user sessions.
2) Using the database resource manager we can set initial login priorities for various consumer groups. 
3) By using the concept of active session pool,we can specify the maximum number of concurrent active sessions for a consumer group-the Database resource manager will automatically queue all the subsequent requests until the currently running sessions complete.

555.

What Is A Database Resource Manager?

Answer»

Database RESOURCE manager allows us to CREATE resource plans, which specify how much of our resources should go to various consumer groups.We can group users based on their resource REQUIREMENT and we can have the database resource manager allocate a preset amount of resources to these groups.We can easily prioritize our users and jobs.

Database resource manager allows us to create resource plans, which specify how much of our resources should go to various consumer groups.We can group users based on their resource requirement and we can have the database resource manager allocate a preset amount of resources to these groups.We can easily prioritize our users and jobs.

556.

What Is Difference Between Char And Varchar2? What Is The Maximum Size Allowed For Each Type?

Answer»

CHAR pads BLANK spaces to the MAXIMUM length.
VARCHAR2 does not pad blank spaces.
For CHAR the maximum length is 255 and 2000 for VARCHAR2.

CHAR pads blank spaces to the maximum length.
VARCHAR2 does not pad blank spaces.
For CHAR the maximum length is 255 and 2000 for VARCHAR2.

557.

How Many Long Columns Are Allowed In A Table? Is It Possible To Use Long Columns In Where Clause Or Order By?

Answer»

Only ONE LONG column is ALLOWED. It is not POSSIBLE to use LONG column in WHERE or ORDER BY clause.

Only one LONG column is allowed. It is not possible to use LONG column in WHERE or ORDER BY clause.

558.

What Are The Pre-requisites To Modify Datatype Of A Column And To Add A Column With Not Null Constraint?

Answer»

- To modify the DATATYPE of a column the column MUST be empty.
- To ADD a column with NOT NULL constrain, the table must be empty.

- To modify the datatype of a column the column must be empty.
- To add a column with NOT NULL constrain, the table must be empty.

559.

If Unique Key Constraint On Date Column Is Created, Will It Validate The Rows That Are Inserted With Sysdate?

Answer»

It won't, Because SYSDATE FORMAT contains TIME attached with it.

It won't, Because SYSDATE format contains time attached with it.

560.

How To Access The Current Value And Next Value From A Sequence? Is It Possible To Access The Current Value In A Session Before Accessing Next Value?

Answer»

SEQUENCE name CURRVAL, sequence name NEXTVAL. It is not possible. Only if you ACCESS NEXT value in the SESSION, current value can be accessed.

Sequence name CURRVAL, sequence name NEXTVAL. It is not possible. Only if you access next value in the session, current value can be accessed.

561.

If A View On A Single Base Table Is Manipulated Will The Changes Be Reflected On The Base Table?

Answer»

If changes are MADE to the TABLES and these tables are the BASE tables of a view, then the changes will be reference on the view.

If changes are made to the tables and these tables are the base tables of a view, then the changes will be reference on the view.

562.

Display Odd/ Even Number Of Records?

Answer»

Odd NUMBER of records:

SELECT * from emp where (rowid,1) in (select rowid, MOD(rownum,2) from emp);
1
3
5.

EVEN number of records:

select * from emp where (rowid,0) in (select rowid, mod(rownum,2) from emp)
2
4
6.

 

Odd number of records:

Even number of records:

 

563.

Other Way To Replace Query Result Null Value With A Text?

Answer»

SQL> SET NULL ‘N/A’ to RESET SQL> Set NULL.

SQL> Set NULL ‘N/A’ to reset SQL> Set NULL.

564.

What Is The Maximum Number Of Triggers, Can Apply To A Single Table?

Answer»

12 TRIGGERS.

12 triggers.

565.

What Is An Advantage To Using A Stored Procedure As Opposed To Passing An Sql Query From An Application?

Answer»

A stored procedure is pre-loaded in memory for faster execution. It ALLOWS the DBMS control of PERMISSIONS for security PURPOSES. It also eliminates the need to RECOMPILE components when minor changes occur to the database.

A stored procedure is pre-loaded in memory for faster execution. It allows the DBMS control of permissions for security purposes. It also eliminates the need to recompile components when minor changes occur to the database.

566.

When A Query Is Sent To The Database And An Index Is Not Being Used, What Type Of Execution Is Taking Place?

Answer»

A table SCANS.

A table scans.

567.

What Are Different Oracle Database Objects?

Answer»

-TABLES
-VIEWS
-INDEXES
-SYNONYMS
-SEQUENCES
-TABLESPACES etc.

-TABLES
-VIEWS
-INDEXES
-SYNONYMS
-SEQUENCES
-TABLESPACES etc.

568.

What Are Various Privileges That A User Can Grant To Another User?

Answer»

-SELECT.
-CONNECT.
-RESOURCES.

-SELECT.
-CONNECT.
-RESOURCES.

569.

What Is Difference Between Rename And Alias?

Answer»

RENAME is a PERMANENT NAME given to a table or column whereas Alias is a temporary name given to a table or column which do not exist once the SQL STATEMENT is executed.

Rename is a permanent name given to a table or column whereas Alias is a temporary name given to a table or column which do not exist once the SQL statement is executed.

570.

What Is A Outer Join?

Answer»

Outer Join--Its a join CONDITION USED where you can query all the rows of one of the TABLES in the join condition EVEN though they don?t satisfy the join condition.

Outer Join--Its a join condition used where you can query all the rows of one of the tables in the join condition even though they don?t satisfy the join condition.

571.

What Is Oci. What Are Its Uses?

Answer»

ORACLE Call Interface is a method of accesing database from a 3GL program. Uses--No 
precompiler is REQUIRED,PL/SQL blocks are executed like other DML statements. 
The OCI LIBRARY provides 
--functions to parse SQL statemets 
--bind input variables 
--bind output variables 
--EXECUTE statements 
--fetch the results 

Oracle Call Interface is a method of accesing database from a 3GL program. Uses--No 
precompiler is required,PL/SQL blocks are executed like other DML statements. 
The OCI library provides 
--functions to parse SQL statemets 
--bind input variables 
--bind output variables 
--execute statements 
--fetch the results 

572.

How You Open And Close A Cursor Variable.why It Is Required?

Answer»

OPEN cursor VARIABLE FOR SELECT...Statement.
CLOSE cursor variable In order to associate a cursor variable with a particular SELECT statement. OPEN SYNTAX is USED. In order to free the resources used for the QUERY CLOSE statement is used.

OPEN cursor variable FOR SELECT...Statement.
CLOSE cursor variable In order to associate a cursor variable with a particular SELECT statement. OPEN syntax is used. In order to free the resources used for the query CLOSE statement is used.

573.

How Will You Delete Duplicating Rows From A Base Table?

Answer»

DELETE from table_name where ROWID not in (SELECT max(rowid) from table group by 
duplicate_values_field_name); or delete duplicate_values_field_name dv from table_name.
where rowid <(select MIN(rowid) from table_name TB where ta.dv=tb.dv); 

delete from table_name where rowid not in (select max(rowid) from table group by 
duplicate_values_field_name); or delete duplicate_values_field_name dv from table_name.
where rowid <(select min(rowid) from table_name tb where ta.dv=tb.dv); 

574.

Which Is More Faster - In Or Exists?

Answer»

EXISTS is more FASTER than IN because EXISTS RETURNS a Boolean value WHEREAS IN returns a value.

EXISTS is more faster than IN because EXISTS returns a Boolean value whereas IN returns a value.

575.

You Want To Include A Carriage Return/linefeed In Your Output From A Sql Script, How Can You Do This?

Answer»

The best METHOD is to use the CHR() FUNCTION (CHR(10) is a return/linefeed) and the CONCATENATION function "||". Another method, although it is hard to document and isn?t always portable is to use the return/linefeed as a PART of a quoted STRING.

The best method is to use the CHR() function (CHR(10) is a return/linefeed) and the concatenation function "||". Another method, although it is hard to document and isn?t always portable is to use the return/linefeed as a part of a quoted string.

576.

How Can You Find Out How Many Users Are Currently Logged Into The Database? How Can You Find Their Operating System Id?

Answer»

There are several ways. One is to look at the V$SESSION or v$PROCESS views. Another way is to check the current_logins parameter in the v$sysstat view. Another if you are on UNIX is to do a "ps -ef|grep oracle|wc -l? COMMAND, but this only works against a single instance installation.

There are several ways. One is to look at the v$session or v$process views. Another way is to check the current_logins parameter in the v$sysstat view. Another if you are on UNIX is to do a "ps -ef|grep oracle|wc -l? command, but this only works against a single instance installation.

577.

If You Have An Example Table, What Is The Best Way To Get Sizing Data For The Production Table Implementation?

Answer»

The best way is to analyze the table and then USE the data PROVIDED in the DBA_TABLES VIEW to get the average row LENGTH and other pertinent data for the calculation. The quick and dirty way is to look at the number of blocks the table is actually using and ratio the number of rows in the table to its number of blocks against the number of EXPECTED rows.

The best way is to analyze the table and then use the data provided in the DBA_TABLES view to get the average row length and other pertinent data for the calculation. The quick and dirty way is to look at the number of blocks the table is actually using and ratio the number of rows in the table to its number of blocks against the number of expected rows.

578.

A User Is Getting An Ora-00942 Error Yet You Know You Have Granted Them Permission On The Table, What Else Should You Check?

Answer»

You need to check that the USER has specified the FULL NAME of the object (SELECT empid FROM scott.EMP; instead of SELECT empid FROM emp;) or has a synonym that points to the object (CREATE SYNONYM emp FOR scott.emp;).

You need to check that the user has specified the full name of the object (SELECT empid FROM scott.emp; instead of SELECT empid FROM emp;) or has a synonym that points to the object (CREATE SYNONYM emp FOR scott.emp;).

579.

What Causes The "snapshot Too Old" Error? How Can This Be Prevented Or Mitigated?

Answer»

This is caused by large or long RUNNING transactions that have either WRAPPED onto their own rollback space or have had another transaction write on part of their rollback space. This can be PREVENTED or mitigated by breaking the transaction into a set of smaller transactions or increasing the size of the rollback SEGMENTS and their EXTENTS.

This is caused by large or long running transactions that have either wrapped onto their own rollback space or have had another transaction write on part of their rollback space. This can be prevented or mitigated by breaking the transaction into a set of smaller transactions or increasing the size of the rollback segments and their extents.

580.

You Are Using Hot Backup Without Being In Archivelog Mode, Can You Recover In The Event Of A Failure? Why Or Why Not?

Answer»

You can't use hot backup WITHOUT being in ARCHIVELOG mode. So no, you couldn't recover.

You can't use hot backup without being in archivelog mode. So no, you couldn't recover.

581.

What Happens If A Primary Key Constraint Is Disabled And Then Enabled Without Fully Specifying The Index Clause?

Answer»

The index is created in the users DEFAULT TABLESPACE and all SIZING information is LOST. Oracle doesn't store this information as a part of the constraint definition, but only as part of the index definition, when the constraint was disabled the index was dropped and the information is gone.

The index is created in the users default tablespace and all sizing information is lost. Oracle doesn't store this information as a part of the constraint definition, but only as part of the index definition, when the constraint was disabled the index was dropped and the information is gone.

582.

What Is The Proper Method For Disabling And Re-enabling A Primary Key Constraint?

Answer»

You USE the ALTER TABLE COMMAND for both. However, for the enable clause you must specify the USING INDEX and TABLESPACE clause for PRIMARY keys.

You use the ALTER TABLE command for both. However, for the enable clause you must specify the USING INDEX and TABLESPACE clause for primary keys.

583.

What Happens If A Tablespace Clause Is Left Off Of A Primary Key Constraint Clause?

Answer»

This results in the INDEX that is automatically generated being placed in then users DEFAULT tablespace. SINCE this will usually be the same tablespace as the table is being created in, this can cause serious performance problems.

This results in the index that is automatically generated being placed in then users default tablespace. Since this will usually be the same tablespace as the table is being created in, this can cause serious performance problems.

584.

What Happens If The Constraint Name Is Left Out Of A Constraint Clause?

Answer»

The Oracle system will use the default NAME of SYS_Cxxxx where xxxx is a system generated NUMBER. This is bad since it makes tracking which table the constraint BELONGS to or what the constraint does HARDER.

The Oracle system will use the default name of SYS_Cxxxx where xxxx is a system generated number. This is bad since it makes tracking which table the constraint belongs to or what the constraint does harder.

585.

What Are Some Of The Oracle Provided Packages That Dbas Should Be Aware Of?

Answer»

Oracle provides a number of PACKAGES in the form of the DBMS_ packages owned by the SYS user. The packages used by DBAS MAY INCLUDE: DBMS_SHARED_POOL, DBMS_UTILITY, DBMS_SQL, DBMS_DDL, DBMS_SESSION, DBMS_OUTPUT and DBMS_SNAPSHOT.

Oracle provides a number of packages in the form of the DBMS_ packages owned by the SYS user. The packages used by DBAs may include: DBMS_SHARED_POOL, DBMS_UTILITY, DBMS_SQL, DBMS_DDL, DBMS_SESSION, DBMS_OUTPUT and DBMS_SNAPSHOT.

586.

You Have A Rollback Segment In A Version 7.2 Database That Has Expanded Beyond Optimal, How Can It Be Restored To Optimal?

Answer»

USE the ALTER TABLESPACE ..... SHRINK COMMAND.

Use the ALTER TABLESPACE ..... SHRINK command.

587.

What Is The Purpose Of The Import Option Ignore? What Is It's Default Setting?

Answer»

The IMPORT IGNORE option tells import to ignore "ALREADY exists" errors. If it is not specified the tables that already EXIST will be SKIPPED. If it is specified, the ERROR is ignored and the tables data will be INSERTED. The default value is N.

The IMPORT IGNORE option tells import to ignore "already exists" errors. If it is not specified the tables that already exist will be skipped. If it is specified, the error is ignored and the tables data will be inserted. The default value is N.

588.

Give One Method For Transferring A Table From One Schema To Another:

Answer»

There are SEVERAL possible METHODS, export-import, CREATE TABLE... AS SELECT, or COPY.

There are several possible methods, export-import, CREATE TABLE... AS SELECT, or COPY.

589.

In What Order Should A Open/fetch/loop Set Of Commands In A Pl/sql Block Be Implemented If You Use The %notfound Cursor Variable In The Exit When Statement? Why?

Answer»

OPEN then FETCH then LOOP followed by the EXIT when. If not specified in this ORDER will result in the final RETURN being done twice because of the way the %NOTFOUND is handled by PL/SQL.

OPEN then FETCH then LOOP followed by the exit when. If not specified in this order will result in the final return being done twice because of the way the %NOTFOUND is handled by PL/SQL.

590.

Describe The Use Of Pl/sql Tables

Answer»

PL/SQL TABLES are scalar arrays that can be referenced by a binary integer. They can be used to HOLD VALUES for use in later queries or calculations. In ORACLE they will be ABLE to be of the %ROWTYPE designation, or RECORD.

PL/SQL tables are scalar arrays that can be referenced by a binary integer. They can be used to hold values for use in later queries or calculations. In Oracle they will be able to be of the %ROWTYPE designation, or RECORD.

591.

Describe The Use Of %rowtype And %type In Pl/sql

Answer»

%ROWTYPE allows you to associate a VARIABLE with an entire table ROW. The %TYPE ASSOCIATES a variable with a single column type.

%ROWTYPE allows you to associate a variable with an entire table row. The %TYPE associates a variable with a single column type.

592.

Describe The Difference Between A Procedure, Function And Anonymous Pl/sql Block.

Answer»

Candidate should mention USE of DECLARE statement, a FUNCTION must return a value while a procedure doesn't have to. Also ONE can use function in Select SQL statement but not procedure.

Candidate should mention use of DECLARE statement, a function must return a value while a procedure doesn't have to. Also one can use function in Select Sql statement but not procedure.

593.

Explain An Ora-01555

Answer»

You get this ERROR when you get a snapshot too old within rollback. It can USUALLY be solved by INCREASING the undo retention or increasing the size of rollbacks. You should ALSO look at the logic involved in the application getting the error message.

You get this error when you get a snapshot too old within rollback. It can usually be solved by increasing the undo retention or increasing the size of rollbacks. You should also look at the logic involved in the application getting the error message.

594.

How Would You Go About Increasing The Buffer Cache Hit Ratio?

Answer»

Use the buffer cache ADVISORY over a GIVEN workload and then QUERY the v$db_cache_advice table. If a change was necessary then I would use the alter SYSTEM set db_cache_size command.

Use the buffer cache advisory over a given workload and then query the v$db_cache_advice table. If a change was necessary then I would use the alter system set db_cache_size command.

595.

How Would You Go About Generating An Explain Plan?

Answer»

CREATE a PLAN table with utlxplan.sql. Use the explain plan set statement_id = ‘tst1′ into plan_table for a SQL statement. LOOK at the explain plan with utlxplp.sql or utlxpls.sql.

Create a plan table with utlxplan.sql. Use the explain plan set statement_id = ‘tst1′ into plan_table for a SQL statement. Look at the explain plan with utlxplp.sql or utlxpls.sql.

596.

What Column Differentiates The V$ Views To The Gv$ Views And How?

Answer»

The INST_ID column which indicates the instance in a RAC ENVIRONMENT the information CAME from.

The INST_ID column which indicates the instance in a RAC environment the information came from.

597.

Give The Stages Of Instance Startup To A Usable State Where Normal Users May Access It.

Answer»

STARTUP NOMOUNT - Instance startup.
STARTUP MOUNT - The database is MOUNTED.
STARTUP OPEN - The database is opened.

STARTUP NOMOUNT - Instance startup.
STARTUP MOUNT - The database is mounted.
STARTUP OPEN - The database is opened.

598.

What Command Would You Use To Create A Backup Control File?

Answer»

ALTER database backup CONTROL file to TRACE.

Alter database backup control file to trace.

599.

Explain The Difference Between Archivelog Mode And Noarchivelog Mode And The Benefits And Disadvantages To Each.

Answer»

ARCHIVELOG mode is a mode that you can put the database in for creating a BACKUP of all transactions that have occurred in the database so that you can RECOVER to any POINT in time. NOARCHIVELOG mode is basically the ABSENCE of ARCHIVELOG mode and has the disadvantage of not being able to recover to any point in time. NOARCHIVELOG mode does have the advantage of not having to write transactions to an archive LOG and thus increases the performance of the database slightly.

ARCHIVELOG mode is a mode that you can put the database in for creating a backup of all transactions that have occurred in the database so that you can recover to any point in time. NOARCHIVELOG mode is basically the absence of ARCHIVELOG mode and has the disadvantage of not being able to recover to any point in time. NOARCHIVELOG mode does have the advantage of not having to write transactions to an archive log and thus increases the performance of the database slightly.

600.

A Table Is Classified As A Parent Table And You Want To Drop And Re-create It. How Would You Do This Without Affecting The Children Tables?

Answer»

DISABLE the foreign key CONSTRAINT to the PARENT, DROP the table, re-create the table, enable the foreign key constraint.

Disable the foreign key constraint to the parent, drop the table, re-create the table, enable the foreign key constraint.