Oracle dead lock deep research.
Update SQLS will lead dead lock exception. Because by default, it use optimistic lock but not pessimistic lock.
Below description is exceprted from the attachment(It exceeds my image that this blog can not upload the attachment,hehe)
Optimistic locking offers an elegant solution to the problems outlined above. Optimistic locking does
not lock records when they are read, and proceeds on the assumption that the data being updated has not
changed since the read. Since no locks are taken out during the read, it doesn’t matter if the user goes to
lunch after starting a transaction, and deadlocks are all but eliminated since users should never have to
wait on each other’s locks
There are some ways to resolve this problem.
1. Create a pessimistic lock. Change the sql like below formal.
First: select … from … for update nowait
Second: update the resultSet.
2. Execute the SQL again after a random duration when program meets this kind of exception. (It will consume lot of db server resource. I don't think it is the better way)
3. Schedule the SQL executed sequenced or split data without interfere.
相关文档:
Oracle中to_date()与24小时制表示法及mm分钟的显示:
在使用Oracle的to_date函数来做日期转换时,很多Java程序员也许会和我一样,直觉的采用“yyyy-MM-dd HH:mm:ss”的格式
作为格式进行转换,但是在Oracle中会引起错误:“ORA 01810 格式代码出现两次”。如:
to_date('2005-01-01 13:14:20 ......
存储过程
==========================================================================
==========================================================================
【训练15.1】 创建一个显示雇员总人数的存储过程。
步骤1:登录SCOTT账户(或学生个人账户)。
步骤2: ......
买本书 先从安装开始吧 然后买本PLSQL 学学语法 这是最基本的 接下来就研究故障后怎么修复 再就是备份 优化 集群 然后还要学习LINUX操作 这是一定要的 装WINDOWS上的ORACLE不多 再花2W去考个OCP 就行了
oracle的官方教材的顺序是sql基础,结构,备份恢复,性能优化。
sql语句的基础还是很重要的。如果你想做开发pl/sql一 ......
请验证一下solaris和oracle的版本信息,如果版本号不对,可能会安装失败
solaris版本:SunOs 5.10
oracle版本: Oracle Database 10g Release 2 (10.2.0.2) for Solaris Operating System (x86)
**如果不知道solaris的版本,可以在命令窗口输入:uname -a
第一步:以ROOT身份登陆系统
第二步:创建用户和组:
#groupadd ......