打印 mySQL 数据库的 ER 图(800 个表)

发布于 2024-09-06 17:30:42 字数 533 浏览 5 评论 0原文

我们有一个由 Parallels 构建的系统,它依赖于一个巨大的(800+)表来维护一切。

我需要学习这个系统,以便能够编写查询来检索数据以根据各种需求生成报告。

显然,我很难隔离哪些表当前与手头的任务相关,因此我认为最好的方法是为整个表系统在多个页面上生成和打印 ERD。

我尝试使用 TOAD 拖动所有表格 - 结果崩溃了:) 在第二次尝试时,我成功地将表 AN 拖到了(很长一段时间)之后,MZ 表成功了。

我什至设法将它们全部调整大小、排列并将 ERD 保存到文件中。

但是,当我进入打印或预览时,打印子进程崩溃了呵呵。

关于如何打印如此庞大的 ERD 有什么建议吗?或者也许是另一种方法?表名似乎不言自明,所以我不能(老实说,并不是真的想要)查看 800 多个表,并希望我不会错过我需要的内容或其中的一部分。

在我真正开始编写脚本和代码之前,我将非常感谢有关如何继续的任何建议或想法。

数据库在CentOS下的mySQL上,有些表是InnoDB,有些表是MyISAM。 许多表似乎都有外键。

谢谢!

We have a system built by Parallels, which is relying on a huge (800+) tables to maintain everything.

I need to learn this system, in order to be able to write queries to retrieve data for report generation on various needs.

I am obviously, having difficulties isolating which tables are currently relevant for the task at hand, so I thought the best way would be, to generate and print ERD over multiple pages, for the entire system of tables.

I have attempted to drag all the tables using TOAD - which crashed :)
On second attempt, I dragged tables A-N, after a (long) while, M-Z tables successfully.

I even managed to have them all resized, arranged and saved the ERD into file.

However, when I go into print or preview, the sub-process for print crashes hehe.

Any suggestions on how to print this massive ERD? or perhaps another method? The table names dont seem self explanatory, so I cant (and honestly, not really wanting) go over 800+ tables, and hope I dont miss what I need, or parts of.

I would greatly appreciate any advices or ideas on how to proceed, before I even get to actually writing the scripts and code.

The database is on mySQL under CentOS, some tables are InnoDB, some are MyISAM.
Many tables seem to be having Foreign Keys.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

小巷里的女流氓 2024-09-13 17:30:42

我工作的地方有几百张桌子(近 1000 张),没有人真正知道系统中发生了什么,公司正在成长并雇用了很多人。一个人的任务是绘制图表,他自动神奇地创建了一张巨大的平铺海报,其中包含每张桌子,并用线连接各个桌子(遍布整个地方)。我不确定他用的是什么,几年前是 Unix 和 Oracle(早于 Linux 和开源)。他的图表中的表格布局没有真正的韵律或理由。他成功地创建了每张桌子的图表。这张“海报”被贴在公共区域的墙上,看了几眼,但没有人真正使用过它,它无法使用,太杂乱,太杂乱。因此,我使用 MS-Word 创建了一个包含 20 个主表的单页图表(当我“发现”新的主表时,它经历了几次迭代),每个外键都有行,每个表都以逻辑方式定位。我显示了列名称、数据类型、可空性、PK 和所有 FK。我把图表挂在墙上显示器旁边。最终每个人都想要我的图表的副本,包括制作“海报”的人。当我离开那份工作时,他们仍在向新员工提供我的图表。

我建议您像探索者一样工作,找到关键表并在您探索时绘制它们,在发现系统时根据需要制作尽可能多的特定图表。试图自动制作一张巨大的“海报”效果并不好。

I worked at a place that had several hundred tables (near 1k) and no one really knew what was going on in the system, company was growing and hiring a lot. A guy was tasked with doing a diagram, and he auto-magically created a gigantic tiled poster that contained every table with lines connecting various tables (going all over the place). I'm not sure what he used, it was Unix and Oracle years ago (way before Linux and open source). There was no real rhyme or reason to the layout of the the tables in his diagram. He had successfully created a diagram of every table. The "poster" was put on a wall in a common area, and got a few looks, but no one ever really used it, it was unusable, too cluttered, too unorganized. As a result, I used MS-Word to create a single page diagram containing the 20 main tables (it went through a few iterations as I "discovered" new main tables) with lines for each foreign key and each table located in a logical manner. I showed the column name, data type, nullability, PK, and all FKs. I put my diagram up on my wall by my monitor. Eventually everyone wanted a copy of my diagram, including the person that made the "poster". When I left that job they were still giving my diagram to new hires.

I recommend that you work like an explorer, find the key tables and map them as you go, making as many specific diagrams as necessary as you discover the system. Trying to make a gigantic "poster" automatically will not work very well.

‘画卷フ 2024-09-13 17:30:42

您尝试过 mysql 工作台 吗?
如果您不介意 Windows,您也可以尝试 Enterprise Architect

have you tried mysql workbench?
if you don't mind windows, you could try Enterprise Architect as well

梦萦几度 2024-09-13 17:30:42

MySQL Workbench 有一些很棒的工具,可以通过创建脚本进行逆向工程。我还没有将它用于如此大的数据库,但你应该检查一下。

链接: http://wb.mysql.com/

MySQL Workbench has some great tools for reverse engineering from the create script. I haven't used it for such large databases, but you should check it.

Link: http://wb.mysql.com/

素染倾城色 2024-09-13 17:30:42

IIRC,MS Sql Server 有一些很好的用于制作图表的实用程序,我知道它很有帮助,您可以添加一个表,它会自动添加所有相关表。如果您可以将表转换为 MS SQL 兼容的 SQL 脚本,这可能会有所帮助。

IIRC, MS Sql Server has some nice utility for making diagrams, I know it helped a lot, you could add a table and it would automatically add all related tables. If you could convert your tables to a MS SQL compatible sql script, this might help.

浅暮の光 2024-09-13 17:30:42

Navicat 10.1 及更高版本可以完成这项工作。使用其模型工具并将数据库导入其中,然后轻松重新排列。将结果打印为 pdf 或直接打印到打印机。

Navicat 10.1 and later can do the job. use its model tool and import the database into it, then rearrange at your ease. printing results a pdf or directly to printer.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文