Oracle Database Administration and SQL
Test your knowledge of Oracle database administration, SQL queries, performance tuning, and database management concepts including transactions, indexes, functions, control files, and redo logs.
Questions
Archived Redo Log is
- It consists of Redo Log files that have archived before being reused.
- It consists of Redo Log files that have archived after being reused.
- It consists of Redo Log files that is archiving when currently being reused.
- It consists of Redo Log files that have archived not being reused.
Examine the syntax for creating a DEPARTMENT table: CREATE TABLE ABCD( A NUMBER(4), B VARCNAR2(30), C NUMBER(6), D NUMBER(4)) STORAGE(INITIAL 200K NEXT 200K PCTINCREASE 50 MINEXTENTS 1 MAXEXTENTS 5) TABLESPACE userdata; What is the size defined for the fifth extent?
- 500K
- 300K
- 675K
- 275K
The control file defines the current state of the physical database. Which dynamic performance views obtain information from the control file?
- V$LOG
- V$THREAD
- V$DATAFILE
- All of the above
Control file contains information about
- database
- redo logfile & datafile
- archivelog file location
- All of the above
What is a Parallel Server
- Multiple instances accessing the same database (Only In Multi-CPU environments)
- Multiple instances accessing the same database (Only In single-CPU environments)
- Multiple instances accessing the different database (Only In single-CPU environments)
- Single instance accessing the multiple database (Only In Multi-CPU environments)
To re-create a database, all existing database files should be reused. The following SQL statement is issued: CREATE DATABASE ABC DATAFILE '/u01/oradata/abc/system0l.dbf' SIZE 100M REUSE LOGFILE GROUP 1 ('/u01/oradata/abc/logla.rdo', '/u02/oradata/abc/loglb.rdo') SIZE 50K REUSE, GROUP 2 ('/u01/oradata/abc/log2a.rdo', '/u02/oradata/abc/log2b.rdo') SIZE 50K REUSE MAXLOGFILES 5 MAXLOGHISTORY 100 MAXDATAFILES 10; Why does the CREATE DATABASE statement fail?
- The MAXLOGFILES are set too low
- The CONTROLFILE REUSE clause is omitted
- The online redo log files cannot be reused
- The data file belonging to the SYSTEM tablespace cannot be reused
What represents the value of the ORACLE_HOME environment variable in Oracle 9i?
- @
- !
- ^
- &
Which of the following tasks can be performed by using the TO_CHAR function?
- Convert '10'to 10
- Convert 'TEN' to 10
- Convert 10 to '10'
- Convert a character expression to a date
Evaluate the following SQL statement: SELECT ROUND (TRUNC (MOD (1600, 10),-1), 2) FROM dual; What will be displayed?
- 100
- 0
- 1
- 10
What is the effect of setting the value "ALL_ROWS" for OPTIMIZER_GOAL parameter of the ALTER SESSION command ?
- This value causes the optimizer to the rule-based approach for all SQL statements in the session regardless of the presence of statistics and to optimize with a goal of best throughput
- This value causes the optimizer to the rule-based approach for all SQL statements in the session in regard of the presence of statistics and to optimize with a goal of best throughput
- This value causes the optimizer to the cost-based approach for all SQL statements in the session regardless of the presence of statistics and to optimize with a goal of best throughput
- This value causes the optimizer to the cost-based approach for all SQL statements in the session regard of the presence of statistics and to optimize with a goal of best throughput
What is the correct use of the Trunc command on a date?
- SELECT TRUNC(TO_DATE('12-Feb-99','DD-MON-YY'), 'YEAR') "Date " FROM DUAL;
- SELECT TRUNC(TO_DATE('12-Feb-99','DD-MON-YY'), 'YEAR') FROM DUAL;
- TRUNCATE=To_Date('09-Jan-02,DD-MON-YY,'YEAR',"Date" from Dual;
- Date =TRUNCATE(To_DATE('09-Jan-02','DD-MON-YY'),'YEAR'),'YEAR)"DATE: from DUAL;
How do I eliminate duplicate rows in an Oracle database?
- DELETE FROM table_name WHERE ROWID IN (SELECT MAX (ROWID) FROM table_name GROUP BY duplicate_values_field_name);
- DELETE FROM table_name WHERE ROWID NOT IN (SELECT MAX (ROWID) FROM table_name GROUP BY duplicate_values_field_name);
- DELETE FROM table_name WHERE ROWID IN (SELECT MIN (ROWID) FROM table_name GROUP BY duplicate_values_field_name);
- DELETE FROM table_name WHERE ROWID IN (SELECT AVG (ROWID) FROM table_name GROUP BY duplicate_values_field_name);
Which Oracle access method is the fastest way for Oracle to retrieve a single row?
- Primary key access
- Access via unique index
- Table access by ROWID
- Full table scan
Which command will delete all data from a table and will not write to the rollback segment?
- DROP
- DELETE
- CASCADE
- TRUNCATE
Which character function can be used to return a specified portion of a character string?
- INSTR
- SUBSTRING
- SUBSTR
- POS
Which of the following SQL functions can operate on any datatype?
- TO_CHAR
- LOWER
- LPAD
- MAX
- CEIL
Which of the following is an important consideration when tuning an SQL statement?
- The number of CPUs on the server
- The degree of parallelism on the tables
- The use of bitmap indexes
- The quality of the SQL optimization
What best describes the relationship between indexes and SQL performance?
- Indexes are only used in special cases
- Indexes are used to make table storage more efficient
- Indexes rarely make a difference in SQL performance
- Indexes exist solely to improve query speed
Which of the following SQL clauses is used to select data from 2 or more tables?
- HAVING
- JOIN
- WHERE
- BETWEEN
Which of the following commands cause a transaction to end?
- DELETE
- ALTER
- INSERT
- UPDATE
- ROLLBACK