Tuesday, August 13, 2013

ORACLE MCQ Test - 4


Que.1. Oracle creates an index for the _____________ in the snapshot base table

A:        Primary key
B:        Foreign key
C:        Super key
D:        Both a and c

Right Answer: A

Que.2. How should a many-to-many relationship be handled?

A:        By adding an join entity table
B:        By adding intersection entity table
C:        By adding union entity table
D:        By adding Cartesian entity table

Right Answer: B

Que.3. The delay between the time a DML change is applied at the originating database and the time the transaction reaches the destination databases is called as

A:        Propagation
B:        Propagation latency
C:        Conflict
D:        Conflict latency

Right Answer: B

Que.4. Which of the following rule below is FALSE for a database object?

A:        Has a unique name within that schema
B:        Object names cannot be longer than 30 bytes
C:        Must begin with a letter
D:        None of the above

Right Answer: D

Que.5. More than one materialized view cannot use a materialized view log

A:        True
B:        False

Right Answer: B

Que.6. Name the tool for tuning SQL statements.

A:        TUNEUP SYS
B:        EXPLAIN SYS
C:        DB_TUNEUP
D:        EXPLAIN PLAN

Right Answer: D

Que.7. What is the probable cause for getting the following error stack?
ERROR: ORA-01034: ORACLE not available
ORA-07318: smsget: open error when opening sgadef.dbf file.
HP-UX Error: 2: No such file or directory

A:        The Oracle segment is shutdown that they are trying to access
B:        The Oracle namespace is shutdown that they are trying to access
C:        The Oracle instance is shutdown that they are trying to access
D:        None of the above

Right Answer: C

Que.8. A ____________________ is a structure that contains definitions, blocks of PL/SQL code, or both in a single unit

A:        Package body
B:        Package
C:        Procedure
D:        Both a and b

Right Answer: B

Que.9. Which of the following is the fastest query method for a table?

A:        Fetch by columnid
B:        Fetch by tableid
C:        Fetch by rowid
D:        Fetch by indexid

Right Answer: C

Que.10. By default which refresh on a snapshot is performed by Oracle?

A:        Fast refresh
B:        Complete refresh
C:        Automatic refresh
D:        Attempts fast refresh, if it cannot be preformed server performs a complete refresh

Right Answer: D

Que.11. What do you mean by Quiescence?

A:        act of suspending DML activity for all tables in a given replication group
B:        act of suspending DML activity for selected tables in a given replication group
C:        act of granting DML activity for selected tables in a given replication group
D:        act of granting DML activity for all tables in a given replication group

Right Answer: A

Que.12. Which of the following below is a type of replication?

A:        Update replication
B:        Read-only materialized views
C:        Multi replication
D:        All of the above

Right Answer: B

Que.13. Using synonyms is a good way to implement location transparency.

A:        True
B:        False

Right Answer: A

Que.14. What are the two ways to determine the structure of a table in database?

A:        Using DESCRIBE command and dbms_metadata_get_commit package
B:        Using METADATA command STRUCTURE commands
C:        Using DATA_ON_DATA and STRUCTURE commands
D:        Using DESCRIBE command and dbms_metadata_get_ddl package

Right Answer: D

Que.15. Where would you look for errors from the database engine?

A:        In the error log
B:        In the alter log
C:        In the alert log
D:        In the recovery log

Right Answer: C

Que.16. Which of the following are three advisory statistics to collect?

A:        Buffer Cache Table, Segment Level Statistics, Timed Statistics
B:        Buffer Table Cursor statistics, Segment Level Cursor statistics, Timed statistics
C:        Segment Table statistics, Buffer and Cursor statistics, Timed Cursor statistics
D:        Buffer Index statistics, Segment Index Statistics, Timed Index Statistics

Right Answer: A

Que.17. A cluster is a schema object that contains data from _____________ , all of which have one or more columns in common.

A:        one table
B:        one or more tables
C:        two or more tables
D:        atleast two tables

Right Answer: C

Que.18. A _______________ is a collection of one or more replicated objects (typically tables) that are administrated together

A:        Replica
B:        Replica group
C:        Replication
D:        Replication group

Right Answer: D

Que.19. A hot backup is

A:        taking up the backup of the database while it is still up and running
B:        taking up the backup of the database after the user logs off
C:        taking up the backup followed by taking cold backup
D:        None of the above

Right Answer: A

Que.20. What command is used to encrypt a PL/SQL application?

A:        DB_ENCRYPT
B:        DBMS_ENCRYPT
C:        DBMS_WRAP
D:        WRAP

Right Answer: D

Java MCQ Test – 4


Que.1. Which cannot directly cause a thread to stop executing?

A:        Calling a yield method.
B:        Calling the start method on another Thread object.
C:        Calling the notify method on an object.
D:        Calling wait method on an object.

Right Answer: C

Que.2. Which of the following statement is true?

A:        An anonymous inner class can access final variables in any
B:        enclosing scope.
C:        An anonymous inner class may be declared as protected.
D:        An anonymous inner class can implement multiple interface.

