Exporting SQL DB

classic Classic list List threaded Threaded
4 messages Options
nsquare nsquare
Reply | Threaded
Open this post in threaded view
|

Exporting SQL DB

Hi,

I have a 3 node ignite cluster which stores data in SQL tables. All the tables and table contents can be seen with sqline.sh tool. 

How can I export these tables as an SQL DB file for future reference?

Cheers,
NSquare
akorensh akorensh
Reply | Threaded
Open this post in threaded view
|

Re: Exporting SQL DB

Hi,
  You can record data output from sqlline
  0: jdbc:ignite:thin://127.0.0.1/> !outputformat csv
   jdbc:ignite:thin://127.0.0.1/> !record data.csv
  Saving all output to "data.csv". Enter "record" with no arguments to stop
it.
  0: jdbc:ignite:thin://127.0.0.1/> select * from Person

  here the output from the "select" will go into data.csv

  You can then clean up the csv and use it as need be.

  see:  https://apacheignite-sql.readme.io/docs/sqlline
Thanks, Alex



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
nsquare nsquare
Reply | Threaded
Open this post in threaded view
|

Re: Exporting SQL DB

Hi Alex,

Thanks for your response. I want to export the data into a SQL db file which can be then loaded with any standard SQL viewer. CSV would be difficult for me as the data stored in these tables is huge. Just to give some context, one of the services running on this cluster would pump one record every 10ms and the entire system would run for about 20 hours. There are 14 such services that pump data with a duration of 20ms to 2 sec per record for such duration.

I am not sure if ignite stores data to the SQL db file which can be used for later usage. Please let me know if you need any further information.

-- Nishant



On Wed, May 20, 2020 at 1:42 AM akorensh <[hidden email]> wrote:
Hi,
  You can record data output from sqlline
  0: jdbc:ignite:thin://127.0.0.1/> !outputformat csv
   jdbc:ignite:thin://127.0.0.1/> !record data.csv
  Saving all output to "data.csv". Enter "record" with no arguments to stop
it.
  0: jdbc:ignite:thin://127.0.0.1/> select * from Person

  here the output from the "select" will go into data.csv

  You can then clean up the csv and use it as need be.

  see:  https://apacheignite-sql.readme.io/docs/sqlline
Thanks, Alex



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/
akorensh akorensh
Reply | Threaded
Open this post in threaded view
|

Re: Exporting SQL DB

Your best choice is to write your own exporter/use sqlline/other tool to get
the data from Ignite.
Ignite's db files are in a proprietary format that can't be used w/other
tools.
more info here:
https://cwiki.apache.org/confluence/display/IGNITE/Ignite+Persistent+Store+-+under+the+hood



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/