What You’ll Learn
Both methodologies are very popular today, but PostgreSQL has gained market share recently and is trending upwards because (some have claimed) it has features more suited to today’s dynamic development requirements. Review five crucial database parameters and decide for yourself.
Oracle is a commercial solution that has steep pricing options, with additional payments required for extra features. PostgreSQL easily clinches this comparison since acquisition, installation and support is completely free of charge. This factor alone can prove to be crucial when it comes to small and medium-sized organizations. If budget is a primary concern for your organization, consider PostgreSQL as a free and open-source option that still provides robust functionality and support through its active community.
Another win for the open-source solution. PostgreSQL has an extremely active community where patches, tweaks, updates and more can be found very easily. Even answers to questions that arise during installation or upgrades are easy to find with minimal delays. This is not the case with Oracle, where support costs money. Large organizations that choose to implement PostgreSQL can also opt for paid professional support, where services tend to be cheaper than their Oracle counterpart
Oracle Database has decades of experience and high levels of development expertise. It not only provides more transactions per second than PostgreSQL, but also arguably provides higher levels of security. However, it should be noted that many of Oracle’s security features come at an added cost. Oracle is secure and ensures that user data is not tampered with through prompt updates. For organizations that prioritize security and need a database that offers advanced transactional capabilities, Oracle’s paid features can provide the extra layer of protection and speed required for large-scale operations. Its experience with various industries also gives it the upper hand. That doesn’t mean, however, that PostgreSQL has poor functionality. It offers three levels of transaction isolation: Read Committed, Repeatable Read and Serializable. It is immune to dirty reads. Requesting a Read Uncommitted transaction isolation level provides read committed instead. PostgreSQL supports full serializability via serializable snapshot isolation (SSI).
While both solutions are quite capable in this category, PostgreSQL may have a slight advantage due to its open-source characteristics. Not only is it much lighter than Oracle, it doesn’t require users to spend more money to expand infrastructure. PostgreSQL is capable of accommodating any volume of data.
Oracle has a robust language in PL/SQL, however PostgreSQL allows you to write language handlers in multiple languages (Python, R, etc.) directly in the database.PostgreSQL also clearly has the edge when it comes to compatibility with operating systems, which is extremely crucial in today’s diverse and complex development environments. FreeBSD, HP-UX, Linux, NetBSD, OpenBSD, OS X, Solaris, Unix and Windows are all compatible with PostgreSQL , which is a big advantage.
DBmaestro’s Source Control product supports both Oracle and PostgreSQL. And it works with any IDE. Changing procedure code, creating new tables and reviewing changes is a very user-friendly and easy process. Save your changes in one place and work with any git repository. When you’re ready, push the changes so that all other teams can pull them. DBmaestro’s Source Control product will automatically generate the code to include all changes in your database(s). In fact, DBmaestro’s Source Control works with MySQL as well as MariaDB, with MsSQL and PostgreSQL. They offer a free trial of their Source Control product, so anyone can evaluate it for free.
Key Takeaways
This move includes well-known customer-facing brands and sites such as Alexa, Amazon Prime, Amazon Prime Video, Amazon Fresh, Kindle, Amazon Music, Audible, Shopbop, Twitch, and Zappos, as well as internal teams such as AdTech, Amazon Fulfillment Technology, Consumer Payments, and more.
So what are the implications of this gigantic milestone? Let’s find out.
Amazon’s DBAs once spent a lot of time managing and scaling their legacy Oracle databases. The migration freed up time that the DBAs now use to do an even better job of performance monitoring and query optimization, all with the goal of letting them deliver a better customer experience.
As part of the historic migration process, Oracle DBAs have been trained to become database migration specialists and advisors.
AWS said that Amazon’s consumer business has decommissioned and migrated 75 petabytes of data in nearly 7,500 Oracle databases to multiple AWS database services. As a result of this enormous move, the company has noticed latency reductions of 40% and lowered database admin overhead by 70%.
Credit: Amazon
What Amazon has done with this migration is part of a massive operation that was planned and executed for months. But this is far from becoming the norm.
Oracle remains the market leader in the database software market despite falling way behind in cloud computing capabilities and functionality, mainly due to immense migration costs. While this fact prevents its existing customer base from defecting to competitors, it’s not helping it win new customers.
Oracle’s cloud strategy has largely been built around providing its on-premise customers a path to the cloud that doesn’t go via Amazon.
The company has also recently introduced a free tier for its cloud computing platform that lets non-Oracle customers try out its latest autonomous database with no strings attached. Oracle’s free tier is practical, allowing developers to build proof-of-concepts before committing to the company’s cloud services.
It’s a step in the right direction for Oracle, but Amazon Web Services is now a viable option for smaller companies that are looking for a quick solution.
It’s natural to be concerned with database automation while making the move from Oracle to Amazon Relational Database Service (Amazon RDS). But there is good news. DBmaestro’s comprehensive solution covers both scenarios seamlessly, making automation a non factor while migrating.
Furthermore, DBmaestro helps handle a wide range of technical issues that may arise after the migration process and create bugs or downtime. These include:
To sum it up, it doesn’t matter if you are migrating, planning to migrate or staying with Oracle for the time being. DBmaestro has you covered in all cases.
Commercial solutions like Oracle Database present numerous challenges to the modern customer – licensing costs, choosing from various complex packages, inconsistent customer support, and audit risk being just a few of them. PostgreSQL, also known as Postgres, eliminates most of these issues.
The potential problems mentioned above don’t mean that commercial database solutions are going away, but more and more companies are migrating to PostgreSQL due to its inherited advantages. But how should you make this move? Let’s take a closer look at Oracle to PostgreSQL migration.
The common perception is that migrating databases is an easy process, but there can be many hiccups if the following issues are not addressed.
Pro Tip: Conduct a detailed assessment of existing database objects and functions before starting migration to identify potential compatibility issues.
For example, Npgsql .net data Provider doesn’t support CommandType.StoredProcedure. It performs CommandType.Text Query instead of the required Call operation. A workaround for this would be creating a wrapper class to convert Executes based on CommandType.
There is also the case of inexperienced professionals. If your organization has been using Oracle for a while, your team is probably very capable of working in this environment. Migration will require you to invest time and resources in educating them about PostgreSQL, along with proper support documentation.
Before getting started, it’s important to understand that no tool that can automate the process completely. Migration requires a hands-on approach.
Pro Tip: Create a migration checklist with a timeline to track progress and allocate resources effectively.
1- Preliminary Checking
Make sure you understand what needs to be migrated. This requires systematic mapping and checking. Also, look for any historical data that you may need. Don’t waste time replicating unnecessary data. For example, this can be backup data and temporary tables from past maintenance procedures.
2 – Migration Assessment
Once you have completed your preliminary checking, you need to analyze app and database objects to locate incompatibilities between the databases.
Tools such as Ora2pg are very helpful with migration assessment. They hook up seamlessly to the Oracle database, scan it automatically and extract the data to generate a comprehensive database migration report. To sum it up, this step will help you estimate the time and cost required for the migration process.
3 – Data Type Mapping
Oracle and PostgreSQL have quite a lot of differences when it comes to data types. You need to do some mapping and make sure things are being done correctly.
Oracle | PostgreSQL |
VARCHAR2(n) | VARCHAR(n) |
CHAR(n) | CHAR(n) |
NUMBER(n,m) | NUMERIC(n,m) |
NUMBER(4) | SMALLINT |
NUMBER(9) | INT |
NUMBER(18) | BIGINT |
NUMBER(n) | NUMERIC(n) |
DATE | TIMESTAMP(0) |
TIMESTAMP WITH LOCAL TIME ZONE |
TIMESTAMPTZ |
CLOB | TEXT |
BLOB RAW(n) |
BYTEA(1 GB limit) Large object |
4 – Watch the Transactions
Oracle has built-in transaction functionality, which has to be activated manually in PostgreSQL. In Oracle, the transaction starts when executing any statement and ends with the COMMIT statement. In PostgreSQL, the transaction commences with BEGIN and ends with the COMMIT statement.
PostgreSQL possesses all the isolation levels just like Oracle. However, keep in mind that the default isolation level of PostgreSQL is Read Committed.
5 – Don’t Ignore the Differences
There are quite a few technical issues when it comes to migrating Oracle to PostgreSQL. You need to make sure your team is aware of the following:
Time Retrieval Method | Required Function |
SQL start time | Statement_timestamp() |
Transaction start time | Transaction_timestamp() |
Time of function implementation | Clock_timestamp() |
6 – PLSQL to PLPGSQL Conversion
PostgreSQL’s PL/pgSQL language is similar to Oracle’s PL/SQL language in many ways. It is a block-structured, imperative language, and all variables have to be declared. Assignments, loops, conditionals are similar in both databases. However, the main differences you should keep in mind while porting are:
7 – Testing
Testing the newly the migrated database is crucial because despite many functions being the same in both databases, the outcome can turn out to be extremely different in PostgreSQL. You probably don’t have unlimited time for this, but the following scenarios must be tested to ensure smooth performance.
Completing your database migration successfully with minimal issues is a great achievement, but you cannot get optimal results if you are not automating your DevOps. Today’s dynamic development environment requires a comprehensive solution to address the ever-growing list of challenges and requirements.
Integrating automation into PostgreSQL ecosystem can help you make multiple cross-platform deliveries, while establishing a wide range of performance and business KPIs. These can then be tracked and monitored 24/7 via a centralized dashboard, eliminating the need for cumbersome manual supervision.
Automation helps improve speed, accuracy, consistency and reliability, while helping you pin-point issues as they arise and minimize remediation times. Compliment your Oracle to PostgreSQL migration with an automation solution to boost your brand value and customer satisfaction. Fly safe!
Key Takeaways
One of the most common ways to improve the performance of an INSERT operation is to use the APPEND optimizer hint.
APPEND forces the optimizer to perform a direct path INSERT and appends new values above the high water mark (the end of the table) while new blocks are being allocated. This is instead of the default process whereby holes in your blocks are filled with free space. In other words, APPEND enhances the performance of the INSERT statement.
Unfortunately, use of the APPEND hint is only possible when performing an INSERT using a SELECT clause, which inserts the SELECT statement into the table. APPEND cannot be used to insert single rows via the INSERT statement with the VALUES clause.
A few years back, Oracle introduced a little known optimizer hint called APPEND_VALUES. This hint provides the same feature and behavior of the direct path INSERT, but when calling on the VALUES clause, users can still insert new individual records into the table and benefit from the APPEND feature.
If your looking for low-hanging fruit that can be plucked to improve your Oracle database management, the APPEND hint is a logical place to start. Consider the case when using a PL/SQL block and adding a large number of records in a FORALL loop, while the loop is doing an INSERT VALUES statement. In this case, the APPEND_VALUES optimizer hint can simply be added to the INSERT statement to deliver performance improvements similar to those offered by the APPEND hint. When dealing with large data insertions in Oracle, use the APPEND_VALUES hint in your INSERT statements to boost performance, especially in PL/SQL loops.
Pro Tip: If you’re dealing with bulk INSERT operations inside loops, consider using FORALL with the APPEND_VALUES hint to reduce context switches between PL/SQL and SQL engines, leading to faster execution.
For example:
FORALL i IN table_type.FIRST..table_type.LAST
INSERT /*+ APPEND_VALUES */ INTO table_name VALUES
table_type(i);
The use of the APPEND_VALUES optimizer hint can drastically increase INSERT statement performance when inserting a large number of rows into a table, especially when the table has many holes (blocks that have empty spaces which should be filled during the row insertion process).
Pro Tip: When using the APPEND_VALUES hint, ensure that your table has proper indexing and is free from frequent fragmentation to maximize the performance benefits. This can help prevent performance degradation in the long term.
This hint forces the Oracle database to allocate new blocks above the table’s high water mark, with new rows inserted into the new allocated area, instead of searching for free space in other existing blocks.
Making use of this hint results not just in a better structured database but will also allows users to insert and append individual rows – making for a more fluid (read more agile) development process.
Of course, the easier it is to make changes, the more important it is to have a well-structured and enforced change documentation process. To avoid unintentional errors or version drift when making database changes, always combine performance enhancements like APPEND_VALUES with a robust source control system. This ensures all changes are tracked and validated. The more agile you become, the more “small”, off the cuff changes you’ll make and the more those “small changes” will contribute to large-scale version drift.
Oracle DBAs and developers would be wise to implement some sort of enforced source control. With a sufficiently robust source control solution in place, DBAs can focus more on database improvement and less on process control and management. Changes will be blocked if performed out-of-process and all valid changes will be automatically documented.
Mastering the full array of Oracle Database’s optimizer hints is a great way to accelerate your pace of development. But only with an appropriate oversight and control system in place, can those development changes be promoted through to release. It’s like pen and paper. On their own, each is of little utility, but together, they can raise empires.
Key Takeaways
Oracle’s industry leadership has expanded from servers and storage, to database and middleware, through applications and into the cloud.
Oracle has solidified its place at the forefront of the industry time and time again with its innovative company culture and intricate knowledge of customer challenges and successes.
How much do you know about Oracle and the 35 years of innovation that resulted in the development of the Oracle database?
Take this quiz to test your knowledge.
As the second largest software maker in the world by revenue, there is almost as much to know about Oracle corporation as there is to know about the Oracle Database!
I hope you learned a thing or two and I am optimistic that this information will come in handy down the road. Especially if you apply for a job at Oracle!
]]>