Oracle Archives | DBmaestro Database delivery automation. Simplified. Sat, 30 Nov 2024 16:10:04 +0000 en-US hourly 1 https://wordpress.org/?v=6.8.1 Oracle vs PostreSQL: The Battle of the Titans https://www.dbmaestro.com/blog/database-automation/postgresql-vs-oracle Thu, 08 Sep 2022 11:14:40 +0000 https://www.dbmaestro.com/?p=1469

What You’ll Learn

  • A detailed comparison of Oracle and PostgreSQL across five key parameters: value for money, support, functionality, scalability, and compatibility.
  • Which database system, Oracle or PostgreSQL, excels in terms of cost-effectiveness, support options, and flexibility.
  • Insights into PostgreSQL’s rising popularity in modern development environments and how it stacks up against Oracle’s extensive experience and functionality.
  • The role of version control systems like DBmaestro in enhancing the capabilities of both Oracle and PostgreSQL.”

PostgreSQL vs Oracle: The Showdown

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.

  1. Value for Money – PostgreSQL wins

    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.

  2. Support – PostgreSQL wins

    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

    get a demo banner

  3. Functionality – Oracle wins

    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).

  4. Scalability – too close to call definitively

    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.

  5. Compatibility – PostgreSQL wins

    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.

    read the white paper

What about Version Control?

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

  • PostgreSQL wins in terms of value for money, offering free acquisition, installation, and support, making it a solid choice for small to medium-sized organizations.
  • Oracle takes the lead in functionality, providing better transaction rates and stronger security features, though many come with added costs.
  • Both databases are strong contenders for scalability, but PostgreSQL offers better compatibility across multiple operating systems and languages.
  • DBmaestro’s Source Control product supports both Oracle and PostgreSQL, providing a user-friendly experience for version control and database changes.

]]>
Oracle or Not, DBmaestro Has You Covered https://www.dbmaestro.com/blog/database-devops/oracle-or-not Wed, 06 Nov 2019 11:18:52 +0000 https://www.dbmaestro.com/?p=1382

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.

Internal-oracle-or-AWS,-DBmaestro-has-you-covered-2

A Quick Review

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%.

Oracle AWSCredit: Amazon

What’s Next?

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.

DBmaestro – Automation for All Scenarios

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:

  • Accidental Override – DBmaestro documents and marks each iteration of code changes by giving it proper version numbers for good version management.
  • Partial Updates – Its no longer required to afraid of rollbacks while migrating. DBmaestro analyzes version upgrade changes and points at issues if such arise.
  • Manual Errors – DBmaestro has this problem covered by flagging all tampering instances, identifying the stakeholders, and sending alerts in real-time.

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.

 

 

]]>
The Ultimate Oracle to PostgreSQL Migration Checklist https://www.dbmaestro.com/blog/database-automation/postgresql-migration-checklist Wed, 19 Jun 2019 08:59:34 +0000 https://www.dbmaestro.com/?p=1346 What You’ll Learn

  • Key steps and challenges in migrating from Oracle to PostgreSQL.
  • Essential differences between Oracle and PostgreSQL that impact migration.
  • Practical tips for ensuring smooth code, transaction, and data type compatibility.
  • How automation can enhance database migration efficiency and accuracy.

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.

Internal-PostgreSQL-oracle-migration2

Potential Challenges While Migrating

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.

  1. Performance Bugs – Most PostgreSQL data types are easier to work with than their corresponding Oracle ones. However, some differences can cause issues if not tested properly. For example, The PostgreSQL “Timestamp With Time Zone” field is the actual equivalent to Oracle’s “Timestamp With Local Time Zone”.
  2. Packaged Applications – PostgreSQL is ACID-compliant and conforms to the ANSI SQL:2008 standard. However, if you’re using a packaged software app which does not certify on PostgreSQL, migrating cannot be commenced without asking the vendor to move PostgreSQL to its supported database list.
  3. Large Data Volumes – Migrating small databases (100GB or less) is quite easy. However, bigger databases can be time and resource (bandwidth) consuming if done in the traditional way. You may want to use date-based partitions, which makes it easier to choose and isolate the data that is moved offline.
  4. Code Migration Issues – Porting the code to work with PostgreSQL is a big challenge. The good news – most of the code can be migrated automatically using tools such as the AWS Schema Conversion Tool (AWS SCT) or Ora2Pg. However, the rest has to be done manually and tested accordingly.
  5. Version Compatibility – Please note that Store Procedures were not introduced until PostgreSQL Version 11. Earlier versions worked only with functions.

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.

The Checklist: Oracle to PostgreSQL Migration

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.

