Oracle Academy Tech Chat

Part II Transforming Database Operations: MCP Server + OCI Generative AI in Action


Listen Later

In Part II of this episode we explore how Oracle's latest AI-driven database tools are revolutionizing teaching and learning in higher education. Tailored for global faculty and students, the episode demonstrates how artificial intelligence makes database operations more accessible, intuitive, and relevant to real-world applications. Faculty will discover strategies to integrate AI-powered tools into their curriculum, using features like natural language processing database queries, schema analysis, and automated health checks—all in simple language, not complex SQL. Students will see live demonstrations where database tasks are executed through everyday commands, bridging the gap between AI and hands-on expertise needed for today's tech landscape. Key highlights include an introduction to the MCP server, insights into OCI Generative AI integration with databases, and step-by-step interactive demos ideal for classroom and research settings. This podcast is a must-listen for educators seeking innovative approaches, students aiming to build in-demand skills, and academic leaders looking to advance curriculum and research with the latest in AI technology.

------------------------------------------------------------

Episode Transcript:

00;00;09;02 - 00;00;28;19

Welcome to the Oracle Academy Tech Chat. This podcast provides educators and students in-depth discussions with thought leaders around computer science, cloud technologies, and software design to help students on their journey to becoming industry ready technology leaders of the future. Let's get started.

00;00;28;22 - 00;00;46;13

Welcome back to Oracle Academy Tech Chat, where we discuss how Oracle Academy is helping prepare the next generation's workforce. This episode is part two of Transforming Database Operations MCP server and OCI generative AI in action.

00;00;46;16 - 00;01;02;05

So here is the code which we have built it. And I'll start my server. Okay. So first thing is like we can just do list all the databases.

00;01;02;07 - 00;01;28;22

So you can see like how many databases we have. So here are all the databases which we help you see. Database 123. Okay. And we can see what are the prompts. So let's say the first prompt I am using. Connect me to the database and list user tables. Okay. So I'll just go ahead.

00;01;28;25 - 00;01;42;24

Connect me to the I will connect to the first database and list all the user tables.

00;01;42;26 - 00;02;03;17

And meanwhile it does it operation. I'll also show like how you can build your own resources. So you see here I am using this open AI. If I wanted to use I can use this okay. Okay. So these are the things and these are the databases connections which I have used. So basically consist of the resources grants and the tools.

00;02;03;18 - 00;02;26;27

So this is some thing you can think like a resource. This will just turn to you okay. These are the resources which I am using it. And then I was also talking like a you can build your own provider. So I have been like OCI provider. This is my OCI provider. Similarly I have built open a provider. Here is my opening a provider.

00;02;26;29 - 00;02;50;28

And when you build your own provider you can also build like as I said MCP server consists of the prompt state prompt also tool and resources resources. I already shown these are the prompts. If you see here you are an expert Oracle DB which has this access for database operation. Perform these operations. So these are the prompt which you have to provide okay.

00;02;51;00 - 00;03;11;18

And there are certain means. There are the tools which we have already discussed. I will show us in the code. And that tool you can invoke. So yeah. So here you can see I have like within the prompt only I have added these tools stuff. Use this for SQL query to use this for this connection for list like that.

00;03;11;21 - 00;03;35;21

So if you see here I give the prompt connect me to the PUC database and list all the users tables. What it basically does it it basically with the first option it does it it basically connects me to the database automatically. Then it runs this again. It gets the response. It sees that response, and then it runs the query.

00;03;35;24 - 00;04;06;05

And you can see for the user table. So first it does the connection. Second it does the user query to get the response. So if you can see there are two operations which it performs after getting the response it performs another one operation. So total two task has been performed. Successful two okay. So yeah. So here you can see now I will just go to the next prompt list user table.

00;04;06;05 - 00;04;32;24

We already shown you. Now I just run this one list user table list transition event skills in separate tables. So if anyone has to build their own MCP server by using our good, I'll be sharing this code. This is available in the GitHub repository. So you can build your own orchestrator so that you can use this code as a reference code.

00;04;32;27 - 00;04;56;24

And in this code, if you see there is an MCP server code. So basically Oracle already came up with a tool which is a plugin which you can install SQL okay, you can install and you don't have to do. But what we have done is like we have mirrored that tool by building our own MCP server. Like we build a real database connection, we build the real tool, expose it, and trying to use it.

