Pakistan's First Oracle Blog

AI Web Scraping for Free with DeepSeek R1 Locally with Crawl4AI and Ollama
This video shows how to do AI web-scraping with DeepSeek R1 locally with Ollama and Crawl4AI easily.
Code:
Getting Data LLM-Ready with JSON in Oracle Database
If you are building an AI-powered application, especially with tools and function calling you know that using JSON could greatly improve the accuracy of your application and the LLM would be able to give more grounded response. That is where this blog post is helping to show you how easy and powerful it is to use JSON with Oracle PL/SQL, which is still very much relevant in today's AI world.
Oracle Database provides native support for JavaScript Object Notation (JSON) data, allowing you to store, index, and query JSON data using standard SQL and PL/SQL.
Benefits of Using JSON in Oracle Database
- Schemaless development: Quickly react to changing application requirements without needing to change storage schemas.
- Flexible data analysis and reporting: Leverage the power of SQL and relational databases for complex data analysis and reporting.
- Rock-solid data protection and access control: Ensure data integrity and security with Oracle Database's robust features.
JSON data can be stored, indexed, and queried without defining a schema. Oracle Database supports JSON natively, providing features like transactions, indexing, declarative querying, and views. JSON data is stored using standard SQL data types such as VARCHAR2, CLOB, and BLOB. It is recommended to use an is_json check constraint to ensure column values are valid JSON instances.
PL/SQL supports SQL code, including SQL code that accesses JSON data. You can use SQL/JSON functions and conditions as built-in PL/SQL functions.
Additionally, PL/SQL provides object types for JSON, allowing for fine-grained construction and manipulation of in-memory JSON data.
Let's say we have a JSON object that represents a list of books:
The output of this script would be:
By leveraging Oracle Database's native support for JSON data, you can efficiently store, query, and analyze JSON data using standard SQL and PL/SQL.
How-To Speedup Initial Load from Oracle to SQL Server with Oracle GoldenGate 23ai
Have you ever stared at your computer screen, watching the hours tick by as you wait for a massive data transfer to complete? If you're using Oracle GoldenGate to move data from an Oracle database to SQL Server, you might know the feeling all too well—especially when you're dealing with something like 200 million rows that take way too long. Let’s dive into how Oracle GoldenGate works and some simple tricks to speed up that initial load time.
What is Oracle GoldenGate?
First things first—what is Oracle GoldenGate? In simple terms, it's like a super-efficient courier service that gets your data from one place to another. It specializes in real-time data integration and replication, making sure every bit of information moves swiftly and accurately from your Oracle database to whatever destination you've chosen, like SQL Server, in this case. It's especially handy for businesses that need their data synchronized quickly and continuously.
Making the Initial Load Faster
Now, onto the good part: how can you speed up the initial load that seems to take forever? The good news is that there are several strategies you can use to make the process more efficient.
Using the BATCHSQL parameter is one approach. This allows you to bundle multiple SQL insert statements together, reducing the overall time spent on these operations. Creating a unique index on your target SQL Server for inserts is another useful tip. This helps your database manage the incoming data more efficiently, cutting down on the time it takes to sort and place the records.
Splitting your data into smaller batches is also a great way to speed things up. Instead of overwhelming your system with 200 million rows all at once, use the Range function or Column Filters to divide the data into more manageable chunks. This approach is especially useful for large tables, as it allows you to tackle the data in sections rather than trying to handle it all at once.
Finally, if you're working with multiple database instances that are all on the same version, consider creating multiple extracts that can connect to these different instances. This allows you to distribute the workload across various sources, which can significantly speed up the entire process.
By implementing these strategies, you can make your initial load process faster, smoother, and less stressful. Whether you're dealing with 200 million rows or even more, these tips can help you get the job done more efficiently.
How-To Fix Poco::IOException Error During Goldengate 23ai Upgrade
I recently upgraded Oracle GoldenGate 23ai. In this post, I'll share my experience and provide a step-by-step guide on how to upgrade Oracle GoldenGate 23ai using the GUI and especially a weird error which I received during this upgrade which is as follows:
Error:
If you want TLDR; then I had to apply patch 27788241 to get this resolved. For details, keep reading on.
To start the upgrade, I downloaded the latest Oracle GoldenGate 23ai software from the Oracle Technology Network or eDelivery. Then, I moved the software to a staging folder and unzipped it.
For Linux users, the commands are:
Next, I uploaded the Oracle GoldenGate 23ai software to a staging location on the server where the previous release of Oracle GoldenGate existed.
Upgrading the Service Manager
After installing the latest Oracle GoldenGate 23ai version, I upgraded the Service Manager. I logged into the Service Manager using the URL: https://hostname:servicemanager_port.
From the Service Manager Overview page, I selected the ServiceManager link in the Deployments section. Then, I clicked the pencil icon next to the Deployment Detail section to open the dialog box for editing the GoldenGate home path.
I updated the GoldenGate Home path with the full path to the new Oracle GoldenGate 23ai home and clicked Apply. Finally, I restarted the Service Manager using the Action dropdown.
Upgrading the Deployment
To upgrade the deployment, I stopped all Extract and Replicat processes. I checked for open transactions and Bounded Recovery.
Then, I updated the deployment with the location of the new Oracle GoldenGate 23ai Home directory. I edited the deployment details and updated the Oracle GoldenGate 23ai Home path.
Resolving the Error
During the upgrade, I got this error:
After researching, I found that applying patch 27788241 fixed the issue. I applied the patch, and the upgrade completed successfully.
Hope this helps.
DeepSeek R1 Coding Examples - Easy Tutorial for Beginners and Experts
Oracle Scheduler SQL Cheat Sheet
Oracle Scheduler is a built-in job scheduler in Oracle Database that enables you to manage and execute various tasks, such as running database program units, external executables, and scripts. It provides a flexible and sophisticated way to schedule jobs based on time, events, or dependencies, allowing you to automate routine tasks and reduce manual intervention.
The Scheduler offers advanced features, including prioritization of jobs based on business requirements, resource allocation, and monitoring of job execution. It also supports execution of jobs in a clustered environment, such as Oracle Real Application Clusters (Oracle RAC). With Oracle Scheduler, you can streamline your database operations, improve reliability, and reduce operating costs.
You can use following SQLs to manage your Scheduler and the jobs:
SOLVED - ORA-20000: ORA-24247: Network access denied by access control list (ACL) with Select AI
I have been experimenting with Oracle Select AI for couple of months now and it has become one of my favorite tool. The other day, I encountered an error while playing with it and it took me sometime to find a fix, so thought of sharing it with you guys.
If you don't know what Oracle Select AI is, here is a quick simple intro:
Oracle Select AI is a tool that lets you interact with your database using everyday language instead of complicated SQL code. It uses artificial intelligence (AI) to understand what you're asking and generate the right SQL queries for you. This makes it easier for everyone, regardless of their technical expertise, to get insights from their data and develop AI-based applications.
Now we know what Oracle Select AI is, lets have a look at error:
I was trying to integrate Select AI with Oracle APEX. Oracle Application Express (Oracle APEX) is a low-code application development platform that enables users to build scalable, secure enterprise applications. It is a web-based integrated development environment (IDE) that runs as part of the Oracle Database.
But when I was trying to configure profile with OpenAI's model like following:
BEGIN
DBMS_CLOUD_AI.CREATE_PROFILE(
profile_name => 'OPENAI_ORACLE',
attributes => '{ "provider": "openai",
"credential_name": "OPENAI_CRED",
"object_list": [{"owner": "SCOTT", "name": "MYTABLE"}]
}',
description => 'AI profile to use OpenAI with Oracle APEX'
);
END;
I was getting following error:
ORA-20000: ORA-24247: Network access denied by access control list (ACL)
ORA-06512: en "C##CLOUD$SERVICE.DBMS_CLOUD$PDBCS_240705_0", línea 2064
ORA-06512: en "C##CLOUD$SERVICE.DBMS_CLOUD_AI", línea 5674
ORA-06512: en línea 2 Error at Line: 7 Column: 0
After much ado, it turned out that I had missed following step to grant network access:
BEGIN
DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
HOST => 'api.openai.com',
ACE => XS$ACE_TYPE(PRIVILEGE_LIST => XS$NAME_LIST('http'),
PRINCIPAL_NAME => 'SCOTT',
PRINCIPAL_TYPE => XS_ACL.PTYPE_DB)
);
END;
As soon as I run above network ACL command, it worked like a charm.
Hope that helps.
NVIDIA SANA Model Local Installation with GUI - Step-by-Step Tutorial
This video locally installs NVIDIA SANA which is a text-to-image framework that can efficiently generate images up to 4096 × 4096 resolution.
Code:
How to Use OpenAI models with Oracle Select AI
If you want to use OpenAI models with Oracle databases then Oracle Select AI makes it a breeze to do so. Provided you already have an Oracle autonomous database in OCI, you can use following steps to use OpenAI's model to use natural language to query you database with LLMs from OpenAI.
Oracle Autonomous Database Select AI is a powerful tool that enables you to leverage AI capabilities directly within your database environment, and OpenAI is a leading AI model provider. Also, as OpenAI is a paid option, so you would need to grab your OpenAI's API key from platform.openai.com. By default, Oracle Select AI uses gpt-3.5-turbo (default) from OpenAI but you can select any model from below list:
- gpt-3.5-turbo (default)
- gpt-4o
- gpt-4o-mini
- gpt-4
- gpt-4-0613
- gpt-4-32k
- gpt-4-32k-0613
- gpt-3.5-turbo-0613
- gpt-3.5-turbo-16k
- gpt-3.5-turbo-16k-0613
Lets first create a user:
--
CREATE USER SCOTT IDENTIFIED BY "SelectAI25#TEST";
GRANT RESOURCE TO SCOTT;
GRANT CREATE SESSION TO SCOTT;
GRANT CREATE VIEW TO SCOTT;
GRANT CREATE TABLE TO SCOTT;
GRANT CONNECT TO SCOTT;
--Grants EXECUTE privilege to SCOTT
--
SQL> grant execute on DBMS_CLOUD_AI to SCOTT;
-- Grant Network ACL for OpenAI endpoint
--
SQL> BEGIN
DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
host => 'api.openai.com',
ace => xs$ace_type(privilege_list => xs$name_list('http'),
principal_name => 'SCOTT',
principal_type => xs_acl.ptype_db)
);
END;
/
--
-- Create Credential for AI provider
--
EXEC
DBMS_CLOUD.CREATE_CREDENTIAL(
CREDENTIAL_NAME => 'OPENAI_CRED',
username => 'OPENAI',
password => '<OPENAI_API_KEY>');
--
-- Create AI profile
--
BEGIN
DBMS_CLOUD_AI.CREATE_PROFILE(
profile_name => 'OPENAI',
attributes =>'{"provider": "openai",
"credential_name": "OPENAI_CRED",
"object_list": [{"owner": "SCOTT", "name": "MYTABLE"},
"conversation": "true"
}');
END;
/
--
-- Enable AI profile in current session
--
SQL> EXEC DBMS_CLOUD_AI.SET_PROFILE('OPENAI');
--
-- Use Select AI
--
SQL> select ai how many rows exist in table;
SQL> select ai how many users in Jakarta are jobless;
-- You can also show the actual SQL with the result:
SQL> select ai showsql how many users in Jakarta are jobless;
How-To Create Lip Sync Video with AI - Change Any Video or Audio Locally and Free
This video shows how to locally install Latent Sync AI model to lip sync any video and audio for free and in private.
Code:
git clone https://github.com/bytedance/LatentSync.git && cd LatentSync
source setup_env.sh
./inference.sh
Install NVIDIA Ingest Locally and Use it with Thousands of Documents
This video shares step-by-step instructions to install NVIDIA Ingest locally and use it with PDFs, Word, and PowerPoint.
Code:
Oracle Select AI and DBMS_CLOUD_AI in Simple Words
Oracle Select AI enables you to elevate your productivity and develop innovative AI-based applications by interacting with your database and Large Language Models (LLMs) using natural language through SQL.
Select AI leverages generative AI to automate and simplify various tasks, including:
- Generating, running, and explaining SQL queries from natural language prompts
- Retrieval augmented generation using vector stores
- Synthetic data generation
- Conversing with LLMs
- Seamless Natural Language Interaction
With Select AI, Autonomous Database effortlessly converts natural language into SQL. This enables you to interact with your data using natural language prompts instead of SQL code.
Select AI serves as a productivity tool for both expert and non-expert SQL users, enabling them to:
- Derive valuable insights from data without requiring extensive technical knowledge
- Automate the retrieval augmented generation process
- Utilize features like synthetic data generation, chat history support, and more from a SQL interface
The DBMS_CLOUD_AI package facilitates integration with user-specified LLMs, enabling natural language to SQL generation. This package provides an augmented prompt to the LLM, containing relevant database schema metadata, to generate, run, and explain SQL queries based on natural language prompts.
At the moment, following models are supported by Select AI:
- meta.llama-3.1-70b-instruct (default)
- meta.llama-3.1-405b-instruct
- meta.llama-3.2-90b-vision-instruct
- cohere.command-r-16k (deprecated)
- cohere.command–r-plus (deprecated)
- cohere.command-r-08-2024
- cohere.command-r-plus-08-2024
- GPT-4o
- GPT-4
- GPT-4 Turbo with Vision
- GPT-3.5-Turbo
- command (default)
- command-nightly (experimental)
- command-r
- command-r-plus
- command-light
- Mixtral-8x7B-Instruct-v0.1 (default)
- Meta-Llama-3-70B-Instruct
- Qwen1.5-1.8B
- claude-3-5-sonnet-20240620 (default)
- claude-3-opus-20240229
- claude-3-sonnet-20240229
- gpt-3.5-turbo (default)
- gpt-4o
- gpt-4o-mini
Install Kokoro TTS Model Locally
This video locally installs Kokoro which is a frontier TTS model for its size of 82 million parameters. It can be run anywhere.
MagicQuill Installation on Windows, Linux, Mac for AI Image Editing for Free
This video is an easy step-by-step tutorial to install MagicQuill locally on Linux, Windows, Mac.
Code:
SOLVED - Cannot Log in Oracle cloud with 2FA after Phone Change with Oracle Mobile Authenticator
I have been logging in to Oracle cloud using multi-factor authentication using 2FA with Oracle Mobile Authenticator and it was going fine until I had to change my phone. Both of my phones are android and I THOUGHT that I will simply migrate the apps and keep using the accounts in my Oracle mobile authenticator same way, but it seems that after migration I lost all the accounts.
Multi-Factor Authentication (MFA) is a security process that requires a user to provide two or more authentication factors to access a system, network, or application. Two-Factor Authentication (2FA) is a type of Multi-Factor Authentication that requires a user to provide two authentication factors:
- Something you know (password, PIN)
- Something you have (smartphone, token, or a one-time password sent via SMS or authenticator app)
So I was using 2FA with this Oracle Mobile Authenticator. I tried with my older codes , QR codes, the password, PIN and stuff but nothing worked. No matter, what I tried I simply couldn't log in to Oracle Cloud since the page asked me for a code generated by the authenticator.
Eventually following is the only way I could find to resolve this issue:
I talked in Oracle live chat, and they asked me to find an engineer to send me a bypass code.
If you don't know what Oracle Mobile Authenticator app is then as per docs:
Oracle Mobile Authenticator enables you to securely verify your identity by using your mobile device as a authentication factor. The app generates one-time passwords for login. Or it can receive notifications for login, which can be approved with a simple tap. When this authentication is used on top of username-password, it adds an additional layer of security that is essential for today's online applications.
Features:
- Generate one-time passwords even when the device is offline
- Push Notification based approval
- App PIN for app protection
- Set up via QR code, Config URL, or by entering key manually
- Multiple account support
- Generate OTP for other applications that make use of One-Time Password as per RFC 6238
- Generate one-time passwords even when the device is offline
- Push Notification based approval
- App PIN for app protection
I hope this helps.
How-To Integrate ChatGPT with Oracle Digital Assistant
Oracle Digital Assistant (ODA) provides a comprehensive platform for creating conversational interfaces. This article will guide you through integrating ChatGPT with ODA using the bots-node-sdk and openai libraries.
Prerequisites:
- Oracle Digital Assistant instance
- ChatGPT API key
- Node.js environment
Configuration:
Create a new file named services.js and add the following code:
- Replace YOUR_CHATGPT_API_KEY with your actual ChatGPT API key.
- Replace YOUR_ODA_WEBHOOK_URL and YOUR_ODA_WEBHOOK_SECRET with your actual Oracle Digital Assistant webhook URL and secret.
Understanding Read-Only Options in Oracle: Instances vs. Databases
When it comes to limiting data modifications in Oracle, two options are available: Read-Only Instances and Read-Only Databases. While both options restrict data changes, they serve different purposes and are used in distinct contexts.
Read-Only Instances:
A Read-Only Instance is a configuration in Oracle Real Application Clusters (RAC) where one or more instances are set to operate in read-only mode. This setup is ideal for environments with high concurrency for both read and write operations.
Key features of Read-Only Instances include:
- Real-time query scaling by dedicating specific instances to read-only operations
- Write operations are not allowed on designated read-only instances, but other instances can still handle writes
- Useful for load balancing in RAC configurations
- Read-Only Instances are suitable for offloading read-heavy workloads in RAC environments and supporting real-time analytics without impacting primary write performance.
Read-Only Databases
A Read-Only Database, on the other hand, is a database-wide mode that restricts all write operations. This setup is typically used for archiving, reporting, or maintenance tasks.
Key features of Read-Only Databases include:
- The entire database is locked for write operations
- Used for archiving, reporting, or maintenance tasks
- Can be achieved using the ALTER DATABASE OPEN READ ONLY command or a Data Guard physical standby database
- Read-Only Databases are ideal for archiving purposes, maintenance periods, or using a standby database for reporting.
Choosing the Right Option:
When deciding between Read-Only Instances and Read-Only Databases, consider the following:
- If you have a RAC environment and need to offload read-heavy workloads, Read-Only Instances might be the better choice.
- If you need to restrict, write operations across the entire database, a Read-Only Database is the way to go.
Ultimately, understanding the differences between Read-Only Instances and Read-Only Databases will help you make informed decisions about managing your Oracle database.
Hope this helps.
Resolving the "Invalid Characters" Error in Oracle Database 23ai Free Edition Installation
Oracle Database 23ai Free Edition offers a fully functional database for development, testing, and production purposes, allowing users to experience the powerful features of Oracle Database. However, users may encounter errors during the installation process, which can be frustrating and time-consuming to resolve. This article addresses a common issue that users may encounter during the installation of Oracle Database 23ai Free Edition and provides a solution to ensure a successful installation.
During a silent installation of Oracle Database 23ai Free Edition on Windows, the process terminates abruptly, and the setup.log file displays the following error message:
"SEVERE: The provided destination folder has invalid characters. Verify and try again."
The log file continues to grow in size, and the installation process must be manually terminated. This error can occur even when the destination folder path appears to be correct and free of any invalid characters.
Troubleshooting:
To resolve this issue, ensure that the following conditions are met:
1. Absolute Path for RSP File
Specify an absolute path for the RSP file in the command line. For example:
setup.exe /s /v"RSP_FILE=c:\myinstallpath\FREEInstall.rsp" /v"/L*v setup.log" /v"/qn"
This is necessary because the setup.exe file does not recognize the RSP file if only the filename is provided. By specifying the absolute path, you ensure that the setup.exe file can locate the RSP file correctly.
2. Empty Values in RSP File
Although the RSP file comment suggests that no parameter should be left with an empty value, it is safe to leave the DB_DOMAIN parameter empty if it is not required. This is because the DB_DOMAIN parameter is not mandatory, and leaving it empty does not affect the installation process.
Here is an example RSP file (FREEInstall.rsp) that can be used for a successful installation:
#Do not leave any parameter with empty value
#Install Directory location, username can be replaced with current user
INSTALLDIR=C:\app\myname\product\23ai\
#Database password, All users are set with this password, Remove the value once installation is complete
PASSWORD=mypassword
#If listener port is set to 0, available port will be allocated starting from 1521 automatically
LISTENER_PORT=0
#Specify char set of the database
CHAR_SET=AL32UTF8
#Specify the database domain for the db unique name specification
DB_DOMAIN=
#Specify TRUE for performing software only install
SOFTWARE_ONLY=FALSE
#Specify TRUE if installer should modify directory permissions when ACL is incorrect
MODIFY_DIRECTORY_PERMISSIONS=TRUE
By following the troubleshooting steps and using the example RSP file provided, you should be able to successfully install Oracle Database 23ai Free Edition on your Windows system. Remember to specify the absolute path for the RSP file and leave the DB_DOMAIN parameter empty if it is not required. If you encounter any further issues, refer to the Oracle Database documentation and support resources for assistance.
Control LLM's Output with Ollama Structured Outputs
This video shows how to use Ollama to constrain the LLM output to a structured format locally.
Code:
Install Indic Parler-TTS model Locally
This video shows how to locally install Indic Parler-TTS which can officially speak in 20 Indic languages.