123
 123

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

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 (10756 Bytes) » Pythian Group Blog » Log Buffer

Welcome to the 103rd edition of Log Buffer, the weekly review of database blogs.

Starting with Oracle stuff, Chen Shapira (just a simple DBA on a complex production system) is looking for great PL/SQL. Why? To become a better PL/SQL programmer. “But,” she writes, “for PL/SQL , I’m a bit stuck. I can still read my own code for bad examples, but where can I find examples for great code?  . . .  Somehow, there is simply no open-source code written in PL/SQL that I can read to get a good idea of how PL/SQL should be written.” Niall Litchfield recommends the contents of $ORACLE_HOME/rdbms/admin. Any other ideas to help Chen?

There was no shortage of people offering their help, as always. Beginning here on the Pythian blog, Grégory Guillou posted the fifth of his ten-part series on Oracle silent mode, this part covering adding a node to a 10.2 RAC. Says Grégory, “Even if you don’t leverage RAC’s ability to add or remove nodes to gain in agility, it’s still very likely you’ll come to these techniques when you want to upgrade some of your Servers or Operating Systems.” The post includes links to the earlier articles in the series.

On his Core IT for geeks and pros, Tanel Poder expounds another use case for WaitProf. He begins, “I recently diagnosed a performance issue where the ‘events in waitclass Other’ occasionally took significant part of the session’s response time.  . . . So, what to do when this ‘events in waitclass Other’ wait becomes significant in the response time profile?” This is where waitprof, his custom tool, comes into play.

Jeff Hunter of the So What Co-operative posts Something to be aware of, Part II, in which he and Oracle Support tussle over NUMA in Linux, and where he is heard to say, “My next step is talking to a Duty manager. I really don’t want to do that.” And Part III, which Jeff begins, “I escalated my issue to a duty manager . . .”

On Oracle Applications DBA, Aviad Elbaz knows how to do tricks with a pipe, as he shows in his article on how to execute TKPROF on trace files larger than 2GB. Aviad, I think Bilbo and Gandalf would be proud.

Are you like me, shamefully ignorant about the whole Business Intelligence thing? Do you, too, secretly believe it might be an oxymoron? Mark Rittman is here to help, with an introduction to the Oracle BI Applications.

Vivek Sharma of Database/SQL Experiences informs us that he will be contributing a seminar on “Real Time Performance Tuning” to the very first event mounted by the IOUG (All India Oracle User Group). This is their TechNight, taking place in Hyderabad on Friday, July 18th.

(more…)

These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Slashdot
  • Google
  • del.icio.us
  • Facebook
  • bodytext
  • Technorati
  • TwitThis
  • Reddit
  • Spurl
  • De.lirio.us
  • Furl
  • blogmarks
  • Ma.gnolia
  • E-mail this story to a friend!
08:39 盖茨 (406 Bytes) » Uploads from dbanotes

dbanotes posted a photo:

盖茨

离开舞台盖茨。那些以前骂他的人都开始怀念他,曾经视他为恶魔的人现在把他当成神。

08:30 盖茨 [Flickr] (406 Bytes) » DBA notes

dbanotes posted a photo:

盖茨

离开舞台盖茨。那些以前骂他的人都开始怀念他,曾经视他为恶魔的人现在把他当成神。

06:07 教训不教训 (1299 Bytes) » 柔嘉维则@life.oracle.eng
师傅不久前总结教训说,
4.安信最后卖给我们一种地板蜡,声称以极大的优惠150元卖出,结果在淘宝上一查,3瓶才要150元;当时买了3瓶,还送了一个地托,那个赠品只用了3次,坏了,这次购物给我的教训是,永远不要贸然购买你一点都不熟悉的商品
 
我当时在电脑前嘲笑他呢,哈哈哈。不过今天安信的工人来免费拖地板,然后给我讲地板要怎么怎么供起来,听得我云里雾里,然后卖地板精油,我还只能优惠买138块×5瓶,可惜我钱包里只有400块,于是买了2瓶。别人的教训早已忘得一干二净。
结果到淘宝上一看只要28一瓶。好险,要不是今天带钱不多后果不堪设想。
我的教训是,哎。。。。。。
03:24 一千个农行有一千个规定 (176 Bytes) » Fenng's shared items in Google Reader
废话,当然是我们给银行服务的,银行才是大爷嘛
01:30 Troubleshooting Bad Execution Plans | Structured Data (0 Bytes) » del.icio.us/fenng/oracle
00:58 利用rcp复制备机数据库 (4622 Bytes) » OracleBlog.cn

我们在安装双机热备的数据库时,没必要在2台机器上都安装一次数据库,我们只需在一台数据库主机安装完成后,用rcp的方式把app下的所有文件复制到备机上。以下是主要的安装步骤:

1.在A机(10.203.1.1 db_01)上调整主机内核参数,建立dba group和oracle用户,安装数据库软件,且仅安装数据库软件,create database我们后面可以手工的创建。注意此处建立oracle用户后,需要给oracle设置密码,不然之后做信任机制会有问题。

2.如果有需要版本升级,在安装完成数据库软件后,停lsnr、停dbsnmp,运行升级的runInstaller。由于之前我们没有建库,因此我们在此处也就不必运行$ORACLE_HOME/rdbms/admin/catpatch脚本。

3.在B机(10.203.1.2 db_02)上建立dba group和oracle用户,并且调整主机参数,注意由于需要建双机热备,因此需要保证gid和uid和A机上的一致。

4.在A机的/etc/hosts文件上添加:

10.203.1.2 db_02

在B机的/etc/hosts文件上添加:

10.203.1.1 db_01

5.建立信任机制,在A机的主目录建立.rhosts文件

db_02

在B机的主目录建立.rhosts文件

db_01

6.测试信任是否建立成功,rlogin不用密码说明设置信任成功:

$ hostname
db_01
$ rlogin db_02
Please wait...checking for disk quotas
(c)Copyright 1983-2003 Hewlett-Packard Development Company, L.P.
(c)Copyright 1979, 1980, 1983, 1985-1993 The Regents of the Univ. of California
(c)Copyright 1980, 1984, 1986 Novell, Inc.
(c)Copyright 1986-2000 Sun Microsystems, Inc.
(c)Copyright 1985, 1986, 1988 Massachusetts Institute of Technology
(c)Copyright 1989-1993  The Open Software Foundation, Inc.
(c)Copyright 1990 Motorola, Inc.
(c)Copyright 1990, 1991, 1992 Cornell University
(c)Copyright 1989-1991 The University of Maryland
(c)Copyright 1988 Carnegie Mellon University
(c)Copyright 1991-2003 Mentat Inc.
(c)Copyright 1996 Morning Star Technologies, Inc.
(c)Copyright 1996 Progressive Systems, Inc.
 
 
                  RESTRICTED RIGHTS LEGEND
Use, duplication, or disclosure by the U.S. Government is subject to
restrictions as set forth in sub-paragraph (c)(1)(ii) of the Rights in
Technical Data and Computer Software clause in DFARS 252.227-7013.
 
 
                  Hewlett-Packard Company
                  3000 Hanover Street
                  Palo Alto, CA 94304 U.S.A.
 
Rights for non-DOD U.S. Government Departments and Agencies are as set
forth in FAR 52.227-19(c)(1,2).
$ hostname
db_02
$

7.在db_01中将/oracle/app目录拷贝到db_02中:

## rcp的命令格式为: rcp -rp PATH USER@MACHINE_NAME:PATH
## 其中参数r表示包含所有子路径,参数p表示保持文件属性,MACHINE_NAME表示已经建立信任的主机名
rcp -rp /oracle/app oracle@db_02:/oracle/app

8.至此,我们已经完成在B机上的数据库安装,可以用rman来测试下数据库启动(因为还未设置pfile,因此用rman启动):

$ rman target / nocatalog
 
Recovery Manager: Release 9.2.0.8.0 - 64bit Production
 
Copyright (c) 1995, 2002, Oracle Corporation.  All rights reserved.
 
connected to target database (not started)
 
RMAN> startup nomount
00:00 dbms_xplan in 10g « Oracle Scratchpad (110 Bytes) » del.icio.us/fenng/oracle
The hint /*+ gather_plan_statistics */ enables collection of rowsource execution statistics for the statement.

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
01:30 对话 UNIX: TCP/IP 内幕 » developerWorks 中国 : 技术文章 , 教程 AIX
01:14 Salesforce.com: Lessons From The Trenches » Fenng's shared items in Google Reader
00:46 Python 核心编程第二版 » Fenng's shared items in Google Reader
00:43 支付宝调整所有用户即时到帐限额 无证书用户2000元 » Fenng's shared items in Google Reader

2008-06-25 Wed

23:15 Flickr的理想与现实 » Fenng's shared items in Google Reader
20:52 How Facebook serves pictures » Fenng's shared items in Google Reader
20:00 ORA-600(qerghFetch:inc)错误 » yangtingkun
20:00 ORA-600(qerghFetch:inc)错误 » yangtingkun
19:04 《Solaris应用程序设计》书评 » Fenng's shared items in Google Reader
18:31 Slideshare Announces "World's Best Presentation Contest" » Fenng's shared items in Google Reader
09:54 New CSS in Firefox 3 » Fenng's shared items in Google Reader
09:32 SQL Injection: Not an Issue » Fenng's shared items in Google Reader
09:06 Zooomr Just Keeps on Getting Better » Fenng's shared items in Google Reader
06:49 优化一条UPDATE语句 » AnySQL.net