<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Dbabc.Net</title>
	<atom:link href="http://dbabc.net/feed" rel="self" type="application/rss+xml" />
	<link>http://dbabc.net</link>
	<description>畅享生活，关注技术</description>
	<lastBuildDate>Wed, 11 Apr 2012 06:58:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>利用Heartbeat + DRBD搭建MySQL高可用环境</title>
		<link>http://dbabc.net/archives/2012/04/10/heartbeat-drbd-mysql-ha.shtml</link>
		<comments>http://dbabc.net/archives/2012/04/10/heartbeat-drbd-mysql-ha.shtml#comments</comments>
		<pubDate>Mon, 09 Apr 2012 23:17:58 +0000</pubDate>
		<dc:creator>dbabc</dc:creator>
				<category><![CDATA[Mysql]]></category>
		<category><![CDATA[数据库]]></category>

		<guid isPermaLink="false">http://dbabc.net/?p=1646</guid>
		<description><![CDATA[Centos5.8环境下，利用Heartbeat + DRBD搭建MySQL高可用环境，实现故障自动切换。提供pdf下载 一、DRBD 原理与架构信息 &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; 3 1、原理简述&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 3 2、架构图 &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 4 3、主机信息： &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. 4 二、Heartbeat+DRBD+MySQL 安装 &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. 5 1、定义主机名 &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. 5 2、创建磁盘分区 &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; 5 3、安装 drbd、heartbeat &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; 7 4、配置 DRBD &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 8 5、加载 drbd 模块并建立 resource &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 9 6、配置 heartbeat &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; 12 三、测试 Mysql HA &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 14 1、手动切换 Node &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 14 2、模拟 Master 节点宕机或者网络中断 [...]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F10%2F02%2Fvsftp_mysql_vir.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F04%2F10%2Fheartbeat-drbd-mysql-ha.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">vsftp+pam.d+mysql虚拟用户配置</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F12%2F06%2Fmysql-documentation-mysql-reference-manuals.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F04%2F10%2Fheartbeat-drbd-mysql-ha.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">MySQL Documentation: MySQL Reference Manuals</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F01%2F31%2Fmysql-creat-user-only-backup.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F04%2F10%2Fheartbeat-drbd-mysql-ha.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Mysql 新建只有备份（mysqldump）权限的帐号</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F10%2F23%2Fcentos5-6-auto-install-mysql5-5-16.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F04%2F10%2Fheartbeat-drbd-mysql-ha.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">CentOS 全自动编译安装mysql5.5.16脚本分享</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F11%2F19%2F1amoeba-for-mysql-java-memory.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F04%2F10%2Fheartbeat-drbd-mysql-ha.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Amoeba for mysql java内存设置</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>Centos5.8环境下，利用Heartbeat + DRBD搭建MySQL高可用环境，实现故障自动切换。提供pdf下载<br />
一、DRBD 原理与架构信息 &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; 3<br />
1、原理简述&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 3<br />
2、架构图 &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 4<br />
3、主机信息： &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. 4<br />
二、Heartbeat+DRBD+MySQL 安装 &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. 5<br />
1、定义主机名 &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. 5<br />
2、创建磁盘分区 &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; 5<br />
3、安装 drbd、heartbeat &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; 7<br />
4、配置 DRBD &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 8<br />
5、加载 drbd 模块并建立 resource &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 9<br />
6、配置 heartbeat &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; 12<br />
三、测试 Mysql HA &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 14<br />
1、手动切换 Node &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;.. 14<br />
2、模拟 Master 节点宕机或者网络中断 &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; 17<br />
附：HA开、关机流程 &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230; 17<br />
1、正确开机步骤 &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. 17<br />
2、正确关机步骤 &#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;. 17</p>
<div style="width:550px" id="__ss_12496092"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/dbabc/dbabcnet-heartbeat-drbdmy-sql" title="Dbabc.net 利用heartbeat + drbd搭建my sql高可用环境" target="_blank">Dbabc.net 利用heartbeat + drbd搭建my sql高可用环境</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/12496092" width="550" height="560" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">documents</a> from <a href="http://www.slideshare.net/dbabc" target="_blank">dbabc</a> </div>
</p></div>
<p style="text-align: center;"><img class=" wp-image-1647 aligncenter" title="dbabc.net_heartbeat_drbd_mysql_ha" src="http://imfile.dbabc.net/2012/04/dbabc.net_heartbeat_drbd_mysql_ha.jpg" alt="" width="561" height="585" /></p>
<p>pdf下载链接:<a title="http://www.kuaipan.cn/file/id_17198221579279777.html" href="http://www.kuaipan.cn/file/id_17198221579279777.html" target="_blank">http://www.kuaipan.cn/file/id_17198221579279777.html</a></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F10%2F02%2Fvsftp_mysql_vir.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F04%2F10%2Fheartbeat-drbd-mysql-ha.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">vsftp+pam.d+mysql虚拟用户配置</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F12%2F06%2Fmysql-documentation-mysql-reference-manuals.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F04%2F10%2Fheartbeat-drbd-mysql-ha.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">MySQL Documentation: MySQL Reference Manuals</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F01%2F31%2Fmysql-creat-user-only-backup.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F04%2F10%2Fheartbeat-drbd-mysql-ha.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Mysql 新建只有备份（mysqldump）权限的帐号</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F10%2F23%2Fcentos5-6-auto-install-mysql5-5-16.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F04%2F10%2Fheartbeat-drbd-mysql-ha.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">CentOS 全自动编译安装mysql5.5.16脚本分享</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F11%2F19%2F1amoeba-for-mysql-java-memory.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F04%2F10%2Fheartbeat-drbd-mysql-ha.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Amoeba for mysql java内存设置</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://dbabc.net/archives/2012/04/10/heartbeat-drbd-mysql-ha.shtml/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Oracle移动索引到其他表空间包括blob字段</title>
		<link>http://dbabc.net/archives/2012/03/23/oracle_rebuild_index_to_other_tbs.shtml</link>
		<comments>http://dbabc.net/archives/2012/03/23/oracle_rebuild_index_to_other_tbs.shtml#comments</comments>
		<pubDate>Fri, 23 Mar 2012 08:01:33 +0000</pubDate>
		<dc:creator>dbabc</dc:creator>
				<category><![CDATA[数据库]]></category>

		<guid isPermaLink="false">http://dbabc.net/?p=1640</guid>
		<description><![CDATA[新建表之后，索引自动在默认的表空间中，这里将index和表分开放到不同的表空间中。以下是批量将index从一个表空间移动到另一个表空间，而表默认存储在dbabc_data表空间下面. 普通索引转移： SELECT      'ALTER INDEX TYPZPT.' &#124;&#124; index_name &#124;&#124; ' rebuild tablespace   LOG_INDEX; ' FROM   DBA_indexes WHERE   tablespace_name = 'LOG_DATA' AND status = 'VALID'; BLOB字段索引转移 SELECT      'alter table  ' &#124;&#124; owner &#124;&#124; '.' &#124;&#124; t.table_name &#124;&#124; ' move tablespace log_data lob (' &#124;&#124; t.column_name &#124;&#124; ') store as(tablespace log_index);' v_sql FROM   DBA_LOBS t WHERE   OWNER [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Oracle 重命名(移动)数据文件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F11%2F05%2Foracle-rename-datafile.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F03%2F23%2Foracle_rebuild_index_to_other_tbs.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://dbabc.net/www.dbabc.net/wp-content/themes/dbabc/images/dbabclogo.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Oracle 重命名(移动)数据文件</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Oracle书籍推荐" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F01%2F04%2Foracle-books.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F03%2F23%2Foracle_rebuild_index_to_other_tbs.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2012/01/04/13423304.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Oracle书籍推荐</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Oracle Creating and Managing Synonyms" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F10%2F11%2Foracle-creating-and-managing-synonyms.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F03%2F23%2Foracle_rebuild_index_to_other_tbs.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://dbabc.net/www.dbabc.net/wp-content/themes/dbabc/images/dbabclogo.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Oracle Creating and Managing Synonyms</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Oracle RMAN异机异目录恢复" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F08%2F02%2Foracle_rman_recovery_linux_other_machine.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F03%2F23%2Foracle_rebuild_index_to_other_tbs.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/07/21524467.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Oracle RMAN异机异目录恢复</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="每天定时统计Oracle表空间的使用信息" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F08%2F04%2Foracle_tbs_info.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F03%2F23%2Foracle_rebuild_index_to_other_tbs.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://dbabc.net/www.dbabc.net/wp-content/themes/dbabc/images/dbabclogo.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">每天定时统计Oracle表空间的使用信息</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>新建表之后，索引自动在默认的表空间中，这里将index和表分开放到不同的表空间中。以下是批量将index从一个表空间移动到另一个表空间，而表默认存储在dbabc_data表空间下面.<br />
普通索引转移：</p>
<pre>SELECT      'ALTER INDEX TYPZPT.'
|| index_name
|| ' rebuild tablespace   LOG_INDEX; '
FROM   DBA_indexes
WHERE   tablespace_name = 'LOG_DATA' AND status = 'VALID';</pre>
<p>BLOB字段索引转移</p>
<pre>
SELECT      'alter table  '
|| owner
|| '.'
|| t.table_name
|| ' move tablespace log_data lob ('
|| t.column_name
|| ') store as(tablespace log_index);'
v_sql
FROM   DBA_LOBS t
WHERE   OWNER = 'TYPZPT';</pre>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Oracle 重命名(移动)数据文件" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F11%2F05%2Foracle-rename-datafile.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F03%2F23%2Foracle_rebuild_index_to_other_tbs.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://dbabc.net/www.dbabc.net/wp-content/themes/dbabc/images/dbabclogo.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Oracle 重命名(移动)数据文件</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Oracle书籍推荐" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F01%2F04%2Foracle-books.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F03%2F23%2Foracle_rebuild_index_to_other_tbs.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2012/01/04/13423304.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Oracle书籍推荐</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Oracle Creating and Managing Synonyms" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F10%2F11%2Foracle-creating-and-managing-synonyms.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F03%2F23%2Foracle_rebuild_index_to_other_tbs.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://dbabc.net/www.dbabc.net/wp-content/themes/dbabc/images/dbabclogo.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Oracle Creating and Managing Synonyms</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Oracle RMAN异机异目录恢复" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F08%2F02%2Foracle_rman_recovery_linux_other_machine.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F03%2F23%2Foracle_rebuild_index_to_other_tbs.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/07/21524467.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Oracle RMAN异机异目录恢复</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="每天定时统计Oracle表空间的使用信息" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F08%2F04%2Foracle_tbs_info.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F03%2F23%2Foracle_rebuild_index_to_other_tbs.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://dbabc.net/www.dbabc.net/wp-content/themes/dbabc/images/dbabclogo.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">每天定时统计Oracle表空间的使用信息</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://dbabc.net/archives/2012/03/23/oracle_rebuild_index_to_other_tbs.shtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ORA-12516:TNS:监听程序找不到符合协议堆栈要求的可用处理程</title>
		<link>http://dbabc.net/archives/2012/03/07/ora-12516.shtml</link>
		<comments>http://dbabc.net/archives/2012/03/07/ora-12516.shtml#comments</comments>
		<pubDate>Wed, 07 Mar 2012 03:05:04 +0000</pubDate>
		<dc:creator>dbabc</dc:creator>
				<category><![CDATA[数据库]]></category>

		<guid isPermaLink="false">http://dbabc.net/?p=1629</guid>
		<description><![CDATA[今天客户端连接oracle数据库报ORA-12516: TNS: 监听程序找不到符合协议堆栈要求的可用处理程错误，登录服务器检查监听正常。那就估计是process超过最大限制了。执行 select count(*) from v$process; 发现竟然是497个。那肯定是不够用了，目前的DB process都是设置为500的，这个肯定不正常了，平常process总共也就40-50左右。这个参数是静态参数，如果修改的话需要重启数据库，当然了增大参数不是解决问题的方法，最终是开发的问题，产生了大量的无效的连接。kill掉相关程序搞定。一下是 ora 12516的官方解释。 [oracle@dbabc.net ~]$oerr ORA 12516 12516, 00000, "TNS:listener could not find available handler with matching protocol stack" // *Cause: None of the known and available service handlers for the given // SERVICE_NAME support the client's protocol stack: transport, session, // and presentation protocols. // *Action: [...]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F08%2F01%2Fora-12637.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F03%2F07%2Fora-12516.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">ORA-12637:包接收失败</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F01%2F20%2Fora-3136.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F03%2F07%2Fora-12516.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">ORA-3136</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F03%2F15%2F10-2-0-1-ora-00600-qctvcocsform.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F03%2F07%2Fora-12516.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Oracle Grid Control 10.2.0.5管理10.2.0.1出现ORA-00600错误[qctVCO:csform]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F01%2F31%2Fora-01111-name-for-data-file-12-is-unknown-rename-to-correct-file.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F03%2F07%2Fora-12516.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">ORA-01111: name for data file 12 is unknown – rename to correct file</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F02%2F23%2Fora-02019-connection-description-for-remote-database-not-found.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F03%2F07%2Fora-12516.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">ORA-02019: connection description for remote database not found</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>今天客户端连接oracle数据库报ORA-12516: TNS: 监听程序找不到符合协议堆栈要求的可用处理程错误，登录服务器检查监听正常。那就估计是process超过最大限制了。执行 select count(*) from v$process; 发现竟然是497个。那肯定是不够用了，目前的DB process都是设置为500的，这个肯定不正常了，平常process总共也就40-50左右。这个参数是静态参数，如果修改的话需要重启数据库，当然了增大参数不是解决问题的方法，最终是开发的问题，产生了大量的无效的连接。kill掉相关程序搞定。一下是 ora 12516的官方解释。</p>
<pre>[oracle@dbabc.net ~]$oerr ORA 12516
12516, 00000, "TNS:listener could not find available handler with matching protocol stack"
// *Cause: None of the known and available service handlers for the given
// SERVICE_NAME support the client's protocol stack: transport, session,
// and presentation protocols.
// *Action: Check to make sure that the service handlers (e.g. dispatchers)
// for the given SERVICE_NAME are registered with the listener, are accepting
// connections, and that they are properly configured to support the desired
// protocols.</pre>
<p>超过参数processes 的限制会报ORA-12516错误，这些都是在客户端报的错误，在服务器端看不到这些信息，这样的错误只能用户出现问题来协助解决。</p>
<p>ＰＳ： ORA-01000: maximum open cursors exceeded</p>
<pre> SELECT   a.VALUE,
           s.username,
           s.sid,
           s.serial#
    FROM   v$sesstat a, v$statname b, v$session s
   WHERE       a.statistic# = b.statistic#
           AND s.sid = a.sid
           AND b.name = 'opened cursors current'
ORDER BY   1 DESC;</pre>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F08%2F01%2Fora-12637.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F03%2F07%2Fora-12516.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">ORA-12637:包接收失败</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F01%2F20%2Fora-3136.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F03%2F07%2Fora-12516.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">ORA-3136</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F03%2F15%2F10-2-0-1-ora-00600-qctvcocsform.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F03%2F07%2Fora-12516.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Oracle Grid Control 10.2.0.5管理10.2.0.1出现ORA-00600错误[qctVCO:csform]</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F01%2F31%2Fora-01111-name-for-data-file-12-is-unknown-rename-to-correct-file.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F03%2F07%2Fora-12516.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">ORA-01111: name for data file 12 is unknown – rename to correct file</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F02%2F23%2Fora-02019-connection-description-for-remote-database-not-found.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F03%2F07%2Fora-12516.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">ORA-02019: connection description for remote database not found</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://dbabc.net/archives/2012/03/07/ora-12516.shtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux awk 去重</title>
		<link>http://dbabc.net/archives/2012/02/23/linux-awk-uni.shtml</link>
		<comments>http://dbabc.net/archives/2012/02/23/linux-awk-uni.shtml#comments</comments>
		<pubDate>Thu, 23 Feb 2012 07:55:10 +0000</pubDate>
		<dc:creator>dbabc</dc:creator>
				<category><![CDATA[Linux与开源]]></category>
		<category><![CDATA[技术积累]]></category>

		<guid isPermaLink="false">http://dbabc.net/?p=1626</guid>
		<description><![CDATA[中文版putty后门之后，一直没注意自己的虚拟机，虽然我从来不用非官方下载的语言包，但是还是不放心，今天检查一下。通过last查看登录记录，有600多条登录的IP地址，肯定有大量重复的，想用awk去重一下，google之 [root@vps ~]# last &#124;awk {'print $3'} &#124;wc -l 657 awk '!a[$0]++' file last &#124;awk {'print $3'} &#124;awk '!a[$0]++' PS:今天用到的 在某个目录下面查找某个文件含有某个字符 grep dbabc.net /finddir/dbabc/* -r<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F12%2F20%2Flinux-shell-redirection.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F23%2Flinux-awk-uni.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux shell 重定向</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F07%2F18%2Flinux_screen_encoding-_gbk.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F23%2Flinux-awk-uni.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux下screen乱码问题解决</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F12%2F06%2Flinux-tmout-profile-shell.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F23%2Flinux-awk-uni.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">快速设置Linux超时退出脚本</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F09%2F25%2Fcat_linux_system_info.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F23%2Flinux-awk-uni.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">查看Linux系統信息</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F09%2F25%2Flinux_add_swap_partiton.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F23%2Flinux-awk-uni.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux下增加swap分区</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>中文版putty后门之后，一直没注意自己的虚拟机，虽然我从来不用非官方下载的语言包，但是还是不放心，今天检查一下。通过last查看登录记录，有600多条登录的IP地址，肯定有大量重复的，想用awk去重一下，google之</p>
<pre>
[root@vps ~]# last |awk {'print $3'} |wc -l
657
</pre>
<pre><span style="color: #ff6600;"><strong>awk '!a[$0]++' file</strong></span>
</pre>
<pre>
last |awk {'print $3'} |awk '!a[$0]++'
</pre>
<p>PS:今天用到的 在某个目录下面查找某个文件含有某个字符</p>
<pre>
grep dbabc.net /finddir/dbabc/* -r  </pre>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F12%2F20%2Flinux-shell-redirection.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F23%2Flinux-awk-uni.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux shell 重定向</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F07%2F18%2Flinux_screen_encoding-_gbk.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F23%2Flinux-awk-uni.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux下screen乱码问题解决</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F12%2F06%2Flinux-tmout-profile-shell.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F23%2Flinux-awk-uni.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">快速设置Linux超时退出脚本</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F09%2F25%2Fcat_linux_system_info.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F23%2Flinux-awk-uni.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">查看Linux系統信息</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F09%2F25%2Flinux_add_swap_partiton.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F23%2Flinux-awk-uni.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux下增加swap分区</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://dbabc.net/archives/2012/02/23/linux-awk-uni.shtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux下查看cpu的个数</title>
		<link>http://dbabc.net/archives/2012/02/13/linux-cpu-info-count.shtml</link>
		<comments>http://dbabc.net/archives/2012/02/13/linux-cpu-info-count.shtml#comments</comments>
		<pubDate>Mon, 13 Feb 2012 09:01:11 +0000</pubDate>
		<dc:creator>dbabc</dc:creator>
				<category><![CDATA[Linux与开源]]></category>

		<guid isPermaLink="false">http://dbabc.net/?p=1617</guid>
		<description><![CDATA[一直以来以为通过top然后按数字1键，查到的cpu个数是服务器的物理cpu个数，今天在看服务器的硬件配置清单中发现一服务器的物理cpu个数是4个，我就奇怪了，这台机子我的影响很深，明明是48啊，当时通过top 1查看cpu信息还提示 “Sorry ,terminal is not big enough”。想当初服务器只能识别到32个。还是重新编译内核搞定的。后来经过查询原来不是这样滴，top 1查看的是逻辑cpu个数，一下为记。 查看Linux服务器的CPU详细情况 判断Linux服务器CPU情况的依据如下： 具有相同core id的CPU是同一个core的超线程。(Any cpu with the same core id are hyperthreads in the same core.) 具有相同physical id的CPU是同一个CPU封装的线程或核心。(Any cpu with the same physical id are threads or cores in the same physical socket.) 下面举例说明。 物理CPU个数如下： [root@dbabc.net ～］# cat /proc/cpuinfo&#124; grep "physical id"&#124; sort&#124; uniq&#124; wc -l [...]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F01%2F24%2Flinux_cpu_info.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F13%2Flinux-cpu-info-count.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux 查看cpu信息</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F08%2F10%2Flinux-screen.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F13%2Flinux-cpu-info-count.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux技巧：screen的用法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F09%2F25%2Fcat_linux_system_info.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F13%2Flinux-cpu-info-count.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">查看Linux系統信息</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F23%2Flinux-awk-uni.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F13%2Flinux-cpu-info-count.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">linux awk 去重</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F07%2F18%2Flinux_screen_encoding-_gbk.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F13%2Flinux-cpu-info-count.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux下screen乱码问题解决</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>一直以来以为通过top然后按数字1键，查到的cpu个数是服务器的物理cpu个数，今天在看服务器的硬件配置清单中发现一服务器的物理cpu个数是4个，我就奇怪了，这台机子我的影响很深，明明是48啊，当时通过top 1查看cpu信息还提示 “Sorry ,terminal is not big enough”。想当初服务器只能识别到32个。还是重新编译内核搞定的。后来经过查询原来不是这样滴，top 1查看的是逻辑cpu个数，一下为记。<br />
查看Linux服务器的CPU详细情况<br />
判断Linux服务器CPU情况的依据如下：<br />
具有相同core id的CPU是同一个core的超线程。(Any cpu with the same core id are hyperthreads in the same core.)<br />
具有相同physical id的CPU是同一个CPU封装的线程或核心。(Any cpu with the same physical id are threads or cores in the same physical socket.)<br />
下面举例说明。<br />
物理CPU个数如下：</p>
<pre>[root@dbabc.net ～］# cat /proc/cpuinfo| grep "physical id"| sort| uniq| wc -l
4</pre>
<p>每个物理CPU中core的个数(即核数)如下：</p>
<pre>[root@dbabc.net ～］# cat /proc/cpuinfo| grep "cpu cores"| uniq
cpu cores       : 12</pre>
<p>逻辑CPU的个数如下：</p>
<pre>［root@dbabc.net ～］#cat /proc/cpuinfo| grep "processor"| wc -l
48</pre>
<p>按理说物理CPU个数×核数就应该等于逻辑CPU的个数，如果不相等的话，则表示服务器的CPU支持超线程技术。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F01%2F24%2Flinux_cpu_info.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F13%2Flinux-cpu-info-count.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux 查看cpu信息</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F08%2F10%2Flinux-screen.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F13%2Flinux-cpu-info-count.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux技巧：screen的用法</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F09%2F25%2Fcat_linux_system_info.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F13%2Flinux-cpu-info-count.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">查看Linux系統信息</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F23%2Flinux-awk-uni.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F13%2Flinux-cpu-info-count.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">linux awk 去重</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F07%2F18%2Flinux_screen_encoding-_gbk.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F13%2Flinux-cpu-info-count.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux下screen乱码问题解决</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://dbabc.net/archives/2012/02/13/linux-cpu-info-count.shtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux grep命令查看匹配行的上下行</title>
		<link>http://dbabc.net/archives/2012/02/10/linux-grep-a-b-rowns.shtml</link>
		<comments>http://dbabc.net/archives/2012/02/10/linux-grep-a-b-rowns.shtml#comments</comments>
		<pubDate>Fri, 10 Feb 2012 02:36:23 +0000</pubDate>
		<dc:creator>dbabc</dc:creator>
				<category><![CDATA[Linux与开源]]></category>

		<guid isPermaLink="false">http://dbabc.net/?p=1611</guid>
		<description><![CDATA[通过脚本检查Oracle alert日志的时候，通常是通过查找Error和ORA-来检查是否有错误信息，Errors和ORA-对应行的上下几行的内容也是灰常最要的，查找了一下可以通过grep的 -A和-B来实现匹配行的上下行内容。 -B, --before-context=NUM  print NUM lines of leading context -A, --after-context=NUM   print NUM lines of trailing context 比如：查找Error匹配的行，以及这行的上1行和下4行的内容 grep Error -A4 -B1 /u01/app/oracle/admin/dbabc/bdump/alert_dbabc.log 更多grep的参数选项可以通过grep &#8211;help Usage: grep [OPTION]... PATTERN [FILE] ... Search for PATTERN in each FILE or standard input. Example: grep -i 'hello world' menu.h main.c Regexp selection and interpretation: -E, --extended-regexp [...]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F01%2F24%2Flinux_cpu_info.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F10%2Flinux-grep-a-b-rowns.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux 查看cpu信息</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F04%2F05%2Flinux-vnc-geometry.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F10%2Flinux-grep-a-b-rowns.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux下vnc修改分辨率</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F12%2F15%2Fothe.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F10%2Flinux-grep-a-b-rowns.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux的LVM管理（三）–其它命令</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F12%2F20%2Flinux-shell-redirection.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F10%2Flinux-grep-a-b-rowns.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux shell 重定向</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F13%2Flinux-cpu-info-count.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F10%2Flinux-grep-a-b-rowns.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux下查看cpu的个数</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>通过脚本检查Oracle alert日志的时候，通常是通过查找Error和ORA-来检查是否有错误信息，Errors和ORA-对应行的上下几行的内容也是灰常最要的，查找了一下可以通过grep的 -A和-B来实现匹配行的上下行内容。</p>
<pre>-B, --before-context=NUM  print NUM lines of leading context
-A, --after-context=NUM   print NUM lines of trailing context</pre>
<p>比如：查找Error匹配的行，以及这行的上1行和下4行的内容</p>
<pre>grep Error -A4 -B1 /u01/app/oracle/admin/dbabc/bdump/alert_dbabc.log</pre>
<p>更多grep的参数选项可以通过grep &#8211;help</p>
<pre>Usage: grep [OPTION]... PATTERN [FILE] ...
Search for PATTERN in each FILE or standard input.
Example: grep -i 'hello world' menu.h main.c

Regexp selection and interpretation:
  -E, --extended-regexp     PATTERN is an extended regular expression
  -F, --fixed-strings       PATTERN is a set of newline-separated strings
  -G, --basic-regexp        PATTERN is a basic regular expression
  -P, --perl-regexp         PATTERN is a Perl regular expression
  -e, --regexp=PATTERN      use PATTERN as a regular expression
  -f, --file=FILE           obtain PATTERN from FILE
  -i, --ignore-case         ignore case distinctions
  -w, --word-regexp         force PATTERN to match only whole words
  -x, --line-regexp         force PATTERN to match only whole lines
  -z, --null-data           a data line ends in 0 byte, not newline

Miscellaneous:
  -s, --no-messages         suppress error messages
  -v, --invert-match        select non-matching lines
  -V, --version             print version information and exit
      --help                display this help and exit
      --mmap                use memory-mapped input if possible

Output control:
  -m, --max-count=NUM       stop after NUM matches
  -b, --byte-offset         print the byte offset with output lines
  -n, --line-number         print line number with output lines
      --line-buffered       flush output on every line
  -H, --with-filename       print the filename for each match
  -h, --no-filename         suppress the prefixing filename on output
      --label=LABEL         print LABEL as filename for standard input
  -o, --only-matching       show only the part of a line matching PATTERN
  -q, --quiet, --silent     suppress all normal output
      --binary-files=TYPE   assume that binary files are TYPE
                            TYPE is 'binary', 'text', or 'without-match'
  -a, --text                equivalent to --binary-files=text
  -I                        equivalent to --binary-files=without-match
  -d, --directories=ACTION  how to handle directories
                            ACTION is 'read', 'recurse', or 'skip'
  -D, --devices=ACTION      how to handle devices, FIFOs and sockets
                            ACTION is 'read' or 'skip'
  -R, -r, --recursive       equivalent to --directories=recurse
      --include=PATTERN     files that match PATTERN will be examined
      --exclude=PATTERN     files that match PATTERN will be skipped.
      --exclude-from=FILE   files that match PATTERN in FILE will be skipped.
  -L, --files-without-match only print FILE names containing no match
  -l, --files-with-matches  only print FILE names containing matches
  -c, --count               only print a count of matching lines per FILE
  -Z, --null                print 0 byte after FILE name

Context control:
<span style="color: #ff0000;"> -B, --before-context=NUM print NUM lines of leading context</span>
<span style="color: #ff0000;"> -A, --after-context=NUM print NUM lines of trailing context</span>
  -C, --context=NUM         print NUM lines of output context
  -NUM                      same as --context=NUM
      --color[=WHEN],
      --colour[=WHEN]       use markers to distinguish the matching string
                            WHEN may be `always', `never' or `auto'.
  -U, --binary              do not strip CR characters at EOL (MSDOS)
  -u, --unix-byte-offsets   report offsets as if CRs were not there (MSDOS)

`egrep' means `grep -E'.  `fgrep' means `grep -F'.
With no FILE, or when FILE is -, read standard input.  If less than
two FILEs given, assume -h.  Exit status is 0 if match, 1 if no match,
and 2 if trouble.

Report bugs to .</pre>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F01%2F24%2Flinux_cpu_info.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F10%2Flinux-grep-a-b-rowns.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux 查看cpu信息</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F04%2F05%2Flinux-vnc-geometry.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F10%2Flinux-grep-a-b-rowns.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux下vnc修改分辨率</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F12%2F15%2Fothe.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F10%2Flinux-grep-a-b-rowns.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux的LVM管理（三）–其它命令</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F12%2F20%2Flinux-shell-redirection.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F10%2Flinux-grep-a-b-rowns.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux shell 重定向</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F13%2Flinux-cpu-info-count.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F10%2Flinux-grep-a-b-rowns.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux下查看cpu的个数</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://dbabc.net/archives/2012/02/10/linux-grep-a-b-rowns.shtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linux vi E297: Write error in swap file</title>
		<link>http://dbabc.net/archives/2012/02/07/linux-vi-e297-write-error-in-swap-file.shtml</link>
		<comments>http://dbabc.net/archives/2012/02/07/linux-vi-e297-write-error-in-swap-file.shtml#comments</comments>
		<pubDate>Tue, 07 Feb 2012 11:07:59 +0000</pubDate>
		<dc:creator>dbabc</dc:creator>
				<category><![CDATA[Linux与开源]]></category>
		<category><![CDATA[Nosql]]></category>
		<category><![CDATA[技术积累]]></category>

		<guid isPermaLink="false">http://dbabc.net/?p=1602</guid>
		<description><![CDATA[今天在做MongoDB测试的时候，启动mongos进程发现失败，vi查看日志的时候出现 E297: Write error in swap file "log01" [noeol] 209L, 16384C Press ENTER or type command to continue google之，原来是磁盘空间满了。 在虚拟机上创建了5个mongod进程，竟然把40G的磁盘沾满了，架构是 Replica Sets+Sharding。 [mongo@dbabc.net data]$ df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/VolGroup00-LogVol00 35G 34G 0 100% / /dev/sda1 99M 20M 75M 21% /boot tmpfs 1006M 0 1006M 0% /dev/shm MongoDB占的目录的空间 [mongo@dbabc.net data]$ du [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="Veritas Netbackup实验二:Vistor虚拟带库备份测试" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F01%2F15%2Fnbu_vistor.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F07%2Flinux-vi-e297-write-error-in-swap-file.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/07/21524380.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Veritas Netbackup实验二:Vistor虚拟带库备份测试</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="ORA-12637:包接收失败" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F08%2F01%2Fora-12637.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F07%2Flinux-vi-e297-write-error-in-swap-file.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/07/21524572.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">ORA-12637:包接收失败</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Veritas Netbackup实验一:MasterServer Client安装和简单备份" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F01%2F15%2Fnbuinstall.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F07%2Flinux-vi-e297-write-error-in-swap-file.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/07/21524297.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Veritas Netbackup实验一:MasterServer Client安装和简单备份</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="新年第一贴–枣山年馍" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F02%2F21%2Fzaoshannianmo.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F07%2Flinux-vi-e297-write-error-in-swap-file.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/07/21524663.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">新年第一贴–枣山年馍</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="独立图片域名测试" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F01%2F28%2Fpic_tes.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F07%2Flinux-vi-e297-write-error-in-swap-file.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/07/21525102.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">独立图片域名测试</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>今天在做MongoDB测试的时候，启动mongos进程发现失败，vi查看日志的时候出现</p>
<pre>E297: Write error in swap file
"log01" [noeol] 209L, 16384C
Press ENTER or type command to continue</pre>
<p>google之，原来是磁盘空间满了。<br />
在虚拟机上创建了5个mongod进程，竟然把40G的磁盘沾满了，架构是 Replica Sets+Sharding。</p>
<pre>[mongo@dbabc.net data]$ df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
                       35G   34G     0 <span style="color: #ff0000;">100%</span> /
/dev/sda1              99M   20M   75M  21% /boot
tmpfs                1006M     0 1006M   0% /dev/shm</pre>
<p>MongoDB占的目录的空间</p>
<pre>[mongo@dbabc.net data]$ du -sh ./*
4.3G    ./10001
4.3G    ./10002
4.3G    ./10003
4.3G    ./10011
4.3G    ./10012
4.3G    ./10013
189M    ./config1
3.1G    ./config2
20K     ./config3
100K    ./logs</pre>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="ORA-12637:包接收失败" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F08%2F01%2Fora-12637.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F07%2Flinux-vi-e297-write-error-in-swap-file.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/07/21524572.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">ORA-12637:包接收失败</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="PXE环境远程安装Linux" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F04%2F22%2Fpxelinux.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F07%2Flinux-vi-e297-write-error-in-swap-file.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/07/21525361.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">PXE环境远程安装Linux</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="独立图片域名测试" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F01%2F28%2Fpic_tes.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F07%2Flinux-vi-e297-write-error-in-swap-file.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/07/21525102.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">独立图片域名测试</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Oracle书籍推荐" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F01%2F04%2Foracle-books.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F07%2Flinux-vi-e297-write-error-in-swap-file.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2012/01/04/13423304.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Oracle书籍推荐</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Veritas Netbackup实验一:MasterServer Client安装和简单备份" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F01%2F15%2Fnbuinstall.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F07%2Flinux-vi-e297-write-error-in-swap-file.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/07/21524297.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Veritas Netbackup实验一:MasterServer Client安装和简单备份</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://dbabc.net/archives/2012/02/07/linux-vi-e297-write-error-in-swap-file.shtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>linux下文件、文件名编码转换convmv</title>
		<link>http://dbabc.net/archives/2012/02/03/linux-command-convmv.shtml</link>
		<comments>http://dbabc.net/archives/2012/02/03/linux-command-convmv.shtml#comments</comments>
		<pubDate>Fri, 03 Feb 2012 01:52:50 +0000</pubDate>
		<dc:creator>dbabc</dc:creator>
				<category><![CDATA[Linux与开源]]></category>
		<category><![CDATA[技术积累]]></category>

		<guid isPermaLink="false">http://dbabc.net/?p=1592</guid>
		<description><![CDATA[今天开发人员所上传的网站开发文件在web浏览器上不能显示，最后发现不能显示的都是中文的文件名，后来还是开发的搞定了。主要原因是：从windows往Linux拷贝文件，中文文件名乱码的情况，出现这种问题的原因是因为，windows的文件名中文编码默认为GBK,而Linux中默认文件名编码为UTF8,由于编码不一致，所以导致了文件名乱码的问题。 解决方法：从网上搜索了一下，转载http://bin.bin2bing.com/?p=261 文章 查看文件编码file命令 file ip.txt ip.txt: UTF-8 Unicode text, with escape sequences 一、利用iconv命令进行编码转换文件内容编码转换 iconv命令用于转换指定文件的编码,默认输出到标准输出设备,亦可指定输出文件。 用法： iconv [选项...] [文件...] 有如下选项可用: 输入/输出格式规范： -f, --from-code=名称 原始文本编码 -t, --to-code=名称 输出编码 信息： -l, --list 列举所有已知的字符集 输出控制： -c 从输出中忽略无效的字符 -o, --output=FILE 输出文件 -s, --silent 关闭警告 --verbose 打印进度信息 -?, --help 给出该系统求助列表 --usage 给出简要的用法信息 -V, --version 打印程序版本号 例子: iconv -f utf-8 -t [...]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F10%2F09%2Flinux-time-info.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F03%2Flinux-command-convmv.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux下文件的time详解</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F01%2F24%2Flinux_cpu_info.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F03%2Flinux-command-convmv.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux 查看cpu信息</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F09%2F25%2Fcat_linux_system_info.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F03%2Flinux-command-convmv.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">查看Linux系統信息</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F12%2F20%2Flinux-shell-redirection.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F03%2Flinux-command-convmv.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux shell 重定向</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F10%2F02%2Flinux_auto_restart_oracle.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F03%2Flinux-command-convmv.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux平台下开关机自动启动关闭oracle服务</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>今天开发人员所上传的网站开发文件在web浏览器上不能显示，最后发现不能显示的都是中文的文件名，后来还是开发的搞定了。主要原因是：从windows往Linux拷贝文件，中文文件名乱码的情况，出现这种问题的原因是因为，windows的文件名中文编码默认为GBK,而Linux中默认文件名编码为UTF8,由于编码不一致，所以导致了文件名乱码的问题。<br />
解决方法：从网上搜索了一下，转载http://bin.bin2bing.com/?p=261 文章</p>
<p> <strong> 查看文件编码file命令</strong> </p>
<pre>file ip.txt
ip.txt: UTF-8 Unicode text, with escape sequences</pre>
<p><strong>一、利用iconv命令进行编码转换文件内容编码转换</strong></p>
<p>iconv命令用于转换指定文件的编码,默认输出到标准输出设备,亦可指定输出文件。</p>
<pre>
用法： iconv [选项...] [文件...]

有如下选项可用:

输入/输出格式规范：
-f, --from-code=名称 原始文本编码
-t, --to-code=名称 输出编码

信息：
-l, --list 列举所有已知的字符集

输出控制：
-c 从输出中忽略无效的字符
-o, --output=FILE 输出文件
-s, --silent 关闭警告
--verbose 打印进度信息

-?, --help 给出该系统求助列表
--usage 给出简要的用法信息
-V, --version 打印程序版本号

例子:
iconv -f utf-8 -t gb2312 aaa.txt &gt;bbb.txt
这个命令读取aaa.txt文件，从utf-8编码转换为gb2312编码,其输出定向到bbb.txt文件。</pre>
<p> <strong>二、文件名编码转换</strong><br />
 因为现在用linux,原来在windows里的文件都是用GBK编码的。所以copy到linux下是乱码，文件内容可以用iconv来转换可是好多中文的文件名还是乱码，找到个可以转换文件名编码的命令，就是convmv。 </p>
<pre><a href="http://linux.die.net/man/1/convmv" target="_blank">convmv命令详细参数</a>
</pre>
<p>例如</p>
<pre>convmv -f GBK -t UTF-8 *.mp3</pre>
<p>不过这个命令不会直正的转换，你可以看到转换前后的对比。如果要直正的转换要加上参数 &#8211;notest</p>
<pre>convmv -f GBK -t UTF-8 --notest *.mp3</pre>
<p> -f 参数是指出转换前的编码，-t 是转换后的编码。这个千万不要弄错了。不然可能还是乱码哦。还有一个参数很有用。就是 -r 这个表示递归转换当前目录下的所有子目录。<br />
 <strong>* 需要安装 convmv-1.10-1.el5.noarch.rpm</strong><br />
 <strong>三、</strong>更好的傻瓜型命令行工具enca，它不但能智能的识别文件的编码，而且还支持成批转换。<br />
　　1.安装
<pre>
　　$sudo apt-get install enca</pre>
<p>　　2.查看当前文件编码
<pre>
　　enca -L zh_CN ip.txt
   Simplified Chinese National Standard; GB2312
   Surrounded by/intermixed with non-text data</pre>
<p>　　3.转换<br />
　　命令格式如下<br />
　　$enca -L 当前语言 -x 目标编码 文件名<br />
　　例如要把当前目录下的所有文件都转成utf-8
<pre>
　　enca -L zh_CN -x utf-8 *
   enca -L zh_CN file 检查文件的编码　
　　enca -L zh_CN -x UTF-8 file 将文件编码转换为"UTF-8"编码　
　　enca -L zh_CN -x UTF-8 &lt; file1 &gt; file2 如果不想覆盖原文件可以这样，很简单吧。 </pre>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F10%2F09%2Flinux-time-info.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F03%2Flinux-command-convmv.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux下文件的time详解</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F01%2F24%2Flinux_cpu_info.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F03%2Flinux-command-convmv.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux 查看cpu信息</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F09%2F25%2Fcat_linux_system_info.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F03%2Flinux-command-convmv.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">查看Linux系統信息</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F12%2F20%2Flinux-shell-redirection.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F03%2Flinux-command-convmv.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux shell 重定向</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F10%2F02%2Flinux_auto_restart_oracle.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F03%2Flinux-command-convmv.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Linux平台下开关机自动启动关闭oracle服务</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://dbabc.net/archives/2012/02/03/linux-command-convmv.shtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>shell脚本检查Oracle DG备库是否已经应用归档</title>
		<link>http://dbabc.net/archives/2012/02/02/shell-check-oracle-dg-archivelog-reply.shtml</link>
		<comments>http://dbabc.net/archives/2012/02/02/shell-check-oracle-dg-archivelog-reply.shtml#comments</comments>
		<pubDate>Thu, 02 Feb 2012 08:52:52 +0000</pubDate>
		<dc:creator>dbabc</dc:creator>
				<category><![CDATA[数据库]]></category>

		<guid isPermaLink="false">http://dbabc.net/?p=1579</guid>
		<description><![CDATA[鉴于上一篇文章中提到的，今天写了一个自动检查Oracle DG备库是否已经应用归档的shell脚本，现分享如下： PS:本脚本需要先创建table：ARC_NOT_REPLY_LOG，这个表是用来存放记录的，如果不需要存放记录的话，可以将shell脚本的insert删掉。 ARC_NOT_REPLY_LOG 创建脚本: CREATE TABLE ORAM.ARC_NOT_REPLY_LOG ( HOSTNAME VARCHAR2(50 BYTE), NAME VARCHAR2(100 BYTE), SEQUENCE NUMBER, APPLIED VARCHAR2(3 BYTE), COMPLETION_TIME VARCHAR2(50 BYTE), ADD_TIME DATE DEFAULT SYSDATE ) shell脚本内容： #!/bin/bash #by Dbabc.net 2012/02/02 #User specific environment and startup programs # if [ -f ~/.bash_profile ]; then . ~/.bash_profile fi export DBAEMAIL=dbabc@dbabc.net export ORACLE_SID=dbabc export IP='10.8.8.1' [...]<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F12%2F20%2Foracle-dg-check-arc-is-not-trans.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F02%2Fshell-check-oracle-dg-archivelog-reply.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Oracle DG：检测归档是否传输到备库</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F01%2F14%2Fdaily-check-oracle-alert-log-and-send-mail.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F02%2Fshell-check-oracle-dg-archivelog-reply.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">每天定时检查Oracle alert日志并发送mail</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F07%2F18%2Foracle-rman_incremental_shell.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F02%2Fshell-check-oracle-dg-archivelog-reply.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Oracle RMAN增量备份脚本</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F01%2F04%2Foracle-books.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F02%2Fshell-check-oracle-dg-archivelog-reply.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Oracle书籍推荐</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F09%2F27%2Fshell-shortcut-key.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F02%2Fshell-check-oracle-dg-archivelog-reply.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Shell快捷键</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>鉴于<a href="http://dbabc.net/archives/2012/01/31/ora-01111-name-for-data-file-12-is-unknown-rename-to-correct-file.shtml" target="_blank">上一篇文章</a>中提到的，今天写了一个自动检查Oracle DG备库是否已经应用归档的shell脚本，现分享如下：<br />
PS:本脚本需要先创建table：ARC_NOT_REPLY_LOG，这个表是用来存放记录的，如果不需要存放记录的话，可以将shell脚本的insert删掉。<br />
ARC_NOT_REPLY_LOG 创建脚本:</p>
<pre>
CREATE TABLE ORAM.ARC_NOT_REPLY_LOG
(
  HOSTNAME         VARCHAR2(50 BYTE),
  NAME             VARCHAR2(100 BYTE),
  SEQUENCE         NUMBER,
  APPLIED          VARCHAR2(3 BYTE),
  COMPLETION_TIME  VARCHAR2(50 BYTE),
  ADD_TIME         DATE                         DEFAULT SYSDATE
)
</pre>
<p>shell脚本内容：</p>
<pre>#!/bin/bash
#by Dbabc.net 2012/02/02
#User specific environment and startup programs
#

if [ -f ~/.bash_profile ]; then
. ~/.bash_profile
fi

export DBAEMAIL=dbabc@dbabc.net
export ORACLE_SID=dbabc
export IP='10.8.8.1'
export SMTP='smtp.dbabc.net'
export FRUSER='dba@dbabc.net'
export BCCUSER='dba@dbabc.net'
export USERPWD='pwd'
VALUE=`$ORACLE_HOME/bin/sqlplus -S /nolog ＜＜EOF
set heading off feedback off pagesize 0 verify off echo off numwidth 4
connect / as sysdba
select count(*) from v\\$archived_log where applied='NO';
exit
EOF`
if [ "$VALUE" -gt 0 ]; then

$ORACLE_HOME/bin/sqlplus -S /nolog &gt; arc_not_reply.log ＜＜EOF
set heading off feedback off pagesize 0 verify off echo off
set lines 200
col name format a60
connect / as sysdba
alter session set nls_date_format='YYYY-MM-DDHH24:MI:SS';
select '$IP',name,sequence#,applied,completion_time from v\$archived_log where applied='NO';
exit
EOF

cat arc_not_reply.log|rev|awk {'print $1" "$2" "$3" "$4" "$5'} | rev |awk {'print "insert into ARC_NOT_REPLY_LOG(hostname,name,SEQUENCE,applied,COMPLETION_TIME) values(#"$1"#,#"$2"#,"$3",#"$4"#,#"$5"#);"'} |grep -v '##' | grep -v '#on#' | sed "s/#/'/g" |sed "s/%//g"| sed "s/ip/"${v_hostip}"/g" &gt;ARC_NOT_REPLY_LOG.sql;
#echo "insert into ARC_NOT_REPLY_LOG(hostname,name,SEQUENCE#,applied,COMPLETION_TIME) values ( '${INTV1}', '${INTV2},'${INTV3}', '${INTV4}', '${INTV5}');" &gt;ARC_NOT_REPLY_LOG.sql;

$ORACLE_HOME/bin/sqlplus /nolog ＜＜EOF
connect oram/oram@10.8.8.4:1521/yqpt
@ARC_NOT_REPLY_LOG.sql
commit;
exit;
EOF

/usr/local/bin/sendEmail -f $FRUSER -t ${DBAEMAIL} -bcc $BCCUSER -s $SMTP -u "$IP arclog not reply" -o message-file=arc_not_reply.log -xu "$FRUSER" -xp "$USERPWD"
exit
else
echo `date +'%F %T'`" All the archive log have replyed" &gt;arc_replyok.txt
/usr/local/bin/sendEmail -f $FRUSER -t ${DBAEMAIL} -bcc $BCCUSER -s $SMTP -u "$IP arc_replyok" -o message-file=arc_replyok.txt -xu "$FRUSER" -xp "$USERPWD"
fi
exit</pre>
<p>修改其中的变量即可，＜＜ 修改成半角格式，wordpress会自动转换半角的＜＜。<br />
然后再通过crontab定时运行此脚本，实现Email预警。<br />
完整的脚本可以通过 <a title="http://www.kuaipan.cn/file/id_17198221579276190.html" href="http://www.kuaipan.cn/file/id_17198221579276190.html" target="_blank">http://www.kuaipan.cn/file/id_17198221579276190.html</a> 下载。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="2" border="0" width="100%" style="clear: both;">
    
    <tr>
        <td ><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F12%2F20%2Foracle-dg-check-arc-is-not-trans.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F02%2Fshell-check-oracle-dg-archivelog-reply.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Oracle DG：检测归档是否传输到备库</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F01%2F14%2Fdaily-check-oracle-alert-log-and-send-mail.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F02%2Fshell-check-oracle-dg-archivelog-reply.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">每天定时检查Oracle alert日志并发送mail</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F07%2F18%2Foracle-rman_incremental_shell.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F02%2Fshell-check-oracle-dg-archivelog-reply.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Oracle RMAN增量备份脚本</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F01%2F04%2Foracle-books.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F02%2Fshell-check-oracle-dg-archivelog-reply.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Oracle书籍推荐</font>
                    </a>
                </td>
            </tr>
            <tr>
                <td style="margin: 0 !important; padding: 0 !important; line-height: 20px !important;">
                    <img border="0" src="http://static.wumii.com/images/widget/widget_solidPoint.gif">
                    <a target="_blank" style="text-decoration: none !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F09%2F27%2Fshell-shortcut-key.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F02%2F02%2Fshell-check-oracle-dg-archivelog-reply.shtml">
                        <font size="-1" color="#333333" style="line-height: 1.65em; font-size: 12px !important;">Shell快捷键</font>
                    </a>
                </td>
            </tr>
    
    <tr>
        <td  align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://dbabc.net/archives/2012/02/02/shell-check-oracle-dg-archivelog-reply.shtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ORA-01111: name for data file 12 is unknown &#8211; rename to correct file</title>
		<link>http://dbabc.net/archives/2012/01/31/ora-01111-name-for-data-file-12-is-unknown-rename-to-correct-file.shtml</link>
		<comments>http://dbabc.net/archives/2012/01/31/ora-01111-name-for-data-file-12-is-unknown-rename-to-correct-file.shtml#comments</comments>
		<pubDate>Tue, 31 Jan 2012 03:41:19 +0000</pubDate>
		<dc:creator>dbabc</dc:creator>
				<category><![CDATA[数据库]]></category>
		<category><![CDATA[dg]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[rman ora-01111]]></category>

		<guid isPermaLink="false">http://dbabc.net/?p=1567</guid>
		<description><![CDATA[如题：ORA-01111: name for data file 12 is unknown &#8211; rename to correct file 开工第一天，在检查oracle dg的时候发现备库的recovery_mode处于IDLE状态， select recovery_mode from v$archive_dest_status where dest_id=2; 这些备库都是采用的的real-time-apply，怎么会是IDEL呢，手动进行recover,提示 SQL&#62; recover standby database; ORA-00283: recovery session canceled due to errors ORA-01111: name for data file 12 is unknown - rename to correct file ORA-01110: data file 12: '/DB/dbabc.net/10.2.0/db_1/dbs/UNNAMED00012' ORA-01157: cannot identify/lock data [...]<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="本站升级为wordpress3.0正式启用多站点" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F06%2F20%2Fupgrade_wordpress3-0.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F01%2F31%2Fora-01111-name-for-data-file-12-is-unknown-rename-to-correct-file.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/07/21524659.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">本站升级为wordpress3.0正式启用多站点</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="将程序添加到右键菜单中" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2011%2F08%2F09%2Fadd-program-to-right-menu.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F01%2F31%2Fora-01111-name-for-data-file-12-is-unknown-rename-to-correct-file.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/09/21848091.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">将程序添加到右键菜单中</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="PXE环境远程安装Linux" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F04%2F22%2Fpxelinux.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F01%2F31%2Fora-01111-name-for-data-file-12-is-unknown-rename-to-correct-file.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/07/21525361.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">PXE环境远程安装Linux</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="秋天实拍苹果树" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F11%2F04%2Fapple.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F01%2F31%2Fora-01111-name-for-data-file-12-is-unknown-rename-to-correct-file.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/07/21524632.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">秋天实拍苹果树</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="观手知健康(经络全息手诊)蔡洪光" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F03%2F13%2Fhealth-by-finger.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F01%2F31%2Fora-01111-name-for-data-file-12-is-unknown-rename-to-correct-file.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/07/21524661.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">观手知健康(经络全息手诊)蔡洪光</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>如题：ORA-01111: name for data file 12 is unknown &#8211; rename to correct file<br />
开工第一天，在检查oracle dg的时候发现备库的recovery_mode处于IDLE状态，</p>
<pre>select recovery_mode from v$archive_dest_status where dest_id=2;</pre>
<p>这些备库都是采用的的real-time-apply，怎么会是IDEL呢，手动进行recover,提示</p>
<pre>SQL&gt; recover standby database;
ORA-00283: recovery session canceled due to errors
ORA-01111: name for data file 12 is unknown - rename to correct file
ORA-01110: data file 12: '/DB/dbabc.net/10.2.0/db_1/dbs/UNNAMED00012'
ORA-01157: cannot identify/lock data file 12 - see DBWR trace file
ORA-01111: name for data file 12 is unknown - rename to correct file
ORA-01110: data file 12: '/DB/dbabc.net/10.2.0/db_1/dbs/UNNAMED00012'</pre>
<p>想起这可能是备库的数据文件没能创建成功.在主库上查看了 datafile 12 ,果然这个数据文件是放假前刚刚添加的,悲剧的是standby_file_management这个参数竟然是 MANUAL.于是重新检查了所有的数据库的参数,确保此参数是否设置正确.还好只有这个库的参数没修改.<br />
同时备库的alert日志的错误信息如下：</p>
<pre>
Fri Jan 20 09:07:20 2012
Media Recovery Waiting for thread 1 sequence 1523 (in transit)
Fri Jan 20 09:07:20 2012
Recovery of Online Redo Log: Thread 1 Group 11 Seq 1523 Reading mem 0
  Mem# 0 errs 0: /DB/dbabc.net/standby_log11.log
Fri Jan 20 09:08:38 2012
File #12 added to control file as 'UNNAMED00012' because
the parameter STANDBY_FILE_MANAGEMENT is set to MANUAL
The file should be manually created to continue.
MRP0: Background Media Recovery terminated with error 1274
Fri Jan 20 09:08:40 2012
Errors in file /u01/app/oracle/admin/dbabc/bdump/dbabc_mrp0_6664.trc:
ORA-01274: cannot add datafile '/DB/dbabc.net/dbabc5.dbf' - file could not be created
Managed Standby Recovery not using Real Time Apply
Some recovered datafiles maybe left media fuzzy
Media recovery may continue but open resetlogs may fail
Fri Jan 20 09:08:43 2012
Errors in file /u01/app/oracle/admin/dbabc/bdump/dbabc_mrp0_6664.trc:
ORA-01274: cannot add datafile '/DB/dbabc.net/dbabc5.dbf' - file could not be created
Fri Jan 20 09:08:43 2012
MRP0: Background Media Recovery process shutdown (dbabc)
</pre>
<p>/u01/app/oracle/admin/dbabc/bdump/dbabc_mrp0_6664.trc文件的内容如下</p>
<pre>
*** 2012-01-20 09:08:41.292 1011 krsm.c
Managed Recovery: Not Active posted.
ORA-01274: cannot add datafile '/DB/dbabc.net/dbabc5.dbf' - file could not be created
ARCH: Connecting to console port...
*** 2012-01-20 09:08:43.227 60679 kcrr.c
MRP0: Background Media Recovery process shutdown
*** 2012-01-20 09:08:43.227 1011 krsm.c
</pre>
<p>创建缺失的数据文件严格的讲是rename数据文件,这个UNNAMED00012数据文件是不存在的:</p>
<pre>alter database create datafile '/DB/dbabc.net/10.2.0/db_1/dbs/UNNAMED00012' as '/data/dbabc/dbabc05.dbf';</pre>
<p>然后修改standby_file_management的参数为auto，这样的在主库创建数据文件之后，备库会自动创建数据文件。<br />
手动recovery，肯定缺少归档文件喽，因为归档之保留3天的，主库有RMAN备份。从RMAN里面恢复归档文件。<br />
通过以下语句查找没有应用的归档的最小sequence#，</p>
<pre>select min(sequence#) from v$archived_log where applied='NO';</pre>
<p>执行结果是1876目前保留的归档文件的sequence#是2012，中间缺失2012-1876个归档文件。<br />
RMAN恢复归档文件，</p>
<pre>RESTORE ARCHIVELOG SEQUENCE BETWEEN 1523AND 2012
</pre>
<p>这一步可能时间有点长，恢复之后将归档copu到备库，手动应用当，或者直接设置real-time-apply，oracle会自己应有归档。</p>
<p>教训，<br />
1.之前的巡检脚本只是检查归档是否传输到备库，而没有检查归档是否应用，修改巡检脚本，检查归档是否应用，若没应用发mail预警。<br />
2.创建DG的时候相关参数要全部修改好，要进行全面的检查，确保所有的参数都进行准确修改。</p>
<p style="margin:0;padding:0;height:1px;overflow:hidden;">
    <script type="text/javascript"><!--
        var wumiiSitePrefix = "http://dbabc.net";
        var wumiiEnableCustomPos = true;
        var wumiiParams = "&#038;num=6&#038;mode=3&#038;displayInFeed=1&#038;version=1.0.5.5&#038;pf=WordPress3.3.1";
    //--></script><script type="text/javascript" src="http://widget.wumii.com/ext/relatedItemsWidget.htm"></script><a href="http://www.wumii.com/widget/relatedItems.htm" style="border:0;"><img src="http://static.wumii.com/images/pixel.png" alt="无觅相关文章插件，快速提升流量" style="border:0;padding:0;margin:0;" /></a></p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="5"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="独立图片域名测试" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F01%2F28%2Fpic_tes.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F01%2F31%2Fora-01111-name-for-data-file-12-is-unknown-rename-to-correct-file.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/07/21525102.png" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">独立图片域名测试</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Openfiler配置攻略之二：iSCSI存储的创建" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F04%2F14%2Fopenfiler-iscsi.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F01%2F31%2Fora-01111-name-for-data-file-12-is-unknown-rename-to-correct-file.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/07/21524438.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Openfiler配置攻略之二：iSCSI存储的创建</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="新年第一贴–枣山年馍" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F02%2F21%2Fzaoshannianmo.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F01%2F31%2Fora-01111-name-for-data-file-12-is-unknown-rename-to-correct-file.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/07/21524663.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">新年第一贴–枣山年馍</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="利用Heartbeat + DRBD搭建MySQL高可用环境" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F04%2F10%2Fheartbeat-drbd-mysql-ha.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F01%2F31%2Fora-01111-name-for-data-file-12-is-unknown-rename-to-correct-file.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2012/04/10/19126226.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">利用Heartbeat + DRBD搭建MySQL高可用环境</font>
                    </a>
                </td>
                <td width="86" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Linux的LVM管理（一）–基本知识和创建" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fdbabc.net%2Farchives%2F2010%2F12%2F14%2Flvm_base.shtml&from=http%3A%2F%2Fdbabc.net%2Farchives%2F2012%2F01%2F31%2Fora-01111-name-for-data-file-12-is-unknown-rename-to-correct-file.shtml">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 80px !important; height: 80px !important;" src="http://static.wumii.com/site_images/2011/08/07/21525352.jpg" width="80px" height="80px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 86px !important; font: 12px/15px arial !important; height: 53px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Linux的LVM管理（一）–基本知识和创建</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="5" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://dbabc.net/archives/2012/01/31/ora-01111-name-for-data-file-12-is-unknown-rename-to-correct-file.shtml/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

