当前位置:网站首页>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;边栏推荐
- Cannot build artifact 'test Web: War expanded' because it is included into a circular depend solution
- GUI 应用:socket 网络聊天室
- 手机异步发送短信验证码解决方案-Celery+redis
- The super fully automated test learning materials sorted out after a long talk with a Tencent eight year old test all night! (full of dry goods
- 功能:将主函数中输入的字符串反序存放。例如:输入字符串“abcdefg”,则应输出“gfedcba”。
- Five high-frequency questions were selected from the 200 questions raised by 3000 test engineers
- Understanding of Radix
- Celebrate the new year | Suihua fire rescue detachment has wonderful cultural activities during the Spring Festival
- MySQL 8.0.12 error: error 2013 (HY000): lost connection to MySQL server during query
- HR disgusted interview behavior
猜你喜欢

The difference between objects and objects
![[CSDN Q & A] experience and suggestions](/img/db/dff3173dda24ca5740729b54a81153.jpg)
[CSDN Q & A] experience and suggestions

Self study software testing. To what extent can you go out and find a job?

Detailed explanation of the relationship between Zhongtai, wechat and DDD

BBS forum recommendation

Makefile judge custom variables
![[common error] UART cannot receive data error](/img/77/6ba56ce6e64beeb73a77d04af5bd0f.jpg)
[common error] UART cannot receive data error

Employees' turnover intention is under the control of the company. After the dispute, the monitoring system developer quietly removed the relevant services
![Several ways to set up a blog locally [attach relevant software download links]](/img/2f/51a09d9ef71065319ed90306517854.jpg)
Several ways to set up a blog locally [attach relevant software download links]
![[GNN] hard core! This paper combs the classical graph network model](/img/a7/2140744ebad9f1dc0a609254cc618e.jpg)
[GNN] hard core! This paper combs the classical graph network model
随机推荐
网上的低佣金链接安全吗?招商证券怎么开户?
[common error] custom IP instantiation error
MySQL is installed as a Windows Service
Cannot build artifact 'test Web: War expanded' because it is included into a circular depend solution
Global and Chinese market of underwater bags 2022-2028: Research Report on technology, participants, trends, market size and share
[dynamic programming] leetcode 53: maximum subarray sum
HR disgusted interview behavior
Unity elementary case notes of angry birds Siki college 1-6
swagger中响应参数为Boolean或是integer如何设置响应描述信息
On the day when 28K joined Huawei testing post, I cried: everything I have done in these five months is worth it
Development and application of fcitx functional plug-ins
The first training of wechat applet
不得不会的Oracle数据库知识点(二)
[cloud native topic -48]:kubesphere cloud Governance - operation - overview of multi tenant concept
[prefix and notes] prefix and introduction and use
Data storage - interview questions
gslb(global server load balance)技术的一点理解
Unity Shader入门精要读书笔记 第三章 Unity Shader基础
Employees' turnover intention is under the control of the company. After the dispute, the monitoring system developer quietly removed the relevant services
From functools import reduce -- see the use of reduce function from typical examples