-1

May I ask is it possible to migrate / clone the hashed string (SHA-512) from one Oracle database to another ? If not then how the big corp they migrate their users accounts ?

Thanks,

Toan Dao
  • 551
  • 7
  • 19
  • Please [edit] your question to include more context. What hashed string? Is it one generated by queries? Is it something in a wallet somewhere? Are you talking about Oracle user accounts or are you talking about accounts for an application that stores its data in Oracle tables? – MT0 Nov 26 '20 at 10:38

1 Answers1

1

May I ask is it possible to migrate / clone the hashed string (SHA-512) from one Oracle database to another?

Yes, just copy the data from one database to another. Then when you want to compare a value to the hash then just put that value through the same hash algorithm and compare the hashes.

You can do:

SELECT STANDARD_HASH( 'my data', 'SHA512' ) FROM DUAL;

On two different databases and it will come up with the same result on both.

| STANDARD_HASH('MYDATA','SHA512')                                                                                                   |
| :--------------------------------------------------------------------------------------------------------------------------------- |
| 0x6E5F36E9CEE5CBA6AD938977C98E12F3A61FC4D944753AD130116B026B8AB2C895878910FEA3B47DBA6D760A20D0B23233980A8DAB13F04F262C53F25222B416 |

db<>fiddle here

If the value is salted before hashing then you will need to make sure you copy the salt as well and apply the salt in exactly the same way across both systems; if you can do that then the generated hashes will be equivalent.

MT0
  • 143,790
  • 11
  • 59
  • 117
  • Thanks for replying. But the oracle 11g doesn't have this function. Can you help with Oracle 11g ? – Toan Dao Nov 26 '20 at 13:47
  • 1
    @ToanDao 20 seconds with a search engine looking for "oracle 11g standard_hash" got me to [this webpage](https://dzone.com/articles/hashing-with-sha-256-in-oracle-11g-r2). I'm sure you can adapt it for SHA512 or do your own searching to find other solutions. – MT0 Nov 26 '20 at 13:50