Migrate Your Data to Autonomous Database After you capture a sufficient amount of SQL on the source Oracle Database with Automatic SQL Tuning Set (ASTS) enabled, perform the migration to Autonomous Database.
Import Automatic SQL Tuning Set to Autonomous Database After you perform the migration to Autonomous Database and you export the Automatic SQL Tuning Set (ASTS) from the source Oracle Database you are migrating, import the ASTS to your Autonomous Database.
About Migrating to Autonomous Database with Real-time SQL Plan Management
(SPM)
🔗
Describes using Real-time SQL Plan Management when you migrate from a source
Oracle Database to Autonomous Database.
When you migrate from a source Oracle Database to Autonomous Database you can use Real-time SQL Plan
Management (SPM). This enables you to capture the SQL execution plans from your source
database and move them into Automatic SQL Tuning Set (ASTS) on Autonomous Database so that plans continue to perform
with the same or better performance after the migration. Real-time SPM allows plans to change
on Autonomous Database, but if Real-time SPM sees
poor performance, it may use a plan that came from the pre-migrated database if that plan
provides better performance (Real-time SPM uses the plans in Automatic SQL Tuning Set (ASTS)
only if they provide better performance).
Keep the following in mind for using Real-time SPM with a
migration to Autonomous Database:
SPM relies on repeatable SQL statements. SPM is
not suitable for databases that use literal values in SQL statements or for SQL that is
highly dynamic, such as in ad-hoc query environments. However, if the SQL statements use
literal values and the CURSOR_SHARING parameter is set to
FORCE, SPM will work.
In the source Oracle Database that you are
migrating to Autonomous Database you capture
application SQL statements in a SQL tuning set (SYS_AUTO_SYS). This can
consume space in SYSAUX, but typically consumes no more than a few
gigabytes (even for large systems). You can monitor the SYSAUX usage and
increase the size of the tablespace, if necessary.
Real-time SPM cannot prevent all performance regressions,
but it can significantly reduce the risk of
performance regressions happening due to SQL
execution plan changes.
Perform the following steps to enable SQL Plan Management (SPM) on your source
Oracle Database and to migrate the database to Autonomous Database:
Enable Automatic SQL Tuning Set on the Source
Oracle Database 🔗
Before you
migrate to Autonomous Database enable
Automatic SQL Tuning Set (ASTS) on your source Oracle Database.
ASTS needs to run for enough time to cover your workload and
capture all or most of the SQL statements and their execution plans.
So, consider enabling ASTS with lead time in advance of the
migration to Autonomous Database. For example, for a financial or sales
application, capture month-end or year-end processing.
On the source Oracle Database, as DBA user enable Automatic
SQL Tuning Set (ASTS):
SELECT task_name, interval,status, last_schedule_time, enabled
FROM dba_autotask_schedule_control
WHERE dbid = sys_context('userenv','con_dbid') AND
task_name = 'Auto STS Capture Task';
If you want to monitor the SQL that's being captured, view
DBA_SQLSET_STATEMENTS. For example:
SELECT substr(sql_text,1,100) txt, executions
FROM dba_sqlset_statements
WHERE sqlset_name = 'SYS_AUTO_STS';
As required, you can monitor the size and free space of
SYSAUX. For example:
SELECT sum(bytes)/(1024*1024*1024) size_gb
FROM dba_data_files
WHERE tablespace_name = 'SYSAUX' GROUP BY tablespace_name;
SELECT sum(bytes)/(1024*1024*1024) free_gb
FROM dba_free_space
WHERE tablespace_name = 'SYSAUX' GROUP BY tablespace_name;
After you
capture a sufficient amount of SQL on the source Oracle Database with Automatic SQL
Tuning Set (ASTS) enabled, perform the migration to Autonomous Database.
Import Automatic SQL Tuning Set to Autonomous
Database 🔗
After you
perform the migration to Autonomous Database and you export the Automatic SQL Tuning Set (ASTS) from the
source Oracle Database you are migrating, import the ASTS to your Autonomous Database.
Import the staging file to your Autonomous Database.
Use Oracle Data Pump to import the staging
table into Autonomous Database. First upload the dump
file you exported from your source Oracle Database
to a Cloud Object Storage bucket and then import the
dump file.
For example, as the ADMIN user run these commands:
Create the credential to access the Cloud
Object Store bucket.
Make
sure that the timezone file in Autonomous Database matches the value in the source
Oracle Database where you created the dump file. If
there is a timezone mismatch, the database raises
the following
error:
ORA-39002: invalid operation' error raised by dbms_datapump.start_job'