Expert Oracle Database Architecture学习笔记之:Setting Up Your Environment

本文记录了在学习Expert Oracle Database Architecture时遇到的问题及解决方案,包括'ORA-01843'错误的修正,涉及NLS_DATE_LANGUAGE设置和TO_DATE函数的使用。此外,讨论了设置环境的重要性,特别是SQL Plus技巧,如Runstats和Big_Table脚本,并提到了在不同Oracle版本中可能存在的对象名差异。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Expert Oracle Database Architecture

Oracle Database 9i, 10g, and 11g Programming Techniques and Solutions

Thomas Kyte  应该是第二版。第一版没有提到11G。

详情参见: http://www.apress.com/9781430229469

 

Expert Oracle Database Architecture

作者推荐阅读本书的同时需要参阅oracle concepts doc。

 

小记录:

1.运行示例demobld.sql.

可能会碰到一个问题是:EMP表插入语句时报“ORA-01843: 无效的月份”错误。

 

参阅博文:

1. http://blog.youkuaiyun.com/dannyoracle/archive/2010/10/25/5964848.aspx

2. http://www.cnblogs.com/afant/archive/2009/01/04/1368334.html

3. http://yhq82523.blog.163.com/blog/static/382511432009210104430399/

官方文档:

1.Globalization Support Guide Doc;

2.SQL Reference Doc.

 

后在dembld.sql中:

修改

INSERT INTO EMP VALUES (7934, 'MILLER', 'CLERK', 7782,
TO_DATE('23-JAN-1982', 'DD-MON-YYYY'), 1300, NULL, 10);

为:

INSERT INTO EMP VALUES (7934, 'MILLER', 'CLERK', 7782,
TO_DATE('23-JAN-1982', 'DD-MON-YYYY','NLS_DATE_LANGUAGE = American'), 1300, NULL, 10);

表插入成功。

 

2.总结

所参考博文中的做法是 Setting the Session Time Zone(具体没有实验,也还没有仔细阅读官方文档中的关于这部分的内容。)

该问题可以阅读官方文档

 

1.Globalization Support Guide Doc;

2.SQL Reference Doc.

 

 

NLS_LANG。  Globalization Support Guide该文中的第三章3 Setting Up a Globalization Support Environment

TO_DATE。    SQL Reference 该文中的TO_DATE一节。(p356)

之所以不采用参考博文的做法,原因如下:

1.>服务器端的NLS_LANG应该是开发人员都清楚的;

2.>开发人员插入数据时,应用TO_DATE函数时候,应该要考虑到数据库端记录date数据类型的要求。

3.>因为要插入数据,就需要进行一下alter session set ,虽然简单,却总觉得有点小题大做,搞的开发人员还晕晕乎乎的。

 

3.未读:Setting Your Environment。此处我犯了严重的错误。(看书还是稍微认真点的好,可能也是由于看英文版的原因吧。有点欠耐心)

粗粗的翻看了一下,觉得大部分是sql plus使用上的技巧。就暂时略过。

Setting Environment 部分中的Custom Scripts(Runstats,Big_Table)对整本书的后面还是很重要的。

就是在运行   Runstats 会碰到权限问题。

 

 第二版中THOMAS增加了一段note:

Note The actual object names you need to be granted access to will be V_$STATNAME, V_$MYSTAT, and so
on—that is, the object name to use in the grant will start with V_$ not V$. The V$ name is a synonym that points
to the underlying view with a name that starts with V_$. So, V$STATNAME is a synonym that points to V_$STATNAME
– a view. You need to be granted access to the view.

 

需要给其中的几个系统视图(V_$...)授权SELECT给普通用户。

 

在执行Big_Table 以及给Big_Table插入数据的时候:

 

 

在thomas的第二版中,他用的应该是 11g所以,

select rownum+l_cnt,
OWNER, OBJECT_NAME, SUBOBJECT_NAME, OBJECT_ID, DATA_OBJECT_ID,
OBJECT_TYPE, CREATED, LAST_DDL_TIME, TIMESTAMP, STATUS,
TEMPORARY, GENERATED, SECONDARY, NAMESPACE, EDITION_NAME

红色部分的字段名在10中是没有的,如果是用10g的测试环境,可以删掉红色部分再执行big_table的代码即可。

 

 

Now in its third edition, this best-selling book continues to bring you some of the best thinking on how to apply Oracle Database to produce scalable applications that perform well and deliver correct results. Tom Kyte and Darl Kuhn share a simple philosophy: "you can treat Oracle as a black box and just stick data into it, or you can understand how it works and exploit it as a powerful computing environment." If you choose the latter, then you’ll find that there are few information management problems that you cannot solve quickly and elegantly. This fully revised third edition covers the developments up to Oracle Database 12c. Significant new content is included surrounding Oracle's new cloud feature set, and especially the use of pluggable databases. Each feature is taught in a proof-by-example manner, not only discussing what it is, but also how it works, how to implement software using it, and the common pitfalls associated with it. Don’t treat Oracle Database as a black-box. Get this book. Get under the hood. Turbo-charge your career. Revised to cover Oracle Database 12c Proof-by-example approach: Let the evidence be your guide Dives deeply into Oracle Database’s most powerful features What you’ll learn Develop an evidence-based approach to problem solving Manage transactions in highly concurrent environments Speed access to data through table and index design Manage files and memory structures for performance and reliability Scale up through partitioning and parallel processing Load and unload data to interface with external systems Who this book is for Expert Oracle Database Architecture is aimed at Oracle Database administrators, at PL/SQL and Java developers writing code to be deployed inside the database, and at developers of external applications who use Oracle Database as a data store. It is the go-to book for those wishing to create efficient and scalable applications.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值