123
 123

Tip: 看不到本站引用 Flickr 的图片? 下载 Firefox Access Flickr 插件 | AD: 订阅 DBA notes --

2008-06-28 Sat

20:01 行链接在存储结构上是如何实现的(一) (722 Bytes) » yangtingkun
如果一条记录的长度超过了BLOCK_SIZE,Oracle会以行链接的形式来存放,不过Oracle到底是如何实现行链接的,一直没有深究,直到有一个网友问起这个问题。如果知道答案,这个问题并不困难,所以如果只是将结果贴出来可能意义并不大,因此这里将寻找答案的整个探索过程贴出来,希望能起到抛砖引玉的作用。首先将问题描述的清晰一些,如果表中的某一条记录的长度超过了DB_BLOCK_SIZE的大小,则Oracle没有办法在一个BLOCK中存放这条记录。显然这条记录会存放到多个BLOCK中,而且出于空间利用的考虑,Oracle在将记录存放到多个BLOCK的时候,并不...
10:47 好歹做了一年多理财网站 (3093 Bytes) » Fenng's shared items in Google Reader

财帮子,一个直接的收获就是一些理财和金融的知识,上证指数陪着我们从3000点杀到6000点,又跌到现在的2748点,更可谓刺激非常。

今天和一个朋友聊起股市,他说他自己现在满仓,亏得不敢看。我自己在6000点的时候是2/3债券基金,1/3股票型基金,跌到3500点的时候,转换了一部分债券型到股票型,两个月前开始定投股票型基金,目前接近60%的股票型,40%的债券型。累计收益-18%,超过81%的财迷。

很多人都骂中国的股市不理性,可很少有人细究为什么会这样,更多的人乐于把责任推卸给政府、证监会、机构或者当年忽悠他们进场的人。要我说,的确有这样那样的原因,但是股市是股民组成,股市的不理性正是股民的不理性的反映,是我们的股民造就了我们的股市,不是别人。06/07年的股市暴涨让多少本来理性的人失去了理性,又让更多本来没什么理性可言的人冲进了市场,泡沫就是这样起来的。

也总有人在这个时候质疑为什么政府不救市。股市上涨的时候是没有人喜欢政府来干预市场经济的,去年调高印花税,不知道多少人骂呢。我并不是来开脱谁的责任,但如果已经有人通过一些手段来告诉你风险很高了,你没有听,还要他怎么救你呢?还有我也想不出该怎么救市,如果政府真有什么有效的干预手段让救股市到规规矩矩回到6000点,手段一出,招来的就是索罗斯们。如果这次学费白交了,下次只能还做受害者。

我选择这个时候开始定投,并不是说我认为现在是底了,我不是来抄底的,只是觉得现在比较低了,去年11月份之前,相信每个人都会想,如果2700点有一次进的机会该有多好,现在还有多少人把这看成机会呢?我选择定投而不是一下全赌进去,如果股市再跌,那么下个月我可以买到更便宜的基金,熊市时间越长,我能够收集的筹码越多,总有涨上去的那天。这就是定投的好处。

这些都是我和朋友谈的对现在市场的看法,我肯定不是什么专家,不过是经过这一年的一些所得。

本文链接 | 快来评论
09:27 Remote Access Control for New Users on HMC 7.3.3.0.1 (1144 Bytes) » AIXpert

As of Service Pack 1 of HMC V7R3.3, there's a new access control that must be considered when creating new users. By default, remote access is not allowed, even if in general you've already allowed remote users.

The box to check if you want to allow remote access is found under User Properties in the task used to create or modify a user's account. When creating a user account, remember to click on User Properties at the bottom of the task menu. In the lower left corner of the menu that comes up next you'll find a check box that says Allow Remote Access via the Web. By default, it's unchecked, so be sure to change the value if this user will access the HMC over the web.

