sqlite3到底能支持多大的数据量?

hai_cheng001 2014-01-17 02:08:49
网上很多人说sqllite可支持TB级别的数据量,可为什么我在向sqllite数据库中写入数据的时候每当写入到2G这个临界点的时候数据文件就会损坏呢。(从2GB大小编程1MB多点)

分析一些原因,也没找到问题所在
可能原因:
正在写入数据的时候断电(没有断电,排除)
磁盘坏道(向硬盘放置一些其他的文件,将这部分磁盘占用掉,再去写入文件,同样到2G崩溃)
缓存大小的设置(sqllite在写入文件的时候会首先将数据放入到缓存中,然后再向数据文件中写入,可能是缓存设置的小了, 针对这个可能原因我是这么测试的,首先向数据库中写入1.9GB大小的数据,给予他足够的时间去处理,同样到2G崩溃 ,我觉得这个原因可以排除)
sqllite数据文件所在磁盘空间不足(硬盘空间足够,而且sqllite也没有Oracle中表空间的概念,排除)

最可能的原因也就是可能是sqllite有一些可设置的参数影响着sqllite数据文件的大小?但是我没查到。


请求大家帮助

最近一直在针对Oracle、Mysql、SQL Server 、Sqllite3这几个数据库进行调研,到现在也没找出哪个数据库适合我们的项目。




...全文
45873 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
SQLite数据库有已知的大小限制吗? 在Windows和Unix下,版本2.7.4的SQLite可以达到2的41次方字节(2T字节)。老版本的为2的31次方字节(2G字节)。 SQLite版本2.8限制一个记录的容量为1M。SQLite版本3.0则对单个记录容量没有限制。 表名、索引表名、视图名、触发器名和字段名没有长度限制。但SQL函数的名称(由sqlite3_create_function() API函数创建)不得超过255个字符。
clxer 2015-05-12
  • 打赏
  • 举报
回复
3.Big data? → choose client/server If your data will grow to a size that you are uncomfortable or unable to fit into a single disk file, then you should select a solution other than SQLite. SQLite supports databases up to 140 terabytes in size, assuming you can find a disk drive and filesystem that will support 140-terabyte files. Even so, when the size of the content looks like it might creep into the terabyte range, it would be good to consider a centralized client/server database. sqlite官网原文
rex1981 2014-01-24
  • 打赏
  • 举报
回复
ACMAIN_CHM 2014-01-20
  • 打赏
  • 举报
回复
随便把这段话中的某句复制到 google 中就可以找到了。
hai_cheng001 2014-01-20
  • 打赏
  • 举报
回复
引用 7 楼 ACMAIN_CHM 的回复:
引用
Maximum Database Size Every database consists of one or more "pages". Within a single database, every page is the same size, but different database can have page sizes that are powers of two between 512 and 65536, inclusive. The maximum size of a database file is 2147483646 pages. At the maximum page size of 65536 bytes, this translates into a maximum database size of approximately 1.4e+14 bytes (140 terabytes, or 128 tebibytes, or 140,000 gigabytes or 128,000 gibibytes). This particular upper bound is untested since the developers do not have access to hardware capable of reaching this limit. However, tests do verify that SQLite behaves correctly and sanely when a database reaches the maximum file size of the underlying filesystem (which is usually much less than the maximum theoretical database size) and when a database is unable to grow due to disk space exhaustion.
检查SQLITE版本,检查操作系统磁盘格式,确定是否是 NTFS
请问下,这段是在哪看到的
ACMAIN_CHM 2014-01-20
  • 打赏
  • 举报
回复
引用
Maximum Database Size Every database consists of one or more "pages". Within a single database, every page is the same size, but different database can have page sizes that are powers of two between 512 and 65536, inclusive. The maximum size of a database file is 2147483646 pages. At the maximum page size of 65536 bytes, this translates into a maximum database size of approximately 1.4e+14 bytes (140 terabytes, or 128 tebibytes, or 140,000 gigabytes or 128,000 gibibytes). This particular upper bound is untested since the developers do not have access to hardware capable of reaching this limit. However, tests do verify that SQLite behaves correctly and sanely when a database reaches the maximum file size of the underlying filesystem (which is usually much less than the maximum theoretical database size) and when a database is unable to grow due to disk space exhaustion.
检查SQLITE版本,检查操作系统磁盘格式,确定是否是 NTFS
hai_cheng001 2014-01-20
  • 打赏
  • 举报
回复
引用 4 楼 iihero 的回复:
还真没听说过sqlite支持TB级,它的大小受制于运行时的文件系统。
http://baike.baidu.com/link?url=uK2p7LG9HS55yZKJX9h9fW8ZkaiEKWTU7Tsg9FkRuN8MS7lkq3o_QdWijj1ajbwm这里提到了sqlite的支持数据量到2TB,也有一些其他地方说的,官方网站没有找到明确数字。 至于文件系统的限制 我的硬盘格式是NTFS的文件大小限制应该是64GB吧,总不至于因为这个原因导致我写不了2GB的数据
ACMAIN_CHM 2014-01-17
  • 打赏
  • 举报
回复
你的操作系统,文件系统是什么版本? 操作系统本身对文件大小的限制是什么?
iihero 2014-01-17
  • 打赏
  • 举报
回复
还真没听说过sqlite支持TB级,它的大小受制于运行时的文件系统。
wwwwb 2014-01-17
  • 打赏
  • 举报
回复
SQLITE对并发(网络)支持不好,建议使用SYBASE的ASA。
hai_cheng001 2014-01-17
  • 打赏
  • 举报
回复
引用 1 楼 wwwwb 的回复:
SQLITE什么版本,什么系统,磁盘什么格式,对数据库有什么要求,详细说明
sqlite版本:sqlite3 操作系统:暂时测试是在window下,部署是在linux下的 磁盘格式:NTFS 数据库要求:由于sqlite不支持分区,建20000个表,每个表插入86400条数据,需要没秒对着20000个表中的一条记录进行修改。这是极限情况,正常使用也就是没5s对20000个表同时修改一下。 顺便再问下:sqlite只能同时存在一个写的连接吗?有没有什么办法可以让它同时多个连接进行写入。
wwwwb 2014-01-17
  • 打赏
  • 举报
回复
SQLITE什么版本,什么系统,磁盘什么格式,对数据库有什么要求,详细说明

2,209

社区成员

发帖
与我相关
我的任务
社区描述
其他数据库开发 其他数据库
社区管理员
  • 其他数据库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