Import all database to ClickHouse - clickhouse

Does anybody know is there a way to import locally all tables to clickHouse from csv or sql file (mysql dump) but not one by one table?
I found information only about table by table import https://clickhouse.com/docs/en/integrations/data-formats/csv-tsv

Related

IMPDP : How to import only Table data

I tried to import (TABLES, PROCEDURE, FUNCTION etc) from a dump file. I did a mistake by
executing KILL -9 <PROCESS_ID> while import was still going on.
So, I started to import again. Now, I did another mistake by NOT mentioning
TABLE_EXISTS_ACTION=TRUNCATE . So, tables have been imported with duplicate records.
I want to get rid of duplicate data. There are more than 500 tables involved.
I am planning to import again by first truncating the table and then importing data only.
Below is the import command I have come up with. Will this command import ONLY table data(records) by first
truncating the table and then insert only the data?
impdp DIRECTORY=MY_DIRECTORY dumpfile=EXP_MY_DUMP.dmp INCLUDE=TABLE_DATA TABLE_EXISTS_ACTION=TRUNCATE
I could try executing myself and find out if that works. But, I have already tried twice and failed.
Also, I don't want to again import INDEX, SEQUENCES etc. Just table records.
Remove INCLUDE=TABLE_DATA. That will not execute create table.. that should work.

Importing DB with index without reindexing

I want to import a DB using impdp. I would like to import the INDEX NAMES and after that, rebuild it manually.
I used the option
EXCLUDE=index
but then I can't find the index in the table all_indexes
Is there a way to import the index without build them, and build them manually afterwards ?
Import all tables and data with following parameters
SQLFILE=create_index.sql include=index
This parameter doesn't create any index but create a sql file with all create index sql statements. Using this file you can create index manually after finishing table and data import.
you can also export/ import only metadata, this will import only table & index structures.
CONTENT=metadata_only

SQOOP - how to do a multi table or selective table import in sqoop from MYSQL

how to do a multi table or selective table import in sqoop from MYSQL
I can see either we can import table by table or import-all-tables.
am looking for a way to import only certain tables from MYSQL.
Any help would be appreciated ?
Thanks
There is no way to put multiple tables in sqoop import command.
But you can use import-all-tables with --exclude-tables <tables> to exclude some tables while importing all the tables of a database.
For example
You have 5 tables (tbl1, tbl2, tbl3, tbl4, tbl5) in testdb database and you want to exclude tbl2 and tbl4.
Use the following command:
sqoop import-all-tables --connect jdbc:mysql://localhost:3306/testdb --exclude-tables tbl2,tbl4 .....

Oracle remap_Tablespace for Datalob/Data/Index

I'm facing a new problem about importing data on Oracle.
I've got a dump file of around 40GB, and I'm trying to import this to my Oracle Database 10g Release 10.2.0.4.0.
On our system we have 3 tablespaces (Datalob/Data and Index), one of our Customer is using only one tablespace (MIG).
if I try to import the data (from customer), I get the error ORA-01652 unable to extend segment by ... because i don't have enough space.
too bad, I can't make the tablespace bigger/ or is not allowed.
is there a way to import the tablespace for Datalob(all lob fields) to the tablespace DATALOB, all index to INDEX and normal data to DATA?
like Remap_Tablespace=MIG(LOB):DATALOB remap_tablespcae=MIG(IDX):INDEX
I'd use a sequential approach - not very elegant, but it should work:
import only the metadata (into your "table" tablespace)
move the LOB segments to the LOB tablespace
move the indices to the index tablespace
import the contents
Pre-create the table using the tablespaces you want and use TABLE_EXISTS_ACTION=APPEND.

Can I manually change the dump file created by imp tool of Oracle?

I have encountered a problem in importing the dump file to a new database.
When importing the dump file it requires a new tablespace which does not exist in the database.
To create the tablespace I need to hijack some scripts which is readonly.For this reason it is complicated to export the table structure through imp tool of Oracle so my colleage changed the dump file manually and it is able to be imported.
Is it OK to change the dump file manually in order to import the file if it is the quickest way?
if are comfortable to change the dump file manually then it is fine, keeping that you are aware of the the complete structure of the .dmp file.
i will suggest u to use data pump as it remaps the table space of the existing schema with the new one. and performance wise data pump is much faster then normal dump.
As an alternative, get a dummy database and
create the tablespace/schema.
Do the import there with ROWS=N
ALTER TABLE ... MOVE .... to put the tables into the desired tablespace
Export tables (structures) from there
import corrected structures
Import the data with IGNORE=Y so that the data can be imported over the existing structures.
if you create the user with a default tablespace that is a tablespace that exists, you can import with rows=n and ignore=y and that should bring the objects in for you into that tablespace.

Resources