Oracle与MySQL中“可串行化”的对比测试
Oracle与MySQL中“可串行化”的对比测试
Thomas Kyte 在“Oracle 9i&10g编程艺术”一书中为了说明事务的隔离级别,提供了一些例子。这里我们来看看“可串行化”级别下的表现。
以普通用户登录系统,并创建测试用的表。
idle> connect scott/tiger
Connected.
scott@FOO> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for Linux: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
scott@FOO> create table a(x int);
Table created.
scott@FOO> create table b(x int);
Table created.
修改事务的隔离级别为“可串行化”
时刻 会话1 会话2
t1 scott@FOO> alter session set isolation_level = serializable;
Session altered.
t2 scott@FOO> alter session set isolation_level = serializable;
相关文档:
1、创建表:
create table stud(
sid int,
sname varchar2(50)
)
并插入一条数据
&n ......
begin
for item in (select * from user_constraints a where a.constraint_type = 'R') loop
execute immediate 'alter table ' || item.table_name || ' disable constraint ' || item.constraint_name;
end loop;
end;
/ ......
备注:如果你有时间你应该阅读这个备注,如果没有时间你更要阅读以下备注。 在网络上找了很多相关备份和还原的教程,大多都是互相抄袭,按照他们的教程能够成功备份,还原就很让人揪心了。谈谈思路和注意点吧。 首先,第一步不用说,肯定是备份数据库。最简单,打开管理节点的ndb_mgm控制台,输入start backup backupID( ......
系统环境:rhel5 (最小化安装,只安装vi工具) 内核:2.6.18-8.el5 1、 下载编译安装 #cd /usr/local/src/tarbag #wget http://mysql.byungsoo.net/Downloads/MySQL-5.1/mysql-5.1.38.tar.gz //下载5.1.38 #tar xzvf mysql-5.1.38.tar.gz -C ../software/ #cd ../software/mysql-5.1.38 #./configure --prefix=/usr ......
注: 从MySQL从服务器的版本不能小于主服务器的版本 实验环境 Master Mysql服务器版本5.1.36,IP:192.168.128.130 Slave Mysql服务器版本5.1.36,IP:192.168.128.132 一. MySQL主服务器配置 1.建立授权用户 用法:grant replication slave on *.* to ‘用户名’@'主机’ identified by ‘密码’; mysql>grant replicatio ......