I found this comparing databases and genrating sql script using liquibase
and I was wondering if how I can do the same with Flyway.
1.- Generating sql script from the differences between tow databases.
Thanks!
There is an option if you use IntelliJ IDEA. Install JPA Buddy and follow this video:
There is no built-in functionality to do this at this point.
You can use any tool able to do database comparison and generate SQL: Oracle SQL Developer, TOAD, Squirrel SQL, etc.
Liquibase could make the diff from current database (e.g: product) and reference database (e.g: development), but unfortunately, it only works in the same database type, not cross databases with problems: Java Hibernate, Liquibase supports cross databases and SQLite?
Related
I'm using EF Core to access CDC tables within system tables in SQL Server, but command ef scaffold does not find the tables. I do access tables out of system tables successfully.
I've tried to grant table to dbo owner, without success.
Stack
SQL Server 2016
EF Core 3.1
I don't think you can use the CDC tables directly, and I would probably recommend against it since they can change between SQL Server versions.
If you really want to use them, you could create one or more views over the top of the CDC tables and use them instead. That way EF will pick them up and they are somewhat future proof if the tables change since you only need to change the views instead of fix and recompile your code.
Hi I have source SQL DB and destination RDS PostgreSQL DB.
I want to migrate by using flyway. First is it possible ?
If possible then can anybody help me with solutions?
Flyway is a tool for running scripts, rollbacks, targeted piecemeal deployments, all sorts of other stuff. However, it doesn't generate scripts. You have to provide it with syntax appropriate to the database system you're deploying to. T-SQL isn't the same as PostgreSQL. Nothing in Flyway will allow you to translate the T-SQL. You will have to do that work on your own. Once completed though, Flyway will absolutely be able to deploy those changes to your new database.
i)How to find out the long running query in oracle?
ii)How to find out the long running error query?
Please help me on this.
I guess you need to profile your stored procedures.
I used to use PL/SQL Developer for profiling my PL/SQL packages and procedures, it showed me all bottlenecks with detail information about time and resources. I believe all IDE for oracle have to have this functionality, you can choose your favorite one.
Use the AWR report from enterprise manager if you are running it. If you don't have access to this then you can use EXPLAIN PLAN, TKPROF, or look at the dictionary tables like v$_session_longops.
e.g. http://blog.psftdba.com/2007/10/using-vsessionlongops-to-find-long.html
I would like to use Sqlite database in my Monotouch app. From http://docs.xamarin.com/recipes/ios/data/sqlite i see two options.
Sqlite-net
ADO.NET
Doing research i found that Sqlite-net is easy to use, works on both ios and android but does not support foreign key concept. My need is to have relations in my db. Student table is linked to classes, professor, assignments table. Not so complicated!!!
Does Sqlite-net supports such relations? Which one is better choice Sqlite-net or ADO.Net.
Appreciated...
Thanks
ADO.Net doesn't give you out of the box support for relationships either. It only gives you raw classes like SQLCommand and SQLDataReader.
I would highly recommend sqlite-net, as it is a huge timesaver in being an ORM.
You can setup foreign keys by calling manual SQL statements in sqlite-net, which is the same you would do with ADO.Net anyway.
So with sqlite-net, there are several ways you could setup your database:
Call sqlite-net's APIs for creating tables based on your C# classes, then add things it doesn't support with manual SQL like foreign keys and indexes
Include an empty database with your app with the full schema already setup
Create the entire database with a raw SQL script
I tend to go with option #2 if I want full control of the database schema (and it's a little easier to include a database file I made in SQLite Expert). sqlite-net should work with an existing database just fine.
I'm building a small ASP.NET MVC site where I want to use SQLite. While I already know how I will be connecting to the database (using DbLinq), I don't understand how to put the ASP.NET tables generated by aspnet_regsql.exe into an SQLite database.
I've used the regsql tool before with SQL Server, but never with SQLite. How do I create them for the SQLite DB?
One strategy that I think might somehow work is:
Use aspnet_regsql.exe to create the tables into an empty SQL Server database
Script all the objects in the database into T-SQL
Apply the T-SQL to the SQLite DB (how?)
Take a look at http://salient.codeplex.com
the Web.SQLite directory contains a drop in replacement for the default SQL providers.
It was a proof of concept that turned out ok. It uses EF, so is not as performant as it could be but should service low/medium traffic sites without issue.
You should be able to exclude all other files except that subdirectory and build it in isolation if desired. This will allow you to also trim the references.
Let me know if you have any issues.
You could try it with SQL Server Compact Edition 4 which is an embeddable SQL engine like SQLite but has an easier upgrade path if you need to grow it up to SQL Express or SQL Server.
Unfortunately the aspnet_regsql will not work with SQLite, so your strategy is essentially the correct approach. However, I would suggest looking at something like Roger Martin's Gallery Server Pro, which uses SQLite and already has the Membership, Role, and Profile provider tables scripted. You can make use of the script. See Roger's Code Project article from more information.