Showing posts with label Database Tools. Show all posts
Showing posts with label Database Tools. Show all posts

Monday, May 27, 2024

ORA-04030 out of process memory when trying to allocate - 3 Step Resolution

ORA-04030: out of process memory when trying to allocate bytes, occurs when an Oracle process runs out of operating system memory.

The error is caused by either:

  • Exhausting total machine physical memory
  • Exhausting designated space in the Program Global Area (PGA).

◉ Understanding ORA-04030


The ORA-04030: out of process memory when trying to allocate bytes, occurs when an Oracle process runs out of operating system memory. 


This can be caused by either:

◉ Exhausting total machine memory. i.e. there isn't enough physical RAM on the machine

Or

◉ Exhausting designated space in the Program Global Area, known as the PGA.

The error message will show how much memory the process tried to allocate and provide details of where the allocation failure happened.

ORA-04030 out of process memory when trying to allocate - 3 Step Resolution

ORA-04030 can occur in either a client or database process.

If raised by a database process then an entry will be made in the database alert log, which will point to a trace file containing more details, which can be useful to identify the cause.

ORA-04030 out of process memory when trying to allocate - 3 Step Resolution

Resolving an ORA-04030 error typically involves addressing the memory limitations that caused it.

This might be:

  • Increasing available RAM
  • Adjusting PGA size
  • Optimizing resource usage
  • Reviewing operating system limits
  • Identifying and resolving memory leaks

◉ ORA-04030 Error Troubleshooting Steps


The basic Fix Flow steps for ORA-04030 are:

1. Use Autonomous Health Framework to generate an ORA-04030 Service Request Data Collection (SRDC)

In the first step we’re going to use Autonomous Health Framework to generate an ORA-04030 diagnostic collection.

The Autonomous Health Framework provides a series of capabilities aimed at making it easier for you to maintain your database.

It’s the same technology Oracle uses in the cloud to keep the Autonomous Database running, and it’s available for you at no extra cost as part of your existing software support agreement.

ORA-04030 out of process memory when trying to allocate - 3 Step Resolution

You can download Autonomous Health Framework by logging into My Oracle Support and searching – or you can just go to http://bit.ly/oracleahf, which will take you directly to the download page.

ORA-04030 out of process memory when trying to allocate - 3 Step Resolution

Autonomous Health Framework is capable of collecting various types of diagnostic collections, with problem specific SRDCs being one of them.

Before Autonomous Health Framework, Oracle Support might have asked you to go through many different steps as part of SRDC or Service Request Data Collection for ORA-04030. This would involve collecting and trimming different logs and running scripts, to understand how to perform it correctly required watching a video and reading other knowledge documents.

Now all this SRDC logic is packaged within Autonomous Health Framework and you can capture it all with a single command.

Login to the machine where the ORA-04030 occurred and as the Oracle user run the command:

tfactl diagcollect –srdc ORA-04030

You’ll be prompted to enter the date and time of the ORA-04030 you’re interested in, and then the database name

For example

$ tfactl diagcollect -srdc ORA-04030
Enter the time of the ORA-04030 [YYYY-MM-DD HH24:MI:SS,<RETURN>=ALL] : 

Enter the Database Name [Required for this SRDC] :

Components included in this collection: OS DATABASE CHMOS SOSREPORT

Preparing to execute support diagnostic scripts.
    Executing DB Script srdc_db_sid_memorysizes_11gplus.sql on CDB12 with timeout of 300 seconds...

Collecting data for all nodes

TFA is using system timezone for collection, All times shown in PDT.
Scanning files from 2024-03-25 10:07:36 PDT to 2024-03-25 10:40:07 PDT

Collection Id : 20240325104016mymachine03

Detailed Logging at : /opt/oracle.ahf/data/repository/srdc_ora4030_collection_Mon_Mar_25_10_40_19_PDT_2024_node_all/diagcollect_20240325104016_mymachine03.log

