[sqlite] Usage of SQLITE_OMIT_DISKIO and SQLITE_OMIT_MEMORYDB

2010-03-23 Thread ramesh.kotabagi
Hi,
 
SQLITE_OMIT_DISKIO :
This option omits all support for writing to the disk and forces
databases to exist in memory only.
 
SQLITE_OMIT_MEMORYDB:
When this is defined, the library does not respect the special database
name ":memory:" (normally used to create an in-memory database). If
":memory:" is passed to sqlite3_open(), sqlite3_open16(), or
sqlite3_open_v2(), a file with this name will be opened or created,
 
1) Using flag, will DB is stored in RAM.. ?
2) Will access to DB(read and write) become faster compared to one
normal file format DB.
3) How the DB is maintained here, file OR data structure ?
 
 
Currently we are using sqlite in normal mode, without using these
option, how much these flags help,
to make faster access to DB(write and read)
 
Thanks in advance,
 
Regards,
Ramesh
 
 
 
 
 

Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email. 

www.wipro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Possible Corruption for DB malformation

2010-03-02 Thread ramesh.kotabagi
Hi,

Below  is the part of code which gives error, when running the corrupted
DB with gdb, i guess this may help to find the root cause for DB
corruption,

The DB was able to recover with "vacuum" command also.



SQLite version 3.6.22

Enter ".help" for instructions

Enter SQL statements terminated with a ";"

sqlite>  pragma integrity_check;

*** in database main ***

Main freelist: 21 of 21 pages missing from overflow list starting at 0

Page 1604: btreeInitPage() returns error code 11

Page 1461 is never used

Page 1468 is never used

Page 1469 is never used

Page 1472 is never used

Page 1473 is never used

Page 1474 is never used

Page 1475 is never used

Page 1478 is never used

Page 1480 is never used

Page 1482 is never used

Page 1484 is never used

Page 1485 is never used

Page 1486 is never used

Page 1488 is never used

Page 1489 is never used

Page 1491 is never used

Page 1517 is never used

Page 1531 is never used

Page 1536 is never used

Page 1578 is never used

Page 1581 is never used

(gdb) b btreeInitPage

Breakpoint 1 at 0x40031130: file sqlite3.c, line 38929.

(gdb) list

...

..

(gdb)

39024   if( nFree>usableSize ){

39025 return SQLITE_CORRUPT_BKPT;

39026   }

39027   pPage->nFree = (u16)(nFree - iCellFirst);

39028   pPage->isInit = 1;

39029 }

39030 return SQLITE_OK;

39031   }

39032

