当前位置:网站首页>不得不会的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(列的名称,列的类型);
边栏推荐
- 网上的低佣金链接安全吗?招商证券怎么开户?
- Gossip about redis source code 75
- Alibaba test engineer with an annual salary of 500000 shares notes: a complete set of written tests of software testing
- Kubedl hostnetwork: accelerating the efficiency of distributed training communication
- JDBC Technology
- How to trade spot gold safely?
- [software testing] you haven't mastered these real interview questions of big companies?
- For loop
- STM32 key light
- Several ways to set up a blog locally [attach relevant software download links]
猜你喜欢
Self study software testing. To what extent can you go out and find a job?
Kubedl hostnetwork: accelerating the efficiency of distributed training communication
Detailed explanation of the relationship between Zhongtai, wechat and DDD
Report on prospects and future investment recommendations of China's assisted reproductive industry, 2022-2028 Edition
[Mongodb] 2. Use mongodb --------- use compass
Analysis on the scale of China's smart health industry and prediction report on the investment trend of the 14th five year plan 2022-2028 Edition
STM32 key light
Idea a method for starting multiple instances of a service
Analysis: misunderstanding of choosing WMS warehouse management system
[PHP basics] session basic knowledge, application case code and attack and defense
随机推荐
Struct in linked list
Kubedl hostnetwork: accelerating the efficiency of distributed training communication
Distributed transaction -- middleware of TCC -- selection / comparison
Gossip about redis source code 78
Pytorch learning notes 5: model creation
What is the future of software testing industry? Listen to the test veterans' answers
What is the Valentine's Day gift given by the operator to the product?
Reading notes on how programs run
[GNN] hard core! This paper combs the classical graph network model
【leetcode】300. Longest increasing subsequence (dynamic programming, dichotomy)
Ramble 72 of redis source code
Suggestions for improving code quality
Makefile judge custom variables
Tencent interview: can you pour water?
The frost peel off the purple dragon scale, and the xiariba people will talk about database SQL optimization and the principle of indexing (primary / secondary / clustered / non clustered)
Global and Chinese markets of distributed control system (DCS) consumption 2022-2028: Research Report on technology, participants, trends, market size and share
Briefly understand the operation mode of developing NFT platform
Software testers, how can you quickly improve your testing skills? Ten minutes to teach you
Selenium library 4.5.0 keyword explanation (I)
Double efficiency. Six easy-to-use pychar plug-ins are recommended