当前位置:网站首页>Oracle database knowledge points that cannot be learned (III)
Oracle database knowledge points that cannot be learned (III)
2022-07-04 00:41:00 【zhulin1028】
Catalog
Locks and database objects
1. lock
The mechanism used by database to control concurrent access to shared resources .
The type of lock : Row-level locks , Table lock .
Row-level locks : Lock the row being modified . Row lock is also called exclusive lock .
When using the following statements ,Oracle Will automatically apply row level lock :
insert,update,delete,select…… for update
select……for update Allow users to lock multiple records for update at a time .
Use commit or rollback Release the lock .
Table lock :
lock table user_tbl in mode mode;Table lock type :
Line sharing row share
OK, exclusive row exclusive
share share
Shared row exclusive share row exclusive
Exclusive exclusive
Deadlock : Two or more transactions wait for each other to release resources , So it's a deadlock
2. Database objects
oracle Database objects are also called schema objects
Database objects are collections of logical structures , The most basic database objects are tables
Database objects :
surface , Sequence , View , Indexes .
Sequences are used to generate unique , Objects with consecutive numbers .
Create Syntax :
create sequence user_id_seq
start with 1000
increment by 1
maxvalue 2000
minvalue 1000
nocycle
cache 1000;-- Specify the sequence number preallocated in memory Access sequence :
select user_id_seq.currval from dual;
select user_id-seq.nextval from dual;Change delete sequence :
alter sequence user_id_seq maxvalue 10000;-- It cannot be modified start with value
drop sequence user_id_seq;stay Hibernate Medium access sequence :
<generator class="sequence">
<param name="sequence">
user_id_seq
</param>
</generator>View
Display data from one or more tables in a customized way
Create view :
create or replace view
user_tbl_view (vid,vname,vage)
as select id,user_name,age from user_tbl
[with check option]|[with read only];Create a view with errors :
create force view user_tbl_force_view as
select * from user_table;-- here user_table Can not exist Create an outer join view :
create view user_stu_view as
select u.id,u.user_name,u.password,s.ddress
from user_tbl u,stu_tbl s
where u.s_id(+)=s.id;-- Which side has (+), Which side is secondary Delete view :
drop user_stu_view;The index is used to improve SQL The performance of statement execution
Index type :
unique index , Bitmap index , Composite index , Function based index , Reverse key index
Create a standard index :
create index user_id_index on user_tbl(id) tablespace schooltbs;Rebuild index :
alter index user_id_index rebuild;Delete index :
drop index user_id_index;Create unique index :
create unique index user_id_index on user_tbl(id);Create a composite index :
create index name_pass_index on user_tbl(user_name,password);Create reverse key index :
create index user_id_index on user_tbl(id) reverse;边栏推荐
- ESP Arduino playing with peripherals (V) basic concept of interrupt and timer interrupt
- Data mining vs Machine Learning: what is the difference between them? Which is more suitable for you to learn
- 查询效率提升10倍!3种优化方案,帮你解决MySQL深分页问题
- A method to solve Bert long text matching
- [NLP] text classification still stays at Bert? Duality is too strong than learning framework
- What is regression testing? Talk about regression testing in the eyes of Ali Test Engineers
- 数据库表外键的设计
- It's OK to have hands-on 8 - project construction details 3-jenkins' parametric construction
- NLP Chinese corpus project: large scale Chinese natural language processing corpus
- Suggestions for improving code quality
猜你喜欢

Software testers, how can you quickly improve your testing skills? Ten minutes to teach you

功能:求出菲波那契数列的前一项与后一项之比的极限的 近似值。例如:当误差为0.0001时,函数值为0.618056。

Cloud dial test helps Weidong cloud education to comprehensively improve the global user experience

Sorry, Tencent I also refused

Makefile judge custom variables

swagger中响应参数为Boolean或是integer如何设置响应描述信息

Regular expressions and text processors for shell programming
![[error record] configure NDK header file path in Visual Studio](/img/9f/89f68c037dcf68a31a2de064dd8471.jpg)
[error record] configure NDK header file path in Visual Studio

我管你什么okr还是kpi,PPT轻松交给你

Unity elementary case notes of angry birds Siki college 1-6
随机推荐
(Introduction to database system | Wang Shan) Chapter V database integrity: Exercises
AI Challenger 2018 text mining competition related solutions and code summary
Future source code view -juc series
Entropy and full connection layer
[PHP basics] cookie basics, application case code and attack and defense
Generic
BBS forum recommendation
Introduction to thread pool
From functools import reduce -- see the use of reduce function from typical examples
[cloud native topic -48]:kubesphere cloud Governance - operation - overview of multi tenant concept
Shell script three swordsman sed
CesiumJS 2022^ 源码解读[8] - 资源封装与多线程
Sorry, Tencent I also refused
ESP Arduino playing with peripherals (V) basic concept of interrupt and timer interrupt
Collation of the most complete Chinese naturallanguageprocessing data sets, platforms and tools
The culprit of unrestrained consumption -- Summary
Data mining vs Machine Learning: what is the difference between them? Which is more suitable for you to learn
Reading notes on how programs run
Makefile judge custom variables
MySQL winter vacation self-study 2022 12 (1)