当前位置:网站首页>不得不会的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,resource
9. 授予连接服务器的角色
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(列的名称,列的类型);
边栏推荐
- How to make recv have a little temper?
- Distributed transaction -- middleware of TCC -- selection / comparison
- Global and Chinese markets for coronary artery disease treatment devices 2022-2028: Research Report on technology, participants, trends, market size and share
- Stock price forecast
- [C language] break and continue in switch statement
- Self study software testing. To what extent can you go out and find a job?
- Is user authentication really simple
- Eight year test old bird, some suggestions for 1-3 year programmers
- Introduction to thread pool
- Reading notes on how programs run
猜你喜欢
Vscode regular match replace console log(.*)
URL (data:image/png; Base64, ivborw0k... Use case
Test the influence of influent swacth on the electromagnetic coil of quartz meter
Sorry, Tencent I also refused
BBS forum recommendation
Celebrate the new year | Suihua fire rescue detachment has wonderful cultural activities during the Spring Festival
Pytorch learning notes 5: model creation
Several ways to set up a blog locally [attach relevant software download links]
Software testers, how can you quickly improve your testing skills? Ten minutes to teach you
Entropy and full connection layer
随机推荐
Yyds dry goods inventory three JS source code interpretation - getobjectbyproperty method
【leetcode】300. Longest increasing subsequence (dynamic programming, dichotomy)
[software testing] you haven't mastered these real interview questions of big companies?
想请教一下,十大劵商如何开户?在线开户是安全么?
Global and Chinese markets for blood and liquid heating devices 2022-2028: Research Report on technology, participants, trends, market size and share
Celebrate the new year | Suihua fire rescue detachment has wonderful cultural activities during the Spring Festival
MySQL is installed as a Windows Service
How to trade spot gold safely?
Gossip about redis source code 73
Suggestions for improving code quality
Report on the construction and development mode and investment mode of sponge cities in China 2022-2028
Double efficiency. Six easy-to-use pychar plug-ins are recommended
[error record] configure NDK header file path in Visual Studio
Zipper table in data warehouse (compressed storage)
网上的低佣金链接安全吗?招商证券怎么开户?
Global and Chinese market of process beer equipment 2022-2028: Research Report on technology, participants, trends, market size and share
Generic
What is regression testing? Talk about regression testing in the eyes of Ali Test Engineers
Axure resources and prototype tool Axure RP 9 download
[complimentary ppt] kubemeet Chengdu review: make the delivery and management of cloud native applications easier!