如何在Oracle中备份视图和某些表? [英] How to backup view and some tables in oracle?

查看:1248
本文介绍了如何在Oracle中备份视图和某些表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Oracle数据库.在数据库上有三个表(a,b,c表)和一个视图(a和b表的联合).

I have an Oracle database. On the database There are three tables (a,b,c tables) and a view (union of a and b tables).

我想备份dan b表和视图.我使用了这种语法exp user/psw file=backup.dmp tables=(a,b),但是它不备份视图,仅备份表. 我如何包含要备份的视图?

I want to backup of a dan b tables and also the view. I used this syntax exp user/psw file=backup.dmp tables=(a,b) ,but it doesnt backup the view,only the table. How can i include the view to be backed up?

推荐答案

从Oracle 10g开始,expdp是标准导出命令,而exp已弃用.

From Oracle 10g onward, expdp is standard export command and exp is deprecated.

expdp具有include子句,您可以在其中指定要导出的表和视图.这是一个示例命令.

expdp has include clause where in you can specify tables and views you want to export. Here is a sample command.

expdp scott/tiger@mydb schemas=MYSCHEMA
 include=TABLE:"IN ('A', 'B','C')",VIEW:"IN('my_view')"  
 directory=MY_DIR dumpfile=Exp_ABC_MyView.dmp logfile=expdpExp_ABC_MyView.log

此外,您只能导出对象定义或数据,或两者都导出. https://oracle-base.com/articles/10g /oracle-data-pump-10g

Further you can export only object definitions or data or both as well. more examples in https://oracle-base.com/articles/10g/oracle-data-pump-10g

这篇关于如何在Oracle中备份视图和某些表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