简体   繁体   English

通过Shell脚本从Oracle DB中提取插入语句

[英]Extract Insert statements from Oracle DB through Shell script

I want to extract the insert statements for the data in a table in Oracle DB through the shell script. 我想通过shell脚本为Oracle DB中的表提取数据的插入语句。 It would be similar to DB backup but I need insert statements for data in all tables in DB. 这将类似于数据库备份,但是我需要在数据库中所有表中的数据插入语句。

If your aim is : Extract all insert statement for all tables in database, than run those insert in different database ? 如果您的目标是:为数据库中的所有表提取所有insert语句,而不是在其他数据库中运行那些insert? Or wish to save these insert statement for future use ? 还是希望保存这些插入语句以备将来使用?

If above requirement is true, their are better way to achieve this. 如果上述要求是正确的,则它们是实现此目的的更好方法。 Insert statement with "data" shown expose data to anyone who can read these extract & a serious security threat. 显示带有“数据”的插入语句会将数据公开给任何可以读取这些摘录的人,并且这是严重的安全威胁。 You should look for using datapump for this requirement. 您应该为此目的使用datapump。

  • Abhi ABHI

If you have TOAD for Oracle you can exact the results of a query from Data Grid of a Editor window. 如果您有TOAD for Oracle,则可以从“编辑器”窗口的“数据网格”中精确查询结果。 Click the Export Dataset button above the resulting data set and select insert statements. 单击结果数据集上方的导出数据集按钮,然后选择插入语句。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM