25
loading...
This website collects cookies to deliver better user experience
Here we are getting all the extra stuff that DMS won’t bring across like certain constraints, foreign keys, sequences etc.
Ensure your ssh tunnels run on different local ports, so that you can connect to the Source and Target simultaneously.
Running the output of the diff will enable constraints and enable triggers that were previously disabled.
If you feel like it has missed something, you can invert the disable commands in the above section.
It’s possible not all constraints or indexes will create successfully, check the output of executed SQL carefully.
If you are unable to apply constraints due to duplicate rows, the below will help you identify and remove these rows.
Out of almost 1 billion rows that we moved, we did experience 6 duplicate row issues across 3 tables due to us stopping and starting cdc a few times.
select ID, count(ID) from TABLENAME group by ID having count (ID) > 1;
select 'ALTER SEQUENCE SCHEMANAME.'||sequencename||' INCREMENT BY 1000000;' || chr(10) ||'SELECT SCHEMANAME.'||sequencename||'.NEXTVAL FROM dual;' || chr(10) ||'ALTER SEQUENCE SCHEMANAME.'||sequencename||' INCREMENT BY 1;' from usersequences where incrementby=1 order by sequencename;
SELECT COUNT(*) FROM SCHEMANAME.SOMETABLE;
EXEC DBMSSTATS.GATHERSCHEMA_STATS(OWNNAME => 'schema', CASCADE => TRUE)
select indexname, status from dbaindexes where owner = 'SCHEMANAME'
If you find indexes that have a status of “UNUSABLE” then you will need to investigate why before continuing!
You can use SQL Developer studio or SQL commands to investigate these indexes, drop them and recreate them before continuing.
Unusable indexes can come from things like primary keys indexes failing to create due to constraints or similar issues. Re-creating these in the correct order will usually resolve your problems.
If you have queries that are unindexed and suddenly you have a surge of traffic. Your CPU usage is going to get pegged at 100% and your application will fall to pieces. By checking that all your indexes both exist and are valid first, you can save yourself some significant pain.
If you’ve done this as part of a cutover, you’re about to get a flood of users hitting your brand-new RDS database instance.
Recommend that you turn on performance insights for RDS and watch that screen carefully. It can provide another view that something hasn’t been created properly during your diff run.
If you have application logs that are dumping SQL that is failing or taking too long to respond, copy that into a SQL worksheet and run explain on both your Source and Target oracle server. This will give you a visual workflow, so you can see what is going on. Typically, it’ll be an index that is missing or unusable.