Hot answers tagged

6

You could use Flashback to return the table data back to its original state. Is Flashback enabled? Database needs to be in archive mode: select log_mode from v$database; Should return "ARCHIVEMODE" Check if flashback is enabled: select flashback_on from v$database; Should return "YES" If "NO", you can enable flashback by runing: alter database ...


6

You just need to add OPTIONALLY ENCLOSED BY '"': LOAD DATA INFILE 'filename.csv' INTO TABLE table_name FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' IGNORE 1 LINES; Documentation link. File: n1,s1,s23,n2,s4,s56 1,string1,"str2,str3",2,string4,"str5, str6" Table and test: mysql> create table tbl_name ( ...


4

I see you are attempting to use the Wizard to import data. You may be better off manually creating the table with the column definitions you desire, and using the T-SQL BULK INSERT command to import the data. USE tempdb; CREATE TABLE dbo.TestSource ( SomeNumber INT NULL ); I created a plain-text sample file named C:\temp\test.txt which contains ...


4

SQLCMD can be used to export data. The default output is sometimes unwieldy for that, but you can use some command-line options to turn off the headers, trim trailing spaces, and to use a comma separator instead of the default space: sqlcmd -Q "SET NOCOUNT ON; SELECT TOP(10) name, object_id, type FROM sys.objects;" ^ -h-1 -W -s "," Returns: ...


3

The constraints are kept for the renamed table. Drop them before you import the tables with the correct data. alter table t1 drop constraint c; There is also another way to do it if you do not want to lose the wrong data. You can create a new table based on the 2 tables: create table t1 as select * from t; Then you must disable the constraints and ...


3

In the end I coded a Python function import_csv_to_dynamodb(table_name, csv_file_name, colunm_names, column_types) that imports a CSV into a DynamoDB table. Column names and column must be specified. It uses boto, and takes a lot of inspiration from this gist. Below is the function as well as a demo (main()) and the CSV file used. Tested on Windows 7 x64 ...


3

A DMP file is just a copy of the whole database contents. During the Import, it does not get modified, so you can use that file to "jump back" to the time when that dump file was created as often as you want.


3

There is a known issue when certain checkpointing / flushing configuration results in stall. Here is a quote from Percona 5.5 documentation Improved InnoDB I/O Scalability: Normally, the checkpoint is done passively at the current oldest page modification (this is called “fuzzy checkpointing”). When the checkpoint age nears the maximum checkpoint age ...


2

CSV files are not included in the dacpac that you deploy so you will need to make sure that you copy it with the dacpac and that if you use relative paths the working directory is what you think it is. What I do for extra files is set the "Build Action" of the file to "Copy if Newer", when the dacpac is built in the bin folder you will also have a "Data" ...


2

