How to Create and Transfer Profile from One Database to Another
The following example illustrates the process of moving a SQL Profile from 10.2 onwards. 1. Create SQL Profile in SCOTT schema The SQL Profile is created based on the tuning task created and the recommendations given by the tuning task: DECLARE my_task_name VARCHAR2(30); my_sqltext CLOB; my_sqlprofile_name VARCHAR2(30); BEGIN my_sqltext := 'select /*+ no_index(emp pk_emp) */ * from emp where empno=7839'; my_task_name := DBMS_SQLTUNE.CREATE_TUNING_TASK(sql_text => my_sqltext, user_name => 'SCOTT', scope => 'COMPREHENSIVE', time_limit => 60, task_name => 'my_sql_tuning_task', description => 'Demo Task to tune a query'); DBMS_SQLTUNE.EXECUTE_TUNING_TASK( task_name => 'my_sql_tuning_task'); my_sqlprofile_name := DBMS_SQLTUNE.ACC...