So I am working on this project which basically clones the functionalities of a sofware programmed in C# (I have no information about the source code).
Problem
I am developing a web application that will do a simple update on the database (db shared with the same software mentioned above). What i want to do? I want to 'spy' the SQL Queries executed by the software and by that, acquiring the information about it to perform my own queries clone a specific feature of that sofware. How can i accomplish that?
My Solution:
My idea is, I use the software, specificaly the feature I am interested in, then i check in the database which queries did the software execute and by doing that, i gain information about the updated tables and can code my own features.
My question is, how can you 'spy' the queries did the software execute using SQL Server Management ?
You probably want to log all the queries run by the app with Sql Server Profiler.
Related
I am an extremely under-experienced web developer who is attempting to create a website with a couple friends. The front end stuff is all taken care of and I have been assigned to handle the back end stuff. My background is Materials Engineering, so needless to say, my programming experience relative to back end web development is non-existent. The questions I am going to ask will likely be trivial, and might not make sense at all!
I am just going to try and gain any understanding of the dynamics between MySQL, MAMP, and Eclipse.
If I use the tools provided by MAMP (phpMyAdmin) to create databases, do I then have to incorporate code into our front end code to get it to talk to the databases?
Is MySQLWorkbench a viable option to create the databases? If it is, and I create the databases and extract the code for the databases, where would this code go?
I guess I am just trying to obtain general knowledge on how to create and incorporate databases with MAMP and eclipse, when using MySQL as a database. Again, I understand this is probably trivial, so I would appreciate any information that can be provided!
Thank you.
Firstly, eclipse is simply an IDE (Integrated Development Environment), rather it is a tool that can be used to help develop your code, make sure that you are following proper syntax, etc. It is not however, a replacement for knowing a programming language.
That said, MAMP (Mac, Apache, MySQL, & PHP) is an application stack. Macintosh being the operating system, Apache being the web server that serves up your web pages, PHP being the back end programming language that (potentially) compiles the pages that Apache Servers, and MySQL being the database from which PHP pulls the data from.
As far as creating your databases, PhpMyAdmin and MySQL Workbench are both tools for helping you accomplish the task of creating your databases, tables, and potentially inserting data into these tables. However, as mentioned above you will need to use PHP or some other language, to connect to these databases and pull the information. I highly recommend checking out the PHP MySQLi and PDO MySQL libraries.
I am curious if there is a standard or open-source application that allows a small team of developers to share MySQL database update/modification scripts?
Right now all the developers have a VM with their own instance of a database, so there are no conflicts and each can have separate development environment. When one makes a DB change we add the SQL scripts to a SQL text file in SVN, which is then run by each dev in their own environment when necessary.
The issue that we are having is that when someone updates the file, the others run the script, and then we add additional changes. It gets very confusing and we get errors if there are ALTER table statements, etc.
We don't want to use DB replication because if one dev destroys their DB we don't want the others to be affected.
We use ExpressionEngine and I've noticed they use PHP to check/validate SQL updates, is that the direction we will need to go?
Anyone else deal with this issue? If so, what did you end up using?
A fairly simple solution is to have a directory, instead of a single file. Then each time a Dev makes a change, they add a "patch file" to the directory. Other developers can get their databases up to date by running any patches they haven't yet run.
This can even be automated by having a metadata table in the database to track which patches have been run and writing a script to run any that haven't.
Lorna Mitchell has blogged about some strategies to doing this:
http://www.lornajane.net/posts/2010/simple-database-patching-strategy
http://www.lornajane.net/posts/2012/taking-on-a-database-change-process
The comments are full or people recommending various tools to help with the process. Personally, I just have a fairly simple script and have no need for larger libraries, but your mileage may vary.
Perhaps what you want is migration support.
Then, you put the migration code in whatever CVS you use and each team member migrates (i.e. runs the migration script) on their box, and this syncs all databases.
The framework I use (yii) supports it but I'm pretty sure there are some standalone solutions if you don't want to have to bring the whole framework over.
Hi all i am a Student working on a project in an Hospital we designed an application where patient can book an appointment with doctor similar to this application (apphp.com/php-medical-appointment/examples/sample2/index.php) and our application uses php and mysql and runs on microcms framework now what we are trying to do is to get this application integrated with MedTrak (http://www.intersystems.com/trakcare/) which uses CACHE DB (Intersystems Cache db a post relational db)
we have written our application using mysql so is there any possible ways that we can fire data from our application to their db and. get, data from their db
So far we have tried these methods
odbc will it work cause we have to write our application in ODBC again
Help
Enterprise Application Patterns is a great book and I highly recommend it. However, I would add that even if you had top notch messaging middle-ware available to ensure the 2 applications are as loosely coupled as possible, at some point you will have to read or write to the Cache database, and you will probably need both.
Also, a sophisticated approach to integration may or may not be feasible on a student project. Perhaps it would be sufficient to have most of your code talk to an abstract communication layer that encapsulates the exact integration? You could start with whatever is simplest to implement but could have a story about how it could be changed later. Even this is probably quite hard enough for a student project, since the interface really should assume the communication is asynchronous.
In any case, at some point the rubber will meet the road and you will have to read and/or write to the Cache database. And at that point, ODBC is available, and sounds like it would be a good choice for you. There are other methods to connect to Cache but ODBC is widely used (and therefore probably more reliable) and doesn't require you to learn Cache Object Script, which would be a lot of extra work for your situation.
There are many ways to achieve this - the best way to learn about this is to read "Enterprise Integration Patterns".
I wouldn't recommend writing directly to each other's database - it is a fragile way of gluing apps together, because a change in one schema requires you to change the other app at the exact same time. You have to deal with exotic failure modes - one database may be down for backups, which means you can't write the changes from the other database to it.
Read the book for alternatives!
I find myself in a situation that someone else must have got stuck in at some point.
Our company runs an in house MSSQL based database, our website then sits on an external server and currently runs MySQL. The problem comes that both databases need to communicate with each other increasingly often.
Our current solution involves SSIS packages but they are tempromental and often slow. We end up very often having to drop tables on our live production server before then rebuilding them from the in house server. Of course this is leading to data inconsistencies so we try and perform these operations outside of peak hours. However, this leads to 24hr delays in some data being transferred from MySQL to MSSQL and then an additional 24hr delay in getting it back to MySQL. None of this is ideal.
What I am looking for is a solution that will allow replication between our in-house MSSQL server and any database that can sit upon a linux box and play nicely with PHP. As I said, we currently run MySQL so we have a preference to any solution that would include that but all other suggestions would be greatfully received.
I've read somewhere that PostgreSQL is a vialbe solution but I am now struggling to find where I read that. I've come accross a few tools that might help such as DBMoto and Slony-I, does anyone have any experience of either in such a situation?
Alternatively, are we simply barking up the wrong tree altogether and should we be trying to integrate MSSQL into our PHP environment?
Any thoughts or suggestions would be gratefully recieved.
Many thanks
Rob
The best solution that i know and i have used for this kind of job is SymmetricDS .
SymmetricDS is an asynchronous data replication software package that
supports multiple subscribers and bi-directional synchronization.
You can access MSSQL servers from PHP using FreeTDS and the mssql_* family of functions (or classes built thereon, or alternative freetds-using extensions). We use this for our admin application, with a Linux/PHP website talking to a MSSQL database.
Does anybody know how to do smart database update in realtime.
E.g. I have a site with a great database. Suddenly I've made some code changes and database structure and data changes. Is there any standard plan to do it with deploy script or any deploy soft? In realtime without stopping the site?
E.g. switch between two clone databases or smth like that. How do experienced people do that?
Site is written in php, database is MySql.
Thanx!
Have you looked at DBdeploy? There's a good article here on managing database deployments using Phing and DBdeploy
Red Gate MySQL Compare has a 14-day fully functional trial. It preserves data when doing schema changes. There is also a separate MySQL Data Compare tool.
http://www.red-gate.com/products/sql-development/mysql-compare/