英文:
How can I create backup script for selected tables in Oracle
问题
我正在使用以下脚本来创建备份文件,但它备份了所有表格。我想要备份选定的表格。如何实现这一目标。
以下脚本运行正常。
select 'C:\Daily-MIS-Backup\'||TO_CHAR(SYSDATE,'YYYYMMDD-HH24MISS')||'.DMP' foo3 from dual;
HOST EXP USERID=myusername/mypassFILE='^LOG1' GRANTS=Y ROWS=Y OWNER=SMPSYS LOG=EXPORT.LOG
我们尝试了以下代码,但它备份了所有表格。我们需要备份选定的表格。
select 'C:\Daily-MIS-Backup\'||TO_CHAR(SYSDATE,'YYYYMMDD-HH24MISS')||'.DMP' foo3 from dual;
HOST EXP USERID=myusername/mypassFILE='^LOG1' GRANTS=Y ROWS=Y OWNER=SMPSYS LOG=EXPORT.LOG
英文:
I am using below script to create backup file but it takes backup of all tables. I want backup of selected tables. how can I achieve this.
imp <username>/<password>@<hostname> file=<filename>.dmp log=<filename>.log full=y;
Below script is working fine.
select 'C:\Daily-MIS-Backup\'||TO_CHAR(SYSDATE,'YYYYMMDD-HH24MISS')||'.DMP' foo3 from dual;
HOST EXP USERID=myusername/mypassFILE='^LOG1' GRANTS=Y ROWS=Y OWNER=SMPSYS LOG=EXPORT.LOG
We tried following code but it took backup of all tables. we need backup of selected tables.
select 'C:\Daily-MIS-Backup\'||TO_CHAR(SYSDATE,'YYYYMMDD-HH24MISS')||'.DMP' foo3 from dual;
HOST EXP USERID=myusername/mypassFILE='^LOG1' GRANTS=Y ROWS=Y OWNER=SMPSYS LOG=EXPORT.LOG
答案1
得分: 2
import
和 export
工具有一个 TABLES
参数。语法如下:
TABLES=(myschema1.table1, myschema2.table2, ...)
如果你在 UNIX 或需要转义括号的操作系统上使用,请记得转义括号。
英文:
The import
and export
utilities have a TABLES
parameter. Syntax is like this:
TABLES=(myschema1.table1, myschema2.table2, ...)
Remember to escape the parentheses if you're on UNIX or an OS that requires that.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论