00;04;56;26 - 00;05;25;09

So it's just to make sure that everybody understand the actual real world behind this. Okay. So here you can see I gave the prompt, list user tree with rich transaction events using separate tools. Okay. Three tasks has been executed. If you see it user table. These are the user table it tries to get. Then there was some error.

00;05;25;09 - 00;06;07;10

It got other this one queue name is invalid identifier. Then it tries to invoke again okay. And but the system indicate that no errors. So maybe I haven't given the permissions to list available connections or something. But transaction events stuff. Right. So that permission is not there. That's why you didn't able to query the database. So those days just now so is needed whenever you are building the MCP server so that you may not get what I can just say is like, you may not, give him the admin privilege and he can change the policy or do some nasty stuff.

00;06;07;13 - 00;06;37;25

Now, I'll, move to the next prompt. So this one prompt called saw me all the tables. Before that, I'll just use this, provide me the top three weight operations. So let's see how many weight operations which are running inside our database. So it automatically generate the query and tries to find the weight operations. So if you see here here's this is this this was our okay.

00;06;37;25 - 00;07;00;09

So I'll just first go there. So the if you see here this was the things which is try to like using probably does then it converted converts it into the SQL query okay. These are the SQL query. It gets converted. And this was the response which it tries to fetch it. So top three weight event. We asked.

00;07;00;12 - 00;07;24;05

So it gives you the events. Weight class total weights time weighted average wait time. So library cache okay. So basically total three weight operations try to providers ten rows has been selected. You can see here. So yeah. So if you give anything it basically tries to invoke the tool call converts your natural language into the SQL language and gets the response back to you.

00;07;24;07 - 00;07;48;24

And if you wanted to perform some agent approach, you can build your agent approach. As I said, we have already done this right in front of everyone, right? We connect to the database, we get the response, then we are listing the user tables. Okay. There is something called, report. I will show that also before so this is done and then so me all the tables inside the database.

00;07;48;26 - 00;08;09;25

So there are lot of tables. It may take some time so it will take some time. Meanwhile, I'll just say like so if you see here two will already available. But these are the tools. The Oracle has built it just to show everyone that how you can build your own tool.

00;08;09;27 - 00;08;30;16

So this is also the tool this the other tools which we have. I'll make it available as a part of this MCP. So you can see here. So these are the tools we are calling these tools. And then there is a real tool called we are doing it. And basically it does the real database connection okay. It does everything on a real basis.

00;08;30;16 - 00;08;51;11

Not like a plugin does it. you can install and start working on. So basically the idea here is like you can take this code and build your own NCP stuff by taking this as a reference to me. So actually there are a lot of tables we get this query, it may take some time, so I'll just move to the fifth and the sixth prompt.

00;08;51;13 - 00;09;24;08

Close this, start the server again. So I will generate so basically in the database we have report. So all the DB basically goes and then try to analyze this report. And it takes a lot of time. Right. And the first thing is like there is a query with which you can generate a report okay. And then you provide this like what all the weight operation you does all the performance recommendation analysis using that report.

00;09;24;10 - 00;09;57;27

So we'll see how we can generate using this. So I'll connect to my first database and generate report of last one. So meanwhile you can just see here, you have a config and in the config you can this is just like all these sources where you can have your stuff. And from I have already shown so there is a resource ID, there's a prompt and there a tool called.

00;09;57;29 - 00;10;19;21

So all the tools also I have shown. So that's the way you can build your own MCP server okay. So here you can see let me first connect to the database. And in this repository we have given this what I can say Readme file through which you can follow and you can build your own, like you can run this project also.

00;10;19;24 - 00;10;53;19

And I have connected with database now generated, a w report of last one. I will. So this readme file, you can just, take a look and you can actually, have the setup ready inside your system and you can work on it over the top of that and or what else you have. Yeah. So this is what basically will help everyone like building Dhcp server.

00;10;56;21 - 00;11;16;12

I was also talking about this feedback loop mechanism. So one second, if I could show you. So if you see here, the way I have implemented, you guys can also like, take a look. So this, feedback loop mechanism, if you see here.

00;11;16;14 - 00;11;41;02

You have a SQL syntax, you have a two execution score. So if you get your score right, we are basically calculating these those evaluation score result delivers a score. And then we try to find if it is lesser then then we try to do a iterative approach. Like we try to invoke the another that invoke another tool.

