Skip to main content

Posts

Showing posts from December, 2017

export/import query plan from one database to another using sql tuning set and sql plan baseline

The following three links are my guide documents: https://carlos-sierra.net/2013/05/02/migrating-an-execution-plan-using-sql-plan-management/ https://aprakash.wordpress.com/2012/07/05/loading-sql-plan-into-spm-using-awr/ https://www.databasejournal.com/features/oracle/article.php/3730391/Oracle-Database-11g-SQL-Plan-Management-Part-2.htm Option 1: Create SPB on source then migrate SPB into target Steps: Create SQL Plan Baseline (SPB) in Source From Memory; or From AWR (requires Diagnostics Pack license) Package & Export SPB from Source Import & Restore SPB into Target Pros: Simple Cons: Generates a SPB in Source system Option 2: Create SQL Tuning Set (STS) on source, migrate STS into target, promote STS into SPB in target Steps: Create SQL Tuning Set (STS) in Source (requires Tuning Pack license) From Memory; or From AWR (requires Diagnostics Pack license) Package & Export STS from Source Import & Restore STS into Target Create SPB

bcfenv and $ORACLE_SID.env

#!/bin/bash # ========================================================================= # Name ...........: /u01/dba/bin/bcfenv.sh (ugo+x) # Function .......: Displays the Oracle BCF environment selection menu # Usage ..........: This file is called once at log-on from bashrc, and #                   is also called from command line by typing 'bcfenv'. #                   The menu selection that this script displays is built #                   dynamically from the oratab file. This file, aside from #                   displaying the menu, also echoes back variables by #                   calling it with the 'env' parameter eg: 'bcfenv.sh env', #                   there is an alias in the 'bashrc' called 'echov' which #                   calls this script in that manner. # ------------------------------------------------------------------------- # # History # # Date         Rev  Who                          Comments # ----------