Tag: databases

Questions Related to databases

  1. Only when the new master site already has existing replication groups.

  2. By issuing a single command to create , populate, and activate the new master.

  3. When the master definition site is not the same for all of the master grouups.

  4. Without impacting end users who are executing data manipulation language (DML) commands on the replicated tables.


Correct Option: D
  1. It performs a merge join of the row from T2 only if it does'nt exist in the T1 table.

  2. It creates a natural join of table T1 and T2 for all columns that have the same name.

  3. It creates a Cartesian prodcut of table T1 and table T2 for all columns that have the same name.

  4. For each row from T2, it updates the row if it exists witin table T1, otherwise it inserts the row into T1.


Correct Option: D
  1. User the DROP DATAFILE command.

  2. Use the DROP TABLESPACE command.

  3. Ensure that all database files are Oracle Managed Files(OMF) before using the DROP TABLESPACE command.

  4. Ensure that the DB_FILE_CREATE_DEST initialization parameter is set before using the DROP TABLESPACE command.


Correct Option: B
  1. The index need to be dropped, and then re-created.

  2. The resolution of index fragmentation depends on the type of index.

  3. The index can be rebuilt while users continue working on the table.

  4. The fragmented can be ignored because Oracle resolve index fragmentation by means of a freelist.

  5. The index can be rebuilt, but users will not have access to the index during this time.


Correct Option: C
  1. The oracle server creates no undo tablespace.

  2. The oracle server creates an undo segment in the system tablespace.

  3. The oracle server cerates one undo tablespace with the name SYS_UNDOTBS.

  4. Database creation fails because you did not specify an undo tablespace on the create database statment.


Correct Option: C
  1. SELECT text FROM user_source WHERE name = 'SALARY_CALC';

  2. SELECT * FROM user_source WHERE name='SALARY_CALC';

  3. SELECT * FROM user_objects WHERE object_name='SALARY_CALC';

  4. SELECT * FROM user_procedures WHERE object_name='SALARY_CALC';

  5. SELECT text FROM user_source WHERE name='SALARY_CALC' and owner='JOHN'


Correct Option: A
Explanation:

The correct SQL query to view the text of the procedure named SALARY_CALC, created by John, would be:

A. SELECT text FROM user_source WHERE name = 'SALARY_CALC';

This query selects the text column from the user_source table where the name is equal to 'SALARY_CALC'. This will retrieve the text of the procedure.

The other options are incorrect because:

B. SELECT * FROM user_source WHERE name='SALARY_CALC'; This query selects all columns from the user_source table where the name is equal to 'SALARY_CALC'. It will retrieve all details of the procedure, not just the text.

C. SELECT * FROM user_objects WHERE object_name='SALARY_CALC'; This query selects all columns from the user_objects table where the object_name is equal to 'SALARY_CALC'. This will retrieve details about the object, but not the text of the procedure.

D. SELECT * FROM user_procedures WHERE object_name='SALARY_CALC'; This query selects all columns from the user_procedures table where the object_name is equal to 'SALARY_CALC'. This will retrieve details about the procedure, but not the text of the procedure.

E. SELECT text FROM user_source WHERE name='SALARY_CALC' and owner='JOHN'; This query selects the text column from the user_source table where the name is equal to 'SALARY_CALC' and the owner is equal to 'JOHN'. This query assumes that John is the owner of the procedure. If John is indeed the owner, this query will work. However, if John is not the owner, it will not retrieve the text of the procedure.

So, the correct answer is option A.