Quick revision
The short answer
I would turn it from a licence-cost slogan into a measured decision: quantify licence and support costs, risk, available skills, and the size and quality of the PL/SQL estate, then compare three options, porting PL/SQL to PL/pgSQL with tools such as ora2pg, rewriting logic into Java services, or keeping a stable core while building new capabilities outside. A big-bang rewrite of core banking is too risky; the plan migrates incrementally by business capability with parity tests on real data, plans for Oracle and PostgreSQL differences, funds testing and reconciliation heavily, keeps domain experts involved, and sets checkpoints where we can stop.
What to remember
In this answer, we approached a move from 4,000 Oracle PL/SQL procedures to PostgreSQL and Java as a measured decision. We quantified costs, risk, skills and the code estate, including dead code, and compared porting with ora2pg, rewriting into Java and keeping a stable core. We rejected a big-bang rewrite in favour of moving one business capability at a time with shadow parity tests on real data, planned for differences in transactions, packages, autonomous transactions, empty strings and dates, and governed the programme with heavy testing, domain experts and checkpoints that allow us to stop.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
I would turn it from a licence-cost slogan into a measured decision: quantify licence and support costs, risk, available skills, and the size and quality of the PL/SQL estate, then compare three options, porting PL/SQL to PL/pgSQL with tools such as ora2pg, rewriting logic into Java services, or keeping a stable core while building new capabilities outside. A big-bang rewrite of core banking is too risky; the plan migrates incrementally by business capability with parity tests on real data, plans for Oracle and PostgreSQL differences, funds testing and reconciliation heavily, keeps domain experts involved, and sets checkpoints where we can stop.
Why this question is asked
Moving 25 years of core banking logic is one of the riskiest projects a bank can attempt. The savings are real, often millions per year in licences and support, but so are the failure stories: multi-year rewrites that never reach parity and are cancelled. Interviewers ask this of senior leaders to see whether we can separate the decision from the enthusiasm, quantify it, choose a strategy that limits risk, and protect the business while the work happens. In this answer, we will go through how to frame the decision, measure the estate, compare the options, structure an incremental plan, handle the technical differences, and govern the programme.
1Framing the Decision
Leadership has stated a goal, cutting licence costs, and a solution, PostgreSQL and Java. Our first job is to check that the solution actually reaches the goal at an acceptable risk. The total saving is licence and support cost minus the cost of the migration and of running the new platform. A migration that costs three years of savings and carries a chance of a serious banking incident may still be worth doing, but only if that is known up front.
So we start with an assessment phase of a few months with a clear output: the costs, the options, a recommended path, and the conditions under which we would stop. This makes the decision a business decision with numbers, not an architecture preference.
2Measuring the PL/SQL Estate
4,000 procedures is a count, not a size. We analyse the code itself: lines of code, dependencies between procedures and packages, which procedures are called from where, and which features they use. Tools that inventory Oracle schemas, including ora2pg's assessment report, estimate migration effort per object and flag features that have no direct PostgreSQL equivalent. Runtime statistics show which procedures actually run. In estates this old, a significant share is typically dead code, never executed in the last year, and it can be retired instead of migrated.
We also measure quality and safety nets: how much of the logic has automated tests (often very little), how much depends on a few people's knowledge, and which areas change most often. And we look at skills: how many engineers know PL/SQL, PostgreSQL and the banking domain, and what it would cost to hire or train them.
| Question | Example finding |
|---|---|
| Licence and support cost per year | about 4 million, rising with cores |
| Procedures executed in the last year | 2,600 of 4,000 |
| Uses features without a PostgreSQL equivalent | about 15 percent: autonomous transactions, some packages |
| Logic covered by automated tests | under 10 percent |
| Estimated migration effort | range from tool report plus samples |
| People who understand interest and fees code | three, two near retirement |
3Three Options and What Each Costs
The first option is a database move: port PL/SQL to PL/pgSQL with conversion tools such as ora2pg and manual fixes, keeping the logic in the database. It is the fastest path to the licence saving and preserves the architecture, but it keeps logic in stored code, needs PL/pgSQL skills, and conversion tools typically convert most of the code mechanically while the remaining part, the hardest, needs experts.
The second option is a rewrite into Java services. It modernises the architecture, opens hiring to a larger skill pool and makes testing easier, but it is by far the most expensive and risky, because the business rules must be rediscovered from code that is the only real specification. The third option is to keep a stable core: leave the hardest, rarely changing core on Oracle for now, possibly with a reduced licence footprint, and build every new capability outside it in Java and PostgreSQL. It reduces risk most, but it delays much of the saving.
In practice the answer is usually a combination by area: port the parts that are stable and well understood, rewrite the parts that change often and hold back the business, and keep the riskiest core until the end or permanently, depending on the numbers.
4An Incremental Plan With Parity Tests
A big-bang cutover of core banking, where one weekend switches everything, puts the whole bank's operation on a single bet. Instead we use the strangler approach: we move one business capability at a time, such as customer fees, then statements, then interest calculation, routing that capability's work to the new implementation while everything else stays on Oracle.
Each capability moves only after parity testing on real data. We run old and new implementations side by side, in shadow mode, on production inputs or a masked copy, and compare every result: the same fee, to the cent, for the same account and day. Differences are investigated until they are explained or fixed. Only after a period of zero unexplained differences do we switch, and we keep the ability to switch back.
- Pick a capabilitye.g. monthly fees, low coupling
- Port or rewrite itPL/pgSQL or Java service
- Run in shadow next to Oraclesame inputs, results compared
- Zero unexplained differences for a cycle?YesSwitch traffic, keep fallbackNoInvestigate, fix, repeat
- Reconcile daily after switchbalances, totals, counts
- Retire the Oracle codeafter a full business cycle
6 steps in order. Play them, or step through them one at a time.
Every step can stop or roll back; nothing depends on one cutover weekend.
5Planning for Oracle and PostgreSQL Differences
Some differences are known to cause subtle bugs, and the plan budgets for each. Transaction semantics differ: when a statement fails in Oracle, only that statement is rolled back, while in PostgreSQL the whole transaction is aborted until rolled back, and an exception block in PL/pgSQL creates a subtransaction, which costs performance in tight loops. Oracle packages, which group procedures with shared state and private members, have no direct equivalent; we map them to schemas and design state differently. Autonomous transactions, often used for audit logging that must survive a rollback, do not exist in PostgreSQL and need a redesign, for example logging through a separate connection or an extension.
Data types and handling differ too. Oracle treats an empty string as NULL, so code that relies on that breaks silently. Oracle's DATE includes a time of day, unlike PostgreSQL's date. Sequences, NUMBER precision, implicit conversions and date arithmetic all need checking. For a bank, rounding and date handling are where parity tests find most of the differences, so those areas get the most testing.
6Governing the Programme
The programme is funded with testing and reconciliation as first-class work, often a third or more of the budget, because that is what makes the migration safe. Domain experts, the people who know why the interest code has a special case for leap years, are assigned to the programme and their knowledge is captured in tests and documentation before they leave. Regulators and auditors are informed early, because core banking changes often need their review.
We set measurable checkpoints, for example after the first two capabilities: actual effort compared with the estimate, parity defects found, incidents, and savings realised. Each checkpoint has an explicit option to stop or change course, such as keeping the remaining core on Oracle with a smaller licence. Being willing to stop is what makes it safe to start.
7Follow-up questions
How do you handle the procedures nobody understands?
We characterise them before changing them: capture their inputs and outputs in production over a full business cycle, turn those into tests, and ask domain experts to explain the surprising cases. If a procedure has not run in a year, we retire it instead. Unknown logic is never rewritten from reading the code alone.
Would you run Oracle and PostgreSQL at the same time?
Yes, for the whole migration. Data for migrated capabilities is synchronised between them, often with CDC or replication tools, and reconciliation jobs compare balances every day. The dual running period costs money, but it is what allows shadow testing and a fallback.
8Conclusion
In this answer, we approached a move from 4,000 Oracle PL/SQL procedures to PostgreSQL and Java as a measured decision. We quantified costs, risk, skills and the code estate, including dead code, and compared porting with ora2pg, rewriting into Java and keeping a stable core. We rejected a big-bang rewrite in favour of moving one business capability at a time with shadow parity tests on real data, planned for differences in transactions, packages, autonomous transactions, empty strings and dates, and governed the programme with heavy testing, domain experts and checkpoints that allow us to stop.
Open with
I would first make it a decision with numbers. In an assessment phase I would quantify the licence and support cost, the size and quality of the PL/SQL estate using inventory tools like ora2pg's assessment plus runtime statistics, which usually show a lot of dead code we can retire, the test coverage, and the people who understand the domain.
Then, if they want more
Then I would compare three options: port PL/SQL to PL/pgSQL with conversion tools and keep the logic in the database, which gets the saving fastest; rewrite into Java services, which modernises but is the most expensive and risky; or keep a stable core and build new things outside it. The realistic answer is usually a mix by area.
I would not do a big-bang rewrite of core banking. I would move one business capability at a time, run the new implementation in shadow next to Oracle on real data, compare every result to the cent, and switch only after a cycle with no unexplained differences, keeping a fallback and daily reconciliation.
I would plan for the known differences: PostgreSQL aborts the whole transaction on an error, there are no packages or autonomous transactions, Oracle treats empty strings as NULL and its DATE has a time.
I would fund testing and reconciliation heavily, keep domain experts on the team, involve regulators early, and set checkpoints where we can stop or keep the core on Oracle.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- PostgreSQL documentation, MySQL reference manual
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Your company's core banking logic lives in 4,000 Oracle PL/SQL procedures written over...": https://scrivio-interview-library.netlify.app/databases/stored-code/532a6ca200/