Data migration concept in databases - migration

i have a generic question about data migration/conversion.
here the situation:
i have data in a access db and want to migrate it into a oracle db. its not a 1 to 1 migration. i need to define which data should be imported into a specific oracle table and create some logic after that somehow.
do you have some ideas or a concept how to do this? maybe a checklist not that i forget something or i dont know.
Thank you.

Are you going to run it just once and be done? Or do you need to set up a job that routinely transfers the data? The keyword you might not be familiar with for googling is "ETL" - Extract, Transform, Load - and there are lots of products designed to handle ETL tasks.
Common sticking points are converting dates from one db to another and floating point numbers (especially currency.) When you hit specific problems, post new questions. There's a stackoverflow sister site, serverfault.com that might be a better fit for a lot of ETL questions. The products you're working with are popular so the db experts there are likely to have quick answers on datatype issues.

Related

Databricks: Best practice for creating queries for data transformation?

My apologies in advance for sounding like a newbie. This is really just a curiosity question I have as an outsider observing my team clash with our client. Please ask any questions you have, and I will try my best to answer it.
Currently, we are storing our transformation queries in a DynamoDB table. When needed, we pull into Databricks and execute the query. Simple as that. Our client has called this out as “hard coding” (more on that soon)
Our client has come up with an alternative that involves creating JSON config files containing the transformation rules (all tables/attributes required, target table names, Alias names, join keys, etc. etc.). From here, the SQL query is dynamically created. This approach is still “hard coding” since these config files would need to be manually edited anytime there is a change in the rules.
The way I see this: I think storing the transform rules in JSON is more business user friendly, but that’s about where I see the pros end. It brings in much more complexity to the code and likely will need to be continuously developed to support new queries. Also, I don’t see anyway to prevent “hard coding”. The client business leads seem to think there is some magical tool to convert plain English text to complex SQL queries
I just wanted to get some experts thoughts on this. Which solution is better, or is there another approach that should be taken?

