当前位置:网站首页>不得不会的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(列的名称,列的类型);
边栏推荐
- [complimentary ppt] kubemeet Chengdu review: make the delivery and management of cloud native applications easier!
- Social network analysis -social network analysis
- Tencent interview: can you pour water?
- [NLP] text classification still stays at Bert? Duality is too strong than learning framework
- Kubedl hostnetwork: accelerating the efficiency of distributed training communication
- Is the securities account opened by Caicai for individuals safe? Is there a routine
- 2022 system integration project management engineer examination knowledge points: software development model
- [2021]NeRF in the Wild: Neural Radiance Fields for Unconstrained Photo Collections
- Unity elementary case notes of angry birds Siki college 1-6
- Version rollback revert don't reset better reset must be forced
猜你喜欢
Report on prospects and future investment recommendations of China's assisted reproductive industry, 2022-2028 Edition
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
Docking Alipay process [pay in person, QR code Payment]
Zipper table in data warehouse (compressed storage)
What is the potential of pocket network, which is favored by well-known investors?
Similarities and differences of text similarity between Jaccard and cosine
Pytorch learning notes 5: model creation
Self study software testing. To what extent can you go out and find a job?
ESP Arduino playing with peripherals (V) basic concept of interrupt and timer interrupt
I wrote a chat software with timeout connect function
随机推荐
想请教一下,十大劵商如何开户?在线开户是安全么?
[error record] configure NDK header file path in Visual Studio (three header file paths of NDK | ASM header file path selection related to CPU architecture)
Why use get/set instead of exposing properties
Global and Chinese market of process beer equipment 2022-2028: Research Report on technology, participants, trends, market size and share
Selenium library 4.5.0 keyword explanation (I)
Similarities and differences of text similarity between Jaccard and cosine
A Kuan food rushed to the Shenzhen Stock Exchange: with annual sales of 1.1 billion, Hillhouse and Maotai CCB are shareholders
SPI based on firmware library
Introduction to thread pool
[2021]NeRF in the Wild: Neural Radiance Fields for Unconstrained Photo Collections
Struct in linked list
国元证券开户是真的安全可靠吗
[leetcode] interview question 17.08 Circus tower
Pytorch learning notes 5: model creation
I would like to ask how the top ten securities firms open accounts? Is it safe to open an account online?
Make small tip
[PHP basics] cookie basics, application case code and attack and defense
Gossip about redis source code 74
Distributed transaction -- middleware of TCC -- selection / comparison
Selenium library 4.5.0 keyword explanation (4)