如何按时间段导出oracle数据库?

如何按时间段导出oracle数据库?,第1张

1 如果数据量特别小可以尝试用spool命令

SQL>spool /home/oracle/cc.txt

SQL>select * from tables where time between 20150101 and 20150102

SQL>spool off

2 如果数据库版本高于9i,并且查询数据库小,时间段是最近的可以尝试闪回查询

SQL>select * from tables as of timestamp (systimestamp - interval '10' minute)

3 可以通过闪回数据库,闪回到你要的时间点,然后在备份

4 可以通过exp或expdp的query参数

假设表table1中有字段setdate(date类型)

oracle语法:select

*

from

table1

where (to_char(setdate,'yyyy-mm-dd')

between

'2009-01-01'

and

'2009-12-31')

sqlserver语法:select

*

from

table1

where setdate

between

'2009-01-01'

and

'2009-12-31'

access语法:select

*

from

table1

where setdate

between

#2009-01-01#

and

#2009-12-31#

exp 用户名/密码@网络服务名 file=存储地址\JPG.DMP tables =表名 query=\"where 时间字段>='时间' and 时间字段<'时间' \"


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/sjk/9931059.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-05-03
下一篇2023-05-03

发表评论

登录后才能评论

评论列表(0条)

    保存