True Cache is an in-memory cache. It is read only. True Cache is deployed in front of a primary database, and it is automatically managed. It keeps the most frequently accessed data in the cache, and it keeps the cache consistent with the primary database. They call it diskless, but it’s not. It does require some space for SP file, redo logs, control files, and such. But it’s very similar to Active Data Guard. The queries can be offloaded to the True Cache for faster query response. And the data in the query cache is consistent. Unlike other mid tier caches like Redis or Memcached, a query to the True Cache returns only committed data, and the data is always consistent. It’s secure. Why? Because we implement our Oracle database security policies and you can control access to the cache. Here in this diagram, we can see we have a True Cache configuration. We have four mid-tier sessions using a JDBC thin driver. We have the two True Caches along with one primary database. Now, the solid lines that we see here, they represent the frequent reads that go to the True Cache. So here we can see the solid line going to the True Cache there. Whereas the smaller dash lines, we can see, are going to the primary database. And then those larger lines is showing how, from the primary database, as the data in the true cache changes, it is updated. So why use the True Cache? Well, improve application performance without having to rewrite any applications. That can save considerable amount of time, effort and expense. Reduces the application response time. So the closer the True Cache is to the application, the faster the response. Now, you do need a large amount of memory. We’re talking memory here. It’s an in-memory storage area, and depending on how you configure it, you can have it shared, you can have it divided. And we’ll look at some of the configuration options. I mentioned it’s automatically maintained. So there’s no application changes required, and it is transparent to the application. Again, simplifies that development and maintenance. So at a high-level view, True Cache or primary database, the application configuration serves as other things that are going to decide where is it going to query the data from, from the true crash or from the primary database. The True Cache satisfies that query. And that’s where the data will be fetched from. If not, then from the primary database. On Start up, True Cache is empty. So it starts reading large chunks of data to populate the True Cache. So after a block is cached, then again, it can be automatically updated, apply the redo to it– very similar to the Oracle Active Data Guard. In the data returned it is always going to be consistent. So is it going to be current data? Well, maybe, maybe not. If it’s been updated in the primary, if they redo apply hasn’t occurred yet, then it’s not the most consistent. But as far as the query cache is concerned, it is the most current because we only display consistent. You can have multiple True Caches. You can save the same database application service to the True Cache as you can partition it. We’ll be discussing some of the different True Cache configurations options a little bit later. So some things to know, you need to have significant amount of memory. Memory, memory, memory. So True Cache is completely memory, memory. So I want to have all my data possible in there. The more memory you have, the less likely something is going to age out. And of course, just like with the standard caching, you can also pin objects to stay in the true cache. Yeah, like I said, there are some requirements for storage, even though it’s called diskless because of, again, redo log files, configuration files like the control files, SP file. And again it is read only. However, we’ll be discussing a little thing called DML redirection that you can apply the changes a little bit faster. So with using the True Cache, we have two physical connections, and we can have one to the primary database and one to the two cache. Each connection has a database application service associated with it, and it’s going to choose which connection to use based, whether it’s going to go to the True Cache or to the primary database. The second way is the application maintains one logical connection that uses the application service for the primary database. It’s the JDBC thin driver, starting with Oracle Database 23 is available. It’s going to maintain the physical connections to the primary database and the True Cache itself. Now, as you notice here, the logical connection, the one logical and one physical, is for Java applications only. Applications that work with JSON, we extend the HTTP entity tag support for that. So a database GET request to the True Cache is going to compute the ETag, insert it into the return document. But what happens if there is a mismatch when the modified document is put back into the primary database? Well, then the database is going to verify. OK, what happens with that? It’s going to verify the document row still matches that ETag for that. If with that put command, let’s say, I have new data here, the row is going to match that ETag that was automatically updated. If there’s no match, another user has changed the data and the PUT request is rejected. So the PUT request can be retired using the new data.
Continue reading...AristaDBA's Oracle Blog....
Finally, Oracle 26ai On-Prem Is Here….
And you can dowload it from here, https://www.oracle.com/database/technologies/oracle26ai-linux-downloads.html
Continue reading...Similarity Search….
let’s take a look at basic queries and similarity search. Now before you can do queries against your vector data, you have to insert the data first. So I wanted to show you an example of inserting several rows of vectors. Now in this case, each vector represents some sort of data point. And in some cases, they have more dimensions than in others. So as an example, that first row of inserts, 1.1 comma 2.7 comma 3.14, that has three dimensions. Further down with the 7.3, that only has a single dimension. Now after you insert data, then you can select the data. And in this case, if we select star from the T1 table, it would look like this. You’ll notice that the data is returned in scientific notation. Bear in mind, you could use a function such as to number in order to return a more readable, friendly version of the value. Now let’s talk about some of the basic rules. You’re not allowed to use comparison operations between vectors. If you do, you’re going to get an error message back. And it’s going to tell you that you cannot use vector type as comparison key. We’ll show you another example. Here we’re using the less than or equal to sign. And again, this is going to return the following error. Now let’s take a look at similarity search. Now vector data is usually unevenly distributed and clustered. And clustered means that it is in groups. So you might have groupings of houses, for instance, in a neighborhood that are all around the same price. Now, with similarity searches, you might need to search for nearest neighbors, which is going to be an ordered list by rank. Searches can be approximate, or they can be specific. Now, in this example, you’ll notice that we have different types of animals. We have wolf, dog, puppy, cat, kitten, lion, and elephant. And if we’re talking about nearest neighbors, we see that a dog is more similar to a wolf and is less similar to a kitten. So if we’re looking for the nearest neighbors, we might want to look for dog, puppy, wolf, for instance. And that represents data that makes sense for something that’s relatable to a dog. Now with the exact similarity search, this is going to calculate the query vector distance to all other vectors. And exact similarity searches are also called flat searches. They do give you the most accurate results. But the trade off is that these take longer. Although the search quality is perfect. Now when you do vector distance queries, you use the vector distance function. And the vector distance function uses something that we call a metric as an optional parameter. Now, in this example, we’re going to show you Euclidean and Euclidean squared distances, cosine similarity, dot product similarity, Manhattan distance, Hamming similarity. Now think about it like this. If you’re talking about the distance between a couple of points, what if you’re walking in a city and there are buildings between the two points? You can’t do a straight line between those points. You have to maybe walk around a block or maybe walk around several blocks to get to the location. So that would be an example of Manhattan distance metric. And so you would want to use the metric that makes sense for your particular data set. So here, we have an exact similarity search. And we are searching for the three nearest neighbors to a particular query point. So the query point is vq. And we want to find the three nearest neighbors. This is called a k nearest neighbor search. And we’re highlighting where on this representation those closest neighbors lie to the query point. Now if we wanted to use the Euclidean metric, we would do a SELECT statement that looks something like this. Select the doc ID from the vector tab table. Order by vector distance, and there’s that vector distance function. Now we’re supplying a column called embedding, which is the column that has the embedding, or rather the vector data type. And then we have an input query vector. And then that final parameter is the Euclidean metric. Notice that we are fetching exact first 10 rows only. By the way, the exact keyword would be optional. Now, this is bringing back the 10 closest neighbors using the Euclidean metric. Now, if we leave off the Euclidean metric keyword, then it’s going to use Euclidean squared distance as the default. And so here is another example using the same column, the same table, the same fetch first 10 rows only. So we’re bringing back the 10 closest neighbors. But this time, we’re using the Euclidean squared distance metric. The Euclidean squared distance metric is going to be quicker because it doesn’t have to calculate the squared distance. Now, if you want to do approximate similarity search, that is going to involve the use of vector indexes. And in order to create vector indexes, you do have to enable the vector pool in the SGA. These can be more efficient because they usually operate quicker than exact similarity searches. They can be less accurate. As an example, if you’re doing an exact similarity search, it’s going to be perfect on the results. However, if you use approximate similarity search, it might be 80% accurate. Now you can also provide the parameter as far as your accuracy metric. So if you wanted it to be 95% accurate, you can provide that as input. And that is what I’m talking about here with the target accuracy. So let’s take a look at that in a visual example. So here we have the input, the vq, the query. And if we are looking at an exact similarity search, you’ll notice that it finds the five closest neighbors. And we can visually see that with the gray cloud that’s circling those five other black X’s. Now if we did an approximate search, then notice that we find four out of five of those nearest neighbors. And in this case, you see that that is 80% accurate. So as we mentioned, approximate similarity search uses vector indexes. We have two different indexes that are supported. We have Hierarchical Navigable Small World, or HNSW index. And we have Inverted File Flat, or IVF index. We’re going to show you an example of creating each one of these types of indexes. Here, we’re creating an HNSW index. Create vector index. And the name is going to be galaxies HNSW on the galaxies table, on the vector column, which is called embedding. Organization in memory. Neighbor graph distance cosine with target accuracy 95. And there’s that target accuracy metric that I talked about earlier. And then when we go in and do a select, then it’s going to use the index in order to return the result set. Now in this example, Iám going to show you how to create an IVF or inverted file flat index. Create vector index galaxies IVF IDX on galleries, or sorry, galaxies. Again, the embedding column, which is a vector type. Organization neighbor partitions distance cosine with target accuracy 95. And then when we do that SELECT statement there, it does return the first three rows or the three closest neighbors. And this will use the IVF index in this example.
Continue reading...Vector Embedding Models….
vector embedding models quantify features or dimensions. As an example , we have the word LION. And we want to convert that into a vector to represent what that word means. So we use a vector embedding model to generate an embedding and store that as a vector in a vector type column. The models can be pretrained open source models. They can also be based on your own data set. Now, depending on the type of data, you can use different pretrained open source models as examples for textual data. There are sentence transformers which transform words, sentences or paragraphs into vector embeddings. For visual data, you can use residual network, also known as ResNet, to generate vector embeddings. For audio data, you can use the visual spectrogram representation of the audio data in order to fall back into the visual data case. Now, there are many different types of models. And depending on the model, they have different numbers of dimensions. As an example, Cohere’s embedding model has 1,024 dimensions. OpenAI’s embedding model, text-embedding-3-large, has 3,072 dimensions. And Hugging Face’s embedding model, all-MiniLM-L6-v2, has 384 dimensions. You can also create your own model that is trained with your own data set. Now we’re going to talk more on generating vector embeddings. You can do that either outside the Oracle database or within the Oracle database. In order to do that within the Oracle database, you can import a model, as long as it is in the ONNX format. Now ONNX stands for Open Neural Network Exchange. And it is a standard. Oracle Database implements an ONNX runtime directly within the database. This allows you to generate vector embeddings directly within the Oracle database using SQL.
Continue reading...Oracle AI Database , Vector Datatype….
Oracle AI Vector Search Benefits. One of the main benefits of Oracle AI vector search is that we have a single system for both structured and...
Continue reading...Oracle OS Management Hub Overview….
Oracle OS Management Hub is the next generation management solution for operating system environments. It provides a centralized management console to monitor and manage updates across...
Continue reading...Welcome 2026 with 26ai Database….
Oracle 26ai: The Next Generation of AI-Native Database Architecture Oracle Database enters a new era with the launch of Oracle 26ai, its most advanced and intelligent...
Continue reading...Oracle Connection Manager Architecture….
The listener receives client connections and evaluates against a set of rules whether to deny or allow access. If it allows access, then the listener forwards...
Continue reading...Oracle Connection Manager 101…
Oracle Connection Manager is a software component that typically resides on its own computer, separate from the application client and Oracle database server. Oracle Connection Manager...
Continue reading...Oracle Fusion Cloud Applications HCM Foundations Associate….
So I have decided to venture into SaaS. And cleared this exam. I must say, this was not easy. The course material avaiable at mylearn.oracle.com is...
Continue reading...
Recent Comments