Compare SQL Server Database Schema with Oracle Database Schema - sql-server

in my development environment we support the application both on MSSQL Server as well as Oracle. The database schema of both of these RDBMS are same.
while development we found that the developer made a mistake and forgot to change the oracle database for the last 1 yr. therfore the oracle script is quite behind in term of schema from SQL Server schema script.
now the question is how i can compare the two RDBMS systems to find the difference and make the oracle script updated

If there are no track log from which it's possible to find and reproduce all changes applied to SQL Server since first detected inconsistency with Oracle version, or that changes was applied, but only partially, you really need to compare objects presented in both databases.
In this case setup a link between databases on any side and use system dictionary views to compare table structures and other objects to find differences and, possible, to generate script for Oracle scheme rollup.
If you want to act from MS SQL Server side:
Install and configure Oracle Instant Client
Install Oracle ODAC
Follow Microsoft recomendations (64-bit version)
Connect as any user with dba role (or use same Oracle schema where object resides) to Oracle from MS SQL database
If you want to act from Oracle Server side:
Install and configure Oracle Database Gateway for SQL Server.
Create database link to MS SQL Server.
After successful configuration you may join Information schema views on SQL Server side with Data dictionary views on Oracle side to find differences.
Of course there are many troubles at this way like different data types, but it gives a chance to automate at least part of work.

Related

what is the best way to migrate data from SQL Server to Oracle database

I have two remote databases, Oracle 19c and SQL Server 19. In my redhat linux, I have to read SQL Server table and write it to Oracle.
I wrote a Python code to read data from SQL Server and insert it to Oracle database. But, I think it is so slow. Since, the table has about 16 million records.
I search a lot and see this post:
https://stackoverflow.com/a/66550879/6640504
It said that Oracle Transparent Gateway makes it possible to run a procedure for migrating data from extra database to Oracle in little time.
I can access to Oracle database using terminal and don't have any graphical accesses.
Would you please guide me if Oracle Transparent Gateway is the best way to migrate data from SQL Server to Oracle database, how to install Oracle Transparent Gateway and use it? If not, what is the best way?
Any help is really appreciated.
One solution would be to work from SQL Developer.
You can download SQL Developer for free from https://www.oracle.com/tools/downloads/sqldev-downloads.html
SQL Developer provides a "migration workbench" that supports SQL Server.
The data migration can be done online or offline.
Online causes the table data to be moved by SQL Developer when you have completed the necessary information in the wizard; Offline causes SQL Developer to generate scripts after you have completed the necessary information in the wizard, and you must later run those scripts if you want to move the data. (Online moves are convenient for moving small data sets; offline moves are useful for moving large volumes of data.)

How can I encrypt a distributable SQL Server Express database?

We have a product that historically uses a Microsoft Access database which is great because it is portable.
However we are looking to move to SQL Server and this will range from the Express version upwards. In the Access database we can use a password to protect the database from prying eyes. Although I appreciate it only offers limited security. We need to be able to protect a SQL Server database however we do have access to the server as the database is delivered as part of the install. The client would install SQL Server and then attach the database. I looked at NetLib but that requires an install on the server. I cannot use TDE as SQL Express does not support that. I can use column encryption but I was wondering if there was a database wide solution. Basically no one except for us as supplier should be able to query the data unless they use our software interface.

Insert rows into a SQL Server table from Oracle

I have an Oracle 10G database running on a Unix environmnent and have a requirement to write a PL/SQL job that will be running on the Oracle database that will populate tables in another database which is a microsoft SQL Server database running on a Windows platform.
Having looked around, it looks like this is possible via database links. Has anyone got any more information on this? For example how reliable is the connection and are there any disadvantages in having such a setup?
Chances are that i would have limited access to the SQL Server database. Is the above possible without having to make any changes to the SQL server database? (Assuming the DBA on the SQL server has configured the database to be accessed from other databases)
Thanks
Use the Oracle feature DG4ODBC, it is as reliable as any normal DBLINK setup, to the SQL Server side it will look like any other sort of client connection. You only need to do anything more elaborate if you are planning to do distributed transactions between Oracle and SQL Server (i.e. 2 Phase Commit). You will probably also want UnixODBC and FreeTDS.

How Do I Update A Table From A Different SQL Server

I have a table in a database on my development(local workstation) SQL Server 2008 Express that I have added some records to. Now, I would like to deploy this table to the production SQL Server 2000 located on a server. What is the best was to accomplish this? I want to retain the data from the development instance. Both tables have the exact same structure. Can I use the DTS Import/Export wizard from the production SQL Server 2000 through the SQL Server Enterprise Manager? Does it overwrite tables when importing? Will it handle the different versions of SQL Server?
One technique is to create a linked server. Check the msdn link Linked server - msdn
Then you can write a single query to do the Update or whatever that has access to tables on both servers.
You development work should result in scripts, not in bits in the database. There are many advantages in doing so. When you deploy, you run the developed scripts on the productions database. Now that you let the cat out of the bag, your best option is to use export the table and then import it, see FAQ: How do I import/export data with SQL Express. SQL's own import/export wizard requires SSIS (see Importing and Exporting Data by Using the SQL Server Import and Export Wizard), which is not part of Express editions.
If the table is reasonable small you can use a distributed query (ie. linked server), but that will require MSDTC because it will be an update, and you may need to configure it.
If you have SqlServer Management Studio (not express). You can use the import and export options to quickly transfer data in and out. This assumes you can connect to the database from your local machine though.

SQL Server 2000/2005 - Maintaining Development Version and Production Version

I am used to using Oracle Designer by creating database object definitions, then creating DDL SQL required by connecting to a database instance.
For eaxmple, when adding a new column to a table, first I add it to the table definition, then generate the DDL SQL against the development version and run it, then after testing I point to the Production instance to create the missing column in Production.
Given that there is no Designer in SQL Server what is the correct procedure to say add a column to both database instances? Is there a tool for keeping the schemas in sync?
RedGate offer a product called SQL Compare, that can be used to script out the differences between different databases.
See: http://www.red-gate.com/products/SQL_Compare/index.htm
You could also use the Database Diagrams within SQL Server Management Studio to design your database schema however this would be constrained to within a given database.
There isn't a built in tool for keeping them in sync (that I know of), but RedGate has some commercial apps for this.
What do you mean there is no designer in SQL Server? Are you using SQL Server Management Studio?

Resources