1

I'm using Rails 6 with activerecord-oracle_enhanced-adapter adapter for Oracle 11 XE database. At the beginning of the project I was working with Postgres, but due to customer requirements I had to migrate to Oracle.

My question is very similar to Rails: rake db:migrate *very* slow on Oracle, but it's from 11 years ago, i'm using the updated version of the adapter.

I know that after all migrations are applied to database then rake db:migrate calls db:schema:dump task to generate schema.rb file from current database schema. I only have one schema, with many tables (around 90)

The answer for the previous question was something like

One way how to debug this issue would be if you would put some debug messages in oracle_enhanced_adapter.rb file so that you could identify which method calls are taking so long time.

== 20200820164111 RemoveSemesterFromProject: migrated (0.1347s) ===============
real    13m26,038s
user    0m5,494s
sys 0m0,401s

All migrations finished in an reasonable time, so I think the error occurs in the following action "db: schema: dump" but i don't have oracle_enchaced_adapter.rb neither oracle_enhanced_adapter.rb, so i don't know where to look at.

What can i do for improve this behaviour?

[EDIT]:

Time that takes when i run db:schema:dump

real    9m44,074s
user    0m3,701s
sys 0m0,327s

and this is the time that takes when i run db:structure:dump

real    21m40,073s
user    0m5,046s
sys 0m0,413s

Grizz
  • 51
  • 3
  • You might run `db:schema::dump` on its own to see how long that takes. Could try `db:structure:dump` too in case that's quicker. – David Aldridge Aug 20 '20 at 20:21
  • i'm gonna edit, thanks! – Grizz Aug 20 '20 at 20:43
  • Oh dear. Perhaps the question should be "why is the schema/structure dump so slow?". Do you have a DBA for the database? – David Aldridge Aug 24 '20 at 10:56
  • I changed the question and no, i don't have a DBA for the database – Grizz Aug 24 '20 at 19:34
  • I think that if you don't have a DBA available then it might be best to move the question over to https://dba.stackexchange.com/, though you're likely to have to do a bit of digging an explaining about what the schema dumps are. Most likely in Oracle they are calls to the DBMS_METADATA package https://docs.oracle.com/database/121/ARPLS/d_metada.htm#ARPLS026, which might help you start off with a good question. Sorry I can't help more. – David Aldridge Aug 25 '20 at 08:56
  • thanks! i'm gonna do that – Grizz Aug 25 '20 at 16:43
  • @Grizz: Did you succeed in making the migrations finish faster? And (if YES): how? – Tortoise Feb 25 '22 at 15:41

0 Answers0