当前位置:网站首页>不得不会的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(列的名称,列的类型);边栏推荐
- Gossip about redis source code 82
- A Kuan food rushed to the Shenzhen Stock Exchange: with annual sales of 1.1 billion, Hillhouse and Maotai CCB are shareholders
- Gossip about redis source code 79
- Global and Chinese market of glossometer 2022-2028: Research Report on technology, participants, trends, market size and share
- Optimization of for loop
- Alibaba test engineer with an annual salary of 500000 shares notes: a complete set of written tests of software testing
- MySQL winter vacation self-study 2022 12 (2)
- Private project practice sharing populate joint query in mongoose makes the template unable to render - solve the error message: syntaxerror: unexpected token r in JSON at
- Entropy and full connection layer
- Ningde times and BYD have refuted rumors one after another. Why does someone always want to harm domestic brands?
猜你喜欢
![Docking Alipay process [pay in person, QR code Payment]](/img/30/665580241020ee3adb872e725f0624.jpg)
Docking Alipay process [pay in person, QR code Payment]

BBS forum recommendation
![[error record] configure NDK header file path in Visual Studio](/img/9f/89f68c037dcf68a31a2de064dd8471.jpg)
[error record] configure NDK header file path in Visual Studio

(Video + graphics and text) introduction to machine learning series - Chapter 4 naive Bayes

Qtcharts notes (V) scatter diagram qscatterseries
![[NLP] text classification still stays at Bert? Duality is too strong than learning framework](/img/49/1ff6025bdb0445e5638c1451e0b267.jpg)
[NLP] text classification still stays at Bert? Duality is too strong than learning framework

It is forbidden to splice SQL in code

Shell script three swordsman sed

Solve the problem that the kaggle account registration does not display the verification code

Eight year test old bird, some suggestions for 1-3 year programmers
随机推荐
Self study software testing. To what extent can you go out and find a job?
Att & CK actual combat series - red team actual combat - V
system. Exit (0) and system exit(1)
ISBN number
Distributed transaction -- middleware of TCC -- selection / comparison
Alibaba test engineer with an annual salary of 500000 shares notes: a complete set of written tests of software testing
Idea a method for starting multiple instances of a service
Generic
2022 system integration project management engineer examination knowledge points: software development model
[Mongodb] 2. Use mongodb --------- use compass
What are the application fields of digital twins in industry?
[C language] break and continue in switch statement
Gossip about redis source code 74
Global and Chinese markets for coronary artery disease treatment devices 2022-2028: Research Report on technology, participants, trends, market size and share
网上的低佣金链接安全吗?招商证券怎么开户?
Solve the problem that the kaggle account registration does not display the verification code
How to be a professional software testing engineer? Listen to the byte five year old test
How to make recv have a little temper?
Report on the construction and development mode and investment mode of sponge cities in China 2022-2028
Ramble 72 of redis source code