There are some other settings you can select on this same menu: session timeout minutes (default 0), verify timeout minutes (default 15), idle timeout minutes (default 0), and minimum time in minutes between password changes (default 0). You can also select an option to disable the account for inactivity in a certain number of days (default 0), or never disable for inactivity.

09:27 HPUX开异步IO (6016 Bytes) » OracleBlog.cn

同事来说在$ORACLE_HOME/rdbms/log下有大量产生trace文件,trace的文件内容为:

/oracle/app/oracle/product/9.2.0/rdbms/log/jxadt_ora_100.trc
Oracle9i Enterprise Edition Release 9.2.0.6.0 - 64bit Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.6.0 - Production
ORACLE_HOME = /oracle/app/oracle/product/9.2.0
System name:    HP-UX
Node name:      jx_db03
Release:        B.11.11
Version:        U
Machine:        9000/800
Instance name: jxadt
Redo thread mounted by this instance: 0
<none>
Oracle process number: 0
100
 
Ioctl ASYNC_CONFIG error, errno = 1

其实这个问题是由于开异步IO的时候,没有给系统的oracle用户MLOCK权限,当主机已经开启的异步IO的参数,但是没给MLOCK权限,就会报这个错。

我们在HPUX上开异步IO正确做法应该为:

前提:hpux上使用裸设备可以打开异步IO来提高IO性能,如果使用文件系统,就不能使用异步IO,但是可以通过设置多个DBWR进程来提高IO
 
1、Hp-ux使用Aio的补丁要求
   a、Hp-ux 11.00的补丁要求为:
      PHKL_22126: s700_800 VM,async,hyperfabric
   b、HP-UX 11i的补丁要求为:
      PHKL_25212 vm preemption point, mlock/async_io
      PHKL_25506 asyncio driver patch
 
 
2. 创建aio字符设备
   % /sbin/mknod /dev/async c 101 0x0
   % chown oracle:dba /dev/async
   % chmod 660 /dev/async
 
 
3. 用sam调整内核参数
     -> Kernel Configuration
        -> Drivers
           -> 选择'asyncdsk'
           -> Actions>Add Driver to Kernel. (此时pending state由out变为in状态)
 
     -> Kernel Configuration
        -> Configurable Parameters
           -> max_async_ports
              设置为初始化文件中的'processes'值+oracle后台进程数 (根据v$bgprocess,单实例后台进程数最多为78个)
 
4. 用sam设置aio_max_ops
     -> Kernel Configuration
        -> Configurable Parameters
           -> aio_max_ops
           -> 可设置为默认值2048
              
5. 设置oracle用户必须有MLOCK权限。
   a. 设定dba组的MLOCK的权限
      roolt#setprivgrp dba MLOCK
 
    b. 避免重启后失效,需要设置:
       vi /etc/privgroup 添加如下行:
       dba MLOCK
       如果没有设置MLOCK权限,在$ORACLE_HOME/rdbms/log/中有大量含Ioctl ASYNC_CONFIG error, errno = 1的trace文件。
 
6. 其他设置。在hpux中,大部分的进程会遵循一个共享时间表的策略,在业务的忙时,容易造成latch。所以,我们应该设置SCHED_NOAGE参数,使得进程不会具有执行的优先级。
    a. root#setprivgrp dba RTSCHED RTPRIO
      
    b. 同时为了重启后参数失效,在/etc/privgroup文件中添加:
       dba RTSCHED RTPRIO
       结合上面的MLOCK,/etc/privgroup文件中应该为:
       dba RTSCHED RTPRIO MLOCK
 
    c. 数据库中:alter system set hpux_sched_noage=178 scope=spfile;

参考文档:(metalink)Doc ID:139272.1和302801.1

06:40 软件测试基础-确认和验证 (2490 Bytes) » Ricky's Test Blog

这是经典的软件测试的两个概念,难怪有人说,软件测试的过程就是Verification和validation的过程。其中的verification我们就翻译为确认-对需求的确认。validation翻译为验证-验证最终的产品是我们期望的。下面看看wiki的定义吧。

