当前位置:网站首页>不得不会的Oracle数据库知识点(一)
不得不会的Oracle数据库知识点(一)
2022-07-04 00:33:00 【zhulin1028】
目录
前言:
ORACLE支持五种类型的完整性约束
NOT NULL (非空)--防止NULL值进入指定的列,在单列基础上定义,默认情况下,ORACLE允许在任何列中有NULL值.
CHECK (检查)--检查在约束中指定的条件是否得到了满足.
UNIQUE (唯一)--保证在指定的列中没有重复值.在该表中每一个值或者每一组值都将是唯一的.
PRIMARY KEY (主键)--用来唯一的标识出表的每一行,并且防止出现NULL值,一个表只能有一个主键约束.
FOREIGN KEY (外部键)--通过使用公共列在表之间建立一种父子(parent-child)关系,在表上定义的外部键可以指向主键或者其他表的唯一键.ORACLE支持五种类型的完整性约束
NOT NULL (非空)--防止NULL值进入指定的列,在单列基础上定义,默认情况下,ORACLE允许在任何列中有NULL值.
CHECK (检查)--检查在约束中指定的条件是否得到了满足.
UNIQUE (唯一)--保证在指定的列中没有重复值.在该表中每一个值或者每一组值都将是唯一的.
PRIMARY KEY (主键)--用来唯一的标识出表的每一行,并且防止出现NULL值,一个表只能有一个主键约束.
POREIGN KEY (外部键)--通过使用公共列在表之间建立一种父子(parent-child)关系,在表上定义的外部键可以指向主键或者其他表的唯一键.
一.入门部分
1. 创建表空间
create tablespace schooltbs datafile ‘D:\oracle\datasource\schooltbs.dbf’ size 10M autoextend on;2. 删除表空间
drop tablespace schooltbs[including contents and datafiles];3. 查询表空间基本信息
select *||tablespace_name from DBA_TABLESPACES;4. 创建用户
create user lihua
identified by lihua
default tablespace schooltbs
temporary tablespace temp;5. 更改用户
alter user lihua
identified by 123
default tablespace users;6. 锁定用户
alter user lihua account lock|unlock;7. 删除用户
drop user lihua cascade;--删除用户模式8. oracle数据库中的角色
connect,dba,select_catalog_role,delete_catalog_role,execute_catalog_role,exp_full_database,imp_full_database,resource9. 授予连接服务器的角色
grant connect to lihua;10. 授予使用表空间的角色
grant resource to lihua with grant option;--该用户也有授权的权限11. 授予操作表的权限
grant select,insert on user_tbl to scott;--当前用户
grant delete,update on lihua.user_tbl to scott;--系统管理员12. 修改表的结构(alter)
Alter table 表名 add(列的名称,列的类型);边栏推荐
- MySQL 8.0.12 error: error 2013 (HY000): lost connection to MySQL server during query
- Kubedl hostnetwork: accelerating the efficiency of distributed training communication
- Is user authentication really simple
- A Kuan food rushed to the Shenzhen Stock Exchange: with annual sales of 1.1 billion, Hillhouse and Maotai CCB are shareholders
- [BSP video tutorial] stm32h7 video tutorial phase 5: MDK topic, system introduction to MDK debugging, AC5, AC6 compilers, RTE development environment and the role of various configuration items (2022-
- [GNN] hard core! This paper combs the classical graph network model
- [complimentary ppt] kubemeet Chengdu review: make the delivery and management of cloud native applications easier!
- Investment demand and income forecast report of China's building ceramics industry, 2022-2028
- Joint examination of six provinces 2017
- Gossip about redis source code 73
猜你喜欢
![[Mongodb] 2. Use mongodb --------- use compass](/img/d5/0eb7dd4c407fbf2e9ba1b175f5424d.jpg)
[Mongodb] 2. Use mongodb --------- use compass

Tencent interview: can you pour water?

What is the Valentine's Day gift given by the operator to the product?

Shell script three swordsman sed
![[C language] break and continue in switch statement](/img/ae/5967fefcf3262c9d3096e5c7d644fd.jpg)
[C language] break and continue in switch statement

Report on the construction and development mode and investment mode of sponge cities in China 2022-2028

Tencent interview: can you find the number of 1 in binary?

On the day when 28K joined Huawei testing post, I cried: everything I have done in these five months is worth it

MySQL winter vacation self-study 2022 12 (1)

I wrote a chat software with timeout connect function
随机推荐
Optimization of for loop
1214 print diamond
Global and Chinese markets for instant saliva testing devices 2022-2028: Research Report on technology, participants, trends, market size and share
The upload experience version of uniapp wechat applet enters the blank page for the first time, and the page data can be seen only after it is refreshed again
On the day when 28K joined Huawei testing post, I cried: everything I have done in these five months is worth it
Self study software testing. To what extent can you go out and find a job?
[GNN] hard core! This paper combs the classical graph network model
Introducing Software Testing
From functools import reduce -- see the use of reduce function from typical examples
Eight year test old bird, some suggestions for 1-3 year programmers
It is the most difficult to teach AI to play iron fist frame by frame. Now arcade game lovers have something
Gossip about redis source code 83
Software testers, how can you quickly improve your testing skills? Ten minutes to teach you
[complimentary ppt] kubemeet Chengdu review: make the delivery and management of cloud native applications easier!
Yyds dry goods inventory three JS source code interpretation - getobjectbyproperty method
Arc 135 supplementary report
[error record] configure NDK header file path in Visual Studio
[about text classification trick] things you don't know
Solution to the impact of Remote Code Execution Vulnerability of log4j2 component on December 9, 2021
Alibaba test engineer with an annual salary of 500000 shares notes: a complete set of written tests of software testing