00;11;41;04 - 00;11;59;06

So that's the way we have built it. So you can just follow this piece of code and you can, actually do the step. Okay. So yeah, that's comma verse one. I think there are.

00;11;59;08 - 00;12;27;11

Some, there are some errors with the database which I am using it. The database has some issue last 500 characters. Fine. So yeah. So these are the. So if you see it's a complex problem process generate data here for last one hour. If I say generate the report only this much. So it will try to get the whole report from the public database.

00;12;27;13 - 00;12;51;01

Okay. So if these type of things are there you need to enhance this code. If these errors will come you need to enhance your prompt prompting technique and then people will understand accordingly and build a SQL accordingly. So it tries to build a SQL. If you see it. And you did not worked out for large to or not okay.

00;12;51;04 - 00;13;00;13

So algorithm basically tries to convert your natural language to a SQL and try to execute that SQL. But.

00;13;00;15 - 00;13;23;28

Fine. And anything else I have. Yeah. And. Yeah that's it. And then we have all these resources which I think we will be sharing it. So there is a GitHub repository where the code lies. And then there's a conference page we will see like a of 5 to 11 so that you can take a look okay.

00;13;24;00 - 00;13;31;09

And that's it. I don't have much questions. I will happy to answer all the questions.

00;13;31;11 - 00;13;48;27

And thank you Pam. Coach that was wonderful. I can actually pose those questions to you if you want to concentrate on answering them. So we do have some questions in the discussion and I'll just shoot them to you and you can let us know what the answers are. So the first question that we got was in relation to the MCP server.

00;13;49;01 - 00;14;06;23

And its scalability. And the question is how does it handle and manage the connection. And I think when we're talking about scalability, we're also talking about if this is something open, you know, how many connections can you handle. What determines the MCP service capabilities.

00;14;06;25 - 00;14;26;17

So in terms of the scalability, everybody has to like for us, we have to build our own rate limiting logic. Okay. So if you have a rate limiting logic, then let's say there are a lot of, requests are coming. And then you can like, I'm just give you an example, 100 requests at a time, you can process.

00;14;26;17 - 00;14;50;06

Right. So that's the way you can, build a scalability. And also it depends on the automation, right. Or personalize it. It's own MCP server. So by default MCP server is a lightweight protocol right. It is not completely heavy system. So they're just saying something called message routing system which we have it basically use the protocol.

00;14;50;06 - 00;15;14;10

So you but I can only use Http. There is something here you you can use the to do so in inherently what I can say that we use RPC is like inherently scalable which has a recipe structure to call. But if the number of requests are coming used so you can build your own limiting logic. Even doesn't 100 how many requests are coming.

00;15;14;12 - 00;15;25;16

Right. So based on that you can actually limits it. So scalability point of view. So at the time you will have 30 to 80 pulls calls which will be very easy for you.

00;15;25;18 - 00;15;43;24

And so I think this is a question comes in line with that, which is to do with how do you secure the MCP server, for the real time data to be secure. So you did mention it in the presentation, at a very high level, but I think they're just after a little bit more detail and, and I understand that question.

00;15;43;27 - 00;15;49;05

You could answer that ever a couple of hours. But if you have a very short answer for that question, that would be great.

00;15;49;08 - 00;16;09;12

Yeah, I got your point. So basically every organization or every company or every individual who is building MCP, first thing is like it is not, what I can just say it is not secure by design. So the person who is building it, they have to build it secure. So we are giving user level access to the database.

00;16;09;14 - 00;16;39;22

We are not giving the system privileged data, administrator, administrator level privilege because the database so that people cannot, delete it any table or do some modification system device like some views. So there's a way you can come also with your MCP. You can build your own TLS, kind of set up your own certificate training. So this is like the individual, person, what agency or individual organization perspective they have to build their own security system.

00;16;39;25 - 00;16;46;05

I'm maybe not secure by design. It's natively not secure. But yeah, there is.

00;16;46;07 - 00;17;05;03

A friend. So I guess depending upon the risk, the amount of data, what type of data, if it's something like an open database, you would be okay to let anyone access it. But if it's something secure like medical records or, something more sensitive private information, credit cards, you'd obviously make it a lot tighter and make sure that it's inaccessible by anyone.