Verification and Validation (software)

In software project management, software testing, and software engineering, Verification and Validation (V&V) is the process of checking that a software system meets specifications and that it fulfils its intended purpose. It is normally part of the software testing process of a project. In pharmaceutical industry, verification involves testing the suitability of well established procedures or (compendial) methods, whereas validation varies from Cross validation, Empirical validation, periodic partial validation, internal/external validation, competence validation by nature, and Cleaning validation, Process validation, Equipment validation, or Documentation validation by tasks.

Definitions
(more…)


2008-06-27 Fri

20:01 ORA-7445(ACCESS_VIOLATION)(unable_to_trans_pc)(UNABLE_TO_WRITE)错误 (648 Bytes) » yangtingkun
标题比较长,没有办法,错误产生的时候出现的有意义的告警信息就是如此。在同事的笔记本上出现,WindowsXP环境,在metalink上查询了一下,类似的错误还不少,而且基本上都是windows环境。这个错误发生之前只有一个操作,就是数据库建立。也就是说,在DBCA建库完成后,执行了一个SHUTDOWN操作,在SHUTDOWN快要结束的时候,出现了这个ORA-7445错误。日志中的错误信息为:Fri Jun 27 16:22:45 2008Shutting down instance: further logons disabledFri Jun 27 16:22:46 2008Stopping background process QMNCFri Jun 27 16:22:47 2008Stoppin...
20:01 ORA-7445(ACCESS_VIOLATION)(unable_to_trans_pc)(UNABLE_TO_WRITE)错误 (648 Bytes) » yangtingkun
标题比较长,没有办法,错误产生的时候出现的有意义的告警信息就是如此。在同事的笔记本上出现,WindowsXP环境,在metalink上查询了一下,类似的错误还不少,而且基本上都是windows环境。这个错误发生之前只有一个操作,就是数据库建立。也就是说,在DBCA建库完成后,执行了一个SHUTDOWN操作,在SHUTDOWN快要结束的时候,出现了这个ORA-7445错误。日志中的错误信息为:Fri Jun 27 16:22:45 2008Shutting down instance: further logons disabledFri Jun 27 16:22:46 2008Stopping background process QMNCFri Jun 27 16:22:47 2008Stoppin...
14:52 Red Hat Summit: Session slides (and links) (2889 Bytes) » Red Hat Magazine

Hot off the presses, Summit slide decks:

Red Hat Enterprise Linux Kernel Performance Optimization [PDF] - John Shakshober and Larry Woodman

Why Computers Are Getting Slower (And What We Can Do About It) [PDF] - Rik Van Riel

The Virtualization Toolbox. Open Source Solutions for Managing Virtual Environments [PDF 1] [PDF 2] - Dan Berrange and Richard Jones

Func - the Fedora Universal Network Connector [PDF] - Michael DeHann and Adrian Likins

Dynamic Grid Computing with Red Hat Enterprise MRG & Amazon EC2 [PDF] - Bryan Che

Missed the show? Catch up with our videos or check out the full list of available slide decks. We’ll be adding more of our (and your) favorites as they come in.

Other voices:

11:35 MySQL命令行的几个用法 (5233 Bytes) » NinGoo@Net

Author:NinGoo posted on NinGoo.net

MySQL的客户端命令行工具,有很多方便使用者的特性,某些方面甚至可以说比Oracle的sqlplus更加人性化。当然从整体来说,还是sqlplus更加方便些,这么说或许是我对sqlplus更加熟悉吧。这里记录下MySQL命令行几个比较常用的特性。

1.使用\G按行垂直显示结果
如果一行很长,需要这行显示的话,看起结果来就非常的难受。在SQL语句或者命令后使用\G而不是分号结尾,可以将每一行的值垂直输出。这个可能也是大家对于MySQL最熟悉的区别于其他数据库工具的一个特性了。