Waiting up to 120 seconds for collection to start
2024/03/25 10:40:24 PDT : NOTE : Any file or directory name containing the string .com will be renamed to replace .com with dotcom
2024/03/25 10:40:24 PDT : Collection Name : tfa_srdc_ora4030_Mon_Mar_25_10_40_18_PDT_2024.zip
2024/03/25 10:40:24 PDT : Collecting diagnostics from hosts : [mymachine04, mymachine03]
2024/03/25 10:40:25 PDT : Getting list of files satisfying time range [03/25/2024 10:07:36, 03/25/2024 10:40:07]
2024/03/25 10:40:25 PDT : Collecting Additional Diagnostic Information...
2024/03/25 10:40:44 PDT : Collecting ADR incident files...
2024/03/25 10:41:06 PDT : Executing TFA rdahcve with timeout of 600 seconds...
2024/03/25 10:41:08 PDT : Executing IPS Incident Package Collection(s)...
2024/03/25 10:41:10 PDT : Generating IPS Pack for 1 incidents on database cdb12
2024/03/25 10:41:17 PDT : Executing SQL Script db_feature_usage.sql on cdb12 with timeout of 600 seconds...
2024/03/25 10:41:17 PDT : Executing Collection for OS with timeout of 1800 seconds...
2024/03/25 10:41:25 PDT : Executing Collection for SOSREPORT with timeout of 1860 seconds...
2024/03/25 10:42:30 PDT : Completed Collection of Additional Diagnostic Information...
2024/03/25 10:42:35 PDT : Completed Local Collection
2024/03/25 10:42:35 PDT : Not Redacting this Collection on Exadata with no redaction option passed ..
2024/03/25 10:42:35 PDT : Not Redacting this Collection ...
2024/03/25 10:42:35 PDT : Remote Collection in Progress...
2024/03/25 10:42:56 PDT : Collection completed on host: mymachine04 
2024/03/25 10:42:56 PDT : Collection completed on host: mymachine03 
2024/03/25 10:42:56 PDT : Completed collection of zip files.

.---------------------------------------.
|           Collection Summary          |
+-------------+-----------+------+------+
| Host        | Status    | Size | Time |
+-------------+-----------+------+------+
| mymachine04 | Completed | 21MB | 113s |
| mymachine03 | Completed | 36MB | 131s |
'-------------+-----------+------+------'

Logs are being collected to: /opt/oracle.ahf/data/repository/srdc_ora4030_collection_Mon_Mar_25_10_40_19_PDT_2024_node_all
/opt/oracle.ahf/data/repository/srdc_ora4030_collection_Mon_Mar_25_10_40_19_PDT_2024_node_all/mymachine04.tfa_srdc_ora4030_Mon_Mar_25_10_40_18_PDT_2024.zip
/opt/oracle.ahf/data/repository/srdc_ora4030_collection_Mon_Mar_25_10_40_19_PDT_2024_node_all/mymachine03.tfa_srdc_ora4030_Mon_Mar_25_10_40_18_PDT_2024.zip

Once it's finished Autonomous Health Framework will package everything for you in a zip file for each machine, as you progress you'll only need the one from the node where the problem occurred.

2. Use ORA-04030 Troubleshooting Tool to find recommendations

Log into My Oracle Support and search for ORA-04030, or alternatively go to http://bit.ly/ORA-04030 to access it directly.

When you get to the troubleshooting tool click the Next button at the top right

ORA-04030 out of process memory when trying to allocate - 3 Step Resolution

Select the first radio button to choose to upload a Trace File Analyzer package. (Trace File Analyzer is one of the components of Autonomous Health Framework)

Then click the “Choose file” button, select the zip from the failing node that Autonomous Health Framework captured for you in step 1.

Then press the Upload button.

ORA-04030 out of process memory when trying to allocate - 3 Step Resolution

Once this is uploaded click the Next button at the top right again.

ORA-04030 out of process memory when trying to allocate - 3 Step Resolution

The troubleshooting tool will then analyze the contents of the diagnostic collection and compare the log entries against its list of known problems and recommend a solution.

ORA-04030 out of process memory when trying to allocate - 3 Step Resolution

If you go through the MOS troubleshooting tool and can’t find a solution, or you just need some more help, then Oracle Support is just a click away.

3. Log a new SR using the diagnostic collection

Press the Create SR button at the bottom.

ORA-04030 out of process memory when trying to allocate - 3 Step Resolution

You’ll then be prompted to clarify your:

  • Product
  • Product Version
  • Support Identifier
  • Operating System
  • SR severity

Then press the Create SR button.

And you’ll get a new SR number.

ORA-04030 out of process memory when trying to allocate - 3 Step Resolution

Source: oracle.com

Friday, May 24, 2024

Oracle Globally Distributed Database addresses multi-country data residency challenges for Munich Re HealthTech

Customer Success story with Oracle Globally Distributed Database:


