oracle对象类型_如何创建Oracle类型对象

oracle对象类型

Today we will learn how to create Oracle Type Object. If you are working on a large project with lots of tables and data, you might have seen the usage of Packages and DB Objects to perform database specific operations.

今天,我们将学习如何创建Oracle类型对象。 如果您正在处理具有大量表和数据的大型项目,则可能已经看到使用数据库对象来执行特定于数据库的操作。

Oracle类型对象 (Oracle Type Object)

Here we will see how to create a database object in Oracle DB.

在这里,我们将看到如何在Oracle DB中创建数据库对象。

CREATE OR REPLACE TYPE "MY_DBA"."EMP_OBJ" AS OBJECT
(empFirstName			VARCHAR2(80),
empLastName			VARCHAR2(80),
empId				NUMBER,
);

GRANT EXECUTE on EMP_OBJ to MY_USER;

Notice that you need to be logged in with MY_DBA user to create the object and MY_USER is the application user that I am providing privilege to execute this package.

请注意,您需要以MY_DBA用户身份登录才能创建对象,而MY_USER是我提供执行该程序包特权的应用程序用户。

From Security point of view, it’s always better to have a DBA user for DDL changes and an application specific user that will have only the required privileges to perform the database operations.

从安全性的角度来看,最好是让DBA用户进行DDL更改,而让特定于应用程序的用户仅具有执行数据库操作所需的特权。

If I don’t separate these accesses, then the application user will have full access to the DB Object/Packages and they can drop it also, mistakenly or may be by a hacker.

如果我不分开这些访问权限,那么应用程序用户将具有对数据库对象/软件包的完全访问权限,他们也可能错误地或由黑客将其删除。

翻译自: https://www.journaldev.com/1413/oracle-type-object

oracle对象类型

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值