mysql> select * from db_archivelog\G
*************************** 1. row ***************************
id: 1
check_day: 2008-06-26
db_name: TBDB1
arc_size: 137
arc_num: 166
per_second: 1.6
avg_time: 8.7

2.使用pager设置显示方式
如果select出来的结果集超过几个屏幕,那么前面的结果一晃而过无法看到。使用pager可以设置调用os的more或者less等显示查询结果,和在os中使用more或者less查看大文件的效果一样。
使用more

mysql> pager more
PAGER set to ‘more’
mysql> \P more
PAGER set to ‘more’

使用less

mysql> pager less
PAGER set to ‘less’
mysql> \P less
PAGER set to ‘less’

还原成stdout

mysql> nopager
PAGER set to stdout

3.使用tee保存运行结果到文件
这个类似于sqlplus的spool功能,可以将命令行中的结果保存到外部文件中。如果指定已经存在的文件,则结果会附加到文件中。

mysql> tee output.txt
Logging to file ‘output.txt’
或者
mysql> \T output.txt
Logging to file ‘output.txt’

mysql> notee
Outfile disabled.
或者
mysql> \t
Outfile disabled.

4.执行OS命令

mysql> system uname
Linux
mysql> \! uname
Linux

5.执行SQL文件

mysql> source test.sql
+—————-+
| current_date() |
+—————-+
| 2008-06-28 |
+—————-+
1 row in set (0.00 sec)
或者
mysql> \. test.sql
+—————-+
| current_date() |
+—————-+
| 2008-06-28 |
+—————-+
1 row in set (0.00 sec)

其他还有一些功能,可以通过help或者?获得MySQL命令行支持的一些命令。


Related Articles

PermLink: http://www.ningoo.net/html/2008/mysql_cmdline_tips_g_pager_tee.html

Add Comments(0) | Follow NinGoo@Twitter | Google Reader

bookmark

09:33 Log Buffer #103: a Carnival of the Vanities for DBAs » Pythian Group Blog » Log Buffer
08:39 盖茨 » Uploads from dbanotes
08:30 盖茨 [Flickr] » DBA notes
06:07 教训不教训 » 柔嘉维则@life.oracle.eng
05:07 (译)我在这里,我在那里 » Fenng's shared items in Google Reader
03:24 一千个农行有一千个规定 » Fenng's shared items in Google Reader
00:58 利用rcp复制备机数据库 » OracleBlog.cn
00:00 dbms_xplan in 10g « Oracle Scratchpad » del.icio.us/fenng/oracle

2008-06-26 Thu

22:50 Liberation字体提高文档互操作性 » Fenng's shared items in Google Reader
21:30 详讯:澳洲电讯收购皓辰传媒及泡泡网各55%股份 » Fenng's shared items in Google Reader
21:01 ORA-7445(koiogex)错误 » yangtingkun
21:01 ORA-7445(koiogex)错误 » yangtingkun
20:20 让Firefox 3上的未认证ssl简单一点 [Blog on 27th Floor] » Fenng's shared items in Google Reader
17:02 《中国的经济制度》中译版(之四) » Fenng's shared items in Google Reader
16:31 Why are some of the tables in my query missing from the plan? » Inside the Oracle Optimizer - Removing the black magic
12:04 Web Site Optimization: FrontEnd and BackEnd » MySQL Performance Blog
07:28 Toad and Oracle Licensing – What’s the Story ? » Fenng's shared items in Google Reader
07:17 期待TortoiseGit » Fenng's shared items in Google Reader
07:15 软件测试基础-黑盒和白盒 » Ricky's Test Blog
05:46 Jerry’s Back! And So Is Microsoft » Fenng's shared items in Google Reader
05:30 UNIX 编程中错误输出的线程安全问题 » developerWorks 中国 : 技术文章 , 教程 AIX
02:56 用户到底读了多少? » Fenng's shared items in Google Reader
01:30 对话 UNIX: TCP/IP 内幕 » developerWorks 中国 : 技术文章 , 教程 AIX