Snowflake vs Snowflake Preview App and other general clarifications in using Snowflake with Power BI [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
This post might seem as if I haven't used a search engine to answer my own questions, as my questions are general and quite basic, but I assure you I have - I'm just that big of a noob where I need a little more direction / context to connect the dots.
Here are the some questions I'm confused about:
Is the Preview App a 1:1 replacement to the standard UI?
Why would someone use one over the other?
In Preview, is the use case of Dashboards generally for BI purposes or ETL purposes?
Where do worksheets fit in with dashboards?
Can I mock up my final PBI data model for ETL/Validation through Dashboards? It would be nice to write queries or import worksheets to create the general structure of my PBI Data model, then split off the individual tables into views to connect to.
I seem to always be above the record limit for statistics / Query Details. Is there any way to adjust this? Seems odd that my relatively small amount of data exceeds Snowflakes ability to perform basic analytics on it. (My Queries return a maximum 4-5 million records, but most of the time 100k - 2M records)
Best practice to ensure Dimension and Fact tables are 1:*? ( I know how to write queries to check this, in something like SSMS, however I'm wondering if there are quicker, built in features to highlight this)
What the ideal workflow looks like - from writing queries & ETL to connecting to views in PBI
In general for a PBI Developer, what are the biggest advantages of utilizing Snowflake over something like SSMS? What are the limitations?
Clearly I don't have the fundamentals down and need to take a relatively in-depth class - for now I'm just looking to get some momentum going.
If there are any resources you would recommend, I'd love to check them out also!
I'll give you some quick answers, but this is not the best place to ask so many questions at the same time. Try https://reddit.com/r/snowflake for further conversations please.
Is the Preview App a 1:1 replacement to the standard UI?
It's the future UI, so it should match features.
Why would someone use one over the other?
Preference :).
In Preview, is the use case of Dashboards generally for BI purposes or ETL purposes?
BI, I'd say.
Where do worksheets fit in with dashboards?
One worksheet per visualization is the current idea.
Can I mock up my final PBI data model for ETL/Validation through Dashboards? It would be nice to write queries or import worksheets to create the general structure of my PBI Data model, then split off the individual tables into views to connect to.
I will let someone else answer this. Please ask in a separate question or on reddit.
I seem to always be above the record limit for statistics / Query Details. Is there any way to adjust this? Seems odd that my relatively small amount of data exceeds Snowflakes ability to perform basic analytics on it. (My Queries return a maximum 4-5 million records, but most of the time 100k - 2M records)
The preview app looks at the result of queries and summarizes them. 4 million rows are outside of scope for the app (not for Snowflake, but for the client side app that looks at the results)
Best practice to ensure Dimension and Fact tables are 1:*? ( I know how to write queries to check this, in something like SSMS, however I'm wondering if there are quicker, built in features to highlight this)
I will let someone else answer this. Please ask in a separate question or on reddit.
What the ideal workflow looks like - from writing queries & ETL to connecting to views in PBI
I will let someone else answer this. Please ask in a separate question or on reddit.
In general for a PBI Developer, what are the biggest advantages of utilizing Snowflake over something like SSMS? What are the limitations?
I will let someone else answer this. Please ask in a separate question or on reddit.

MongoDB or SQL for text file?

I have a 25GB's text file with that structure(headers):
Sample Name Allele1 Allele2 Code metaInfo...
So it just one table with a few millions of records. I need to put it to database coz sometimes I need to search that file looking, for example, specific sample. Then I need to get all row and equals to file. This would be a basic application. What is important? File is constant. It no needed put function coz all samples are finished.
My question is:
Which DB will be better in this case and why? Should I put a file in SQL base or maybe MongoDB would be a better idea. I need to learn one of them and I want to pick the best way. Could someone give advice, coz I didn't find in the internet anything particular.
Your question is a bit broad, but assuming your 25GB text file in fact has a regular structure, with each line having the same number (and data type) of columns, then you might want to host this data in a SQL relational database. The reason for choosing SQL over a NoSQL solution is that the former tool is well suited for working with data having a well defined structure. In addition, if you ever need to relate your 25GB table to other tables, SQL has a bunch of tools at its disposal to make that fast, such as indices.
Both MySQL and MongoDB are equally good for your use-case, as you only want read-only operations on a single collection/table.
For comparison refer to MySQL vs MongoDB 1000 reads
But I will suggest going for MongoDB because of its aggeration pipeline. Though your current use case is very much straight forward, in future you may need to go for complex operations. In that case, MongoDB's aggregation pipeline will come very handy.

How to Design HBase Schema

We have currently one running project which uses RDBMS database( with lots of tables and stored procedures for manipulating data). The current flow is like : the data access layer will call stored procedures, which will insert/delete/update or fetch data from RDBMS(please note that these stored procedures are not doing any bulk proccesses.). The current data structure contains lots of primary key, foreign key relation ship and have lots of updates to existing database tables.a I just want to know whether we can use HBase for our purpose? then how can we use Hadoop with HBase replacing RDBMS?
You need to ask yourself, what is the RDBMS not doing for you, and what is it that you hope to achieve by moving to Hadoop/HBase?
This article may help. There are a lot more.
http://it.toolbox.com/blogs/madgreek/nosql-vs-rdbms-apples-and-oranges-37713
If the purpose is trying new technology, I suggest trying their tutorial/getting started.
If it's a clear problem you're trying to solve, then you may want to articulate the problem.
Good Luck!
I hesitate to suggest replacing your current rdbms simply because of the large developer effort that you've already spent. Consider that your organization probably has no employees with the needed experience for hbase. Moving to hbase with the attendant data conversion and application rewriting will be very expensive and risky.

How to write a simple database engine [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.
Closed 9 years ago.
The community reviewed whether to reopen this question 12 months ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I am interested in learning how a database engine works (i.e. the internals of it). I know most of the basic data structures taught in CS (trees, hash tables, lists, etc.) as well as a pretty good understanding of compiler theory (and have implemented a very simple interpreter) but I don't understand how to go about writing a database engine. I have searched for tutorials on the subject and I couldn't find any, so I am hoping someone else can point me in the right direction. Basically, I would like information on the following:
How the data is stored internally (i.e. how tables are represented, etc.)
How the engine finds data that it needs (e.g. run a SELECT query)
How data is inserted in a way that is fast and efficient
And any other topics that may be relevant to this. It doesn't have to be an on-disk database - even an in-memory database is fine (if it is easier) because I just want to learn the principals behind it.
Many thanks for your help.
If you're good at reading code, studying SQLite will teach you a whole boatload about database design. It's small, so it's easier to wrap your head around. But it's also professionally written.
SQLite 2.5.0 for Code Reading
http://sqlite.org/
The answer to this question is a huge one. expect a PHD thesis to have it answered 100% ;)
but we can think of the problems one by one:
How to store the data internally:
you should have a data file containing your database objects and a caching mechanism to load the data in focus and some data around it into RAM
assume you have a table, with some data, we would create a data format to convert this table into a binary file, by agreeing on the definition of a column delimiter and a row delimiter and make sure such pattern of delimiter is never used in your data itself. i.e. if you have selected <*> for example to separate columns, you should validate the data you are placing in this table not to contain this pattern. you could also use a row header and a column header by specifying size of row and some internal indexing number to speed up your search, and at the start of each column to have the length of this column
like "Adam", 1, 11.1, "123 ABC Street POBox 456"
you can have it like
<&RowHeader, 1><&Col1,CHR, 4>Adam<&Col2, num,1,0>1<&Col3, Num,2,1>111<&Col4, CHR, 24>123 ABC Street POBox 456<&RowTrailer>
How to find items quickly
try using hashing and indexing to point at data stored and cached based on different criteria
taking same example above, you could sort the value of the first column and store it in a separate object pointing at row id of items sorted alphabetically, and so on
How to speed insert data
I know from Oracle is that they insert data in a temporary place both in RAM and on disk and do housekeeping on periodic basis, the database engine is busy all the time optimizing its structure but in the same time we do not want to lose data in case of power failure of something like that.
so try to keep data in this temporary place with no sorting, append your original storage, and later on when system is free resort your indexes and clear the temp area when done
good luck, great project.
There are books on the topic a good place to start would be Database Systems: The Complete Book by Garcia-Molina, Ullman, and Widom
SQLite was mentioned before, but I want to add some thing.
I personally learned a lot by studying SQlite. The interesting thing is, that I did not go to the source code (though I just had a short look). I learned much by reading the technical material and specially looking at the internal commands it generates. It has an own stack based interpreter inside and you can read the P-Code it generates internally just by using explain. Thus you can see how various constructs are translated to the low-level engine (that is surprisingly simple -- but that is also the secret of its stability and efficiency).
I would suggest focusing on www.sqlite.org
It's recent, small (source code 1MB), open source (so you can figure it out for yourself)...
Books have been written about how it is implemented:
http://www.sqlite.org/books.html
It runs on a variety of operating systems for both desktop computers and mobile phones so experimenting is easy and learning about it will be useful right now and in the future.
It even has a decent community here: https://stackoverflow.com/questions/tagged/sqlite
Okay, I have found a site which has some information on SQL and implementation - it is a bit hard to link to the page which lists all the tutorials, so I will link them one by one:
http://c2.com/cgi/wiki?CategoryPattern
http://c2.com/cgi/wiki?SliceResultVertically
http://c2.com/cgi/wiki?SqlMyopia
http://c2.com/cgi/wiki?SqlPattern
http://c2.com/cgi/wiki?StructuredQueryLanguage
http://c2.com/cgi/wiki?TemplateTables
http://c2.com/cgi/wiki?ThinkSqlAsConstraintSatisfaction
may be you can learn from HSQLDB. I think they offers small and simple database for learning. you can look at the codes since it is open source.
If MySQL interests you, I would also suggest this wiki page, which has got some information about how MySQL works. Also, you might want to take a look at Understanding MySQL Internals.
You might also consider looking at a non-SQL interface for your Database engine. Please take a look at Apache CouchDB. Its what you would call, a document oriented database system.
Good Luck!
I am not sure whether it would fit to your requirements but I had implemented a simple file oriented database with support for simple (SELECT, INSERT , UPDATE ) using perl.
What I did was I stored each table as a file on disk and entries with a well defined pattern and manipulated the data using in built linux tools like awk and sed. for improving efficiency, frequently accessed data were cached.