39033   /*

(gdb) b 39025

Breakpoint 2 at 0x4003134c: file sqlite3.c, line 39025.

(gdb)del 1

(gdb) c

Continuing.



Breakpoint 2, btreeInitPage (pPage=0x82986d4) at sqlite3.c:39025

39025 return SQLITE_CORRUPT_BKPT;

(gdb) bt

#0  btreeInitPage (pPage=0x82986d4) at sqlite3.c:39025

#1  0x4003b0fb in checkTreePage (pCheck=0xbfffced0, iPage=1604,

zParentContext=0xbfffcda0 "On page 226 at right child: ")

...

...

(gdb) print nFree

$1 = 0

(gdb) print usableSize

$2 = 2053

(gdb)



This shows it returns from here

if( nFree>usableSize ){

  return SQLITE_CORRUPT_BKPT;

}

Thanks and Regards,

Ramesh




Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email. 

www.wipro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Unable to recover the DB by vacuum

2010-02-23 Thread ramesh.kotabagi
Thanks lot Pavel,
 
 >I only had two problem tables and luckily these seldom change,  for
these I went back to the week old backup and cut them out of the dump
file and applied them to the newly created database. Now I
integrity_check more often
 
i will try out ".dump option", i done last time also, i didn't able to
recover the complete DB,
the removing the some corrupt rows might have helped me, i will try out
this, thanks JIM
 

Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email. 

www.wipro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Usage of vacuum and auto vacuum

2010-02-23 Thread ramesh.kotabagi
In which version of SQLite does this happen?
 
I am using version-3.5.8

Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email. 

www.wipro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Unable to recover the DB by vacuum

2010-02-23 Thread ramesh.kotabagi
Hi All,
 
I found the DB corruption (malformed database), reporting some unused
pages,
please find the below trace,
 
*** in database main ***
Main freelist: 21 of 21 pages missing from overflow list starting at 0
Page 1604: sqlite3BtreeInitPage() returns error code 11
Page 1461 is never used
Page 1468 is never used
Page 1469 is never used
Page 1472 is never used
Page 1473 is never used
Page 1474 is never used
Page 1475 is never used
Page 1478 is never used
Page 1480 is never used
Page 1482 is never used
Page 1484 is never used
Page 1485 is never used
Page 1486 is never used
Page 1488 is never used
Page 1489 is never used
Page 1491 is never used
Page 1517 is never used
Page 1531 is never used
Page 1536 is never used
Page 1578 is never used
Page 1581 is never used

I tried to recover the DB, by running "vacuum", its failed again saying
"SQL error: database disk image is malformed".
 
How can i recover this kind of DB, is it possible? and is there any way
to avoid these
unused pages, will enable auto_vacuum solve the problem ?
 
I am using 3.5.8 version. and DB size is 1.6M
 
Thanks in advance.
 
Regards,
Ramesh


Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email. 

www.wipro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Usage of vacuum and auto vacuum

2010-02-16 Thread ramesh.kotabagi
On Wed, 10 Feb 2010 10:05:34 +0530,
 wrote:

>Hi All,
> 
>I am Ramesh, facing come issue regarding DB malformed, find trace
below.
>
> sqlite> pragma integrity_check;
> *** in database main ***
> Main freelist: 4 of 4 pages missing from overflow list starting at 0
> Page 1515 is never used
> Page 1519 is never used
> Page 1528 is never used
> Page 1529 is never used
> sqlite>
>
>The above DB can be recover by using VACUUM command.
> 
> sqlite> vacuum;
> sqlite> pragma integrity_check;
> ok
> sqlite>
>
>Presently PRAGMA auto_vacuum is disabled, and we are using as it is,
> 
>Please give me you suggestions to over come this issue,
> 
>will enabling PRAGMA auto_vacuum will solve the issue, 

Probably not.

>OR any othet way...?

In which version of SQLite does this happen?
SELECT sqlite_version();
Check the timeline, there have been similar issues in the
past. Perhaps you use an old version.

http://www.sqlite.org/src/timeline

Make sure you use one of the latest.


>Thanks in advance.
> 
>Regards,
>Ramesh
-- 
  (  Kees Nuyt
  )
c[_]

 
 
>Hi,

> 

>The sqlite version 3.5.8

3.5.8 is old. Too old for people to remember its quirks.

I advise to upgrade to 3.6.22.

>Regards,

>Ramesh

--

( Kees Nuyt

)

c[_]

Hi Kees Nuyt,

Will enabling auto_vacuum help to resolve the issue of getting DB
malformed,

COZ of unused pages, in 3.6.22 version


Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email. 

www.wipro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Usage of vacuum and auto vacuum

2010-02-16 Thread ramesh.kotabagi
Hi kees Nuyt,

I am not able to reply to group, I found option there to reply via email
to U,
Just did that, Please help me.

Regards,
Ramesh 

-Original Message-
From: sqlite-users-boun...@sqlite.org
[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Kees Nuyt
Sent: Wednesday, February 17, 2010 4:58 AM
To: sqlite-users@sqlite.org
Subject: Re: [sqlite] Usage of vacuum and auto vacuum


Hoi Ramesh,

Please reply (again) to the list, not to me personally.


On Tue, 16 Feb 2010 10:13:28 +0530, you wrote:

>Hi,
> 
>The sqlite version 3.5.8

3.5.8 is old. Too old for people to remember its quirks.
I advise to upgrade to 3.6.22.

>Regards,
>Ramesh
--
  (  Kees Nuyt
  )
c[_]
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email. 

www.wipro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] Usage of vacuum and auto vacuum

2010-02-09 Thread ramesh.kotabagi
Hi All,
 
I am Ramesh, facing come issue regarding DB malformed, find trace below.
 
sqlite> pragma integrity_check;
*** in database main ***
Main freelist: 4 of 4 pages missing from overflow list starting at 0
Page 1515 is never used
Page 1519 is never used
Page 1528 is never used
Page 1529 is never used
sqlite>

The above DB can be recover by using VACUUM command.
 
sqlite>vacuum;
sqlite> pragma integrity_check;
ok
sqlite>

Presently PRAGMA auto_vacuum is disabled, and we are using as it is,
 
Please give me you suggestions to over come this issue,
 
will enabling PRAGMA auto_vacuum will solve the issue, OR any othet
way...?
 
 
Thanks in advance.
 
Regards,
Ramesh


Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email. 

www.wipro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] DB Corruption

2010-02-03 Thread ramesh.kotabagi
Hi All,
 
 
I'm Ramesh, currently we are using sqlite-3.5.8 version,
mainly(sqlite3.h and sqlite3.c) files
API to perform DB operations like 1) insert to,
  2) delete from,
  3) select from,
4)
update,
 
we are seeing DB corruption( error #define SQLITE_CORRUPT 11   /*
The database disk image is malformed */)
so often in our software, 
 
Platform: montavista(linux)
Language: C++
 
Please help me to come out of this issue, this is very critical for our
software,
 
Thanks in adv.

Thanks and Regards,
Ramesh

Please do not print this email unless it is absolutely necessary. 

The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments. 

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email. 

www.wipro.com
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users