00;17;05;06 - 00;17;06;11

Yes.

00;17;06;13 - 00;17;20;02

Wonderful. Okay, there is a question here in real life into the demonstration. And what you've showed to say is everything that you try to say, open source or is there are there any licensing phase if you want to build your own, MC server?

00;17;20;04 - 00;17;44;19

Well, so basically we have two testing. One is, we are using OCI. Another is we are using any AI. So if people are using open AI they have to like use their key. I was using my key. And if they are you using OCI or OCI? I don't know how the licensing works, but if they have the access of OCI cloud tenancy, they can go ahead and use the OCI, for accessing like using this MCP.

00;17;44;21 - 00;17;53;09

So it's just a different perspective. They can come and build their own provider, put their own key and they can start using it.

00;17;53;11 - 00;18;05;27

Yeah. So generally I would say with a lot of these protocols and I can speak for now and if you're listening to this in six months time or 12 months time, it might be completely different. But at the moment a lot of them, if you register, you have a certain number of tokens you can use or credit.

00;18;05;27 - 00;18;20;18

So you can use and I think it will be dependent upon that. So that might be where, you know, per day. For example, if you use certain large language models, they give you a certain number of queries, a certain number of questions, and then you run out, you got to wait till the next day. So I think that would be the limitations.

00;18;20;18 - 00;18;42;10

But at the moment, essentially what we've done here, Pankaj, is demonstrated to us is right now free auto degree, I'll say free to a degree. That's, yeah, let's give that one. Now, someone's asked about the usage of this, is it for application development or is it for something you do use for yourself?

00;18;42;12 - 00;19;02;16

So, so usage of this is like, what I can just say, like, if you are in the organization, there are certain tasks like JIRA task or some log analysis or some kind of task which you are doing. You can build your own MVP server and host it. People just have to invoke the tool. That's it.

00;19;02;16 - 00;19;30;01

They don't have to do open the create the ticket or do this, do that. So a lot of operations can be automated using MCP server. You use that. You can create one application host your MSK server somewhere. Third organization people can use this MSK tools and do their daily operations. And for the individual point of view it's more of like you will build, but at the end how many people are using it.

00;19;30;03 - 00;19;54;28

So MCP server is a way. It provides a way which can, invoke the external sources like some other external sources can use your tools for Oracle database. We never provided a layer that any application go inside our database and do some operations. But now we provided a way through which you can come invoke like execute SQL queries using your application.

00;19;55;06 - 00;20;09;07

But there are only five rules which we are making sure you are able to access. Nothing. Nothing. Then more than that, right? So yeah, that is the way you can also provide, like a tool for your purpose.

00;20;09;09 - 00;20;30;09

And I suppose from a usage perspective, really, I mean, it's applications are limited by your imagination, I suppose. Right? I mean, I could probably and correct me if I'm wrong here, have a database of all my contacts, for example, and then have a bunch of cameras around my house. And as I walk around, if a camera detects my hair is too long, it could create a connection.

00;20;30;09 - 00;20;45;09

Call my baba and create and connect with my calendar. Now what? I'm free and create a little, appointment for me with the Baba. I mean, is that kind of if I was to go very imaginative. Is that a potential use case?

00;20;45;12 - 00;21;08;08

Yeah, yeah, it can. It can be like a next step. What you are saying like automatically detecting your hairs and then performing these operations. So detection is also means it. That's the next step of this. So what I was doing this the one which I just showed you build you put some prompt and then it goes do some correction decimal place and you get the response.

00;21;08;11 - 00;21;27;29

And then based on the response you perform certain other actions. So you make a MCP server a genetic approach. Right. You does some operations over the top of the response. So that's W currently this tool supports but like auto detecting and then doing this. So that is another step. Yeah.

00;21;28;01 - 00;21;46;21

Yeah another layer on top of it. So we have another question here. And we've got a couple more minutes for questions. So we're good with that. I think it's how long connections are kept open. So is the MCP server capable of connecting different Oracle database service deployed in different locations. So can you I guess there's probably two parts of this connection.

00;21;46;21 - 00;21;55;26

Is it state or state list. And can it query a bunch of different databases in different locations if that's how your data is distributed?

00;21;55;28 - 00;22;17;05

