Upload
eric-li
View
215
Download
2
Embed Size (px)
DESCRIPTION
task#5
Citation preview
Task#5
Managing Undo Data and Undo Retention
IMPORTANT NOTE:
Create a spool file while working in SQL*Plus to save all your work in an SQL session.
If you prefer to use Oracle Enterprise Manager, do not forget to add either SQL commands or Screen Shots in your report. (Easier way )
Format your output as necessary to make it easy to read.
Steps:
1. UNDO tablespace Creation
List the undo segments in the UNDO1 tablespace
Create a second Undo tablespace named UNDO2 of size 5MB in the same location as your current UNDO1 tablespace. List the undo segments and their status in this
tablespace.
Start a second SQL*Plus session (leave the first one open) and connect to the system as the DBA user. Insert a new row in the Customer table, but do not commit the transaction.
Aldo, do not rollback the transaction or exit the session.
Switch to the first SQL*Plus session and use the ALTER SYSTEM command to switch the active UNDO1 to UNDO2. Now, as the SYS, drop the UNDO1 tablespace. What
happened? List the undo segments and their status. Compare this to the list you
developed earlier in the task.
In the second SQL*Plus session as the user DBA, rollback the transaction and exit the session.
In the first SQL*Plus session as the user SYS, drop the tablespace named UNDO1. What happened?
Note: Remember to update the init.ora file for your database so that on the next startup the
correct UNDO tablespace is used.
2. Use the Undo Advisor to calculate the amount of undo space required to support a report that
takes two days to run. What does the analysis recommend as the Required Tablespaces Size
for New Undo Retention?
3. Resize the undo tablespace to support the retention period required by the new reports (or
1GB, whichever is smaller).