To show relationship among different tables in database.

* SchemaSpy is a Java-based tool (requires Java 5 or higher) that analyzes the metadata of a schema in a database and generates a visual representation of it in a browser-displayable format. It lets you click through the hierarchy of database tables via child and parent table relationships as represented by both HTML links and entity-relationship diagrams. It’s also designed to help resolve the obtuse errors that a database sometimes gives related to failures due to constraints.

* It is free software that is distributed under the terms of the Lesser GNU Public License 2.1.

* Install Graphviz by running following command in terminal(Alt+Ctrl+T):

sudo apt-get install graphviz

* SchemaSpy uses the dot executable from Graphviz to generate graphical representations of the table/view relationships.

* Run the following command in terminal:

sudo apt-get install libmysql-java

* After thet download the SchemaSpy Software from the following link:

http://sourceforge.net/projects/schemaspy/files/schemaspy/SchemaSpy%205

* Rename the downloaded package to your suitable name (say SchemaSpy).

* Now run the SchemaSpy with the following given command.Make appropriate changes in below command before running, like :

java -jar schemaSpy.jar -t mysql -o library -host localhost -db db_name   -u user -p password -dp /usr/share/java/mysql-connector-java.jar

Description of parameters used in above command:

    -t databaseType: Type of Database(e.g ora,db2 etc.)
-db db_name: Name of the Database to connect to.
-u user: Valid database user id with read access.
-s schema: Database schema.
-p password: Password associated with that user.
-o output Directory: Directory to write the generated HTML/graphs to.
-dp path/T/oDrivers: Looks for drivers here before looking in driverPath in [databaseType].properties. The drivers are usually contained in .jar or .zip files and are typically provided by your database vendor.

* Your Library folder has been created in /home/downloads , open the library folder and you can run any of the files in browser and understand relationships among different tables in database.

Note: In some cases,  it gives following error after running the above command :

The program ‘java’ can be found in the following packages:
 * default-jre
 * gcj-4.6-jre-headless
 * openjdk-6-jre-headless
 * gcj-4.5-jre-headless
 * openjdk-7-jre-headless
Try: sudo apt-get install <selected package>

* Run following commands to satisfy all the needs :

apt-cache search jdk

sudo apt-get install openjdk-7-jdk openjdk-7-jre

* Now again run the SchemaSpy with the above given command.It wll work.

Thats all 🙂

Advertisements

10 comments

  1. search engine · July 5, 2012

    I constantly spent my half an hour to read this website’s posts daily along with a mug of coffee.

  2. captcha solver · July 22, 2012

    Hello there, just became alert to your blog through Google, and found that
    it’s truly informative. I am gonna watch out for brussels. I’ll appreciate if you continue this in future. A lot of people will be benefited from your writing. Cheers!

  3. automated captcha bypass · July 22, 2012

    I’m not that much of a internet reader to be honest but
    your blogs really nice, keep it up! I’ll go ahead and bookmark your website to come back in the future. All the best

  4. bypass captcha · July 22, 2012

    Hi, I read your blog regularly. Your story-telling style is witty, keep
    it up!

  5. captcha bypass · July 22, 2012

    Hello, just wanted to mention, I loved this article. It was practical.
    Keep on posting!

  6. how to bypass captcha · July 22, 2012

    I think that is one of the most important information for me.

    And i’m glad studying your article. However wanna remark on some normal things, The site taste is great, the articles is really great : D. Good process, cheers

  7. high pr backlinks · July 23, 2012

    whoah this weblog is fantastic i really like reading your articles.
    Keep up the good work! You realize, a lot of persons are hunting round
    for this information, you could help them greatly.

  8. auto captcha · July 23, 2012

    Excellent blog here! Also your website loads up very fast!
    What host are you using? Can I get your affiliate link to your host?
    I wish my web site loaded up as fast as yours lol

  9. create website Free · July 25, 2012

    Hi there, its fastidious piece of writing on the
    topic of media print, we all be familiar with media is a great source of data.

  10. Ahaa, its fastidious conversation concerning this article at this place at this website, I have read all that, so at this time me also commenting at this place.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s