列出Oracle导出转储文件的内容
我有一个 oracle 完整转储。我知道我必须使用 fromuser
touser
子句来导入转储。但是我不知道转储中包含的模式的名称。
如何打开使用 Oracle 10g 创建的转储来检查和分析内容?
I have an oracle full dump. I know I have to imp the dump with the fromuser
touser
clause. However I don't know the names of the schemas included in the dump.
how can I open the dump created with Oracle 10g just to check and analyze the content?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
只需使用
SHOW=Y
参数Just use the
SHOW=Y
parameter如果您只对对象名称和架构的名称感兴趣,那么这对于对象列表而不是表内的内容很有用。
命令成功完成后,使用您最喜欢的文本编辑器(如记事本/vim)通过添加参数 LOG=logfile.log 打开 imp 命令生成的日志文件。
在此文件中,imp 命令将输出它将按照实际情况执行的所有操作。
现在在每个位置搜索文本“导入”,您将获得架构名称,后跟该架构中包含的 object_names。
接下来是创建/更改对象的命令,就像它们在原始数据库中一样。
之后将模拟数据插入,您可以了解每个模式中有多少记录。
用于仅导入一个表 EMP 的示例导入文件
---------imp 命令的开始输出 --------
---------imp 命令的结束 ---- -----
看这里
该工具声称并为您提供转储文件和将数据放入 Excel/Access/CSV 格式的文件中。这也许就是您正在寻找的。
它显示表中的内容,而无需导入真实数据库,
以防万一有人想要查找哪个转储文件包含所需的数据。
您应该保留一个日志文件,该日志文件的名称与每个 DUMPFILE 后缀相同,并附加其日期和时间,而不是遍历所有旧转储。
例如 FULL_DB_DUMP_15012014_1240pm.DMP,
这样您只需打开相关日志文件即可了解哪些文件包含您需要或感兴趣的架构。
[2]:再考虑一下:如果您的转储文件达到 2GB 并且您可以识别 ORACLE SQL。
使用十六进制编辑器(如 HxD、Hexor、HexEdit)以只读模式打开转储文件。打开后,您可以以二进制/ascii 形式浏览转储文件的内容。这可能是一个粗略的方法,但它会给你一个模式和对象名称 DDL 的部分视图,以及视图/触发器/函数/过程等的一些内容。了解全部内容。但它达到了目的。也许相对较快。
if you are only interested in the name of object names and schema this is good for list of objects not the contents inside table.
once your command is successfully finished, use your favorite text editor like notepad /vim to open the log file generated by imp command by adding parameter LOG=logfile.log.
in this file imp command will output all the actions it will perform as real case scenario.
now search for the text "importing " on each location you will get SCHEMA NAMES followed by the object_names contained in that schema.
followed by commands to create/alter the objects as they were in original database.
after that the data insertions will be simulated you may get idea how many records in each schema.
SAMPLE import file for importing just one table EMP
---------start output of imp command --------
---------end of out of imp command ---------
Look here
This tool claims and offers you to take a dump file and put the data into Excel/Access/CSV formated file. which maybe what you are looking for.
it show whats inside the tables with out import to real database
just in case someone is looking to find which dump file contains the data needed.
instead of going through all the old dumps you should keep a logfile with same name of each DUMPFILE suffix appended with its date and time.
like FULL_DB_DUMP_15012014_1240pm.DMP
so that you just open the relevant log file to get the idea which files contain what schema of your need or interest.
[2]: ON a second thought: if your dump file is upto 2GB and you can identify ORACLE SQL.
Use a hex editor like HxD, Hexor, HexEdit in readonly mode to open the dump file. Once opened you can browse the contents of dump file in binary/ascii form. this may be a crude method but it will give you a partial view of schema and objects names DDL with some contents of views/triggers/Functions/Procedures etc. Although, you will not be able to read & understand the whole contents. but it servers the purpose. maybe relatively fast.
如果您在 UNIX 环境中工作,则可以使用命令字符串来显示转储文件中的可读信息。
if you are working in a UNIX environment, you may use command strings to show readable information from the dump files.
如果您正在寻找表格列表,我发现了这个糟糕的解决方案,我不知道它是否有帮助:
the我得到的输出
If you looking for a list of tables I found this poor solution, I don't know if it helps :
the output I got