http://rockingtechnology.blogspot.co.uk/2011/06/oracle-backup-and-restore-code-in-cnet.html
http://rockingtechnology.blogspot.co.uk/2011/06/oracle-backup-and-restore-code-in-cnet.html
As per the proposed code in the above article, more specifically:
根据上文所提议的守则,更具体地说:
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = "C:/oracle/product/10.2.0/db_1/BIN/exp.exe";
Process process = Process.Start(psi);
process.WaitForExit();
process.Close();
How can I expect the database to be affected with regards to interruption of CRUD operations from elsewhere once calling Process.Start(psi) and, hence, executing exp.exe?
一旦调用Process.Start(psi)并因此执行exp.exe,我怎么能指望数据库会因来自其他地方的CRUD操作中断而受到影响呢?
Using Oracle's exp.exe process - will the sessions of all users currently writing to the db in question be killed, for example? I'd imagine (or at least hope) not, but I haven't been able to find documentation to confirm this.
使用Oracle的exp.exe过程——例如,所有正在向db写入的用户的会话是否会被终止?我想(或至少希望)不会,但我还没有找到文件来证实这一点。
3 个解决方案
#1
1
EXP and IMP are not proper backup and recover tools. They are intended for exchanging data and data structures between Oracle databases. This is also true for their replacement, Data Pump (EXPDP and IMPDP).
EXP和IMP不是正确的备份和恢复工具。它们用于在Oracle数据库之间交换数据和数据结构。这也适用于它们的替换,数据泵(EXPDP和IMPDP)。
Export unloads to a file so it won't affect any users on the system. However if you want a consistent set of data you need to use the CONSISTENT=Y parameter if there are any other users connecting to the system .
导出卸载到文件,这样不会影响系统上的任何用户。但是,如果您想要一组一致的数据,如果有其他用户连接到系统,则需要使用一致=Y参数。
Interestingly Data Pump does not have a CONSISTENT parameter. It unloads tables (or table partitions) as single transactions but the only way to guarantee consistency across all database objects is to use the FLASHBACK_SCN parameter (or kick all your users off the system).
有趣的是,数据泵没有一个一致的参数。它将表(或表分区)卸载为单个事务,但是保证跨所有数据库对象的一致性的唯一方法是使用FLASHBACK_SCN参数(或将所有用户踢出系统)。
"It is all in aid of DR."
"一切都是为了帮助博士"
As a DR solution this will work, with the following provisos.
作为DR解决方案,这将会起作用,并附带以下条件。
- The users will lose all data since the last export (obvious)
- 用户将丢失自上次导出以来的所有数据(显然)
- You will need to ensure the export is consistent across all objects
- 您需要确保所有对象的导出是一致的
- Imports take time. A lot of time if you have many tables or a lot of data. Plus indexes, etc
- 进口需要时间。如果你有很多表格或很多数据,你会花很多时间。加索引等
Also remember to export the statistics as well as the data.
还要记住导出统计数据和数据。
#2
1
You're really asking what effects the (old) Oracle export tool (exp
) has on the database. It's a logical backup so you can think of the effects generally the same way you would think of running multiple SELECT
queries against your database. That is, other sessions don't get killed but normal locking mechanisms may prevent them from accessing data until exp
is done with it and this could, potentially, lead to timeouts.
您实际上是在问(旧的)Oracle export工具(exp)对数据库有什么影响。它是一个逻辑备份,所以您可以像考虑对数据库运行多个SELECT查询一样考虑效果。也就是说,其他会话不会被终止,但是正常的锁定机制可能会阻止它们访问数据,直到使用exp完成,这可能会导致超时。
#3
1
EXP
is the original export utility. It is discontinued and not supported in the most recent version (11g).
EXP是最初的出口工具。在最近的版本(11g)中,它被停止并不支持。
You can use EXPDP
instead, although the export files are written on the server instead of the client machine.
相反,您可以使用EXPDP,尽管导出文件是在服务器上而不是客户机机器上编写的。
Both utilities issue standard SELECT
commands to the database, and since readers don't interfere with concurrency in Oracle (writer don't block readers, readers don't block readers), this will not block your other DB operations.
这两个实用程序都向数据库发出标准的SELECT命令,并且由于读取器不会干扰Oracle中的并发性(写入器不会阻塞读取器,读取器不会阻塞读取器),所以这不会阻塞您的其他DB操作。
Since it issues statements however, it may increase the resource usage, especially IO, which could impact performance for concurrent activity.
但是,由于它发出语句,它可能会增加资源的使用,特别是IO,这可能会影响并发活动的性能。
Whatever tool you use, you should spend some time learning about the options (also since you may want to use it as a logical copy, make sure you test the respective import tools IMP and IMPDP). Also a word of warning: these tools are not backup tools. You should not rely on them for backup.
无论您使用什么工具,您都应该花一些时间了解这些选项(同时,由于您可能希望将其作为逻辑副本使用,请确保您测试了各自的导入工具IMP和IMPDP)。还有一个警告:这些工具不是备份工具。你不应该依赖他们的支持。
#1
1
EXP and IMP are not proper backup and recover tools. They are intended for exchanging data and data structures between Oracle databases. This is also true for their replacement, Data Pump (EXPDP and IMPDP).
EXP和IMP不是正确的备份和恢复工具。它们用于在Oracle数据库之间交换数据和数据结构。这也适用于它们的替换,数据泵(EXPDP和IMPDP)。
Export unloads to a file so it won't affect any users on the system. However if you want a consistent set of data you need to use the CONSISTENT=Y parameter if there are any other users connecting to the system .
导出卸载到文件,这样不会影响系统上的任何用户。但是,如果您想要一组一致的数据,如果有其他用户连接到系统,则需要使用一致=Y参数。
Interestingly Data Pump does not have a CONSISTENT parameter. It unloads tables (or table partitions) as single transactions but the only way to guarantee consistency across all database objects is to use the FLASHBACK_SCN parameter (or kick all your users off the system).
有趣的是,数据泵没有一个一致的参数。它将表(或表分区)卸载为单个事务,但是保证跨所有数据库对象的一致性的唯一方法是使用FLASHBACK_SCN参数(或将所有用户踢出系统)。
"It is all in aid of DR."
"一切都是为了帮助博士"
As a DR solution this will work, with the following provisos.
作为DR解决方案,这将会起作用,并附带以下条件。
- The users will lose all data since the last export (obvious)
- 用户将丢失自上次导出以来的所有数据(显然)
- You will need to ensure the export is consistent across all objects
- 您需要确保所有对象的导出是一致的
- Imports take time. A lot of time if you have many tables or a lot of data. Plus indexes, etc
- 进口需要时间。如果你有很多表格或很多数据,你会花很多时间。加索引等
Also remember to export the statistics as well as the data.
还要记住导出统计数据和数据。
#2
1
You're really asking what effects the (old) Oracle export tool (exp
) has on the database. It's a logical backup so you can think of the effects generally the same way you would think of running multiple SELECT
queries against your database. That is, other sessions don't get killed but normal locking mechanisms may prevent them from accessing data until exp
is done with it and this could, potentially, lead to timeouts.
您实际上是在问(旧的)Oracle export工具(exp)对数据库有什么影响。它是一个逻辑备份,所以您可以像考虑对数据库运行多个SELECT查询一样考虑效果。也就是说,其他会话不会被终止,但是正常的锁定机制可能会阻止它们访问数据,直到使用exp完成,这可能会导致超时。
#3
1
EXP
is the original export utility. It is discontinued and not supported in the most recent version (11g).
EXP是最初的出口工具。在最近的版本(11g)中,它被停止并不支持。
You can use EXPDP
instead, although the export files are written on the server instead of the client machine.
相反,您可以使用EXPDP,尽管导出文件是在服务器上而不是客户机机器上编写的。
Both utilities issue standard SELECT
commands to the database, and since readers don't interfere with concurrency in Oracle (writer don't block readers, readers don't block readers), this will not block your other DB operations.
这两个实用程序都向数据库发出标准的SELECT命令,并且由于读取器不会干扰Oracle中的并发性(写入器不会阻塞读取器,读取器不会阻塞读取器),所以这不会阻塞您的其他DB操作。
Since it issues statements however, it may increase the resource usage, especially IO, which could impact performance for concurrent activity.
但是,由于它发出语句,它可能会增加资源的使用,特别是IO,这可能会影响并发活动的性能。
Whatever tool you use, you should spend some time learning about the options (also since you may want to use it as a logical copy, make sure you test the respective import tools IMP and IMPDP). Also a word of warning: these tools are not backup tools. You should not rely on them for backup.
无论您使用什么工具,您都应该花一些时间了解这些选项(同时,由于您可能希望将其作为逻辑副本使用,请确保您测试了各自的导入工具IMP和IMPDP)。还有一个警告:这些工具不是备份工具。你不应该依赖他们的支持。