当前位置:网站首页>不得不会的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(列的名称,列的类型);边栏推荐
- Research Report on the scale prediction of China's municipal engineering industry and the prospect of the 14th five year plan 2022-2028
- It is worthy of "Alibaba internal software test interview notes" from beginning to end, all of which are essence
- Eight year test old bird, some suggestions for 1-3 year programmers
- Global and Chinese market of breast cancer imaging 2022-2028: Research Report on technology, participants, trends, market size and share
- Collation of the most complete Chinese naturallanguageprocessing data sets, platforms and tools
- Docking Alipay process [pay in person, QR code Payment]
- Report on the construction and development mode and investment mode of sponge cities in China 2022-2028
- Qtcharts notes (V) scatter diagram qscatterseries
- The difference between objects and objects
- MySQL is installed as a Windows Service
猜你喜欢

Kubedl hostnetwork: accelerating the efficiency of distributed training communication

Idea a method for starting multiple instances of a service

Pytorch learning notes 5: model creation

Correlation analysis summary

Yyds dry goods inventory three JS source code interpretation - getobjectbyproperty method

Eight year test old bird, some suggestions for 1-3 year programmers

A method to solve Bert long text matching

China standard gas market prospect investment and development feasibility study report 2022-2028

Introducing Software Testing

Qtcharts notes (V) scatter diagram qscatterseries
随机推荐
[CSDN Q & A] experience and suggestions
Axure resources and prototype tool Axure RP 9 download
Smart fan system based on stm32f407
[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
HR disgusted interview behavior
A Kuan food rushed to the Shenzhen Stock Exchange: with annual sales of 1.1 billion, Hillhouse and Maotai CCB are shareholders
MySQL 8.0.12 error: error 2013 (HY000): lost connection to MySQL server during query
Optimization of for loop
[leetcode] interview question 17.08 Circus tower
Global and Chinese markets for instant saliva testing devices 2022-2028: Research Report on technology, participants, trends, market size and share
Reading notes on how programs run
Anomalies seen during the interview
Five high-frequency questions were selected from the 200 questions raised by 3000 test engineers
Several ways to set up a blog locally [attach relevant software download links]
Selenium library 4.5.0 keyword explanation (4)
Gossip about redis source code 76
Pytest unit test framework: simple and easy to use parameterization and multiple operation modes
Struct in linked list
Interview script of Software Test Engineer