Unfortunately that's not possible if you insist on using the wizard, you would need to edit the package using Visual Studio. There is an option 'keep null's' when editing the package in Visual Studio Given this .csv file: StringField,IntField a,1 b,5 c, d,6 e, f,8 g, h, i,10 j, and this table definition CREATE TABLE [dbo].[NullTest]( [StringField] ...


2

The simplest method which we use is something like below Create a table on destination server using the scripts generated from the table on the source server by right click and going through option of Tasks/Generate scripts. Then run the below T-SQL to upload the data from source table to destination. INSERT INTO dbo.YourTableNameHere SELECT * FROM ...


2

Of course you can put it up on Dropbox - or anywhere else. Depends on how secure you want your data to be? Do you want the NSA looking at it? Dropbox employees? I would put up an encrypted version of your mysqldump and securely transmit the key to your colleague - either face to face or over encrypted email, or have the password/key sent by courrier. ...


2

No, that is not a possible way: Most of the non-table objects will already exist in your schema. You already get such error messages. The import will not overwrite it. You can configure how export should work if a table already exists but if there is a table that s referenced by another table then TRUNCATE and REPLACE will not work. Even if there is ...


2

I agree with Nawaz. WorkBench migration tool works very well, at least between MS-SQL and Mysql. Another solution is to use a Modeling tool like PowerDesigner or Embarcadero Data Architect Studio. Reverse engineer your schema from INformix, then switch the schema to Mysql. You can then generate the script and apply it to Mysql. For data export, you'll need ...


2

Give something like the below a try... You'll obviously need to plug in your variables for your environment, check the data types (may need to add logic to keep leading zeros?), change from the final temp tables to your regular table(s), etc. Works fine for me for import from XML files to temp tables without deleting the files afterwards but adding logic ...


2

This is actually very simple to do via SQLCLR. A Stored Procedure can be set up t read any xml files in a particular directory (or just as easily check all sub-directories) and output a single result set with all of their contents. Doing this, you could populate your table with the following query: INSERT INTO dbo.R000000 (R00000010, R00000020, R00000030, ...


2

As per documentation your error is: Error: 1261 SQLSTATE: 01000 (ER_WARN_TOO_FEW_RECORDS) Message: Row %ld doesn't contain data for all columns Thus it appears that your table have more column than the file. You will have to specify the column-names explicitly. Also the remaining columns should be nullable. (You might want to share table definition ...


2

Go to folder C:\wamp\bin\mysql\MYSQL_VERSION\bin Hit shift + right-click in that folder and select "Open command window here" from the menu that pops up. This will open a command window in the path you are already in, so C:\wamp\bin\mysql\MYSQL_VERSION\bin Enter any of the MySQL commands you like with any of the executables you find in that folder. To ...


2

I'm assuming based on the post that the PostgreSQL database server and the process restoring the dump are on the same machine. If so: Is it possible to pause the import of the database? Not really. You could SIGSTOP the pg_restore or psql process and/or the corresponding postgres backend, but I wouldn't consider that my first-choice option. If not, ...


2

You wrote 12c db has the exact data of 11g (expdp/impdp) But are you sure? 1) Did you make a consistent export of your tables? This means all table data is from the same point in time. For this it is sufficient that you stop all other write activity on the database during export. Or you set the flashback_scn parameter when using expdp or the ...


1

Technically, you could, but it is incomplete, so better repeat the export after performing the necessary actions to avoid ORA-01555 errors (have an appropriately sized undo tablespace, set undo_retention and retention guarantee).


1

Try to flashback your table ALTER TABLE your_table ENABLE ROW MOVEMENT; FLASHBACK TABLE your_table TO TIMESTAMP (SYSTIMESTAMP - INTERVAL '1' minute);


1

Another option that could handle this and possibly allow for a bit more flexibility is to use a SQLCLR function or stored procedure that makes use of the SqlBulkCopy class (which is essentially the same framework used by BCP.EXE, BULK INSERT, etc). While writing such a function/procedure might not be worth the time/effort for a one-off project, there is ...


1

I am thinking of two things to try. If you get faster execution time, then the slowness would be related to the distribution of the data. If you still get slow execution time, it maybe then related to the server configs. Try to load allelePiecesab file before. If this is slow, then the data in this file has higher cardinality of key fields. Try to disable ...


1

This is probably due to the fact that the text has Carriage Returns in it and that you are using the default row delimiter which is the Carriage Return. This will be tough to fix since you can't know when a Carriage Return is part of a column or actually a new line. the file needs to be fixed manually. Unless you know where the file came from... If ...


1

Create a second MySQL database. This will be used for the migration and then dropped. These are known as staging databases. Make it an exact, table-for-table copy of your source. This way it is easy to export form the source and import into staging without worrying about mapping columns. The documentation will tell you how to load flat files into tables, and ...


1

Use this version of NW instead. Its very light (2.6 MB in disk) and you can download the scripted version. Should be just fine.


1

Something like this, checking every value for '', and inserting NULL instead, may help. Change a,b,c,d for the actual name and number of rows on the table: $ cat /tmp/test.csv test1, test2, test3, test4 ,,, 1,2,3,4 ,,, mysql> LOAD DATA INFILE "/tmp/test.csv" INTO TABLE test.test FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY ...


1

The documentation page you linked to is for the current version (3.8.9) of SQLite. You could dig up the old version of cli.html for 3.7.13, but at that time, .import was pretty much undocumented.


1

Linked servers aren't usually a good idea from a security perspective. See distribution statistics section here I think SSIS would provide a better way of doing this.



Only top voted, non community-wiki answers of a minimum length are eligible