Oracle has helped the leading global specialist in digital solutions for the health insurance industry achieve scalability and data residency through Oracle Globally Distributed Database.


The insurance sector has been correlated with economic growth radically – Undoubtedly, the COVID-19 pandemic has resulted in a huge impact on insurers across the world. Digitalization is a critical driver in shaping politics, economics, and the balance of power in global events. The amplification of growth in technology is changing customer expectations, and in turn, prompting the incumbent and larger insurance companies to accelerate digitization and adopt new ways of working to offer seamless services to their customers.

While the industry heads forward with the changes happening in the ecosystem and shifting regulations with digital initiatives, a few more direct impacts that convert to lower profit margin and growth are compelling insurers to cut costs and perform more efficiently at the same time. Legacy IT infrastructure and the overly manual nature of certain processes and capabilities have challenged insurers’ ability to respond to such crises. This success story will take you through the nuances of the insurance vertical, and how Oracle Globally Distributed Database is helping enterprises in responding to these challenges.

Data Sovereignty in the Post-pandemic Insurance Industry


As insurers and regulators navigate through the digital revolution, the challenges of cyber risk pose obstacles in this thriving data-rich universe. Insurance companies have to collect massive amounts of data with the goal of risk mitigation, optimizing performance, and meeting the rocketing expectations of customers hence, data is key to remaining competitive. For ages, insurance companies have been aggregating a great deal of data, however, they face challenges, preventing them from making the most of the power offered by data governance frameworks and meeting the data sovereignty requirements such as:

◉ Maintaining control over encryption and access to your data
◉ Giving organization visibility and control over provider operations

Organizations across the globe are now prioritizing their data sovereignty to stay ahead of the curve. Residing the data close to the consumers is the best way to deal with such issues.

Solution: 


Oracle Globally Distributed Database meets data sovereignty requirements and supports applications that require low latency and high availability. It offers user-defined data placement for complying with regulatory requirements.

Oracle Globally Distributed Database provides comprehensive data sovereignty solutions that focus on the following aspects:

Data Residency: Data can be distributed across multiple shards, which can be deployed in different geographical locations.

Data Processing: Application requests are automatically routed to the correct shard irrespective of where the application is running.

Data Access: Data access within a region can be restricted further using the Virtual Private Database capability of Oracle Database.

Derivative Data: Ensuring that the data is stored in an Oracle Database, and using Oracle Database features to contain the proliferation of derivative data.

Data Replication: Oracle Globally Distributed Database can be used with Oracle Data Guard or Oracle GoldenGate to replicate data within the same Data Sovereignty region.

Customer story: 


Oracle has helped the leading global specialist in digital solutions for the health insurance industry achieve scalability and data residency through Oracle Globally Distributed Database.



Company’s Overview :


  • Munich Re HealthTech (MRHT) is a division of Munich Re, one of the world’s leading providers of reinsurance, primary insurance and insurance-related risk solutions. MRHT, which is a leading global specialist in digital solutions for the health insurance industry, has been operating since 1995 and its solutions currently support 27 organizations in 19 countries in Europe, MEA, Asia and Latin America.
  • They have an application called SMAART i.e Munich Re HealthTech’s all-in-one tool for sophisticated insurance claims reserving, advanced portfolio performance monitoring, and pricing system for the health insurance business. It provides you with a 360-degree view of your business performance, allowing you to monitor your portfolio profitability from a product and policy perspective.
  • SMAART is built using the low-code Oracle APEX development platform within the Oracle Database

Business Challenges:


Data Sovereignty - Privacy & Residency

  • SMAART is experiencing growth across multiple countries, and it requires adherence to data residency laws
  • Clients that are using their systems are companies with a business that spans across several countries: Regulators (UAE, Saudi Arabia so far, and more countries in the ME in the coming future) are enforcing data residency requirements where personal and/or non-personal data must be stored locally
  • There was a need to store some of the client data locally in the country of origin to comply with data residency regulations 
  • Clients do not want to have a limited view of data per country, they need to be able to see the overall picture
  • The maintainability of multiple infrastructures for a single client in multiple countries is an issue due to the costs involved
  • Maintenance costs for MRHT are also higher due to increased support
  • The customer evaluated several vendors to build a globally distributed database. However, migrating the data model and modifying the code would take several years if they build a globally distributed database. Some of the other shortcomings included a lack of full concurrency, transaction, and update support or joins