demorequest

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:

    • Dual Table – In Oracle, the FROM clause is mandatory for every SELECT statement. Hence, Oracle database uses DUAL table for SELECT statements where the table name is not required. In PostgreSQL, the FROM clause is not mandatory. Hence, DUAL table is not required.
    • SYSDATE – Oracle’s SYSDATE function returns date and time. On the contrary, PostgreSQL doesn’t have any function corresponding to the SYSDATE function. Hence, you will need to use one of the following methods to get the date and time, as per the application purpose.
Time Retrieval Method Required Function
SQL start time Statement_timestamp()
Transaction start time Transaction_timestamp()
Time of function implementation Clock_timestamp()

 

 

    • Empty String and NULL – There is a clear difference in behavior when it comes to these two important parameters. In Oracle, the IS NULL operator is used to check whether a string is empty or not. However, in PostgreSQL, the result is FALSE for empty string and TRUE for NULL.
    • SUBSTR – SUBSTR behaves differently in Oracle and PostgreSQL. It works smoothly in PostgreSQL but returns a different result in Oracle. This difference can lead to potential issues. The solution is to use the Oracle SUBSTR function which returns the same result as Oracle.
    • The DELETE Statement – In Oracle, the DELETE statement can work without the FROM clause, which is not the case in PostgreSQL. You will need to add the FROM clause in PostgreSQL DELETE statement manually. Ignoring this step can cause a plethora of issues going ahead.

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:

    • In PostgreSQL, the function body must be written as a string literal. You need to use a dollar quoting or escape single quotes within the function body.
    • There are no packages in PostgreSQL. Instead, use schemas to organize your functions into the required/ desired groups.
    • Data type names often need translation. For example, in Oracle string values are commonly declared as “varchar2”, a non-SQL-standard type.
    • There are various notational differences for the use of cursor variables.
    • Since there are no packages, there are no package-level variables either. You can keep per-session state in temporary tables instead.

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.

    • Make sure all objects are correctly converted.
    • Check whether all the DMLS’s are working properly.
    • Load some sample data in both databases to check the results. The SQL results from both databases should be identical.
    • Assess the DML performance and work on it if necessary.

Automate for Optimal Results

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.

Database release automation

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

  • Database migrations, especially from Oracle to PostgreSQL, require thorough planning and testing due to compatibility challenges.
  • Differences in data types, transaction handling, and functions necessitate careful mapping and manual adjustments.
  • Automated tools and DevOps practices can simplify complex migrations and ensure accuracy across environments.
  • Integrating automation after migration enables efficient monitoring, cross-platform deliveries, and centralized issue tracking, enhancing database performance and reliability.
]]>
Oracle RDBMS Optimizer Hint: Boost INSERT Statements With APPEND_VALUES https://www.dbmaestro.com/blog/database-devops/boost-insert-statements Wed, 16 Aug 2017 12:04:02 +0000 https://www.dbmaestro.com/?p=1139 What You’ll Learn:

  • The difference between the Oracle APPEND and APPEND_VALUES optimizer hints and when to use each.
  • How the APPEND_VALUES hint can improve performance in INSERT statements with individual rows.
  • Practical examples of using the APPEND_VALUES hint in PL/SQL for faster data insertion.
  • Best practices for optimizing Oracle database performance with direct path INSERT operations.

When to Use APPEND_VALUES Over APPEND

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.

continuous-delivery-oracle-rdbms

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.

Those Who Cannot APPEND, APPEND_VALUES

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);

database-wordcloud.png

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).

get a demo banner

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.

APPEND_VALUES in the Broader Context of Oracle Database

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.

Optimizing Oracle INSERT Performance with APPEND_VALUES: Best Practices

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.

read the whitepaper banner

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

  • The APPEND_VALUES hint offers significant performance benefits for individual row inserts, similar to the APPEND hint for bulk inserts.
  • By allocating new blocks above the high water mark, APPEND_VALUES ensures more efficient data handling and faster INSERT operations.
  • Combining the APPEND_VALUES hint with PL/SQL best practices, such as using FORALL, can reduce execution time and improve overall database performance.
  • Implementing source control and monitoring database structure are essential for maintaining long-term optimization.
]]>
How Much Do You Know About The Company Behind The Oracle Database? https://www.dbmaestro.com/blog/database-devops/company-oracle-database Tue, 11 Apr 2017 13:22:42 +0000 https://www.dbmaestro.com/?p=1077 For over 35 years, Oracle has been at the forefront of the database software industry. It has successfully developed breakthrough technologies and acquired best-in-class companies over the years.

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!

]]>