Shell script matching similar records

hello all,
I have requirement to identify similar records matching about 80% to 90%.I have to black list customers with multiple accounts.
The data is in the Oracle Database, but is there any way I can get the data into flat file and compare the strings and fetch similar matching records?
I have one table with

id 
Name
middle_name
address
city

I need to pull out name and address fields similar. And spaces or slight difference can be ignored. I have tried within database methods which is very slow. And I have only basic knowledge of shell scripting need help for a way to get compared result faster. I have very large data to compare..more than 10 millions..

Exporting 10 million records to a flat file and processing that is unlikely to be faster than just doing it in SQL, at least if the relevant columns are indexed. Have you checked your query with explain plan or similar to see if you can optimise it at all?

ya I thought it will be a problem but any way I got some hint of using CONTAINS function oracle. Thank you