SMAART Got Intelligent Architecture With Oracle Globally Distributed Database

In-country data storage with a global view

  • Oracle Globally Distributed Database architecture enabled a single logical database to be distributed over multiple geographies to achieve data residency requirement
  • The application stack is deployed in one region, while database shards are stored in different countries
  • Support from APEX to run multi-shard and single-shard queries and VPD (Oracle VPD) to handle row-level security 

Oracle Globally Distributed Database addresses multi-country data residency challenges for Munich Re HealthTech


Oracle Globally Distributed Database addresses multi-country data residency challenges for Munich Re HealthTech

The SMAART Approach


In-country data storage with a global view

  1. Central ‘Catalog’ database and two sharded nodes one in each remote site
  2. Selected the Sharding Key (in this case Client Organization ID)
  3. We uploaded data in the Catalog database and verified that they were directly stored in the relevant sharded tables depending on the organization ID
  4. Could connect to and query the Catalog database transparently, getting results for all sharded tables as if they were stored in the same centralized location
  5. Could connect directly to the shard and retrieve information only for the data of the particular shard
  6. Installed Oracle APEX on the Catalog database and installed the SMAART application
  7. Applied VPD and tested VPD through APEX
  8. Tested different types of user access through APEX

Business Benefits:


The client gained notable efficiencies from the comprehensive system overhaul:

High Performance 

  • Sharded architecture delivered a single global database for the customer, offering higher performance than ever before
  • This architecture substantially reduced global data replication and selectively replicate data only when needed to satisfy joins against local data
  • APEX automated the data extraction from spreadsheets reducing the time to build analytical dashboards from 15 days to an hour and reducing human error and security risks
  • Enabled customer to perform shard-specific DML or cross-shard DML without any impact on performance

Faster reporting response 

  • Enabled customers to run reports and analytics against a single global database as and when needed
  • This robust architecture eliminated the need to copy large amounts of data to a central warehouse as distributed parallel queries run against all shards with local data
  • The architected solution offered a bird’s eye view of their entire cross-country portfolio, and at the same time limited access of users to specific areas that how much they need to see

The actuary is making better decisions now

  • Oracle capabilities empowered them to build AI forecasting models by using the R interface with Oracle Machine Learning in Oracle Database
  • The client achieved enhanced performance and isolated data manipulations at the local shard site with the support of R, ODI, and ODM
  • Fully supports Oracle Analytics Server and enables cross-shard access and single-shard access based on user setup and configuration (can be enabled in RPD)

This is how Oracle Globally Distributed Database made it possible to satisfy data privacy regulatory requirements related to data residency where regional data would remain in respective regions and storing data close to its consumers that delivered data proximity.

To conclude, Oracle Globally Distributed Database is the perfect solution for covering data residency requirements while keeping central maintenance of their application and users. The solution can deliver hybrid functionalities leveraging Cloud and on-premises infrastructures.

The Way Forward:


Since 2014, top insurance players had delivered an annual Total Shareholder Return of 20% by the end of 2019. However, by the second quarter of 2020, the insurance sector underperformed the market by approximately 12%. The insurance industry’s proportionality with economic growth and fallouts is crystal clear. Going forward, technological enhancements and data sovereignty will have a significant impact on the growth potential of the insurance industry and ultimately the global economy. The road ahead will necessarily be paved by the growing digital and technological capabilities of countries as they aim for newer advancements in technology and digital sovereignty. Oracle Globally Distributed Database is all set to help its customers in this upcoming wave of disruption.

Source: oracle.com

Monday, April 22, 2024

Oracle Database API for MongoDB - Best Practices

Oracle Database API for MongoDB - Best Practices

The Oracle Database API for MongoDB (hereafter MongoDB API) allows you to access Oracle Databases from MongoDB-compatible programs and drivers simply by modifying the access URI of your program or application.

There are two ways to use the Oracle Database API for MongoDB (or MongoDB API):

1. As part of a fully managed Autonomous Database Serverless.
2. Using a standalone ORDS server connected to an Autonomous Database Dedicated/CC or an unmanaged Oracle Database, on-premises or in the Cloud.

As a fully managed service, the first option requires no configuration (beyond turning the feature on) nor any maintenance from a customer perspective. This document will therefore concentrate on the second option, where the customer manages the deployment and support of the MongoDB API.

MongoDB API architecture