Right Answer: B

Que.3. Which statement is true for the Class java.util.HashSet?

A:        The collection is guaranteed to be immutable.
B:        The elements in the collection are unique.
C:        The elements in the collection are ordered.
D:        The elements in the collection are synchronized.

Right Answer: B

Que.4. Which of the following is false for vector class?

A:        The size of a Vector is static
B:        The Vector class implements an incremental array of objects.
C:        The vector components can be accessed using an integer index.
D:        The size of a Vector increases or decreases as needed to accommodate the items.

Right Answer: A
Que.5.

class Test
{
public static void main(String [] args)
{
Integer i = new Integer(0);
add(i);
System.out.println(i);
}
static void add(Integer i)
{
int val = i.intValue();
val+=3;
i = new Integer(val);
}
}

What would be the output?

A:        Compile Error
B:        0
C:        3
D:        Runtme Exception

Right Answer: B

Que.6. Java Constructor

class Add
{
int add (int x , int y)
{
return (x+y);
}
}
class FloatAdd extends Add
{
float add(float x, float y)
{
return (x+y);
}
}
class Test
{
public static void main(String [] args)
{
Add a = new Add();
FloatAdd addObj = (FloatAdd) a;
System.out.println("Result : "+addObj.add(10, 20));
}
}

What would be output?

A:        30.00
B:        30
C:        Complie error
D:        Runtime Exception

Right Answer: C

Que.7. What is the purpose of code attribute of applet tags?

A:        A URL that points to the class of the applet
B:        A URL to the applet when it is stored in a Java Archive or ZIP file
C:        Indicates the base URL of the applet if the code attribute is relative
D:        Defines the horizontal spacing around the applet

Right Answer: A

Que.8. ______________ is a command that disassembles a class file

A:        javaamd
B:        javacmd
C:        javad
D:        javap

Right Answer: D

Que.9.

String a = "Hello World";
String b = "Hello World";
System.out.println(a.equals(b));
System.out.print(a==b);
System.out.print(a == b.intern());

What would be output?

A:        Compile time error
B:        True false false
C:        true false true
D:        true true true

Right Answer: D

Que.10.

public class Test
{
public static void main(String [] args)throws Exception
{
Object object = new Object();
synchronized (Thread.currentThread())
{
object.wait();
object.notify();
}
}
}

What is the result?

A:        Compiles successfully.
B:        Throws an InterruptedException.
C:        Throws an IlleagalStateException.
D:        Throws an IllegalMonitorStateException

Right Answer: D

Que.11.
To execute the threads one after another

A:        the keyword synchronize is used
B:        the keyword synchronizable is used
C:        the keyword synchronized is used
D:        None of the above

Right Answer: B

Que.12. BY restricting the state change of a class object, I can make a class immutable?

A:        No
B:        Yes

Right Answer: B

Que.13. DataInputStream is an example of

A:        Output stream
B:        I/O stream
C:        Filtered stream
D:        File stream

Right Answer: C

Que.14. Java Constructor

class Nest
{
Nest()
{
System.out.print("Nest");
}
Nest (long l)
{
this();
System.out.print(l);
}
Nest(int i)
{
this(i);
System.out.print(i*2);
}
}
Public static voidmain(String[] args)
{
int i = 4;
new Nest(i);
}

What would be the output?

A:        Nest48
B:        Nest84
C:        Nest44
D:        Compile Error

Right Answer: D

Que.15. Which of the following below are abilities of Reflection API in Java?

A:        Determining state of an object
B:        Both B and C
C:        Determining duplicate classes
D:        Determination of the class of an object

Right Answer: D

Que.16. Which of the methods should be implemented if any class implements the Runnable interface?

A:        start()
B:        run()
C:        wait()
D:        notify() and notifyAll()

Right Answer: B

Que.17. What is the difference between java beans and EJB?

A:        Java beans are reusable components that can be used for customized user objects while EJB are reusable components that are developed to comply with enterprise specification adhering to setter and getter methods and two public constructors.
B:        Java beans are reusable components that can be used for customized user objects while EJB are reusable components that are developed to comply with enterprise specification adhering to setter and getter methods and one public constructor.
C:        Java beans are reusable components that can be used for customized user objects while EJB are reusable components that are developed to comply with enterprise specification adhering to setter and getter methods and many public constructors.
D:        Java beans are reusable components that can be used for customized user objects while EJB are reusable components that are developed to comply with enterprise specification adhering to setter and getter methods with no public constructor.

Right Answer: B

Que.18. A thread which has invoked wait() method of an object, still owns the lock of the object. Is this statement true or false?

A:        True
B:        False

Right Answer: B

Que.19. The object of DataInputStream is used to

A:        To covert binary stream into character stream
B:        To covert character stream into binary stream
C:        To write data onto output object
D:        All of the above

Right Answer: A

Que.20. Which of the following is not a method of the Thread class.

A:        public void run()
B:        public void start()
C:        public void exit()
D:        public final int getPriority()

Right Answer: C