handson dba - part i

5
Oracle Architectural Components 1 Which one of the following statements is true? a An Oracle server is a collection of data consisting of three file types. b A user establishes a connection with the database by starting an Oracle instance. c A connection is a communication pathway between the Oracle Server and the Oracle Instance. d A session starts when a user is validated by the Oracle server. 2 Which one of the following memory areas is not part of the SGA? a Database buffer cache b PGA c Redo log buffer cache d Shared Pool 3 Which two of the following statements are true about the Shared Pool? a The shared Pool consists of the Library Cache, Data Dictionary Cache, Shared SQL area, Java Pool, and Large Pool. b The Shared Pool is used to store the most recently executed SQL statements and the most recently used data. c The Shared Pool is used for object that can be shared globally. d The Library Cache consist of the Shared SQL and Shared PL/SQL areas. 4 Which one of the following memory areas is used to cache the data dictionary information? a Database Buffer Cache b PGA c Redo log buffer cache d Shared Pool 5 The primary purpose of the Redo Log Buffer Cache is to record all changes to the database data blocks. a True b False 6 The PGA is a memory region that contains data and control information for multiple server processes or multiple background processes. a True b False 7 Which one of the following processes is available when an Oracle instance is started.

Upload: charles-g-galaxyaan

Post on 15-Oct-2014

91 views

Category:

Documents


6 download

TRANSCRIPT

Page 1: Handson DBA - Part I

Oracle Architectural Components

1 Which one of the following statements is true?a An Oracle server is a collection of data consisting of three file types.b A user establishes a connection with the database by starting an Oracle instance.c A connection is a communication pathway between the Oracle Server and the Oracle Instance.d A session starts when a user is validated by the Oracle server.

2 Which one of the following memory areas is not part of the SGA?a Database buffer cacheb PGAc Redo log buffer cached Shared Pool

3 Which two of the following statements are true about the Shared Pool?a The shared Pool consists of the Library Cache, Data Dictionary Cache, Shared SQL area, Java Pool, and Large Pool.b The Shared Pool is used to store the most recently executed SQL statements and themost recently used data.c The Shared Pool is used for object that can be shared globally.d The Library Cache consist of the Shared SQL and Shared PL/SQL areas.

4 Which one of the following memory areas is used to cache the data dictionaryinformation?a Database Buffer Cacheb PGAc Redo log buffer cached Shared Pool

5 The primary purpose of the Redo Log Buffer Cache is to record all changes to thedatabase data blocks.a Trueb False

6 The PGA is a memory region that contains data and control information for multipleserver processes or multiple background processes.a Trueb False

7 Which one of the following processes is available when an Oracle instance is started.a User processb Background processc Server processd System process

8 Identify the Five mandatory background processes.________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

Page 2: Handson DBA - Part I

9 Which one of the following memory areas is used to cache the data dictionary information?a Database Buffer Cacheb PGAc Redo log buffer cached Shared Pool

10 Match the process with its task.a Database Writer ___ Assists with writing to the data file headersb Log Writer ___ Responsible for instance recoveryc System Monitor ___ Cleans up after failed processesd Process Monitor ___ Records database changes for recovery purposese Checkpoint ___ Writes dirty buffers to the data files

11 The physical structure of an Oracle database consists of control files, data files, and redo log files.a Trueb False

12 Place the following structures in order of hierarchy beginning with database.a Tablespacesb Extentc Segmentd databasee block

Creating a Database

Managing an Oracle Instance

1 Connect to the database as user SYS AS SYSDBA and shutdown the database.

2 With the database shutdown, create an SPFILE from the PFILE.Place the SPFILE in directory $HOME/ADMIN/PFILE with the file name formatspfileSID.ora, use your instance name in place of SID. Create the SPFILEfrom the PFILE located in $HOME/ADMIN/PFILE.

3 From the operating system, view the SPFILE.

4 Connect as user SYS AS SYSDBA, and start the database using the SPFILE.

5 Shutdown the database and open it in read-only mode. Connect as user HR passwordHR and and insert the following into the REGIONS table.INSERT INTO regions VALUES ( 5, ‘Mars’ );What happens? Put the database back in read-write mode.

6 Connect as user HR password HR and insert the following row into the tableREGIONS; do not commit or exit.INSERT INTO regions VALUES ( 5, ‘Mars’ );In a new telnet session start SQL*Plus. Connect as SYS AS SYSDBA and performa shut down transactional.What happens? Rollback the insert in the HR session and exit, what happens?

7 Make sure the database is started. Keep the two SQL*Plus sessions open, one

Page 3: Handson DBA - Part I

session as user SYS AS SYSDBA and one as user HR. As user SYS AS SYSDBAenable restricted session. As user HR select from the regions table. Is the selectsuccessful? In the HR session exit SQL*Plus then reconnect as HR. What happens?Disable restricted session.

Data Dictionary Contents and Usage

1 Which of the following statements are true about the data dictionary?a The data dictionary describes the database and its objects.b The data dictionary includes two types of objects: base tables, data dictionary views.c The data dictionary is a set of read-only tables.d The data dictionary records and verifies information about its associated database.

2 Base tables are created using the catalog.sql script.a Trueb False

3 Which of the following statements are true about how the data dictionary is used?a The Oracle server modifies it when a DML statement is executed.b It is used to find information about users, schema objects, and storage structures.c Used by users and DBAs as a read-only reference.d The data dictionary is a necessary ingredient for the database to function.

4 Data dictionary views are static views.a Trueb False

5 The information for a Dynamic View is gathered from the control file anddata files.a Trueb False

6 Which of the following questions might a Dynamic View answer?a Is the object online and available?b What locks are being held?c Who owns the object?d What privileges do users have?e Is the session active?

7 Find a list of the data dictionary views.

8 Identify the database name, instance name, and size of the database blocks.Hint: Query the Dynamic Views V$DATABASE, V$THREAD, andV$PARAMETER.

9 List the name and size of the data files.Hint: Query the view V$DATAFILE.

10 Identify the data file that makes up the SYSTEM tablespace.Hint: Query the data dictionary view DBA_DATA_FILES to identify the data filesthat make up SYSTEM tablespace.

11 How much free space is available in the database and how much is already used?Hints:- Query the data dictionary view DBA_FREE_SPACE to show how much freespace is available in the database.

Page 4: Handson DBA - Part I

- Query the data dictionary view DBA_SEGMENTS to display how much spaceis already used.

12 List the name and creation date of the database users.Hint: Query the data dictionary view DBA_USERS to list the name and the creationof the database users.

Maintaining the Control File

1 Where is the existing control file located and what is the name?Hint: Query the dynamic performance view V$CONTROLFILE orV$PARAMETER, or execute the SHOW PARAMETER command todisplay the name and the location of the control file.

2 Try to start the database without any control files. (Simulate this by changing thename of the control file in the parameter file or changing the control file name.)What happens?

3 Multiplex the existing control file, using the directory u02, and name the new controlfilectrl02.ctl. Make sure that the Oracle Server is able to write to the newcontrol file. For example, on Unix use the command chmod 660. Confirm that bothcontrol files are being used.Hints:- Before shutting down the database alter the SPFILE (SCOPE=SPILE) to addthe new control file to the initialization file.- Shut down the database, and copy the existing control file to a new filewith the name ctrl02.ctl in the directory u02. Use the commandchmod 660 on Unix. Normally the permissions on the file would notbe changed, this is for the classroom environment.- Start up the database.- Query the Dynamic View V$CONTROLFILE or V$PARAMETER, or usetheSHOW PARAMETER command to confirm that both control files arebeing used.