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

推荐订阅源

Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
C
CXSECURITY Database RSS Feed - CXSecurity.com
L
LINUX DO - 热门话题
S
Secure Thoughts
TaoSecurity Blog
TaoSecurity Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
T
Threat Research - Cisco Blogs
AI
AI
B
Blog RSS Feed
S
Schneier on Security
雷峰网
雷峰网
Schneier on Security
Schneier on Security
Help Net Security
Help Net Security
Cloudbric
Cloudbric
L
LINUX DO - 最新话题
罗磊的独立博客
有赞技术团队
有赞技术团队
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Apple Machine Learning Research
Apple Machine Learning Research
P
Proofpoint News Feed
酷 壳 – CoolShell
酷 壳 – CoolShell
The Hacker News
The Hacker News
博客园 - Franky
Attack and Defense Labs
Attack and Defense Labs
The Cloudflare Blog
Webroot Blog
Webroot Blog
Last Week in AI
Last Week in AI
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
博客园 - 叶小钗
美团技术团队
L
Lohrmann on Cybersecurity
T
The Blog of Author Tim Ferriss
The Last Watchdog
The Last Watchdog
T
Troy Hunt's Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Vercel News
Vercel News
Know Your Adversary
Know Your Adversary
O
OpenAI News
博客园 - 【当耐特】
Hacker News - Newest:
Hacker News - Newest: "LLM"
C
Cybersecurity and Infrastructure Security Agency CISA
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
www.infosecurity-magazine.com
www.infosecurity-magazine.com
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
PCI Perspectives
PCI Perspectives
H
Heimdal Security Blog
I
InfoQ
GbyAI
GbyAI
T
Threatpost
C
Cisco Blogs

博客园 - 庆祝

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