MongoDB programs and drivers communicate with their database(s) over a socket connection, usually using port 27017. A URI contains all the information needed to define the server connection and typically takes the form

mongodb://[user:pass@]servername:27017/databasename?parameters

In the case of a MongoDB database, the database server itself listens on port 27017 and acts on incoming requests. Oracle MongoDB API provides the same transparent connection through Oracle REST Data Services (ORDS), so all you need to do is to change your connection string. No additional port openings or firewall changes are required; all you need is network connectivity to your ORDS installation, on-premises, or in the Cloud. 

The MongoDB API is an integral part of ORDS. It rewrites MongoDB requests into appropriate Oracle SQL or SODA operations and passes them to the Oracle database server over SQL*Net. Storing your documents centrally in an Oracle Database enables you to provide MongoDB compatibility with your data stored and managed in the most mature, mission-critical Oracle Database and enhance your capabilities to work with the data beyond pure document-store APIs, such as full SQL/JSON access for analytics.

Oracle Database API for MongoDB - Best Practices

You need to deploy ORDS as a standalone application, meaning that the ORDS process spins up its own Jetty Web Server. Such a deployment has the advantage of requiring only Java and a minimal resource footprint.

The following defines some best practices for deploying the MongoDB API for your applications.

I have an Autonomous Database Serverless. Is there any reason to use a standalone ORDS server??


No.

In most cases, the built-in MongoDB API support is sufficient, and you don’t want to deploy and manage anything yourself. However, you may get more tunability and performance under certain challenging conditions by utilizing a standalone ORDS server on an OCI VM or a machine outside of OCI. If you decide to deploy your own ORDS, you can still use the MongoDB API interface provided by the Autonomous Database Service in parallel, for example, for testing or development purposes.

Can I use WebLogic Server or Apache Tomcat?


No.

Although ORDS itself can run standalone or as part of WebLogic Server (WLS) or Tomcat, the MongoDB API is currently only supported through standalone ORDS deployments.

Where should I run ORDS?


The location of where to deploy ORDS is primarily a decision of your architectural preference and how you leverage ORDS in your enterprise. It also depends on whether ORDS is just a means for providing the MongoDB API or is also leveraged for other ORDS functionality, such as serving as a REST Server or as a backend for Oracle APEX. Depending on your use case, you can either:

◉ Deploy ORDS centrally as a separate component.
◉ Consider ORDS part of your application that requires MongoDB API compatibility.
 
When working with ORDS, where the sole purpose is to provide the MongoDB API, it is usually best to run the ORDS server in the application node next to your application. When you have multiple application servers on individual nodes, you can run an ORDS instance with each application server. That way:

◉ The MongoDB API scales with the number of application server nodes.
◉ You only need to size the resources for each ORDS installation based on the requirements of a single application node.
◉ There’s no need to keep other ports open between your application node and the ORDS node. The only connection port required to communicate with the Oracle Database is the port for your SQL*Net connection.
◉ You don’t need to maintain separate hardware or containers for the ORDS nodes.
◉ Assuming you have a high-availability and/or load-balancing solution for your application nodes, that will also automatically work for ORDS.

However, there can be advantages to running ORDS on a separate cluster, mainly in the case of using ORDS for more than the MongoDB API. The benefits would be:

◉ A single ORDS instance can serve multiple applications and/or databases.
◉ ORDS can be scaled independently of the application.
◉ You can maintain a shared connection pool.

When deploying ORDS as a separate central component in a multi-tenant fashion, you need to ensure that:

◉ Your HA requirements must be met with multiple deployments and a mechanism to transparently work with any of your deployed ORDS instances, for example, through Load Balancers in a Cloud environment.
◉ You need to size the resources required for ORDS based on the aggregated requirements of all ORDS-supported services.

Are there other recommendations for installing and using Standalone ORDS?


Yes. Please see Oracle REST Data Services (ORDS) best practices, but when reading it, remember that any references to WLS or Tomcat should be ignored—any recommendation wrt. High Availability is applicable for standalone ORDS installations. Most of these recommendations will be more relevant for separate, centrally deployed ORDS environments.

Anything I need to do to achieve high throughput?


Yes. ORDS is configured with a relatively basic set of performance settings out of the box. Those might be ok for testing or small applications with light-weight utilization, but if you want high throughput, you must configure some settings like the connection pool size. Please see Section 9.7, Achieving High Performance in the ORDS Installation and Configuration Guide. 

Source: oracle.com