11.07.2015 Views

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

Oracle Database 11 g - Online Public Access Catalog

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

40 CHAPTER 1 ■ INSTALLING, UPGRADING, AND MANAGING CHANGEBefore you can start capturing the workload, you must do the following:1. Back up the production database so you can restore it on the test system later for replayingthe workload. The goal is to reproduce the application state of the production systemby restoring the database before you replay the captured workload. You can use RMAN,a point-in-time recovery, Data Pump Export/Import, or a snapshot standby to back upthe production database before starting the data capture.2. Decide whether you want to restart the production database. You don’t have to restartthe production database before starting the workload capture, but note that any transactionsthat are underway when you begin the workload capture may not be captured.3. If you decide to restart the production database, you must do so in restricted mode afterlogging in as the user sys. Once you start the capture process as shown here, you canopen the database for all user sessions.4. Create a directory with enough space to store the captured workload. Use the createdirectory SQL statement to create the directory object.5. Determine whether some of the user sessions, such as DBA sessions, don’t need to becaptured as part of the workload. You can use workload filters to eliminate these sessionsfrom the workload, as shown in the following example, which uses the add_filter procedureto filter parts of the workload from the data capture:SQL> exec dbms_workload_capture.add_filter (fname => 'my_filter1',-> fattribute => ‘user’, fvalue => 'prod_dba');You can remove any filters you create by executing the delete_filter procedure.Use the start_capture procedure of the DBMS_WORKLOAD package to capture the databaseworkload during a representative period of operation. Here’s a simple example showing how tocapture a database workload:SQL> exec dbms_workload_capture.start_capture(name => -> ' aug20_peak', dir=> 'test_dir',duration=> 240);The name parameter specifies the name of this workload capture process. The dir parameterrefers to the directory object pointing to the directory you created for storing the capturedworkload data. Although you can stop the workload capture with the procedure stop_capture,here we use the duration parameter instead to limit the workload capture to 4 hours (240 minutes).If you choose to stop the workload capture before the end of the 4-hour duration, you can doso in the following way:SQL> execute dbms_workload_capture.finish_capture ();The execution of the finish_capture procedure ends the workload capture. It’s a good ideaat this point to generate a workload capture report to validate your data capture. Validationincludes ascertaining that you did capture the correct workload and didn’t miss any critical partof the production workload by accident. Of course, you must also make sure you can replay thecaptured data on the test server later. Execute the DBMS_WORKLOAD_CAPTURE.GET_CAPTURE_INFOprocedure to generate a workload capture report, as shown here:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!