惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

IT之家
IT之家
NISL@THU
NISL@THU
The Hacker News
The Hacker News
C
CXSECURITY Database RSS Feed - CXSecurity.com
T
Tenable Blog
Forbes - Security
Forbes - Security
V2EX - 技术
V2EX - 技术
Webroot Blog
Webroot Blog
Schneier on Security
Schneier on Security
T
The Exploit Database - CXSecurity.com
T
Tor Project blog
C
Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
The Last Watchdog
The Last Watchdog
PCI Perspectives
PCI Perspectives
O
OpenAI News
C
Cyber Attacks, Cyber Crime and Cyber Security
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Google Online Security Blog
Google Online Security Blog
宝玉的分享
宝玉的分享
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
量子位
D
Docker
AI
AI
Blog — PlanetScale
Blog — PlanetScale
S
Security @ Cisco Blogs
S
Schneier on Security
The GitHub Blog
The GitHub Blog
W
WeLiveSecurity
云风的 BLOG
云风的 BLOG
M
MIT News - Artificial intelligence
P
Privacy International News Feed
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Hackread – Cybersecurity News, Data Breaches, AI and More
B
Blog
C
Check Point Blog
A
About on SuperTechFans
D
Darknet – Hacking Tools, Hacker News & Cyber Security
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Engineering at Meta
Engineering at Meta
I
InfoQ
T
Threat Research - Cisco Blogs
Project Zero
Project Zero
Cloudbric
Cloudbric
MongoDB | Blog
MongoDB | Blog
Cisco Talos Blog
Cisco Talos Blog
L
Lohrmann on Cybersecurity
S
Securelist

博客园 - 庆祝

trigger 来源于:鹰翔宇空的文章 动态判断性别选中的问题 用来在表格中换行 JDK的配置 把struts验证框架的模板翻译成了中文 常用的表查询MSSQL语句 利用JavaEE的Validator 可以创建xml的JAVA工厂类--------JAVA Html简单的Head区专业知识 Oracle温习典故 整理的Oracle精辟问答题(8) 整理的Oracle精辟问答题(7) Oracle几个常用的数据字典 ASP.NET的gridview的页脚添加合计字段 ASP.NET把gridview中的数据导入到Excel中 整理的Oracle精辟问答题(6) 整理的Oracle精辟问答题(4) 整理的Oracle精辟问答题(5)
整理的Oracle精辟问答题(3)
庆祝 · 2008-04-30 · via 博客园 - 庆祝

select * from stuMark
1.我现在即将对student表的stuid=5的学生mark情况进行更新,此时我想阻止其它用户对此行记录的修改,我应如何设置?
  select * from stumark
  update stumark set s_mark = 100 where s_id = 5
  不执行 commit
2.为了防止在修改某数据时,被其它锁定的进程锁住,我们应该如何操作?
select * from stumark for update wait 5;
update stumark set s_mark = 100 where s_id = 5
commit

3.锁定的进程何时才会释放呢?如何来释放自己锁定的操作?
用 commit 提交事务来
4.如何锁定整个表,有哪几种模式?
lock table 表名 in 锁定的模式(row share|row exclusive|share|share row exclusive|exclusive)
5.可以开两个进程测试上述操作

6.表分区的优点?
--1.改善查询的性能
--2.数据更容易管理
--3.便于备份和恢复
--4.提高数据安全性

7.建立表空间phonedat1,phonedat2,phonedat3,数据文件分别存放到d:"ordata目录下,每个表空间由两个数据文件组成,第一个数据文件初始大小20M,不自动增长,第二个数据文件初始大小50M,自动增长。
create tablespace phonedat1
datafile 'j:/my project/oracle/work/phonedat1a.dbf'
size 2m
autoextend off
create tablespace
datafile 'j:/my project/oracle/work/phonedata1b.dbf'
size 1m
autoextend on

8.建立分区表stumark(stuid,stuclass(10),stumark),按stumark进行范围分区,
  40分以下放入第一分区,存储在第一表空间中
  70分以下放入第二分区,存储在表空间phonedat2中
  100...........三..................phonedat3中。
drop table stumark
select * from stumark
create table stumark
(
s_id int,
s_mark int,
s_name varchar(25)
)
partition by range(s_mark)
(
partition p1 values less than (40) tablespace phonedat1,
partition p2 values less than (70) tablespace phonedat2,
partition p3 values less than (100) tablespace phonedat3
)
9.建立分区表phoneinfo(phoneno(11),phonedate date,receivertel(11)),按phonedate进行范围分区
  2004年1月1日之后数据为第一分区,存储在phonedat1中
  2005....................二....................2中
  2006....................三....................3中。
  create table phoneinfo
  (
   phoneno number(11),
   phonedate date,
   receivertel number(11)
  )
  partition by range (phonedate)
  (
   partition p3 values less than (to_date('2004-01-01','yyyy-MM-dd')) tablespace phonedat3,
   partition p2 values less than (to_date('2005-01-01','yyyy-MM-dd')) tablespace phonedat2,
   partition p1 values less than (to_date('2006-01-01','yyyy-MM-dd')) tablespace phonedat1
  )
 
10.建立分区表phoneinfo1(phoneno(11),phonedate date,receivertel(11)),按phoneno进行散列分区
  第一分区,存储在phonedat1中
  ..二....................2中
  ..三....................3中。
create table phoneinfo1
(
  phoneno number(11),
  phonedate date,
  receivertel number(11)
)
partition by hash(phoneno)
(
partition part1 tablespace phonedat1,
partition part2 tablespace phonedat2,
partition part3 tablespace phonedat3

)

11.仍以上表为例,请以字段phonedate为基础建立3个范围分区,再以phoneno为字段建立4个散列分区,要求数据存储在phonedat1..3表空间中。
  create table phoneinfo2
  (
   phoneno number(11),
   phonedate date,
   receivertel number(11)
  )
  partition by range(phonedate)
  subpartition by hash(phoneno)
  subpartitions 4
  (
  partition p1 values less than (to_date('2004-01-01','yyyy-MM-dd')),
  partition p2 values less than (to_date('2005-01-01','yyyy-MM-dd')),
 partition p3 values less than (maxvalue)
 
  )
12.建立分区表stumark1(stuid,stuclass(10),stumark),按stuclass建立列表分区
    create table stumark1
    (
       stuid int,
       stuclass varchar2(10),
       stumark int
    )
    partition by list(stuclass)
    (
     partition part1 values ('class1'),
     partition part2 values ('class2'),
     partition part3 values ('class3')
    )

13.在第9题中,由于2006年电话特别多,而且D盘上还放置了其他表空间,IO操作频繁,我现在想将第三个分区移到E盘的表空间phonedat41中,请完成?
  create tablespace phonedat4
  datafile 'd:/phonedat4.dbf'
  size 1m
  autoextend on
  alter table phoneinfo move partition p1 tablespace phonedat4
14.在第9题中,由于2006年的电话特别多,后想根据6月30号为标准进行细分,请写脚本完成?最后修改分区的名称符合本表分区的命名规范。
alter table phoneinfo
split partition p1 at (to_date('2006-06-30'),'yyyy-MM-dd') into (partition p31,partition p32)
15.表级锁的模式有哪些?其内容分别是什么?
  行共享
  行排他
  共享
  共享行排他
  排他
16.请写语句将student表以共享模式锁定。
  lock table student in share mode

17.在上述16题中,在锁定过程中,此时另一用户也欲对此表进行锁定修改,最好的操作方式是什么?请写脚本。
    lock table student in exclusive mode nowait