Yeah. So it so as it is at one time as you. So it depends on the resources. What will the resource that you have available as a part of resources. Right. I made like one database connection. You can go multiple data connection, but not at a time because the client will make the connection at one client will make one connection.

00;22;17;05 - 00;22;51;01

Right. It cannot make multiple connection. And then do a log out. Do this that. So for our database like what one database at a time. It is doing one connection. But if you want to make a multiple connection. So like at the same time then you have to come within a genetic approach and you have to build a microservices architecture where you have to like a have multiple services of application which connect to the multiple MCP server, and then it can be done.

00;22;51;03 - 00;23;11;01

Okay. So that makes sense. So the connections are within the databases themselves connected. And then you're doing the one query at every time. Yes. Yes. Yeah okay. And a quick question. We've had a couple of questions on on certifications Oracle certifications and I and I know it's probably not your area of expertise, but do you recommend any.

00;23;11;01 - 00;23;27;22

And there is a question about the cost. And I believe the foundational ones are free at the moment. And there are a couple of that are available. And I mentioned some of those in my answer. But certainly you would start with OCI foundations associate if you had not much experience with AI. Is that what you would say would be the great starting point?

00;23;27;25 - 00;23;29;06

Yes.

00;23;29;09 - 00;23;33;18

Yeah. So I hope that answers that question.

00;23;33;21 - 00;23;45;10

And I'm just if anyone has any more questions, feel free to throw them in right now. Otherwise we will send our goodbyes and close out the session.

00;23;45;12 - 00;23;59;02

I think we've answered all the questions there. I there just want to ask one extra questions pop in. Actually, what mechanisms does the MCP server use to handle schema mismatches when generating context for the ARM?

00;23;59;04 - 00;24;20;27

So schema mismatch context is like it depends on the allele, it depends on the prompting. And so once you do a prompt, write a line. Basically read your prompt. It was going to read your natural language. It's converting to the SQL language. And if the SQL or the schema right whatever it has been converted, that is not a proper.

00;24;21;00 - 00;24;41;10

It means somewhere the prompting technique has to be improved somewhere. Array. You have to change. If you are using Gemini, you can try with Claude, or if you're using Claude, you can try with this. And token size is very important. The amount of context you are providing. If you are using a lamp which has only 5000 tokens, that may not be helpful.

00;24;41;10 - 00;25;06;14

Let me use the glow for 20,000 tokens. So token size is something where you can give a lot a lot of context. So your token size needs to be very good. And then the the element which you are using it must have the proper prompting technique, whatever you are applying so that it converts, your normal English to the SQL in a proper and appropriate way.

00;25;06;16 - 00;25;21;27

But and so I appreciate that. Okay. We're about to close as we hit the top of the hour. Do you have any final words you'd like to share with your with the audience before I say thank you and goodbyes? They're very appreciative and we've got some great feedback so far. Thank you. And we really appreciate your time.

00;25;21;27 - 00;25;34;12

So if you have any final words for students or people teaching AI, maybe a little bit of a vision of what the future might hold or that's a bit of a challenging question, but I'll give you a minute space to talk.

00;25;34;15 - 00;25;58;17

Yeah. So what I feel like everybody's every organization is building MCP and it is good to start. And a lot of startups also coming on the MCP. So, there are a lot of things which are happening. So you start doing dirty your hand using this MCP stuff. And what just Danny said right here, detection and many other challenges which are in the market can be solved using MCP.

00;25;58;19 - 00;26;03;03

So it is just an start over. So that's what I wanted to say.

00;26;03;05 - 00;26;19;05

Lovely. And you'll be sharing the slides and some of the code that you showed today. So yeah okay. So look first of all I just want to thank everyone who has attended today and everyone who's listening to this recording. I think it's really important that you take the time to develop yourselves, to learn as much as you can to keep ahead.

00;26;19;05 - 00;26;38;05

This is a great, session. It's great technology, and it's, a great way to make sure that we stay relevant in our industry. And I think that's really important. So I thank you all, and I appreciate your time today. And with that will close the session. Thank you very much.

00;26;38;07 - 00;26;44;26

That wraps up this episode. Thanks for listening. And stay tuned for the next Oracle Academy Tech Chat podcast.

...more
View all episodesView all episodes
Download on the App Store

Oracle Academy Tech ChatBy Oracle Corporation

  • 3
  • 3
  • 3
  • 3
  • 3

3

2 ratings