﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-blueskiner-随笔分类-数据库</title><link>http://www.cppblog.com/blueskiner/category/19760.html</link><description /><language>zh-cn</language><lastBuildDate>Fri, 12 Oct 2012 23:59:40 GMT</lastBuildDate><pubDate>Fri, 12 Oct 2012 23:59:40 GMT</pubDate><ttl>60</ttl><item><title>ld: 0711-736 XCOFF64 object files are not allowed in 32-bit mode</title><link>http://www.cppblog.com/blueskiner/archive/2012/10/12/193216.html</link><dc:creator>卡洛shll</dc:creator><author>卡洛shll</author><pubDate>Fri, 12 Oct 2012 07:47:00 GMT</pubDate><guid>http://www.cppblog.com/blueskiner/archive/2012/10/12/193216.html</guid><wfw:comment>http://www.cppblog.com/blueskiner/comments/193216.html</wfw:comment><comments>http://www.cppblog.com/blueskiner/archive/2012/10/12/193216.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/blueskiner/comments/commentRss/193216.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/blueskiner/services/trackbacks/193216.html</trackback:ping><description><![CDATA[编译BDB报错： 
<p>&#8230;&#8230;</p>
<p>Stop.<br />ld: 0711-736 ERROR: Input file jjkz_rcv.o:<br />&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr>&nbsp;<wbr> XCOFF64 object files are not allowed in 32-bit mode.</p>
<p>&nbsp;<wbr></p>
<p>查了link，解决方法为在系统变量里加个参数：</p>
<p>export OBJECT_MODE=64<br /><br />编译过去了，可执行文件生成了。</p>
<p>还有报错，估计是程序的通用性问题。</p>
<p>记下来，便于以后查找。</p><img src ="http://www.cppblog.com/blueskiner/aggbug/193216.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/blueskiner/" target="_blank">卡洛shll</a> 2012-10-12 15:47 <a href="http://www.cppblog.com/blueskiner/archive/2012/10/12/193216.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Berkeley DB在Queue模式下的使用</title><link>http://www.cppblog.com/blueskiner/archive/2012/09/06/189707.html</link><dc:creator>卡洛shll</dc:creator><author>卡洛shll</author><pubDate>Thu, 06 Sep 2012 07:13:00 GMT</pubDate><guid>http://www.cppblog.com/blueskiner/archive/2012/09/06/189707.html</guid><wfw:comment>http://www.cppblog.com/blueskiner/comments/189707.html</wfw:comment><comments>http://www.cppblog.com/blueskiner/archive/2012/09/06/189707.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/blueskiner/comments/commentRss/189707.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/blueskiner/services/trackbacks/189707.html</trackback:ping><description><![CDATA[Berkeley DB在Queue模式下的使用<br /><br />&nbsp;&nbsp;&nbsp;Queue模式下仅能存储定长的记录，即value的长度为定长。Queue的key是一个逻辑增长的数，一般就是int。<br />不需要开发者去改变这个类型。<br /><br />&nbsp;&nbsp;&nbsp;Queue模式下只能存储定长的记录。所以一定要调用Db的set_re_len函数来设定数据库中记录的长度。<br />如果没有设定，默认的为0。这样当存储记录时一定会报异常。程序出错。<br />在读取记录时，当记录的长度小于设定的长度时，会填充字符达到设定长度。<br />默认的字符为0x02（ASCII中的）。可以设定自己的填充字符。调用DB的set_re_pad。<br /><br />一个简单的示例<br /><br />#include &lt;time.h&gt;<br />#include &lt;iostream&gt;<br />#include &lt;db_cxx.h&gt;<br /><br />struct ValueType<br />{<br />&nbsp;&nbsp; &nbsp;int _int;<br />&nbsp;&nbsp; &nbsp;char _char;<br />&nbsp;&nbsp; &nbsp;char _array[256];<br />};<br /><br />void writeDB( void )<br />{<br />&nbsp;&nbsp; &nbsp;Db bdb(0, 0);<br /><br />&nbsp;&nbsp; &nbsp;bdb.set_re_len(sizeof(ValueType)); //用Queue模式一定要调用，而且一定要在open前调用<br />&nbsp;&nbsp; &nbsp;bdb.set_re_pad(0x00); //填充字符串为0。<br /><br />&nbsp;&nbsp; &nbsp;bdb.open(0, "SaveRecodeDB.db", 0, DB_QUEUE, DB_CREATE, 0);<br /><br />&nbsp;&nbsp; &nbsp;size_t k;<br />&nbsp;&nbsp; &nbsp;ValueType v;<br />&nbsp;&nbsp; &nbsp;Dbt key&amp;k, sizeof(size_t));<br />&nbsp;&nbsp; &nbsp;Dbt value(&amp;v, sizeof(ValueType));<br /><br />&nbsp;&nbsp; &nbsp;//直接用数据库的写函数<br />&nbsp;&nbsp; &nbsp;for (int i=0; i&lt;1000000; ++i) {<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;bdb.put(0, &amp;key, &amp;value, DB_APPEND);<br />&nbsp;&nbsp; &nbsp;}<br /><br />&nbsp;&nbsp; &nbsp;bdb.close(0);<br />}<br /><br />int main( int argc, char* argv[] )<br />{<br />&nbsp;&nbsp; &nbsp;clock_t et1 = clock();<br />&nbsp;&nbsp; &nbsp;writeDB();<br />&nbsp;&nbsp; &nbsp;clock_t et2 = clock();<br /><br />&nbsp;&nbsp; &nbsp;std::cout &lt;&lt; "work is fine, " &lt;&lt; "have times : " &lt;&lt; et2 - et1 &lt;&lt; std::endl;<br />&nbsp;&nbsp; &nbsp;return 0;<br />} <br /><br />在Queue模式下不能用游标进行数据的插入。只能进行数据的修改。<br /><br />Queue模式读数据的一个简单的示例<br />在Queue模式下读数据，记录（Dbt）要调用set_ulen函数和set_flags函数<br /><br />#include &lt;time.h&gt;<br />#include &lt;iostream&gt;<br />#include &lt;bdb/db_cxx.h&gt;<br /><br />struct ValueType<br />{<br />&nbsp;&nbsp;&nbsp; int _int;<br />&nbsp;&nbsp;&nbsp; char _char;<br />&nbsp;&nbsp;&nbsp; char _array[256];<br />};<br /><br />void readDB( void )<br />{<br />&nbsp;&nbsp; &nbsp;Db bdb(0, 0);<br /><br />&nbsp;&nbsp; &nbsp;bdb.set_re_len(sizeof(ValueType)); //用Queue模式一定要调用，而且一定要在open前调用<br />&nbsp;&nbsp; &nbsp;bdb.set_re_pad(0x00); //字符串的填充为0。<br /><br />&nbsp;&nbsp; &nbsp;bdb.open(0, "SaveRecodeDB.db", 0, DB_QUEUE, DB_CREATE, 0);<br /><br />&nbsp;&nbsp; &nbsp;size_t k;<br />&nbsp;&nbsp; &nbsp;ValueType v;<br />&nbsp;&nbsp; &nbsp;Dbt key( &amp;k, sizeof( size_t ) );<br />&nbsp;&nbsp; &nbsp;key.set_ulen( sizeof( size_t ) );<br /><br />&nbsp;&nbsp; &nbsp;Dbt value( &amp;v, sizeof( ValueType ) );<br />&nbsp;&nbsp; &nbsp;value.set_ulen( sizeof( ValueType ) );<br />&nbsp;&nbsp; &nbsp;value.set_flags( DB_DBT_USERMEM );<br /><br />&nbsp;&nbsp; &nbsp;//直接用数据库的读函数<br />&nbsp;&nbsp; &nbsp;for( int i=0; i&lt;1000000; ++i )<br />&nbsp;&nbsp; &nbsp;{<br />&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;bdb.get( 0, &amp;key, &amp;value, DB_CONSUME );<br />&nbsp;&nbsp; &nbsp;}<br /><br />&nbsp;&nbsp; &nbsp;bdb.close( 0 );<br />}<br /><br />int main( int argc, char* argv[] )<br />{<br />&nbsp;&nbsp;&nbsp; clock_t et1 = clock();<br />&nbsp;&nbsp;&nbsp; readDB();<br />&nbsp;&nbsp;&nbsp; clock_t et2 = clock();<br /><br />&nbsp;&nbsp;&nbsp; std::cout &lt;&lt; "work is fine, " &lt;&lt; "have times : " &lt;&lt; et2 - et1 &lt;&lt; std::endl;<br />&nbsp;&nbsp;&nbsp; return 0;<br />} <img src ="http://www.cppblog.com/blueskiner/aggbug/189707.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/blueskiner/" target="_blank">卡洛shll</a> 2012-09-06 15:13 <a href="http://www.cppblog.com/blueskiner/archive/2012/09/06/189707.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>oracle清除数据库表空间</title><link>http://www.cppblog.com/blueskiner/archive/2012/08/30/188710.html</link><dc:creator>卡洛shll</dc:creator><author>卡洛shll</author><pubDate>Thu, 30 Aug 2012 02:20:00 GMT</pubDate><guid>http://www.cppblog.com/blueskiner/archive/2012/08/30/188710.html</guid><wfw:comment>http://www.cppblog.com/blueskiner/comments/188710.html</wfw:comment><comments>http://www.cppblog.com/blueskiner/archive/2012/08/30/188710.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/blueskiner/comments/commentRss/188710.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/blueskiner/services/trackbacks/188710.html</trackback:ping><description><![CDATA[在<a onclick="javascript:tagshow(event, '%CA%FD%BE%DD%BF%E2');" href="javascript:;" target="_self">数据库</a>表空间满后，直接执行drop，delete，truncate等删除数据的操作，都不会释放数据库表空间，释放os的空间，用df -lh 查看都还是满的。虽然<a onclick="javascript:tagshow(event, 'oracle');" href="javascript:;" target="_self">oracle</a>的表空间即便不被回收，也是可以利用的，但会引起问题，释放os的空间是最放心的。 
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在这种情况下，如果要释放os的空间，解决办法如下：</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1.exp<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2.drop tablespace<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3.create tablespace<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4.imp</div>
<div>1.exp 导出表空间中所需的数据。</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在这之前，如果日志数据不是很必要，非保留不可，可以先truncate table tablename;然后导出数据已满的表空间。cd $ORACLE_HOME/bin目录下，</div>
<div>./exp<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#110;&#97;&#109;&#101;&#47;&#112;&#97;&#115;&#115;&#64;&#116;&#101;&#115;&#116;&#100;&#98;">name/pass@testdb</a>file=/tmp/bak/tabelspace.dmp tablespaces=TBS_TEST</div>
<div>2.drop tablespace 删除数据库表空间</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;命令drop tablespace TBS_TEST INCLUDING CONTENTS;然后进入到表空间的物理存储目录，执行rm -f *，这是空间利用率下来了。如果想直接删除文件，可以用drop tablespace TBS_TEST INCLUDING CONTENTS and datafiles;，这是会发现时间的物理数据文件已经没有了，但df -lh空间使用率并没有变化，需要重启数据库。删除表空间和删除物理文件的顺序不能改变，如果反了，请参考上一篇文章。</div>
<div>3.create tablespace 重新创建数据库表空间</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;使用创建命令，直接创建即可。create bigfile tablespace tbs_test datafile '/usr/data/test/tbs_test.DBF' size 2000M autoextend on next 100M;</div>
<div>4.imp 导入数据文件</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ./imp<a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;&#110;&#97;&#109;&#101;&#47;&#112;&#97;&#115;&#115;&#64;&#116;&#101;&#115;&#116;&#100;&#98;">name/pass@testdb</a>file=/tmp/bakloginfo.dmp full=y tablespaces=TBS_TEST</div>
<div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果不想做导入导出，比如索引表空间，可以直接删除表空间，删除物理文件，然后创建表空间，重建索引。</div><img src ="http://www.cppblog.com/blueskiner/aggbug/188710.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/blueskiner/" target="_blank">卡洛shll</a> 2012-08-30 10:20 <a href="http://www.cppblog.com/blueskiner/archive/2012/08/30/188710.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ORACLE的TNS配置</title><link>http://www.cppblog.com/blueskiner/archive/2012/08/27/188442.html</link><dc:creator>卡洛shll</dc:creator><author>卡洛shll</author><pubDate>Mon, 27 Aug 2012 10:50:00 GMT</pubDate><guid>http://www.cppblog.com/blueskiner/archive/2012/08/27/188442.html</guid><wfw:comment>http://www.cppblog.com/blueskiner/comments/188442.html</wfw:comment><comments>http://www.cppblog.com/blueskiner/archive/2012/08/27/188442.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/blueskiner/comments/commentRss/188442.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/blueskiner/services/trackbacks/188442.html</trackback:ping><description><![CDATA[<p style="text-indent: 2em">在ORACLE当中，如果想访问某个服务器，必需要设置TNS，它不想SQLSERVER那样，客户端会自动列举出在局域网内所有的在线服务器，只需在客户端选择需要的服务器，然后使用帐号与密码登录即可。而ORCAL是不会自动列举出网内的服务器的，需要通过读取TNS配置文件才能列出经过配置的服务器名。</p>
<p style="text-indent: 2em">ORACLE的配置文件名：tnsnames.ora</p>
<p style="text-indent: 2em">文件所在路径：安装ORACLE所在的目录\oracle\ora92\network\admin\tnsnames.ora</p>
<p style="text-indent: 2em">配置的一个实例：</p>
<p style="text-indent: 2em"># TNSNAMES.ORA Network Configuration File: D:\Oracle\network\admin\tnsnames.ora</p>
<p style="text-indent: 2em"># Generated by Oracle configuration tools.</p>
<p style="text-indent: 2em">ODS =</p>
<p style="text-indent: 2em">&nbsp; (description =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (address = (protocol = tcp)(host = 10.201.64.12)(port = 1521))</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (connect_data =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (sid = ods)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; )</p>
<p style="text-indent: 2em">&nbsp; )</p>
<p style="text-indent: 2em">AUTOCLM_10.210.4.11 =</p>
<p style="text-indent: 2em">&nbsp; (DESCRIPTION =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (ADDRESS_LIST =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (ADDRESS = (PROTOCOL = TCP)(HOST = 10.210.4.11)(PORT = 1521))</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; )</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (CONNECT_DATA =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SID = autoclm)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SERVER = DEDICATED)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; )</p>
<p style="text-indent: 2em">&nbsp; )</p>
<p style="text-indent: 2em">PROPTEST_10.210.4.30 =</p>
<p style="text-indent: 2em">&nbsp; (DESCRIPTION =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (ADDRESS_LIST =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (ADDRESS = (PROTOCOL = TCP)(HOST = 10.210.4.30)(PORT = 1521))</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; )</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (CONNECT_DATA =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SID = proptest)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SERVER = DEDICATED)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; )</p>
<p style="text-indent: 2em">&nbsp; )</p>
<p style="text-indent: 2em">p05 =</p>
<p style="text-indent: 2em">&nbsp; (DESCRIPTION =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (ADDRESS_LIST =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (ADDRESS = (PROTOCOL = TCP)(HOST = 10.201.64.14)(PORT = 1521))</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; )</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (CONNECT_DATA =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SID = p05)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SERVER = DEDICATED)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; )</p>
<p style="text-indent: 2em">&nbsp; )</p>
<p style="text-indent: 2em">p05_8 =</p>
<p style="text-indent: 2em">&nbsp; (DESCRIPTION =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (ADDRESS_LIST =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (ADDRESS = (PROTOCOL = TCP)(HOST = 10.201.64.8)(PORT = 1521))</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; )</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (CONNECT_DATA =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SID = p05)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; )</p>
<p style="text-indent: 2em">&nbsp; )</p>
<p style="text-indent: 2em">&nbsp; </p>
<p style="text-indent: 2em">ODS =</p>
<p style="text-indent: 2em">&nbsp; (description =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (address = (protocol = tcp)(host = 10.201.64.8)(port = 1521))</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (connect_data =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (sid = p05)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; )</p>
<p style="text-indent: 2em">&nbsp; )</p>
<p style="text-indent: 2em">test_14 =</p>
<p style="text-indent: 2em">&nbsp; (DESCRIPTION =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (ADDRESS_LIST =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (ADDRESS = (PROTOCOL = TCP)(HOST = 10.201.64.14)(PORT = 1521))</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; )</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (CONNECT_DATA =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SERVICE_NAME = p05test)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; )</p>
<p style="text-indent: 2em">&nbsp; )&nbsp;&nbsp;&nbsp; </p>
<p style="text-indent: 2em">&nbsp; </p>
<p style="text-indent: 2em">CIBS =</p>
<p style="text-indent: 2em">&nbsp; (DESCRIPTION =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (ADDRESS_LIST =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (ADDRESS = (PROTOCOL = TCP)(HOST = 10.203.68.71)(PORT = 1521))</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; )</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (CONNECT_DATA =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SERVICE_NAME = cibs)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; )</p>
<p style="text-indent: 2em">&nbsp; )</p>
<p style="text-indent: 2em">&nbsp; </p>
<p style="text-indent: 2em">&nbsp; ORA10 =</p>
<p style="text-indent: 2em">&nbsp; (DESCRIPTION =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (ADDRESS_LIST =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (ADDRESS = (PROTOCOL = TCP)(HOST = 10.202.1.77)(PORT = 1521))</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; )</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (CONNECT_DATA =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SERVICE_NAME = ORA10)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; )</p>
<p style="text-indent: 2em">&nbsp; )</p>
<p style="text-indent: 2em">CIBS =</p>
<p style="text-indent: 2em">&nbsp; (DESCRIPTION =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (ADDRESS_LIST =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (ADDRESS = (PROTOCOL = TCP)(HOST = 10.203.68.71)(PORT = 1521))</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; )</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (CONNECT_DATA =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SERVICE_NAME = cibs)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; )</p>
<p style="text-indent: 2em">&nbsp; )&nbsp; </p>
<p style="text-indent: 2em">&nbsp; </p>
<p style="text-indent: 2em">CAI =</p>
<p style="text-indent: 2em">&nbsp; (DESCRIPTION =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (ADDRESS_LIST =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (ADDRESS = (PROTOCOL = TCP)(HOST = 10.203.68.80)(PORT = 1521))</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; )</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (CONNECT_DATA =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SERVICE_NAME = proplh)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; )</p>
<p style="text-indent: 2em">&nbsp; )&nbsp; </p>
<p style="text-indent: 2em">&nbsp; </p>
<p style="text-indent: 2em">CHELP =</p>
<p style="text-indent: 2em">&nbsp; (DESCRIPTION =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (ADDRESS_LIST =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (ADDRESS = (PROTOCOL = TCP)(HOST = 10.203.68.137)(PORT = 1521))</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; )</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; (CONNECT_DATA =</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (SERVICE_NAME = autoclm)</p>
<p style="text-indent: 2em">&nbsp;&nbsp;&nbsp; )</p>
<p style="text-indent: 2em">&nbsp; )&nbsp; </p>
<p style="text-indent: 2em">配置完毕后，客户端就可以列举出&#8220;CAI&#8221;，&#8220;CHELP&#8221;，&#8220;CIBS&#8221;等的服务器名出来。</p><img src ="http://www.cppblog.com/blueskiner/aggbug/188442.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/blueskiner/" target="_blank">卡洛shll</a> 2012-08-27 18:50 <a href="http://www.cppblog.com/blueskiner/archive/2012/08/27/188442.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ORA-01034:ORACLE not available问题的解决方法</title><link>http://www.cppblog.com/blueskiner/archive/2012/08/27/188428.html</link><dc:creator>卡洛shll</dc:creator><author>卡洛shll</author><pubDate>Mon, 27 Aug 2012 08:07:00 GMT</pubDate><guid>http://www.cppblog.com/blueskiner/archive/2012/08/27/188428.html</guid><wfw:comment>http://www.cppblog.com/blueskiner/comments/188428.html</wfw:comment><comments>http://www.cppblog.com/blueskiner/archive/2012/08/27/188428.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/blueskiner/comments/commentRss/188428.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/blueskiner/services/trackbacks/188428.html</trackback:ping><description><![CDATA[<p>[mailz@/cdr2/home/mailz]$ su - oracle<br />oracle's Password: <br />-bash-3.00$ sqlplus /as sysdba</p>
<p>SQL*Plus: Release 10.2.0.1.0 - Production</p>
<p>Copyright (c) 1982, 2005, Oracle.&nbsp; All rights reserved.</p>
<p>Usage 1: sqlplus -H | -V</p>
<p>&nbsp;&nbsp;&nbsp; -H&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Displays the SQL*Plus version and the<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; usage help.<br />&nbsp;&nbsp;&nbsp; -V&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Displays the SQL*Plus version.</p>
<p>Usage 2: sqlplus [ [&lt;option&gt;] [&lt;logon&gt;] [&lt;start&gt;] ]</p>
<p>&nbsp; &lt;option&gt; is: [-C &lt;version&gt;] [-L] [-M "&lt;options&gt;"] [-R &lt;level&gt;] [-S]</p>
<p>&nbsp;&nbsp;&nbsp; -C &lt;version&gt;&nbsp;&nbsp; Sets the compatibility of affected commands to the<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; version specified by &lt;version&gt;.&nbsp; The version has<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the form "x.y[.z]".&nbsp; For example, -C 10.2.0<br />&nbsp;&nbsp;&nbsp; -L&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Attempts to log on just once, instead of<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; reprompting on error.<br />&nbsp;&nbsp;&nbsp; -M "&lt;options&gt;" Sets automatic HTML markup of output.&nbsp; The options<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; have the form:<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; HTML [ON|OFF] [HEAD text] [BODY text] [TABLE text]<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [ENTMAP {ON|OFF}] [SPOOL {ON|OFF}] [PRE[FORMAT] {ON|OFF}]<br />&nbsp;&nbsp;&nbsp; -R &lt;level&gt;&nbsp;&nbsp;&nbsp;&nbsp; Sets restricted mode to disable SQL*Plus commands<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; that interact with the file system.&nbsp; The level can<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; be 1, 2 or 3.&nbsp; The most restrictive is -R 3 which<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; disables all user commands interacting with the<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; file system.<br />&nbsp;&nbsp;&nbsp; -S&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Sets silent mode which suppresses the display of<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the SQL*Plus banner, prompts, and echoing of<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; commands.</p>
<p>&nbsp; &lt;logon&gt; is: (&lt;username&gt;[/&lt;password&gt;][@&lt;connect_identifier&gt;] | /)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [AS SYSDBA | AS SYSOPER] | /NOLOG</p>
<p>&nbsp;&nbsp;&nbsp; Specifies the database account username, password and connect<br />&nbsp;&nbsp;&nbsp; identifier for the database connection.&nbsp; Without a connect<br />&nbsp;&nbsp;&nbsp; identifier, SQL*Plus connects to the default database.</p>
<p>&nbsp;&nbsp;&nbsp; The AS SYSDBA and AS SYSOPER options are database administration<br />&nbsp;&nbsp;&nbsp; privileges.</p>
<p>&nbsp;&nbsp;&nbsp; The /NOLOG option starts SQL*Plus without connecting to a<br />&nbsp;&nbsp;&nbsp; database.</p>
<p>&nbsp; &lt;start&gt; is: @&lt;URL&gt;|&lt;filename&gt;[.&lt;ext&gt;] [&lt;parameter&gt; ...]</p>
<p>&nbsp;&nbsp;&nbsp; Runs the specified SQL*Plus script from a web server (URL) or the<br />&nbsp;&nbsp;&nbsp; local file system (filename.ext) with specified parameters that<br />&nbsp;&nbsp;&nbsp; will be assigned to substitution variables in the script.</p>
<p>When SQL*Plus starts, and after CONNECT commands, the site profile<br />(e.g. $ORACLE_HOME/sqlplus/admin/glogin.sql) and the user profile<br />(e.g. login.sql in the working directory) are run.&nbsp; The files may<br />contain SQL*Plus commands.</p>
<p>Refer to the SQL*Plus User's Guide and Reference for more information.<br />-bash-3.00$ sqlplus / as sysdba</p>
<p>SQL*Plus: Release 10.2.0.1.0 - Production on Mon Aug 27 15:54:53 2012</p>
<p>Copyright (c) 1982, 2005, Oracle.&nbsp; All rights reserved.</p>
<p>Connected to an idle instance.</p>
<p>SQL&gt; alter user sys identified by 123;<br />alter user sys identified by 123<br />*<br />ERROR at line 1:<br />ORA-01034: ORACLE not available</p>
<p><br />SQL&gt; select username from dba_users;<br />select username from dba_users<br />*<br />ERROR at line 1:<br />ORA-01034: ORACLE not available</p>
<p><br />SQL&gt; quit<br />Disconnected<br />-bash-3.00$ id oracle<br />uid=205(oracle) gid=203(oinstall) groups=204(dba)<br />-bash-3.00$ lsnrctl start</p>
<p>LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production on 27-AUG-2012 15:57:24</p>
<p>Copyright (c) 1991, 2005, Oracle.&nbsp; All rights reserved.</p>
<p>Starting /cdr2/app/oracle/product/10gr2/bin/tnslsnr: please wait...</p>
<p>TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production<br />System parameter file is /cdr2/app/oracle/product/10gr2/network/admin/listener.ora<br />Log messages written to /cdr2/app/oracle/product/10gr2/network/log/listener.log<br />Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))<br />Listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=cdr2)(PORT=1521)))</p>
<p>Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))<br />STATUS of the LISTENER<br />------------------------<br />Alias&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LISTENER<br />Version&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production<br />Start Date&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 27-AUG-2012 15:57:27<br />Uptime&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 days 0 hr. 0 min. 2 sec<br />Trace Level&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; off<br />Security&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ON: Local OS Authentication<br />SNMP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ON<br />Listener Parameter File&nbsp;&nbsp; /cdr2/app/oracle/product/10gr2/network/admin/listener.ora<br />Listener Log File&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /cdr2/app/oracle/product/10gr2/network/log/listener.log<br />Listening Endpoints Summary...<br />&nbsp; (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))<br />&nbsp; (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=cdr2)(PORT=1521)))<br />Services Summary...<br />Service "PLSExtProc" has 1 instance(s).<br />&nbsp; Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...<br />Service "ocstest" has 1 instance(s).<br />&nbsp; Instance "ocstest", status UNKNOWN, has 1 handler(s) for this service...<br />Service "test62" has 1 instance(s).<br />&nbsp; Instance "test62", status UNKNOWN, has 1 handler(s) for this service...<br />The command completed successfully<br />-bash-3.00$ id<br />uid=205(oracle) gid=203(oinstall) groups=204(dba)<br />-bash-3.00$ lsnrctl status</p>
<p>LSNRCTL for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production on 27-AUG-2012 15:58:31</p>
<p>Copyright (c) 1991, 2005, Oracle.&nbsp; All rights reserved.</p>
<p>Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))<br />STATUS of the LISTENER<br />------------------------<br />Alias&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LISTENER<br />Version&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TNSLSNR for IBM/AIX RISC System/6000: Version 10.2.0.1.0 - Production<br />Start Date&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 27-AUG-2012 15:57:27<br />Uptime&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0 days 0 hr. 1 min. 5 sec<br />Trace Level&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; off<br />Security&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ON: Local OS Authentication<br />SNMP&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ON<br />Listener Parameter File&nbsp;&nbsp; /cdr2/app/oracle/product/10gr2/network/admin/listener.ora<br />Listener Log File&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /cdr2/app/oracle/product/10gr2/network/log/listener.log<br />Listening Endpoints Summary...<br />&nbsp; (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))<br />&nbsp; (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=cdr2)(PORT=1521)))<br />Services Summary...<br />Service "PLSExtProc" has 1 instance(s).<br />&nbsp; Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...<br />Service "ocstest" has 1 instance(s).<br />&nbsp; Instance "ocstest", status UNKNOWN, has 1 handler(s) for this service...<br />Service "test62" has 1 instance(s).<br />&nbsp; Instance "test62", status UNKNOWN, has 1 handler(s) for this service...<br />The command completed successfully<br />-bash-3.00$ sqlplus /nolog</p>
<p>SQL*Plus: Release 10.2.0.1.0 - Production on Mon Aug 27 15:59:00 2012</p>
<p>Copyright (c) 1982, 2005, Oracle.&nbsp; All rights reserved.</p>
<p>SQL&gt; connect /as sysdba<br />Connected to an idle instance.<br />SQL&gt; startup<br />ORACLE instance started.</p>
<p>Total System Global Area 1610612736 bytes<br />Fixed Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2021224 bytes<br />Variable Size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 318769304 bytes<br />Database Buffers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1275068416 bytes<br />Redo Buffers&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 14753792 bytes<br />Database mounted.<br />Database opened.<br />SQL&gt; quit<br />Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit Production<br />With the Partitioning, OLAP and Data Mining options<br />-bash-3.00$ env|grep ORACLE<br />ORACLE_SID=ocstest<br />ORACLE_BASE=/cdr2/app/oracle<br />ORACLE_HOME=/cdr2/app/oracle/product/10gr2<br />-bash-3.00$ sqlplus /nolog</p>
<p>SQL*Plus: Release 10.2.0.1.0 - Production on Mon Aug 27 16:00:36 2012</p>
<p>Copyright (c) 1982, 2005, Oracle.&nbsp; All rights reserved.</p>
<p>SQL&gt; connect /as sysdba<br />Connected.<br />SQL&gt; select username from dba_users;</p><img src ="http://www.cppblog.com/blueskiner/aggbug/188428.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/blueskiner/" target="_blank">卡洛shll</a> 2012-08-27 16:07 <a href="http://www.cppblog.com/blueskiner/archive/2012/08/27/188428.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>undefined reference boost::system::get_system_category</title><link>http://www.cppblog.com/blueskiner/archive/2012/08/05/186377.html</link><dc:creator>卡洛shll</dc:creator><author>卡洛shll</author><pubDate>Sun, 05 Aug 2012 11:47:00 GMT</pubDate><guid>http://www.cppblog.com/blueskiner/archive/2012/08/05/186377.html</guid><wfw:comment>http://www.cppblog.com/blueskiner/comments/186377.html</wfw:comment><comments>http://www.cppblog.com/blueskiner/archive/2012/08/05/186377.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/blueskiner/comments/commentRss/186377.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/blueskiner/services/trackbacks/186377.html</trackback:ping><description><![CDATA[<p>这个问题是在从1.82升级到2.0的时候出的连接问题，自己用了很长时间才解决掉，总算解决了，分享下原因吧。主要是因为从官网上下载的C++ Mongo驱动有问题。必须自己编译，可以通过命令查看：<br /></p>
<p>&nbsp;</p>
<div class="dp-highlighter" sizset="66" sizcache06808750399006669="3">
<div class="bar" sizset="66" sizcache06808750399006669="3">
<div class="tools" sizset="66" sizcache06808750399006669="3"><a href="http://my.oschina.net/chen106106/blog/51093#"><u><font color="#4466bb">源码</font></u></a><a href="http://my.oschina.net/chen106106/blog/51093#"><u><font color="#4466bb">copy to clipboard</font></u></a><a href="http://my.oschina.net/chen106106/blog/51093#"><u><font color="#4466bb">打印</font></u></a><a href="http://my.oschina.net/chen106106/blog/51093#"><u><font color="#4466bb">？</font></u></a></div></div>
<ol class="dp-cpp"><li class="alt"><span>&gt;&gt;nm&nbsp;libmongoclient.a&nbsp;|&nbsp;grep&nbsp;get_system_category&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;</span></li><li><span>U&nbsp;_ZN5boost6system19get_system_categoryEv &nbsp;&nbsp;</span></li><li class="alt"><span>U&nbsp;_ZN5boost6system19get_system_categoryEv &nbsp;&nbsp;</span></li><li><span>U&nbsp;_ZN5boost6system19get_system_categoryEv &nbsp;&nbsp;</span></li><li class="alt"><span>U&nbsp;_ZN5boost6system19get_system_categoryEv &nbsp;&nbsp;</span></li><li><span>U&nbsp;_ZN5boost6system19get_system_categoryE&nbsp;&nbsp;</span></li></ol></div><pre style="display: none" class="cpp" readonly="" name="code">&gt;&gt;nm libmongoclient.a | grep get_system_category                                                                              
U _ZN5boost6system19get_system_categoryEv
U _ZN5boost6system19get_system_categoryEv
U _ZN5boost6system19get_system_categoryEv
U _ZN5boost6system19get_system_categoryEv
U _ZN5boost6system19get_system_categoryE</pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>会发现这个在boost库中根本就没有这个函数。可能官网提供的lib编译参数不一样。 只能自己编译了。 另外如果boost还有其它问题，你需要。</p>1.删除boost /usr/include/ 和/usr/lib/下的 所有关于boost的文件 还有系统自带的 一般在 /usr/lib64 下 可以通过 locate boost | grep usr 来查找 <br />
<p>2.重新安装boost:<br /></p>
<p>&nbsp;</p>
<div class="dp-highlighter" sizset="70" sizcache06808750399006669="3">
<div class="bar" sizset="70" sizcache06808750399006669="3">
<div class="tools" sizset="70" sizcache06808750399006669="3"><a href="http://my.oschina.net/chen106106/blog/51093#"><u><font color="#4466bb">源码</font></u></a><a href="http://my.oschina.net/chen106106/blog/51093#"><u><font color="#4466bb">copy to clipboard</font></u></a><a href="http://my.oschina.net/chen106106/blog/51093#"><u><font color="#4466bb">打印</font></u></a><a href="http://my.oschina.net/chen106106/blog/51093#"><u><font color="#4466bb">？</font></u></a></div></div>
<ol class="dp-cpp"><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;./bootstrap.sh &nbsp;&nbsp;</span></li><li><span>&nbsp;&nbsp;&nbsp;&nbsp;./bjam&nbsp;install&nbsp; &nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;默认会安装到/usr/local&nbsp;下&nbsp;&nbsp;</span></li></ol></div><pre style="display: none" class="cpp" readonly="" name="code">    ./bootstrap.sh
    ./bjam install 
&nbsp;  &nbsp;默认会安装到/usr/local 下
</pre><br /><img src ="http://www.cppblog.com/blueskiner/aggbug/186377.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/blueskiner/" target="_blank">卡洛shll</a> 2012-08-05 19:47 <a href="http://www.cppblog.com/blueskiner/archive/2012/08/05/186377.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>