﻿<?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>BlogJava-光子CI之旅-随笔分类-数据库</title><link>http://www.blogjava.net/kuuyee/category/40997.html</link><description>while (产品+需求+设计+开发+测试+部署+发布 == doing) 
{ 
  CI 
}</description><language>zh-cn</language><lastBuildDate>Wed, 05 Jun 2013 12:02:12 GMT</lastBuildDate><pubDate>Wed, 05 Jun 2013 12:02:12 GMT</pubDate><ttl>60</ttl><item><title>Linux下的ORACLE安装，成功率99.99999%</title><link>http://www.blogjava.net/kuuyee/archive/2013/05/24/399719.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Fri, 24 May 2013 04:27:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2013/05/24/399719.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/399719.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2013/05/24/399719.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/399719.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/399719.html</trackback:ping><description><![CDATA[<div style="float: left; min-height: 1px; margin-left: 30px; width: 870px; color: #4e443c; font-family: adelle, Georgia, 'Times New Roman', serif; line-height: 20px; background-color: #f0efe7;"><div style="background-color: #fcfcfa; border: 1px solid #e2e0d8; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; padding: 22px; margin-bottom: 35px;"><h2><span style="font-size: 14px;">相信很多童鞋都有过在Linux上安装Oracle数据库的痛苦经历，其中绝大多数都是环境设置的问题。我给大家推荐一个国外大牛写的Oracle的安装脚本&nbsp;</span><a href="http://sourceforge.net/projects/oratoolkit/?source=navbar" style="font-size: 14px; color: #0088cc; text-decoration: none;">OTK</a><span style="font-size: 14px;">，是用Bash写的，这东东大大简化了Oracle安装过程，而且成功率达到99.9999%以上，只要确保你的Linux系统是干净的，那么按照这个教程，保证你会安装成功。</span></h2><div><h4>准备工作</h4><div><p style="margin: 0px 0px 10px;">OTK针对各种Linux提供了&nbsp;<a href="https://www.oratoolkit.ch/knowledge/" style="color: #0088cc; text-decoration: none;">安装文档</a>，本文使用的RHEL5.5_x86_64位，数据库版本为11gR2，主要参考这个&nbsp;<a href="https://www.oratoolkit.ch/knowledge/howto/installation/eeSrv-11g-R2-on-RHEL-5.5-x86_64.php" style="color: #0088cc; text-decoration: none;">文档</a>。</p></div><div><p style="margin: 0px 0px 10px;">首先准备阿好如下的安装文件：</p></div><div><ul style="padding: 0px; margin: 0px 0px 10px 25px;"><li><p style="margin: 0px 0px 10px;"><a href="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-linx8664soft-100572.html" style="color: #0088cc; text-decoration: none;">linux.x64_11gR2_database_1of2.zip</a></p></li><li><p style="margin: 0px 0px 10px;"><a href="http://www.oracle.com/technetwork/database/enterprise-edition/downloads/112010-linx8664soft-100572.html" style="color: #0088cc; text-decoration: none;">linux.x64_11gR2_database_2of2.zip</a></p></li><li><p style="margin: 0px 0px 10px;"><a href="https://www.oratoolkit.ch/redirect.php?url=http://sourceforge.net/projects/oratoolkit/files/" style="color: #0088cc; text-decoration: none;">oratoolkit-1.0.2.1.5-1.noarch.rpm</a></p></li></ul></div><div><p style="margin: 0px 0px 10px;">下载上述文件并放在<tt>/var/tmp/oracle</tt>目录下。最好要把你的YUM源指向你的系统安装光盘或者ISO文件。</p></div></div><div><h4>安装OTK</h4><div><p style="margin: 0px 0px 10px;">用root登陆，执行如下命令：</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;"># su - root <br /># cd /var/tmp/oracle <br /># ls -1 oratool* <br />oratoolkit-1.0.2.1.5-1.noarch.rpm <br /># rpm -ivh oratoolkit-1.0.2.1.5-1.noarch.rpm <br />Preparing...                ########################################### [100%]<br />    1:oratoolkit             ########################################### [100%]</code></pre></div></div><div><p style="margin: 0px 0px 10px;">otk已经帮我们建立了oracle用户，下面需要设置Oracle用户密码</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;"># passwd oracle <br />Changing password for user oracle. <br />New UNIX password: <br />BAD PASSWORD: it is based on a dictionary word <br />Retype new UNIX password: <br />passwd: all authentication tokens updated successfully.</code></pre></div></div></div><div><h4>解决环境依赖</h4><div><p style="margin: 0px 0px 10px;">这一步最爽，最为头疼的环境依赖问题轻松就解决了！首先要验证下你的系统还差什么没有满足要求，OTK脚本提供了智能的环境是否满足检查:</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;"># /opt/oracle/otk/current/bin/installManager swReqCheck osSetup11gR2.cfg <br />...//省略大部分输出 <br />20130521_165122: Info: Action swReqCheck of installManager ended with 7 WARNINGS</code></pre></div></div><div><p style="margin: 0px 0px 10px;">最后的结论告诉你的系统共有几个警告（我的系统是7个），你可以在输出日志中查看到底缺了什么。下面的一组命令很酷，让你一下子解决所有的问题:</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">//先拼装命令 <br /># REQ_FILE_DIR="/opt/oracle/otk/current/conf/installManager/requirement" <br /># REQ_FILE_PATH="$REQ_FILE_DIR/ora11gR2-redhat-5-x86_64.pkg.lst" <br /># YUM_COMMAND=$(echo "yum install") <br /># YUM_COMMAND+=$(egrep -v "#" $REQ_FILE_PATH | grep 32-bit | awk '{ print " "$1".i[356]86" }') <br /># YUM_COMMAND+=$(egrep -v "#" $REQ_FILE_PATH | grep 64-bit | awk '{ print " "$1".x86_64" }')  <br /><br />//用echo看看最终拼装的命令是什么样 <br /># echo $YUM_COMMAND  <br /><br />//执行命令 <br /># $YUM_COMMAND  <br /><br />//再次执行环境检查 <br /># /opt/oracle/otk/current/bin/installManager swReqCheck osSetup11gR2.cfg <br />... <br />20130521_170131: Info: Action swReqCheck of installManager ended successfully //这次验证成功了，环境已经满足Oracle安装要求</code></pre></div></div></div><div><h4>增强sqlplus</h4><div><p style="margin: 0px 0px 10px;">OTK提供了一个优化增强的sqlplus环境：</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;"># cd /opt/oracle/otk/current/tools/rlwrap/ <br /># ./configure <br /># make <br /># make install <br /># /usr/local/bin/rlwrap -v <br />rlwrap 0.30</code></pre></div></div></div><div><h4>使用installManager提取安装</h4><div><p style="margin: 0px 0px 10px;">切换到<tt>/opt/oracle/otk/current/conf/installManager</tt>目录，编辑<tt>osSetup11gR2.cfg</tt>来配置安装参数，包括内核参数、目录创建及所有授权等设置，如果你想默认安装就无需更改这个文件。</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;"># cd /opt/oracle/otk/current/conf/installManager/ <br /># vi osSetup11gR2.cfg <br /># sdiff -s osSetup11gR2.cfg sample/osSetup11gR2.cfg //对比哪些参数修改过 <br /># /opt/oracle/otk/current/bin/installManager osSetup osSetup11gR2.cfg</code></pre></div></div></div><div><h4>把Oracle安装文件移入资源目录</h4><div><p style="margin: 0px 0px 10px;">otk默认读取oracle安装文件的目录是<tt>/var/opt/oracle/repository</tt>，otk的<strong>swInst</strong>实例安装命令会读取这个目录：</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;"># cd /var/tmp/oracle <br /># chown oracle:oinstall * <br /># mv linux.x64_11gR2_database_1of2.zip linux.x64_11gR2_database_2of2.zip /var/opt/oracle/repository/</code></pre></div></div></div><div><h4>定制oracle用户登录的PS1变量</h4><div><p style="margin: 0px 0px 10px;">这一步没什么实际意义，就是定制Oracle用户登录的提示符。</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;"># su - oracle<br /> ------------------------------------------------------  <br /> oraToolKit environment variables<br /> ------------------------------------------------------  <br /> Installation directory :   /opt/oracle/otk  <br /> Release                :   1.0.2.1.5  <br /> $RUN directory         :   /opt/oracle/otk/1.0/bin  <br /> $LOG_BASE directory    :   /var/opt/oracle/otk/1.0/log  <br /> ------------------------------------------------------  <br />&lt;SITE|COMPANY&gt;:oracle@stquist1p:sidNotSet$ grep ^SITE .profile.custom.interactive <br />SITE="&lt;SITE|COMPANY&gt;" <br />&lt;SITE|COMPANY&gt;:oracle@stquist1p:sidNotSet$ vi .profile.custom.interactive <br />&lt;SITE|COMPANY&gt;:oracle@stquist1p:sidNotSet$ grep ^SITE .profile.custom.interactive <br />SITE="KuuYee"//修改这一行，可以显示你喜欢的内容 <br />&lt;SITE|COMPANY&gt;:oracle@stquist1p:sidNotSet$ exit <br /># su - oracle <br />KuuYee:oracle@stquist1p:sidNotSet$</code></pre></div></div></div><div><h4>安装Oracle数据库</h4><div><p style="margin: 0px 0px 10px;">OTK没有采用Oracle Universal Installer(<strong>OUI</strong>)，而是用<strong>swInst</strong>来控制整个安装过程的：</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">$ bash <br />$ cd $INSTALL_CONF <br />$ cp sample/swInstEeSrv11gR2-Step1-linux-x86_64.cfg . <br />$ installManager swInst swInstEeSrv11gR2-Step1-linux-x86_64.cfg <br />$ su - <br /># /opt/oracle/eesrv/11.2.0/db1/root.sh<br /># exit</code></pre></div></div></div><div><h4>创建数据库实例</h4><div><p style="margin: 0px 0px 10px;">OTK采用<strong>dbSetup</strong>来创建实例，首先要进入<tt>$INSTALL_CONF</tt>目录配置实例参数</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">$ cd $INSTALL_CONF <br />$ ls -1 dbSetup*.cfg <br />dbSetup-dev.cfg <br />dbSetup-prod.cfg <br />dbSetup-test.cfg <br />$ vi dbSetup-prod.cfg //prod为生产模式 <br />$ sdiff -s dbSetup-prod.cfg sample/dbSetup-prod.cfg <br />DB_NAME="idm_test"                                            | DB_NAME="prod" <br />ORACLE_HOME="$ORACLE_BASE/eesrv/11.2.0/db1"                   | ORACLE_HOME="$ORACLE_BASE/sesrv/11.1.0/db1" <br />NLS_LANG=".AL32UTF8"                                          | NLS_LANG=".UTF8" <br />SYSTEM_SIZE=1G                                                | SYSTEM_SIZE=512M <br />TEMP_SIZE=2G                                                  | TEMP_SIZE=512M <br />UNDO_SIZE=2G                                                  | UNDO_SIZE=512M <br />USERS_SIZE=100M                                               | USERS_SIZE=10M <br />LISTENER_PORT="1541"                                          | LISTENER_PORT="1531" <br />MEMORY_TARGET=7G                                              | MEMORY_TARGET=512M <br />MEMORY_MAX_TARGET=7G                                          | MEMORY_MAX_TARGET=512M <br />SGA_TARGET=3G                                                 | SGA_TARGET=256M <br />PROCESSES=1000                                                | PROCESSES=100 <br />$ installManager dbSetup dbSetup-prod.cfg //执行这部之前最好先配置下/etc/hosts文件，看下面说明</code></pre></div></div><div><p style="margin: 0px 0px 10px;">本文采用<tt>dbSetup-prod.cfg</tt>生产环境模式配置，我们看到还有dev(开发环境)和test(测试环境)，不过我没试过，有兴趣的童鞋可以试试。我在上面列出了我所作出的配置，原文并没有修改内存参数，我之所以修改是因为实际环境因为内存设置太小导致运行一段时间数据库经常挂掉，经过多次的调试而得到的经验值，这里需要说明下我的数据库配置：<br /><strong>OS</strong>：VMware虚拟机(RHEL5.5)<br /><strong>CPU</strong>：8核<br /><strong>内存</strong>：32G<br /><strong>硬盘</strong>：200GB<br />上面用<tt>sdiff -s dbSetup-prod.cfg sample/dbSetup-prod.cfg</tt>命令可以对比下我的参数修改，左面是我的修改参数，右面是原参数,需要特别说明的是第二个参数<tt>ORACLE_HOME</tt>，一定要自修修改，原来的参数是<tt>$ORACLE_BASE/sesrv/11.1.0/db1</tt>，要修改为$ORACLE_BASE/<strong>eesrv/11.2.0</strong>/db1，别改错了！</p></div><div><p style="margin: 0px 0px 10px;"><tt>installManager dbSetup dbSetup-prod.cfg</tt>命令开始安装数据库实例，不过我建议你最好先配置下你的<tt>/etc/hosts</tt>文件，加入下面的内容：</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">127.0.0.1    你的hostname</code></pre></div></div><div><p style="margin: 0px 0px 10px;">接下来就是漫长的等待，大概需要几十分钟，具体根据你的机器配置情况。如果你最后看到如下的输出：</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">---------------------------------------------------------------------------------------------------- <br />20130522_091856: Info: Executing libmiscellaneous.getFooter function <br />20130522_091856: Info: Terminating installManager execution <br />20130522_091856: Info: Summary log file:  /var/opt/oracle/otk/1.0/log-old/installManager/../installManager.log <br />20130522_091856: Info: Detailed log file: /var/opt/oracle/otk/1.0/log-old/installManager/dbsetup-20130522_090349.log <br />20130522_091856: Info: Action dbSetup of installManager ended successfully <br />----------------------------------------------------------------------------------------------------</code></pre></div></div><div><p style="margin: 0px 0px 10px;"><strong>Congratulations！</strong>你安装成功了。</p></div><div><p style="margin: 0px 0px 10px;">下面登陆试试：</p></div><div style="padding-left: 15px; margin: 0px 0px 20px; border-left-width: 5px; border-left-style: solid; border-left-color: #eeeeee;"><table style="max-width: 100%; background-color: transparent; border-collapse: collapse; border-spacing: 0px;"><tbody><tr><td><div>Note</div></td><td>OTK默认创建了一个<strong>otk</strong>用户，密码也是<strong>otk</strong>，&nbsp;<strong>sys</strong>和<strong>system</strong>默认密码是<strong>manager</strong></td></tr></tbody></table></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">$ bash <br />$ sourceProdEnv <br />$ sqlplus sys/manager@idm_dev as sysdba; <br />或者 <br />$ sqlplus otk/otk@idm_dev  <br /><br />SQL*Plus: Release 11.2.0.1.0 Production on Wed May 22 11:05:16 2013  <br /><br />Copyright (c) 1982, 2009, Oracle.  All rights reserved.   <br /><br /><br />Connected to: <br />Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production <br />With the Partitioning, OLAP, Data Mining and Real Application Testing options  <br /><br />SQL&gt;</code></pre></div></div></div><div><h3>使用appctl管理oracle</h3><div><p style="margin: 0px 0px 10px;">OTK提供了一个ctl工具来帮我们管理Oracle实例：</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">$ ctl status all //查看当前状态 <br />$ ctl stop all   //停止数据库 <br />$ ctl start all  //启动数据库</code></pre></div></div></div><div><h3>使用backupuManager备份oracle</h3><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">$ cd $BACKUP_CONF <br />$ vi prod.cfg <br />$ sdiff -s prod.cfg sample/prod.cfg DISK_DEVICE_MOUNT_POINT="/" | DISK_DEVICE_MOUNT_POINT="/backup01" <br />$ backupManager full prod.cfg</code></pre></div></div><div><p style="margin: 0px 0px 10px;">定时备份Job</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">$ crontab -l|head -2 <br /># Example 1: Daily physical database backup <br /># 0 2 * * * [ -d $HOME/../current ] &amp;&amp; (ksh -c '. ./.profile &gt;/dev/null; backupManager full &lt;sid_1&gt;.cfg &lt;sid_2&gt;.cfg &lt;sid_n&gt;.cfg &gt;/dev/null') <br />$ crontab -e <br />$ crontab -l|head -2 <br /># Example 1: Daily physical database backup <br />0 2 * * * [ -d $HOME/../current ] &amp;&amp; (ksh -c '. ./.profile &gt;/dev/null; backupManager full prod.cfg &gt;/dev/null')</code></pre></div></div><div><h4>创建EM管理控制台</h4><div><p style="margin: 0px 0px 10px;">otk并没有帮我们创建EM控制台，对于习惯用Web管理的用户很不方便，我们需要手工创建：</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">$ emca -config dbcontrol db -repos recreate  <br /><br />STARTED EMCA at May 22, 2013 11:18:41 AM <br />EM Configuration Assistant, Version 11.2.0.0.2 Production <br />Copyright (c) 2003, 2005, Oracle.  All rights reserved.  Enter the following information: <br />Database SID: idm_dev //输入sid <br />Listener port number: 1541 //监听输入端口 <br />Listener ORACLE_HOME [ /opt/oracle/eesrv/11.2.0/db1 ]: //默认回车 <br />Password for SYS user:  //输入密码manager <br />Password for DBSNMP user:  //输入密码manager <br />Password for SYSMAN user:  //输入密码manager <br />Email address for notifications (optional): //默认回车 <br />Outgoing Mail (SMTP) server for notifications (optional): //默认回车 <br />-----------------------------------------------------------------  <br /><br />You have specified the following settings  <br /><br />Database ORACLE_HOME ................ /opt/oracle/eesrv/11.2.0/db1  <br /><br />Local hostname ................ localhost.localdomain <br />Listener ORACLE_HOME ................ /opt/oracle/eesrv/11.2.0/db1 <br />Listener port number ................ 1541 <br />Database SID ................ idm_dev <br />Email address for notifications ............... <br />Outgoing Mail (SMTP) server for notifications ...............  <br /><br />----------------------------------------------------------------- <br />Do you wish to continue? [yes(Y)/no(N)]: yes <br />May 22, 2013 11:19:20 AM oracle.sysman.emcp.EMConfig perform <br />INFO: This operation is being logged at /opt/oracle/cfgtoollogs/emca/idm_dev/emca_2013_05_22_11_18_40.log. <br />May 22, 2013 11:19:21 AM oracle.sysman.emcp.EMReposConfig invoke <br />INFO: Dropping the EM repository (this may take a while) ... <br />May 22, 2013 11:19:23 AM oracle.sysman.emcp.EMReposConfig invoke <br />INFO: Repository successfully dropped <br />May 22, 2013 11:19:23 AM oracle.sysman.emcp.EMReposConfig createRepository <br />INFO: Creating the EM repository (this may take a while) ... <br />May 22, 2013 11:24:27 AM oracle.sysman.emcp.EMReposConfig invoke <br />INFO: Repository successfully created <br />May 22, 2013 11:24:30 AM oracle.sysman.emcp.EMReposConfig uploadConfigDataToRepository <br />INFO: Uploading configuration data to EM repository (this may take a while) ... //可能会等一会 <br />May 22, 2013 11:25:19 AM oracle.sysman.emcp.EMReposConfig invoke <br />INFO: Uploaded configuration data successfully <br />May 22, 2013 11:25:23 AM oracle.sysman.emcp.util.DBControlUtil configureSoftwareLib <br />INFO: Software library configured successfully. <br />May 22, 2013 11:25:23 AM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary <br />INFO: Deploying Provisioning archives ... <br />May 22, 2013 11:25:45 AM oracle.sysman.emcp.EMDBPostConfig configureSoftwareLibrary <br />INFO: Provisioning archives deployed successfully. <br />May 22, 2013 11:25:45 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole <br />INFO: Securing Database Control (this may take a while) ... <br />May 22, 2013 11:25:58 AM oracle.sysman.emcp.util.DBControlUtil secureDBConsole <br />INFO: Database Control secured successfully. <br />May 22, 2013 11:25:58 AM oracle.sysman.emcp.util.DBControlUtil startOMS <br />INFO: Starting Database Control (this may take a while) ... <br />May 22, 2013 11:26:28 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration <br />INFO: Database Control started successfully <br />May 22, 2013 11:26:28 AM oracle.sysman.emcp.EMDBPostConfig performConfiguration <br />INFO: &gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt;&gt; The Database Control URL is https://localhost.localdomain:1158/em &lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt;&lt; //这个是EM的访问链接 <br />May 22, 2013 11:26:31 AM oracle.sysman.emcp.EMDBPostConfig invoke <br />WARNING: <br />************************  WARNING  ************************  <br /><br />Management Repository has been placed in secure mode wherein Enterprise Manager data will be encrypted.  The encryption key has been placed in the file: /opt/oracle/eesrv/11.2.0/db1/localhost.localdomain_idm_dev/sysman/config/emkey.ora.   Please ensure this file is backed up as the encrypted data will become unusable if this file is lost.  <br /><br />*********************************************************** <br />Enterprise Manager configuration completed successfully <br />FINISHED EMCA at May 22, 2013 11:26:31 AM</code></pre></div></div><div><p style="margin: 0px 0px 10px;">OK！ 大功告成，相信各位童鞋都安装成功了，OTK的安装还是很稳健的，至少我安装了几十次都成功了！</p></div><div><p style="margin: 0px 0px 10px;">最后祝各位童鞋好运！</p></div></div></div><p style="margin: 0px 0px 10px;"></p><div>2013-05-21</div></div></div><img src ="http://www.blogjava.net/kuuyee/aggbug/399719.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2013-05-24 12:27 <a href="http://www.blogjava.net/kuuyee/archive/2013/05/24/399719.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ORACLE数据库ORA-00257解决</title><link>http://www.blogjava.net/kuuyee/archive/2013/05/15/399287.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Wed, 15 May 2013 02:13:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2013/05/15/399287.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/399287.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2013/05/15/399287.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/399287.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/399287.html</trackback:ping><description><![CDATA[<div style="width: 1170px; margin-right: auto; margin-left: auto; color: #4e443c; font-family: adelle, Georgia, 'Times New Roman', serif; line-height: 20px;"><div style="margin-left: -30px;"><div style="float: left; min-height: 1px; margin-left: 30px; width: 870px;"><div style="background-color: #fcfcfa; border: 1px solid #e2e0d8; border-top-left-radius: 5px; border-top-right-radius: 5px; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; padding: 22px; margin-bottom: 35px;"><h2><span style="font-size: 14px;">今天数据库突然连不上了，报ORA-00257错误（空间不足错误），通过查找资料，绝大部分说这是由于Archivelog归档日志太多，占用了全部的硬盘剩余空间导致的，通过简单删除日志或加大存储空间就能够解决。</span></h2><div><p style="margin: 0px 0px 10px;">首先进入oracle用户，使用<strong>rman</strong>工具执行命令<strong>rman target/</strong>：</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">oracle@test-idm-db01$ rman target/  <br /><br />Recovery Manager: Release 11.2.0.1.0 - Production on Wed May 15 09:29:06 2013  <br /><br />Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.  <br />RMAN-00571: =========================================================== <br />RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS =============== <br />RMAN-00571: =========================================================== <br />RMAN-00554: initialization of internal recovery manager package failed <br />RMAN-04005: error from target database: <br />ORA-01031: insufficient privileges</code></pre></div></div><div><p style="margin: 0px 0px 10px;">竟然报错了，如果你的空间100%一点剩余都没有，那么就会报这个错，只能想办法让你的系统腾出一点空间，哪怕几百兆！然后重启数据库应该就可以登陆dba了。</p></div><div><p style="margin: 0px 0px 10px;">重启数据库，再次<strong>rman</strong></p></div><div><div monospaced"=""><pre style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);">oracle@test-idm-db01$ rman target/  <br /><br />Recovery Manager: Release 11.2.0.1.0 - Production on Wed May 15 09:29:40 2013  <br /><br />Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.  <br /><br />connected to target database: IDM_TEST (DBID=4064060693)</pre></div></div><div><p style="margin: 0px 0px 10px;">现在删除Archivelog归档文件，执行下面的命令来删除最近7天的归档：</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">RMAN&gt; DELETE ARCHIVELOG FROM TIME 'SYSDATE-7';</code></pre></div></div><div><p style="margin: 0px 0px 10px;">也可以只保留最近7天的，其余的都删除：</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">RMAN&gt; DELETE ARCHIVELOG ALL COMPLETED BEFORE 'SYSDATE-7';</code></pre></div></div><div><p style="margin: 0px 0px 10px;">但是过一段时间你的日志还是回满，对于开发环境这样的归档功能其实没什么必要，彻底解决办法是关闭这个功能，用dba登陆oracle：</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">sqlplus / as sysdba;</code></pre></div></div><div><p style="margin: 0px 0px 10px;">然后执行下面的命令：</p></div><div><div monospaced"=""><pre coderay"="" style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">SQL&gt; <span style="color: #bb0066; font-weight: bold;">alter</span> <span style="color: #333399; font-weight: bold;">database</span> flashback off;</code></pre></div></div><div><p style="margin: 0px 0px 10px;">然后重启数据库就OK了！</p></div><p style="margin: 0px 0px 10px;"></p><div>2013-05-15</div></div></div></div></div><footer style="text-align: center; padding: 20px 0px; margin-top: 20px; border-top-width: 1px; border-top-style: solid; border-top-color: #e5e5e5; background-color: #f5f5f5; color: #4e443c; font-family: adelle, Georgia, 'Times New Roman', serif; line-height: 20px;"><div style="width: 1170px; margin-right: auto; margin-left: auto;"></div></footer><img src ="http://www.blogjava.net/kuuyee/aggbug/399287.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2013-05-15 10:13 <a href="http://www.blogjava.net/kuuyee/archive/2013/05/15/399287.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>在RHEL5.5上安装PostgreSql92</title><link>http://www.blogjava.net/kuuyee/archive/2013/04/09/397587.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Tue, 09 Apr 2013 07:55:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2013/04/09/397587.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/397587.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2013/04/09/397587.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/397587.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/397587.html</trackback:ping><description><![CDATA[<p style="margin: 0px 0px 10px; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 20px; background-color: #ffffff;">RHEL5.5默认的源里没有postgresql9的包，需要下载源。下载地址 ：<a href="http://yum.postgresql.org/9.2/redhat/rhel-5-x86_64/pgdg-redhat92-9.2-7.noarch.rpm" style="color: #0088cc; text-decoration: none;">http://yum.postgresql.org/9.2/redhat/rhel-5-x86_64/pgdg-redhat92-9.2-7.noarch.rpm</a></p><p style="margin: 0px 0px 10px; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 20px; background-color: #ffffff;">然后安装源</p><pre style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; line-height: 20px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">rpm -ivh pgdg-redhat92-9.2-7.noarch.rpm </code></pre><p style="margin: 0px 0px 10px; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 20px; background-color: #ffffff;">最后安装postgresql92</p><pre style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; line-height: 20px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">yum install postgresql92 postgresql92-server postgresql92-devel </code></pre><p style="margin: 0px 0px 10px; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 20px; background-color: #ffffff;">初始化数据库</p><pre style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; line-height: 20px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">service postgresql-9.2 initdb Initializing database:                                     [  OK  ]</code></pre><p style="margin: 0px 0px 10px; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 20px; background-color: #ffffff;">启动数据库</p><pre style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; line-height: 20px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">/etc/init.d/postgresql-9.2 start Starting postgresql-9.2 service:                           [  OK  ]</code></pre><p style="margin: 0px 0px 10px; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 20px; background-color: #ffffff;">查看数据状态</p><pre style="padding: 9.5px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 13px; color: #333333; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; margin-top: 0px; margin-bottom: 10px; line-height: 20px; word-break: break-all; word-wrap: break-word; white-space: pre-wrap; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.14902);"><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; background-color: transparent; border: 0px;">netstat -nutlap | grep post tcp        0      0 127.0.0.1:5432              0.0.0.0:*                   LISTEN      21627/postmaster     udp        0      0 127.0.0.1:12823             127.0.0.1:12823             ESTABLISHED 21627/postmaster </code></pre><div><code style="padding: 0px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: inherit; border-top-left-radius: 3px; border-top-right-radius: 3px; border-bottom-right-radius: 3px; border-bottom-left-radius: 3px; border: 0px;"><br /></code></div><p style="margin: 0px 0px 10px; color: #333333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; line-height: 20px; background-color: #ffffff;"></p><img src ="http://www.blogjava.net/kuuyee/aggbug/397587.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2013-04-09 15:55 <a href="http://www.blogjava.net/kuuyee/archive/2013/04/09/397587.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>ORACLE 11g在Linux下手工配置EM</title><link>http://www.blogjava.net/kuuyee/archive/2012/04/05/373355.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Thu, 05 Apr 2012 03:08:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2012/04/05/373355.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/373355.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2012/04/05/373355.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/373355.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/373355.html</trackback:ping><description><![CDATA[<div id="content" style="font-family: 微软雅黑; line-height: normal; font-size: medium; "><div id="preamble" style="margin-top: 1.5em; margin-bottom: 1.5em; "><div style="font-family: Georgia, 'Times New Roman', Times, serif; margin-left: 0px; "><div><p style="margin-top: 0.5em; margin-bottom: 0.5em; ">使用OTK工具安装的Oracle默认没有配置EM，下面记录下配置和启动过程!</p></div><div><p style="margin-top: 0.5em; margin-bottom: 0.5em; ">首先创建EM，执行下面的命令</p></div><div style="margin-top: 1em; margin-bottom: 1.5em; "><div style="padding-top: 0.5em; padding-right: 0.5em; padding-bottom: 0.5em; padding-left: 0.5em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-top-color: #dddddd; border-right-color: #dddddd; border-bottom-color: #dddddd; border-image: initial; border-left-width: 5px; border-left-style: solid; border-left-color: #f0f0f0; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f8f8f8; background-position: initial initial; background-repeat: initial initial; "><pre style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-bottom: 0px; "><tt style="font-size: inherit; color: navy; ">$ emca -config dbcontrol db -repos recreate</tt></pre></div></div><div><p style="margin-top: 0.5em; margin-bottom: 0.5em; ">我第一次运行报如下错误：<br /></p><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->Mar&nbsp;<span style="color: #800000; font-weight: bold; ">31</span>,&nbsp;<span style="color: #800000; font-weight: bold; ">2012</span>&nbsp;<span style="color: #800000; font-weight: bold; ">4</span>:<span style="color: #800000; font-weight: bold; ">16</span>:<span style="color: #800000; font-weight: bold; ">06</span>&nbsp;PM&nbsp;oracle.sysman.emcp.EMReposConfig&nbsp;createRepository<br />CONFIG:&nbsp;ORA<span style="color: #808080; ">-</span><span style="color: #800000; font-weight: bold; ">00604</span>:&nbsp;error&nbsp;occurred&nbsp;at&nbsp;recursive&nbsp;SQL&nbsp;<span style="color: #0000FF; ">level</span>&nbsp;<span style="color: #800000; font-weight: bold; ">1</span><br />ORA<span style="color: #808080; ">-</span><span style="color: #800000; font-weight: bold; ">01653</span>:&nbsp;unable&nbsp;<span style="color: #0000FF; ">to</span>&nbsp;extend&nbsp;<span style="color: #0000FF; ">table</span>&nbsp;SYS.SOURCE$&nbsp;<span style="color: #0000FF; ">by</span>&nbsp;<span style="color: #800000; font-weight: bold; ">128</span>&nbsp;<span style="color: #808080; ">in</span>&nbsp;tablespace&nbsp;SYSTEM<br />oracle.sysman.assistants.util.sqlEngine.SQLFatalErrorException:&nbsp;ORA<span style="color: #808080; ">-</span><span style="color: #800000; font-weight: bold; ">00604</span>:&nbsp;error&nbsp;occurred&nbsp;at&nbsp;recursive&nbsp;SQL&nbsp;<span style="color: #0000FF; ">level</span>&nbsp;<span style="color: #800000; font-weight: bold; ">1</span><br />ORA<span style="color: #808080; ">-</span><span style="color: #800000; font-weight: bold; ">01653</span>:&nbsp;unable&nbsp;<span style="color: #0000FF; ">to</span>&nbsp;extend&nbsp;<span style="color: #0000FF; ">table</span>&nbsp;SYS.SOURCE$&nbsp;<span style="color: #0000FF; ">by</span>&nbsp;<span style="color: #800000; font-weight: bold; ">128</span>&nbsp;<span style="color: #808080; ">in</span>&nbsp;tablespace&nbsp;SYSTEM<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeImpl(SQLEngine.java:<span style="color: #800000; font-weight: bold; ">1650</span>)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;oracle.sysman.assistants.util.sqlEngine.SQLEngine.executeScript(SQLEngine.java:<span style="color: #800000; font-weight: bold; ">1000</span>)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java:<span style="color: #800000; font-weight: bold; ">339</span>)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;oracle.sysman.assistants.util.sqlEngine.SQLPlusEngine.executeScript(SQLPlusEngine.java:<span style="color: #800000; font-weight: bold; ">380</span>)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;oracle.sysman.emcp.EMReposConfig.createRepository(EMReposConfig.java:<span style="color: #800000; font-weight: bold; ">510</span>)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:<span style="color: #800000; font-weight: bold; ">228</span>)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;oracle.sysman.emcp.EMReposConfig.invoke(EMReposConfig.java:<span style="color: #800000; font-weight: bold; ">157</span>)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;oracle.sysman.emcp.EMConfig.perform(EMConfig.java:<span style="color: #800000; font-weight: bold; ">253</span>)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;oracle.sysman.emcp.EMConfigAssistant.invokeEMCA(EMConfigAssistant.java:<span style="color: #800000; font-weight: bold; ">589</span>)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;oracle.sysman.emcp.EMConfigAssistant.performConfiguration(EMConfigAssistant.java:<span style="color: #800000; font-weight: bold; ">1448</span>)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;oracle.sysman.emcp.EMConfigAssistant.statusMain(EMConfigAssistant.java:<span style="color: #800000; font-weight: bold; ">573</span>)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at&nbsp;oracle.sysman.emcp.EMConfigAssistant.main(EMConfigAssistant.java:<span style="color: #800000; font-weight: bold; ">521</span>)<br />Mar&nbsp;<span style="color: #800000; font-weight: bold; ">31</span>,&nbsp;<span style="color: #800000; font-weight: bold; ">2012</span>&nbsp;<span style="color: #800000; font-weight: bold; ">4</span>:<span style="color: #800000; font-weight: bold; ">16</span>:<span style="color: #800000; font-weight: bold; ">06</span>&nbsp;PM&nbsp;oracle.sysman.emcp.EMReposConfig&nbsp;invoke<br />SEVERE:&nbsp;Error&nbsp;creating&nbsp;the&nbsp;repository</div></div><div><p style="margin-top: 0.5em; margin-bottom: 0.5em; "><strong style="color: #083194; "><br />解决办法</strong></p></div><div><p style="margin-top: 0.5em; margin-bottom: 0.5em; ">使用SYS用户登录sqlplus，然后执行下面的语句：</p></div><div style="margin-top: 1em; margin-bottom: 1.5em; "><div style="padding-top: 0.5em; padding-right: 0.5em; padding-bottom: 0.5em; padding-left: 0.5em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-top-color: #dddddd; border-right-color: #dddddd; border-bottom-color: #dddddd; border-image: initial; border-left-width: 5px; border-left-style: solid; border-left-color: #f0f0f0; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f8f8f8; background-position: initial initial; background-repeat: initial initial; "><pre style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-bottom: 0px; "><tt style="font-size: inherit; color: navy; "> SQL<span style="color: #990000; ">&gt;</span> <span style="font-weight: bold; "><span style="color: #0000ff; ">SELECT</span></span> <span style="color: #990000; ">*</span> <span style="font-weight: bold; "><span style="color: #0000ff; ">FROM</span></span> DBA_DATA_FILES <span style="font-weight: bold; "><span style="color: #0000ff; ">where</span></span> TABLESPACE_NAME <span style="color: #990000; ">=</span> <span style="color: #ff0000; ">'SYSTEM'</span><span style="color: #990000; ">;</span> <br />FILE_NAME     FILE_ID TABLESPACE_NAME                    <br /> BYTES     BLOCKS <span style="font-weight: bold; "><span style="color: #0000ff; ">STATUS</span></span>  RELATIVE_FNO AUT   MAXBYTES  MAXBLOCKS INCREMENT_BY USER_BYTES USER_BLOCKS  <br />ONLINE_  <span style="color: #990000; ">/</span>data01<span style="color: #990000; ">/</span>rdbms<span style="color: #990000; ">/</span>wcdb<span style="color: #990000; ">/</span>datafile<span style="color: #990000; ">/</span>wcdb_system_01<span style="color: #990000; ">.</span>dbf          <span style="color: #993399; ">1</span> SYSTEM                          <span style="color: #993399; ">536870912</span>      <span style="color: #993399; ">65536</span> AVAILABLE           <br /> <span style="color: #993399; ">1</span> NO           <span style="color: #993399; ">0</span>          <span style="color: #993399; ">0</span>            <span style="color: #993399; ">0</span>  <span style="color: #993399; ">535822336</span>       <span style="color: #993399; ">65408</span> <br />SYSTEM</tt></pre></div></div><div><p style="margin-top: 0.5em; margin-bottom: 0.5em; ">然后新定义个空间文件wcdb_system_02.dbf，注意不要重名</p></div><div><p style="margin-top: 0.5em; margin-bottom: 0.5em; ">然后新定义个空间文件*wcdb_system_02.dbf*，注意不要重名</p></div><div style="margin-top: 1em; margin-bottom: 1.5em; "><div style="padding-top: 0.5em; padding-right: 0.5em; padding-bottom: 0.5em; padding-left: 0.5em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-top-color: #dddddd; border-right-color: #dddddd; border-bottom-color: #dddddd; border-image: initial; border-left-width: 5px; border-left-style: solid; border-left-color: #f0f0f0; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f8f8f8; background-position: initial initial; background-repeat: initial initial; "><pre style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-bottom: 0px; "><tt style="font-size: inherit; color: navy; ">SQL<span style="color: #990000; ">&gt;</span> <span style="font-weight: bold; "><span style="color: #0000ff; ">ALTER</span></span> TABLESPACE SYSTEM <span style="font-weight: bold; "><span style="color: #0000ff; ">ADD</span></span> DATAFILE <span style="color: #ff0000; ">'/data01/rdbms/wcdb/datafile/wcdb_system_02.dbf'</span> SIZE 500M<span style="color: #990000; ">;</span> Tablespace altered<span style="color: #990000; ">.</span></tt></pre></div></div><div><p style="margin-top: 0.5em; margin-bottom: 0.5em; ">然后再次执行EM创建成功！</p></div><div><p style="margin-top: 0.5em; margin-bottom: 0.5em; ">EM的访问地址：<a href="https://host:1158/em" style="color: fuchsia; ">https://localhost:1158/em</a></p></div><div><p style="margin-top: 0.5em; margin-bottom: 0.5em; "><strong style="color: #083194; ">删除一个EM资料库</strong></p></div><div style="margin-top: 1em; margin-bottom: 1.5em; "><div style="padding-top: 0.5em; padding-right: 0.5em; padding-bottom: 0.5em; padding-left: 0.5em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-top-color: #dddddd; border-right-color: #dddddd; border-bottom-color: #dddddd; border-image: initial; border-left-width: 5px; border-left-style: solid; border-left-color: #f0f0f0; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f8f8f8; background-position: initial initial; background-repeat: initial initial; "><pre style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-bottom: 0px; "><tt style="font-size: inherit; color: navy; ">$ emca <span style="color: #990000; ">-</span>repos <span style="font-weight: bold; "><span style="color: #0000ff; ">drop</span></span></tt></pre></div></div><div><p style="margin-top: 0.5em; margin-bottom: 0.5em; "><strong style="color: #083194; ">配置数据库的 Database Control</strong></p></div><div style="margin-top: 1em; margin-bottom: 1.5em; "><div style="padding-top: 0.5em; padding-right: 0.5em; padding-bottom: 0.5em; padding-left: 0.5em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-top-color: #dddddd; border-right-color: #dddddd; border-bottom-color: #dddddd; border-image: initial; border-left-width: 5px; border-left-style: solid; border-left-color: #f0f0f0; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f8f8f8; background-position: initial initial; background-repeat: initial initial; "><pre style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-bottom: 0px; "><tt style="font-size: inherit; color: navy; ">$ emca <span style="color: #990000; ">-</span>config dbcontrol db</tt></pre></div></div><div><p style="margin-top: 0.5em; margin-bottom: 0.5em; "><strong style="color: #083194; ">删除数据库的 Database Control配置</strong></p></div><div style="margin-top: 1em; margin-bottom: 1.5em; "><div style="padding-top: 0.5em; padding-right: 0.5em; padding-bottom: 0.5em; padding-left: 0.5em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-top-color: #dddddd; border-right-color: #dddddd; border-bottom-color: #dddddd; border-image: initial; border-left-width: 5px; border-left-style: solid; border-left-color: #f0f0f0; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f8f8f8; background-position: initial initial; background-repeat: initial initial; "><pre style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-bottom: 0px; "><tt style="font-size: inherit; color: navy; ">$ emca <span style="color: #990000; ">-</span>deconfig dbcontrol db</tt></pre></div></div><div><p style="margin-top: 0.5em; margin-bottom: 0.5em; "><strong style="color: #083194; ">重新配置db control的端口，默认端口在1158</strong></p></div><div style="margin-top: 1em; margin-bottom: 1.5em; "><div style="padding-top: 0.5em; padding-right: 0.5em; padding-bottom: 0.5em; padding-left: 0.5em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-top-color: #dddddd; border-right-color: #dddddd; border-bottom-color: #dddddd; border-image: initial; border-left-width: 5px; border-left-style: solid; border-left-color: #f0f0f0; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f8f8f8; background-position: initial initial; background-repeat: initial initial; "><pre style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-bottom: 0px; "><tt style="font-size: inherit; color: navy; ">$ emca <span style="color: #990000; ">-</span>reconfig ports $ emca <span style="color: #990000; ">-</span>reconfig ports <span style="color: #990000; ">-</span>dbcontrol_http_port <span style="color: #993399; ">1160</span> $ emca <span style="color: #990000; ">-</span>reconfig ports <span style="color: #990000; ">-</span>agent_port <span style="color: #993399; ">3940</span></tt></pre></div></div><div><p style="margin-top: 0.5em; margin-bottom: 0.5em; "><strong style="color: #083194; ">先设 置ORACLE_SID环境变量后,启动EM console服务</strong></p></div><div style="margin-top: 1em; margin-bottom: 1.5em; "><div style="padding-top: 0.5em; padding-right: 0.5em; padding-bottom: 0.5em; padding-left: 0.5em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-top-color: #dddddd; border-right-color: #dddddd; border-bottom-color: #dddddd; border-image: initial; border-left-width: 5px; border-left-style: solid; border-left-color: #f0f0f0; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f8f8f8; background-position: initial initial; background-repeat: initial initial; "><pre style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-bottom: 0px; "><tt style="font-size: inherit; color: navy; ">$ emctl start dbconsole</tt></pre></div></div><div><p style="margin-top: 0.5em; margin-bottom: 0.5em; "><strong style="color: #083194; ">先设置 ORACLE_SID环境变量后,停止EM console服务</strong></p></div><div style="margin-top: 1em; margin-bottom: 1.5em; "><div style="padding-top: 0.5em; padding-right: 0.5em; padding-bottom: 0.5em; padding-left: 0.5em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-top-color: #dddddd; border-right-color: #dddddd; border-bottom-color: #dddddd; border-image: initial; border-left-width: 5px; border-left-style: solid; border-left-color: #f0f0f0; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f8f8f8; background-position: initial initial; background-repeat: initial initial; "><pre style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-bottom: 0px; "><tt style="font-size: inherit; color: navy; ">$ emctl stop dbconsole</tt></pre></div></div><div><p style="margin-top: 0.5em; margin-bottom: 0.5em; "><strong style="color: #083194; ">先设置ORACLE_SID环 境变量后,查看EM console服务的状态</strong></p></div><div style="margin-top: 1em; margin-bottom: 1.5em; "><div style="padding-top: 0.5em; padding-right: 0.5em; padding-bottom: 0.5em; padding-left: 0.5em; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-top-color: #dddddd; border-right-color: #dddddd; border-bottom-color: #dddddd; border-image: initial; border-left-width: 5px; border-left-style: solid; border-left-color: #f0f0f0; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: #f8f8f8; background-position: initial initial; background-repeat: initial initial; "><pre style="padding-top: 0px; padding-right: 0px; padding-bottom: 0px; padding-left: 0px; margin-top: 0px; margin-bottom: 0px; "><tt style="font-size: inherit; color: navy; ">$ emctl <span style="font-weight: bold; "><span style="color: #0000ff; ">status</span></span> dbconsole</tt></pre></div></div></div></div></div><div id="footer" style="font-family: Arial, Helvetica, sans-serif; font-size: small; border-top-width: 2px; border-top-style: solid; border-top-color: silver; padding-top: 0.5em; margin-top: 4em; line-height: normal; "></div><img src ="http://www.blogjava.net/kuuyee/aggbug/373355.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2012-04-05 11:08 <a href="http://www.blogjava.net/kuuyee/archive/2012/04/05/373355.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>JBoss AS7配置MySQL数据源</title><link>http://www.blogjava.net/kuuyee/archive/2011/07/19/354598.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Tue, 19 Jul 2011 02:49:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2011/07/19/354598.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/354598.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2011/07/19/354598.html#Feedback</comments><slash:comments>4</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/354598.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/354598.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: AS7默​认​的​数​据​源​是​H2，虽​然​H2方​便​，但​是​一​般​的​生​产​环​境​都​是​MySQL、​ORACLE、​SQLServer居​多​，本​文​描​述​如​何​在​AS7配​置​MySQL数​据​源​。&nbsp;&nbsp;<a href='http://www.blogjava.net/kuuyee/archive/2011/07/19/354598.html'>阅读全文</a><img src ="http://www.blogjava.net/kuuyee/aggbug/354598.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2011-07-19 10:49 <a href="http://www.blogjava.net/kuuyee/archive/2011/07/19/354598.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>开启Mysql远程访问</title><link>http://www.blogjava.net/kuuyee/archive/2009/07/22/287842.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Wed, 22 Jul 2009 05:52:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2009/07/22/287842.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/287842.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2009/07/22/287842.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/287842.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/287842.html</trackback:ping><description><![CDATA[Mysql默认是不可以通过远程机器访问的,通过下面的配置可以开启远程访问.<br />
我的Mysql环境是ubuntu+mysql5<br />
1.修改/etc/mysql/my.conf,修改bind-address,指定为本机实际IP地址,你的my.con修改完大概是如下的样子<br />
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #000000;">[mysqld]<br />
</span><span style="color: #008000;">#</span><span style="color: #008000;"><br />
#&nbsp;*&nbsp;Basic&nbsp;Settings<br />
#</span><span style="color: #008000;"><br />
</span><span style="color: #000000;">default</span><span style="color: #000000;">-</span><span style="color: #000000;">character</span><span style="color: #000000;">-</span><span style="color: #000000;">set</span><span style="color: #000000;">=</span><span style="color: #000000;">utf8<br />
default</span><span style="color: #000000;">-</span><span style="color: #000000;">storage</span><span style="color: #000000;">-</span><span style="color: #000000;">engine</span><span style="color: #000000;">=</span><span style="color: #000000;">INNODB<br />
<br />
</span><span style="color: #0000ff;">bind</span><span style="color: #000000;">-</span><span style="color: #000000;">address&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #800000;">192.168</span><span style="color: #000000;">.</span><span style="color: #800000;">1.107</span><span style="color: #000000;"><br />
<br />
user&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;mysql<br />
pid</span><span style="color: #000000;">-</span><span style="color: #000000;">file&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">/</span><span style="color: #000000;">var</span><span style="color: #000000;">/</span><span style="color: #000000;">run</span><span style="color: #000000;">/</span><span style="color: #000000;">mysqld</span><span style="color: #000000;">/</span><span style="color: #000000;">mysqld</span><span style="color: #000000;">.</span><span style="color: #000000;">pid<br />
</span><span style="color: #0000ff;">socket</span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">/</span><span style="color: #000000;">var</span><span style="color: #000000;">/</span><span style="color: #000000;">run</span><span style="color: #000000;">/</span><span style="color: #000000;">mysqld</span><span style="color: #000000;">/</span><span style="color: #000000;">mysqld</span><span style="color: #000000;">.</span><span style="color: #000000;">sock<br />
port&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #800000;">3306</span><span style="color: #000000;"><br />
basedir&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">/</span><span style="color: #000000;">usr<br />
datadir&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">/</span><span style="color: #000000;">var</span><span style="color: #000000;">/</span><span style="color: #000000;">lib</span><span style="color: #000000;">/</span><span style="color: #000000;">mysql<br />
tmpdir&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">/</span><span style="color: #000000;">tmp<br />
language&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">/</span><span style="color: #000000;">usr</span><span style="color: #000000;">/</span><span style="color: #000000;">share</span><span style="color: #000000;">/</span><span style="color: #000000;">mysql</span><span style="color: #000000;">/</span><span style="color: #000000;">english<br />
skip</span><span style="color: #000000;">-</span><span style="color: #000000;">external</span><span style="color: #000000;">-</span><span style="color: #000000;">locking</span></div>
<br />
2.用root登陆mysql执行如下命令<br />
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #0000ff;">grant</span><span style="color: #000000;">&nbsp;</span><span style="color: #808080;">all</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">on</span><span style="color: #000000;">&nbsp;sonardb.</span><span style="color: #808080;">*</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">to</span><span style="color: #000000;">&nbsp;sonar@</span><span style="color: #ff0000;">'</span><span style="color: #ff0000;">%</span><span style="color: #ff0000;">'</span><span style="color: #000000;">&nbsp;identified&nbsp;</span><span style="color: #0000ff;">by</span><span style="color: #000000;">&nbsp;</span><span style="color: #ff0000;">'</span><span style="color: #ff0000;">123456</span><span style="color: #ff0000;">'</span><span style="color: #000000;">;<br />
</span><span style="color: #0000ff;">grant</span><span style="color: #000000;">&nbsp;</span><span style="color: #808080;">all</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">on</span><span style="color: #000000;">&nbsp;sonardb.</span><span style="color: #808080;">*</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">to</span><span style="color: #000000;">&nbsp;sonar</span><span style="color: #008000;">@localhost</span><span style="color: #000000;">&nbsp;identified&nbsp;</span><span style="color: #0000ff;">by</span><span style="color: #000000;">&nbsp;</span><span style="color: #ff0000;">'</span><span style="color: #ff0000;">123456</span><span style="color: #ff0000;">'</span><span style="color: #000000;">;</span></div>
<br />
sonardb替换为你想访问的数据库名,sonar是你的想使用的用户名,123456替换为你的密码,这样就开启了远程访问功能.<br /><img src ="http://www.blogjava.net/kuuyee/aggbug/287842.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2009-07-22 13:52 <a href="http://www.blogjava.net/kuuyee/archive/2009/07/22/287842.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Ubuntu下更改Mysql默认字符集 </title><link>http://www.blogjava.net/kuuyee/archive/2009/07/22/287814.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Wed, 22 Jul 2009 03:01:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2009/07/22/287814.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/287814.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2009/07/22/287814.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/287814.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/287814.html</trackback:ping><description><![CDATA[在ubuntu安装Mysql Server比较简单,一条命令就可以搞定,如下:<br />
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #000000;">sudo&nbsp;apt</span><span style="color: #000000;">-</span><span style="color: #000000;">get&nbsp;install&nbsp;mysql</span><span style="color: #000000;">-</span><span style="color: #000000;">server</span></div>
<br />
但是用apt-get安装mysql不能设置默认字符集,可能是我不明白怎么弄,安装完默认字符集是latin1,可以登录mysql后用status命令查看,显示内容如下:<br />
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #000000;">root</span><span style="color: #800080;">@ubuntu</span><span style="color: #000000;">-</span><span style="color: #000000;">vm</span><span style="color: #000000;">:/</span><span style="color: #000000;">home</span><span style="color: #000000;">/</span><span style="color: #000000;">kuuyee</span><span style="color: #008000;">#</span><span style="color: #008000;">&nbsp;mysql&nbsp;-u&nbsp;root&nbsp;-p</span><span style="color: #008000;"><br />
</span><span style="color: #000000;">Enter&nbsp;password</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;<br />
Welcome&nbsp;to&nbsp;the&nbsp;MySQL&nbsp;monitor</span><span style="color: #000000;">.</span><span style="color: #000000;">&nbsp;&nbsp;Commands&nbsp;end&nbsp;with&nbsp;;&nbsp;or&nbsp;</span><span style="color: #000000;">\</span><span style="color: #000000;">g</span><span style="color: #000000;">.</span><span style="color: #000000;"><br />
Your&nbsp;MySQL&nbsp;connection&nbsp;id&nbsp;is&nbsp;</span><span style="color: #800000;">4</span><span style="color: #000000;"><br />
Server&nbsp;version</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #800000;">5.0</span><span style="color: #000000;">.</span><span style="color: #000000;">51a</span><span style="color: #000000;">-</span><span style="color: #000000;">3ubuntu5</span><span style="color: #000000;">.</span><span style="color: #800000;">4</span><span style="color: #000000;">&nbsp;(Ubuntu)<br />
&nbsp;<br />
Type&nbsp;</span><span style="color: #000000; font-weight: bold;">'</span><span style="color: #000000; font-weight: bold;">help;</span><span style="color: #000000; font-weight: bold;">'</span><span style="color: #000000;">&nbsp;or&nbsp;</span><span style="color: #000000; font-weight: bold;">'</span><span style="color: #000000; font-weight: bold;">\h</span><span style="color: #000000; font-weight: bold;">'</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">for</span><span style="color: #000000;">&nbsp;help</span><span style="color: #000000;">.</span><span style="color: #000000;">&nbsp;Type&nbsp;</span><span style="color: #000000; font-weight: bold;">'</span><span style="color: #000000; font-weight: bold;">\c</span><span style="color: #000000; font-weight: bold;">'</span><span style="color: #000000;">&nbsp;to&nbsp;clear&nbsp;the&nbsp;buffer</span><span style="color: #000000;">.</span><span style="color: #000000;"><br />
&nbsp;<br />
mysql</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">&nbsp;status<br />
</span><span style="color: #000000;">--------------</span><span style="color: #000000;"><br />
mysql&nbsp;&nbsp;Ver&nbsp;</span><span style="color: #800000;">14.12</span><span style="color: #000000;">&nbsp;Distrib&nbsp;</span><span style="color: #800000;">5.0</span><span style="color: #000000;">.</span><span style="color: #000000;">51a</span><span style="color: #000000;">,</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">for</span><span style="color: #000000;">&nbsp;debian</span><span style="color: #000000;">-</span><span style="color: #000000;">linux</span><span style="color: #000000;">-</span><span style="color: #000000;">gnu&nbsp;(i486)&nbsp;using&nbsp;</span><span style="color: #0000ff;">readline</span><span style="color: #000000;">&nbsp;</span><span style="color: #800000;">5.2</span><span style="color: #000000;"><br />
&nbsp;<br />
Connection&nbsp;id</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800000;">4</span><span style="color: #000000;"><br />
Current&nbsp;database</span><span style="color: #000000;">:</span><span style="color: #000000;"><br />
Current&nbsp;user</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;root</span><span style="color: #800080;">@localhost</span><span style="color: #000000;"><br />
SSL</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Not&nbsp;in&nbsp;</span><span style="color: #0000ff;">use</span><span style="color: #000000;"><br />
Current&nbsp;pager</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;stdout<br />
Using&nbsp;outfile</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000; font-weight: bold;">''</span><span style="color: #000000;"><br />
Using&nbsp;delimiter</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;;<br />
Server&nbsp;version</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800000;">5.0</span><span style="color: #000000;">.</span><span style="color: #000000;">51a</span><span style="color: #000000;">-</span><span style="color: #000000;">3ubuntu5</span><span style="color: #000000;">.</span><span style="color: #800000;">4</span><span style="color: #000000;">&nbsp;(Ubuntu)<br />
Protocol&nbsp;version</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800000;">10</span><span style="color: #000000;"><br />
Connection</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Localhost&nbsp;via&nbsp;UNIX&nbsp;</span><span style="color: #0000ff;">socket</span><span style="color: #000000;"><br />
Server&nbsp;characterset</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;latin1<br />
Db&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;characterset</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;latin1<br />
Client&nbsp;characterset</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;latin1<br />
Conn</span><span style="color: #000000;">.</span><span style="color: #000000;">&nbsp;&nbsp;characterset</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;latin1<br />
UNIX&nbsp;</span><span style="color: #0000ff;">socket</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #000000;">/</span><span style="color: #000000;">var</span><span style="color: #000000;">/</span><span style="color: #000000;">run</span><span style="color: #000000;">/</span><span style="color: #000000;">mysqld</span><span style="color: #000000;">/</span><span style="color: #000000;">mysqld</span><span style="color: #000000;">.</span><span style="color: #000000;">sock<br />
Uptime</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #800000;">16</span><span style="color: #000000;">&nbsp;hours&nbsp;</span><span style="color: #800000;">33</span><span style="color: #000000;">&nbsp;min&nbsp;</span><span style="color: #800000;">45</span><span style="color: #000000;">&nbsp;sec<br />
&nbsp;<br />
Threads</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #800000;">1</span><span style="color: #000000;">&nbsp;&nbsp;Questions</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #800000;">10</span><span style="color: #000000;">&nbsp;&nbsp;Slow&nbsp;queries</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #800000;">0</span><span style="color: #000000;">&nbsp;&nbsp;Opens</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #800000;">12</span><span style="color: #000000;">&nbsp;&nbsp;Flush&nbsp;tables</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #800000;">1</span><span style="color: #000000;">&nbsp;&nbsp;</span><span style="color: #0000ff;">Open</span><span style="color: #000000;">&nbsp;tables</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #800000;">6</span><span style="color: #000000;">&nbsp;&nbsp;Queries&nbsp;per&nbsp;second&nbsp;avg</span><span style="color: #000000;">:</span><span style="color: #000000;">&nbsp;</span><span style="color: #800000;">0.000</span><span style="color: #000000;"><br />
</span><span style="color: #000000;">--------------</span></div>
<br />
解决办法就是更改/etc/mysql/my.cnf文件,在[mysqld]和[mysql]下添加如下内容:<br />
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #000000;">[mysqld]<br />
default</span><span style="color: #000000;">-</span><span style="color: #000000;">character</span><span style="color: #000000;">-</span><span style="color: #000000;">set</span><span style="color: #000000;">=</span><span style="color: #000000;">utf8<br />
default</span><span style="color: #000000;">-</span><span style="color: #000000;">storage</span><span style="color: #000000;">-</span><span style="color: #000000;">engine</span><span style="color: #000000;">=</span><span style="color: #000000;">INNODB<br />
&nbsp;<br />
[mysql]<br />
default</span><span style="color: #000000;">-</span><span style="color: #000000;">character</span><span style="color: #000000;">-</span><span style="color: #000000;">set</span><span style="color: #000000;">=</span><span style="color: #000000;">utf8</span></div>
<br />
然后重启mysql server即可,命令如下:<br />
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br />
<br />
Code highlighting produced by Actipro CodeHighlighter (freeware)<br />
http://www.CodeHighlighter.com/<br />
<br />
--><span style="color: #000000;">sudo&nbsp;</span><span style="color: #000000;">/</span><span style="color: #000000;">etc</span><span style="color: #000000;">/</span><span style="color: #000000;">init</span><span style="color: #000000;">.</span><span style="color: #000000;">d</span><span style="color: #000000;">/</span><span style="color: #000000;">mysql　restart</span></div>
<br />
然后再查看一下status,呵呵!字符集变为utf-8了!<br />
<br /><img src ="http://www.blogjava.net/kuuyee/aggbug/287814.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2009-07-22 11:01 <a href="http://www.blogjava.net/kuuyee/archive/2009/07/22/287814.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>[转载]如何修改MYSQL的ROOT默认空密码</title><link>http://www.blogjava.net/kuuyee/archive/2009/06/19/283263.html</link><dc:creator>kuuyee</dc:creator><author>kuuyee</author><pubDate>Fri, 19 Jun 2009 09:22:00 GMT</pubDate><guid>http://www.blogjava.net/kuuyee/archive/2009/06/19/283263.html</guid><wfw:comment>http://www.blogjava.net/kuuyee/comments/283263.html</wfw:comment><comments>http://www.blogjava.net/kuuyee/archive/2009/06/19/283263.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/kuuyee/comments/commentRss/283263.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/kuuyee/services/trackbacks/283263.html</trackback:ping><description><![CDATA[http://bbs.sinobuy.cn/index.php/topic,4296.0.html?PHPSESSID=25ea8175fd223dca364084582215d04b<br />
<br />
<span style="font-size: 10pt;"><span style="font-size: 8pt;"><span style="font-size: 10pt;"><span style="font-family: 新宋体;">cmd下切换到 mysql 安装目录<br />
例<br />
d:/mysql/bin<br />
前提：mysql用户root密码为空.<br />
输入 mysql -u root mysql <br />
mysql&gt; 状态下输入&nbsp; &nbsp;update user set password=password('新密码') where user='root'; <br />
回显&nbsp; &nbsp;<br />
Query OK, 0 rows affected (0.00 sec) <br />
Rows matched: 2 Changed: 0 Warnings: 0 <br />
mysql&gt; 状态下输入 FLUSH PRIVILEGES; <br />
回显<br />
Query OK, 0 rows affected (0.00 sec)<br />
mysql&gt; 状态下输入 quit&nbsp; &nbsp;<br />
退出 sql <br />
<br />
注意每个命令后都要加上一个分号 ";" <br />
mysql 才开始执行该行命令<br />
而第二个指令会让已载入记忆体的 mysql 系统资料库更新 <br />
<br />
重起 mysql .<br />
在更新 root 密码后，以后要与 MySQL 连接的方法为： <br />
<br />
mysql -u root -p 新密码 </span></span></span></span><img src ="http://www.blogjava.net/kuuyee/aggbug/283263.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/kuuyee/" target="_blank">kuuyee</a> 2009-06-19 17:22 <a href="http://www.blogjava.net/kuuyee/archive/2009/06/19/283263.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>