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

<channel>
	<title>自由自在 &#187; Oracle</title>
	<atom:link href="http://www.aease.org/category/oracle/feed" rel="self" type="application/rss+xml" />
	<link>http://www.aease.org</link>
	<description>懦怯囚禁人的灵魂, 希望可以感受自由!</description>
	<lastBuildDate>Thu, 29 Jul 2010 08:00:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Windows下Oracle启动/关闭脚本</title>
		<link>http://www.aease.org/2010/06/windows%e4%b8%8boracle%e5%90%af%e5%8a%a8%e5%85%b3%e9%97%ad%e8%84%9a%e6%9c%ac.html</link>
		<comments>http://www.aease.org/2010/06/windows%e4%b8%8boracle%e5%90%af%e5%8a%a8%e5%85%b3%e9%97%ad%e8%84%9a%e6%9c%ac.html#comments</comments>
		<pubDate>Thu, 24 Jun 2010 02:34:27 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://www.aease.org/2010/06/windows%e4%b8%8boracle%e5%90%af%e5%8a%a8%e5%85%b3%e9%97%ad%e8%84%9a%e6%9c%ac.html</guid>
		<description><![CDATA[from: http://it.toolbox.com/ 针对不同版本的数据库需注释相关命令行。 启动数据库脚本：dbstart.cmd @echo off REM ------ Common Commands ------- set ORAHOME=&#34;ORACLE_HOME_NAME&#34; set ORASID=&#34;ORACLE_SID&#34; net start Oracle%ORAHOME%TNSListener net start OracleService%ORASID% REM ------ Commands For Oracle 8.x - 9.2 -------- REM net start Oracle%ORAHOME%HTTPServer REM net start Oracle%ORAHOME%ClientCache REM net start Oracle%ORAHOME%Agent REM net start Oracle%ORAHOME%SNMPPeerEncapsulator REM net start Oracle%ORAHOME%SNMPPeerMasterAgent REM net start Oracle%ORAHOME%PagingServer REM [...]]]></description>
			<content:encoded><![CDATA[<p>from: <a href="http://it.toolbox.com/wiki/index.php/Start_/_Shut_Oracle_with_a_Click_(Windows_Script)" target="_blank">http://it.toolbox.com/</a></p>
<p>针对不同版本的数据库需注释相关命令行。</p>
<p>启动数据库脚本：dbstart.cmd</p>
<blockquote><pre>@echo off

REM  ------ Common Commands -------
set ORAHOME=&quot;ORACLE_HOME_NAME&quot;
set ORASID=&quot;ORACLE_SID&quot;
net start Oracle%ORAHOME%TNSListener
net start OracleService%ORASID%

REM  ------ Commands For Oracle 8.x - 9.2 --------
REM net start Oracle%ORAHOME%HTTPServer
REM net start Oracle%ORAHOME%ClientCache
REM net start Oracle%ORAHOME%Agent
REM net start Oracle%ORAHOME%SNMPPeerEncapsulator
REM net start Oracle%ORAHOME%SNMPPeerMasterAgent
REM net start Oracle%ORAHOME%PagingServer
REM net start OracleMTSRecoverService

REM  ------ Commands For Oracle 10.x --------
REM net start OracleDBConsole%ORASID%
REM net start OracleJobScheduler%ORASID%
REM net start Oracle%ORAHOME%iSQL*Plus

REM  ------ Commands For Oracle 11.x --------
REM net start OracleDBConsole%ORASID%
REM net start OracleJobScheduler%ORASID%</pre>
</blockquote>
<pre>&#160;</pre>
<p><span id="more-4614"></span></p>
<pre>关闭数据库脚本: <strong>dbshut.cmd</strong></pre>
<blockquote>
<pre>@echo off

REM  ------ Common Commands -------
set ORAHOME=&quot;ORACLE_HOME_NAME&quot;
set ORASID=&quot;ORACLE_SID&quot;
net stop Oracle%ORAHOME%TNSListener
net stop OracleService%ORASID%

REM  ------ Commands For Oracle 8.x - 9.2 --------
REM net stop Oracle%ORAHOME%HTTPServer
REM net stop Oracle%ORAHOME%ClientCache
REM net stop Oracle%ORAHOME%Agent
REM net stop Oracle%ORAHOME%SNMPPeerEncapsulator
REM net stop Oracle%ORAHOME%SNMPPeerMasterAgent
REM net stop Oracle%ORAHOME%PagingServer
REM net stop OracleMTSRecoverService

REM  ------ Commands For Oracle 10.x --------
REM net stop OracleDBConsole%ORASID%
REM net stop OracleJobScheduler%ORASID%
REM net stop Oracle%ORAHOME%iSQL*Plus

REM  ------ Commands For Oracle 11.x --------
REM net stop OracleDBConsole%ORASID%
REM net stop OracleJobScheduler%ORASID%</pre>
</blockquote>
<p><strong>注：</strong></p>
<p><strong>ORACLE_HOME_NAME:</strong></p>
<p>系统注册表HKLM\SOFTWARE\ORACLE\…下<em>ORACLE_HOME_NAME</em>键值。(9i为\HOME0, 10g为\KEY_OraDb10g_home1，11g为\KEY_OraDb11g_home1)</p>
<p><strong>ORALCLE_SID:</strong></p>
<p>为Oracle系统标识符。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aease.org/2010/06/windows%e4%b8%8boracle%e5%90%af%e5%8a%a8%e5%85%b3%e9%97%ad%e8%84%9a%e6%9c%ac.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle中加密PL/SQL源码</title>
		<link>http://www.aease.org/2009/02/oracleplsql.html</link>
		<comments>http://www.aease.org/2009/02/oracleplsql.html#comments</comments>
		<pubDate>Sat, 14 Feb 2009 15:08:06 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://192.168.100.15/blog/2009/02/oracleplsql.html</guid>
		<description><![CDATA[主要是为了保护PL/SQL源代码，防止PL/SQL代码被非法使用。可以使用wrap工具或者DBMS_DDL子程序对PL/SQL源码进行加密。wrap工具加密单个源文件，如SQL*Plus脚本。DBMS_DDL子程序加密单个动态生成的PL/SQL单元，如一个CREATE PROCEDURE声明。加密的源文件可以移动，备份，可被SQL*Plus和Improt和Export工具处理，但在静态数据字典视图*_SOURCE中无法看到源码。 WRAP语法 wrap iname=input_file [oname=output_file] 可省略文件扩展名，如以下的命令是等同的: wrap iname=/mydir/myfile wrap iname=/mydir/myfile.sql 输出文件默认的扩展名为.plb，当然你也可以指定不同的文件名和扩展名。 wrap iname=/mydir/myfile oname=/yourdir/yourfile.out wrap主要是混淆PL/SQL语句的主体部分，如下CREATE语句可以被加密: CREATE [OR REPLACE] FUNCTION function_name CREATE [OR REPLACE] PROCEDURE procedure_name CREATE [OR REPLACE] PACKAGE package_name CREATE [OR REPLACE] PACKAGE BODY package_name CREATE [OR REPLACE] TYPE type_name AS OBJECT CREATE [OR REPLACE] TYPE type_name UNDER type_name CREATE [OR REPLACE] TYPE [...]]]></description>
			<content:encoded><![CDATA[<p>主要是为了保护PL/SQL源代码，防止PL/SQL代码被非法使用。可以使用<strong>wrap</strong>工具或者DBMS_DDL子程序对PL/SQL源码进行加密。wrap工具加密单个源文件，如SQL*Plus脚本。DBMS_DDL子程序加密单个动态生成的PL/SQL单元，如一个CREATE PROCEDURE声明。加密的源文件可以移动，备份，可被SQL*Plus和Improt和Export工具处理，但在静态数据字典视图*_SOURCE中无法看到源码。</p>
<p><font style="FONT-SIZE: 1.21em"><strong>WRAP语法</strong></font></p>
<blockquote>
<p><strong>wrap</strong> iname=<em>input_file</em> [oname=<em>output_file</em>]</p>
</blockquote>
<p>可省略文件扩展名，如以下的命令是等同的: <br />wrap iname=/mydir/myfile <br />wrap iname=/mydir/myfile.sql <br />输出文件默认的扩展名为.plb，当然你也可以指定不同的文件名和扩展名。 <br />wrap iname=/mydir/myfile oname=/yourdir/yourfile.out <br />wrap主要是混淆PL/SQL语句的主体部分，如下CREATE语句可以被加密:</p>
<blockquote>
<p>CREATE [OR REPLACE] FUNCTION <em>function_name</em> <br />CREATE [OR REPLACE] PROCEDURE <em>procedure_name</em> <br />CREATE [OR REPLACE] PACKAGE <em>package_name</em> <br />CREATE [OR REPLACE] PACKAGE BODY <em>package_name <br /></em>CREATE [OR REPLACE] TYPE <em>type_name</em> AS OBJECT <br />CREATE [OR REPLACE] TYPE <em>type_name</em> UNDER <em>type_name</em> <br />CREATE [OR REPLACE] TYPE BODY <em>type_name</em></p>
</blockquote>
<p>CREATE [OR REPLACE] TRIGGER语句不能被加密，但你可调用加密的过程。加密文件中除了语句头部和C风格(/*&#8230;*/)注释外，其它所有注释被删除。 </p>
<p><span id="more-218"></span></p>
<p>输出的文件为文本文件，可以在SQL*Plus执行:</p>
<blockquote>
<p>SQL&gt; @myfile.plb;</p>
</blockquote>
<p><font style="FONT-SIZE: 1.25em"><strong>DBMS_DDL子程序</strong></font> <br />DMBS_DDL包包含WRAP函数和CREATE_WRAPPED过程。CREATE_WRAPPED过程加密语句并创建PL/SQL单元。如下为使用DBMS_DDL.CREATE_WRAPPED加密包的例子:</p>
<blockquote>
<p>DECLARE <br />&nbsp; package_text VARCHAR2(32767); &#8212; text for creating package spec &amp; body&nbsp; <br />&nbsp; FUNCTION generate_spec (pkgname VARCHAR2) RETURN VARCHAR2 AS <br />&nbsp; BEGIN <br />&nbsp;&nbsp;&nbsp; RETURN &#8216;CREATE PACKAGE &#8216; || pkgname || &#8216; AS <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PROCEDURE raise_salary (emp_id NUMBER, amount NUMBER); <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PROCEDURE fire_employee (emp_id NUMBER); <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END &#8216; || pkgname || &#8216;;&#8217;; <br />&nbsp; END generate_spec; </p>
<p>&nbsp; FUNCTION generate_body (pkgname VARCHAR2) RETURN VARCHAR2 AS <br />&nbsp; BEGIN <br />&nbsp;&nbsp;&nbsp; RETURN &#8216;CREATE PACKAGE BODY &#8216; || pkgname || &#8216; AS <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PROCEDURE raise_salary (emp_id NUMBER, amount NUMBER) IS <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BEGIN <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; UPDATE employees <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SET salary = salary + amount WHERE employee_id = emp_id; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END raise_salary; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PROCEDURE fire_employee (emp_id NUMBER) IS <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BEGIN <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DELETE FROM employees WHERE employee_id = emp_id; <br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; END fire_employee; <br />&nbsp;&nbsp;&nbsp; END &#8216; || pkgname || &#8216;;&#8217;; <br />&nbsp; END generate_body; </p>
<p>BEGIN <br />&nbsp; &#8212; Generate package spec <br />&nbsp; package_text := generate_spec(&#8216;emp_actions&#8217;) </p>
<p>&nbsp; &#8212; Create wrapped package spec <br />&nbsp; DBMS_DDL.CREATE_WRAPPED(package_text); </p>
<p>&nbsp; &#8212; Generate package body <br />&nbsp; package_text := generate_body(&#8216;emp_actions&#8217;); </p>
<p>&nbsp; &#8212; Create wrapped package body <br />&nbsp; DBMS_DDL.CREATE_WRAPPED(package_text); <br />END;</p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.aease.org/2009/02/oracleplsql.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PL/SQL中报ORA-00942错误的解决</title>
		<link>http://www.aease.org/2009/02/plsqlora_00942.html</link>
		<comments>http://www.aease.org/2009/02/plsqlora_00942.html#comments</comments>
		<pubDate>Thu, 12 Feb 2009 06:08:22 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://192.168.100.15/blog/2009/02/plsqlora-00942.html</guid>
		<description><![CDATA[在PL/SQL Developer调试Procedure时，提示ORA-00942: table or view does not exist, 搜索了一下错误原因 Cause: The table or view entered does not exist, a synonym that is not allowed here was used, or a view was referenced where a table is required. Existing user tables and views can be listed by querying the data dictionary. Certain privileges may be required [...]]]></description>
			<content:encoded><![CDATA[<p>在PL/SQL Developer调试Procedure时，提示ORA-00942: table or view does not exist, 搜索了一下错误原因 </p>
<blockquote>
<p>Cause: The table or view entered does not exist, a synonym that is not allowed here was used, or a view was referenced where a table is required. Existing user tables and views can be listed by querying the data dictionary. Certain privileges may be required to access the table. If an application returned this message, the table the application tried to access does not exist in the database, or the application does not have access to it.</p>
<p>Action: Check each of the following: </p>
<p>the spelling of the table or view name. </p>
<p>that a view is not specified where a table is required. </p>
<p>that an existing table or view name exists. </p>
<p>Contact the database administrator if the table needs to be created or if user or application privileges are required to access the table. </p>
<p>Also, if attempting to access a table or view in another schema, make certain the correct schema is referenced and that access to the object is granted. </p>
</blockquote>
<p>但在SQL/PLUS中可以直接查询，并且正常返回结果。初步判断当前用户还是没有足够权限，于是进行明确的授权:</p>
<blockquote>
<p>SQL&gt; grant select on employee to wind; <br />Grant succeeded.</p>
</blockquote>
<p>再次编译问题解决。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aease.org/2009/02/plsqlora_00942.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle impdp转换导入对象</title>
		<link>http://www.aease.org/2009/01/impdp.html</link>
		<comments>http://www.aease.org/2009/01/impdp.html#comments</comments>
		<pubDate>Wed, 21 Jan 2009 07:22:06 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://192.168.100.15/blog/2009/01/impdp.html</guid>
		<description><![CDATA[除了在导入时改变或选择schemas, tablespaces, datafiles和表中的数据，也可以在导入时通过TRANSFORM选项改变段属性和存储条件。 TRANSFORM格式： TRANSFORM = transform_name:value[:object_type] transform_name: SEGMENT_ATTRIBUTES, STORAGE value: 可指定包含或排除的段属性(如存储属性, 表空间和日志) object_type: 为可选项, 若指定的话, 只能是以下值是的一个(CLUSTER, CONSTRAINT, INC_TYPE, INDEX, ROLLBACK_SEGMENT, TABLE, TABLESPACE, TYPE) 例 1. 导入表中的部分数据时，需要消除原全表导出相应存储语句，增加如下参数: transform=storage:n:table 2. 消除导出文件中所有表和索引的表空间和存储子句 transform=segment_attributes:n 当数据导入时，将被赋予用户默认的表空间并使用默认表空间的存储参数。]]></description>
			<content:encoded><![CDATA[<p>除了在导入时改变或选择schemas, tablespaces, datafiles和表中的数据，也可以在导入时通过TRANSFORM选项改变段属性和存储条件。   <br />TRANSFORM格式：    <br />TRANSFORM = transform_name:value[:<em>object_type</em>]    <br /><strong>transform_name</strong>: SEGMENT_ATTRIBUTES, STORAGE    <br /><strong>value</strong>: 可指定包含或排除的段属性(如存储属性, 表空间和日志)    <br /><em><strong>object_type</strong></em>: 为可选项, 若指定的话, 只能是以下值是的一个(CLUSTER, CONSTRAINT, INC_TYPE, INDEX, ROLLBACK_SEGMENT, TABLE, TABLESPACE, TYPE)    <br /><b><font style="font-size: 1.5625em;">例 </font></b>1. 导入表中的部分数据时，需要消除原全表导出相应存储语句，增加如下参数:    <br />transform=storage:n:table    <br />2. 消除导出文件中所有表和索引的表空间和存储子句    <br />transform=segment_attributes:n    <br />当数据导入时，将被赋予用户默认的表空间并使用默认表空间的存储参数。</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aease.org/2009/01/impdp.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle中删除重复记录</title>
		<link>http://www.aease.org/2009/01/oracle-7.html</link>
		<comments>http://www.aease.org/2009/01/oracle-7.html#comments</comments>
		<pubDate>Wed, 14 Jan 2009 06:23:00 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://192.168.100.15/blog/2009/01/oracle_7.html</guid>
		<description><![CDATA[1. 利用row_number分析函数 row_number()是一个分析函数,它赋予各分组内以1开始按顺序编号． 语法： row_number() over(query_partition_clause order_by_clause) SQL&#62; delete from temp003 2 where rowid in ( 3 select rid from 4 (select rowid rid,row_number() over(partition by empno,deptno order by empno,deptno) rn 5 from temp003) 6 where rn&#62;1) 7 / &#160; 75 rows deleted &#160; SQL&#62; 2.SQL语句 SQL&#62; delete from temp003 a 2 where rowid&#62;(select min(rowid) [...]]]></description>
			<content:encoded><![CDATA[<p>1. 利用row_number分析函数    <br />row_number()是一个分析函数,它赋予各分组内以1开始按顺序编号．</p>
<p>语法：    <br />row_number() over(query_partition_clause order_by_clause) </p>
<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; font-size: 8pt; width: 97.5%; cursor: text; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244); max-height: 200px;">
<div style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: rgb(0, 0, 255);">SQL</span>&gt; <span style="color: rgb(0, 0, 255);">delete</span> <span style="color: rgb(0, 0, 255);">from</span> temp003</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">  2  <span style="color: rgb(0, 0, 255);">where</span> rowid <span style="color: rgb(0, 0, 255);">in</span> (</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">  3  <span style="color: rgb(0, 0, 255);">select</span> rid <span style="color: rgb(0, 0, 255);">from</span></pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">  4  (<span style="color: rgb(0, 0, 255);">select</span> rowid rid,row_number() <span style="color: rgb(0, 0, 255);">over</span>(partition <span style="color: rgb(0, 0, 255);">by</span> empno,deptno <span style="color: rgb(0, 0, 255);">order</span> <span style="color: rgb(0, 0, 255);">by</span> empno,deptno) rn</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">  5  <span style="color: rgb(0, 0, 255);">from</span> temp003)</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">  6  <span style="color: rgb(0, 0, 255);">where</span> rn&gt;1)</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">  7  /</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">&nbsp;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">75 <span style="color: rgb(0, 0, 255);">rows</span> deleted</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">&nbsp;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: rgb(0, 0, 255);">SQL</span>&gt; </pre>
</div>
</div>
<p>2.SQL语句</p>
</p>
<div style="border: 1px solid gray; margin: 20px 0px 10px; padding: 4px; overflow: auto; font-size: 8pt; width: 97.5%; cursor: text; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244); max-height: 200px;">
<div style="border-style: none; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: rgb(0, 0, 255);">SQL</span>&gt; <span style="color: rgb(0, 0, 255);">delete</span> <span style="color: rgb(0, 0, 255);">from</span> temp003 a</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">  2  <span style="color: rgb(0, 0, 255);">where</span> rowid&gt;(<span style="color: rgb(0, 0, 255);">select</span> <span style="color: rgb(0, 0, 255);">min</span>(rowid)</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">  3  <span style="color: rgb(0, 0, 255);">from</span> temp003 b</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">  4  <span style="color: rgb(0, 0, 255);">where</span> a.empno=b.empno</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">  5  <span style="color: rgb(0, 0, 255);">and</span> a.deptno=b.deptno)</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">  6  /</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">&nbsp;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">75 <span style="color: rgb(0, 0, 255);">rows</span> deleted</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">&nbsp;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(0, 0, 255);">SQL</span>&gt; <span style="color: rgb(0, 0, 255);">rollback</span>;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">&nbsp;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(0, 0, 255);">Rollback</span> complete</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">&nbsp;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(0, 0, 255);">SQL</span>&gt; </pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;"><span style="color: rgb(0, 0, 255);">SQL</span>&gt; <span style="color: rgb(0, 0, 255);">delete</span> <span style="color: rgb(0, 0, 255);">from</span> temp003 a</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">  2  <span style="color: rgb(0, 0, 255);">where</span> rowid&gt;<span style="color: rgb(0, 0, 255);">any</span> (<span style="color: rgb(0, 0, 255);">select</span> rowid</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">  3  <span style="color: rgb(0, 0, 255);">from</span> temp003 b</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">  4  <span style="color: rgb(0, 0, 255);">where</span> a.empno=b.empno</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">  5  <span style="color: rgb(0, 0, 255);">and</span> a.deptno=b.deptno)</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">  6  /</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">&nbsp;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);">75 <span style="color: rgb(0, 0, 255);">rows</span> deleted</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: white;">&nbsp;</pre>
<pre style="border-style: none; margin: 0em; padding: 0px; overflow: visible; font-size: 8pt; width: 100%; color: black; line-height: 12pt; font-family: consolas,'Courier New',courier,monospace; background-color: rgb(244, 244, 244);"><span style="color: rgb(0, 0, 255);">SQL</span>&gt; </pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.aease.org/2009/01/oracle-7.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle procedure out参数测试</title>
		<link>http://www.aease.org/2008/11/oracle-procedure-out.html</link>
		<comments>http://www.aease.org/2008/11/oracle-procedure-out.html#comments</comments>
		<pubDate>Sun, 30 Nov 2008 03:43:51 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://192.168.100.15/blog/2008/11/oracle_procedure_out.html</guid>
		<description><![CDATA[测试procedure out参数: 1: SQL&#62;create or replace procedure test_para_out( 2: o_code OUT varchar2(50), 3: o_mess OUT VARCHAR2(50) 4: ) 5: is 6: ...... 7: begin 8: ...... 9: end; 1: SQL&#62;set serveroutput on 2:&#160; 3: SQL&#62;declare 4: o_code number; 5: o_mess varchar2(50); 6: begin 7: test_para_out(o_code,o_mess); 8: dbms.output.put_line(o_code&#124;&#124;' '&#124;&#124;o_mess); 9: end; 10: /]]></description>
			<content:encoded><![CDATA[<div class="csharpcode-wrapper">
<div class="csharpcode">测试procedure out参数:</div>
<div class="csharpcode">
<div style="BORDER-RIGHT: gray 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: gray 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 8pt; PADDING-BOTTOM: 4px; MARGIN: 20px 0px 10px; OVERFLOW: auto; BORDER-LEFT: gray 1px solid; WIDTH: 97.5%; CURSOR: text; LINE-HEIGHT: 12pt; PADDING-TOP: 4px; BORDER-BOTTOM: gray 1px solid; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BACKGROUND-COLOR: #f4f4f4; max-height: 200px">
<div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none">
<pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"><span style="COLOR: #606060">   1:</span> <span style="COLOR: #0000ff">SQL</span>&gt;<span style="COLOR: #0000ff">create</span> <span style="COLOR: #0000ff">or</span> replace <span style="COLOR: #0000ff">procedure</span> test_para_out(</pre>
<pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"><span style="COLOR: #606060">   2:</span> o_code <span style="COLOR: #0000ff">OUT</span> varchar2(50), </pre>
<pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"><span style="COLOR: #606060">   3:</span> o_mess <span style="COLOR: #0000ff">OUT</span> VARCHAR2(50)</pre>
<pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"><span style="COLOR: #606060">   4:</span> )</pre>
<pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"><span style="COLOR: #606060">   5:</span> <span style="COLOR: #0000ff">is</span></pre>
<pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"><span style="COLOR: #606060">   6:</span> ......</pre>
<pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"><span style="COLOR: #606060">   7:</span> <span style="COLOR: #0000ff">begin</span></pre>
<pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"><span style="COLOR: #606060">   8:</span> ......</pre>
<pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"><span style="COLOR: #606060">   9:</span> <span style="COLOR: #0000ff">end</span>;</pre>
</div>
</div>
</div>
</div>
<div style="BORDER-RIGHT: gray 1px solid; PADDING-RIGHT: 4px; BORDER-TOP: gray 1px solid; PADDING-LEFT: 4px; FONT-SIZE: 8pt; PADDING-BOTTOM: 4px; MARGIN: 20px 0px 10px; OVERFLOW: auto; BORDER-LEFT: gray 1px solid; WIDTH: 97.5%; CURSOR: text; LINE-HEIGHT: 12pt; PADDING-TOP: 4px; BORDER-BOTTOM: gray 1px solid; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BACKGROUND-COLOR: #f4f4f4; max-height: 200px">
<div style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none">
<pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"><span style="COLOR: #606060">   1:</span> <span style="COLOR: #0000ff">SQL</span>&gt;<span style="COLOR: #0000ff">set</span> serveroutput <span style="COLOR: #0000ff">on</span></pre>
<pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"><span style="COLOR: #606060">   2:</span>&nbsp; </pre>
<pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"><span style="COLOR: #606060">   3:</span> <span style="COLOR: #0000ff">SQL</span>&gt;<span style="COLOR: #0000ff">declare</span> </pre>
<pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"><span style="COLOR: #606060">   4:</span> o_code number; </pre>
<pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"><span style="COLOR: #606060">   5:</span> o_mess varchar2(50); </pre>
<pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"><span style="COLOR: #606060">   6:</span> <span style="COLOR: #0000ff">begin</span> </pre>
<pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"><span style="COLOR: #606060">   7:</span>     test_para_out(o_code,o_mess); </pre>
<pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"><span style="COLOR: #606060">   8:</span>     dbms.<span style="COLOR: #0000ff">output</span>.put_line(o_code||<span style="COLOR: #006080">' '</span>||o_mess); </pre>
<pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: white; BORDER-BOTTOM-STYLE: none"><span style="COLOR: #606060">   9:</span> <span style="COLOR: #0000ff">end</span>;</pre>
<pre style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; FONT-SIZE: 8pt; PADDING-BOTTOM: 0px; MARGIN: 0em; OVERFLOW: visible; WIDTH: 100%; COLOR: black; BORDER-TOP-STYLE: none; LINE-HEIGHT: 12pt; PADDING-TOP: 0px; FONT-FAMILY: consolas, 'Courier New', courier, monospace; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BACKGROUND-COLOR: #f4f4f4; BORDER-BOTTOM-STYLE: none"><span style="COLOR: #606060">  10:</span> /</pre>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.aease.org/2008/11/oracle-procedure-out.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>遇到ORA-16038 ORA-19809 ORA-00312错误</title>
		<link>http://www.aease.org/2008/11/ora16038-ora19809-ora00312.html</link>
		<comments>http://www.aease.org/2008/11/ora16038-ora19809-ora00312.html#comments</comments>
		<pubDate>Sun, 23 Nov 2008 06:17:14 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://192.168.100.15/blog/2008/11/ora16038_ora19809_ora00312.html</guid>
		<description><![CDATA[今天在启动测试数据库时报如下错误: ORA-16038: log 1 sequence# 44 cannot be archived ORA-19809: limit exceeded for recovery files ORA-00312: online log 1 thread 1: &#8216;/u01/app/oracle/oradata/test/redo01.log&#8217; 检查v$flash_recovery_area_usage和v$recovery_file_dest发现archivelog占了大部分空间. 利用RMAN的DELETE命令删除归档备份修复此错误. RMAN&#62; delete archivelog until sequence=41; 打开数据库, 查询如下语句会发现该故障的解决方法 :) SQL&#62; select reason,object_type,suggested_action from dba_outstanding_alerts; REASON &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; OBJECT_TYPE &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- SUGGESTED_ACTION &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; db_recovery_file_dest_size of 2147483648 bytes is 98.46% used and has 33048064 remaining bytes [...]]]></description>
			<content:encoded><![CDATA[<p>今天在启动测试数据库时报如下错误:</p>
<p>ORA-16038: log 1 sequence# 44 cannot be archived <br />ORA-19809: limit exceeded for recovery files <br />ORA-00312: online log 1 thread 1: &#8216;/u01/app/oracle/oradata/test/redo01.log&#8217;</p>
<p>检查v$flash_recovery_area_usage和v$recovery_file_dest发现archivelog占了大部分空间. 利用RMAN的DELETE命令删除归档备份修复此错误.</p>
<p><strong>RMAN&gt;</strong> delete archivelog until sequence=41;</p>
<p>打开数据库, 查询如下语句会发现该故障的解决方法 :)</p>
<p>SQL&gt; select reason,object_type,suggested_action from dba_outstanding_alerts; </p>
<p>REASON <br />&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; <br />OBJECT_TYPE <br />&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- <br />SUGGESTED_ACTION <br />&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; <br />db_recovery_file_dest_size of 2147483648 bytes is 98.46% used and has 33048064 remaining bytes available. <br />RECOVERY AREA <br />You have following choices to free up space from flash recovery area: <br />1. Consider changing RMAN RETENTION POLICY. If you are using Data Guard, <br />&nbsp;&nbsp; then consider changing RMAN ARCHIVELOG DELETION POLICY. <br />2. Back up files to tertiary device such as tape using RMAN&nbsp; <br />&nbsp;&nbsp; BACKUP RECOVERY AREA command. <br />3. Add disk space and increase db_recovery_file_dest_size parameter to <br />&nbsp;&nbsp; reflect the new space. <br />4. Delete unnecessary files using RMAN DELETE command. If an operating <br />&nbsp;&nbsp; system command was used to delete files, then use RMAN CROSSCHECK and <br />&nbsp;&nbsp; DELETE EXPIRED commands.</p>
<p>&nbsp;</p>
<p><strong>官方解决方案:</strong></p>
<p>1) Take frequent backup of recovery area using RMAN. <br />2) Consider changing RMAN retention policy. <br />3) Consider changing RMAN archivelog deletion policy. <br />4) Add disk space and increase DB_RECOVERY_FILE_DEST_SIZE. <br />5) Delete files from recovery area using RMAN.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aease.org/2008/11/ora16038-ora19809-ora00312.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Data Pump Export</title>
		<link>http://www.aease.org/2008/11/using-data-pump-export.html</link>
		<comments>http://www.aease.org/2008/11/using-data-pump-export.html#comments</comments>
		<pubDate>Wed, 05 Nov 2008 09:33:54 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://192.168.100.15/blog/2008/11/using_data_pump_export.html</guid>
		<description><![CDATA[数据泵(Data Pump)提供了一个基于服务端数据导出和导入工具. 对于原导入和导出工具有了重大结构和功能上的增强. 数据泵允许停止和重启动任务, 查看运行中任务状态, 对导入导出数据进行结束. 数据泵做为服务进程运行, 极大提高了性能(同原导入导出工具比较)因为数据不再由客户端程序处理, 数据泵还可并行运行, 更进一步增强了性能. 创建目录 数据泵要求为将创建和读取的数据文件和日志文件创建目录. 外部目录必须存在. SQL&#62; create directory DPXFER as &#8216;/Temp/DataPumpXfer&#8217;; Directory created. SQL&#62; grant read, write on directory DPXFER to rjb; Grant succeeded. 启动任务 可通过PARFILE参数在expdp中使用参数文件(参数说明通过expdp help=y查看). 如创建一个名为dp_exp.par的文件: directory=dpxfer dumpfile=metadata_only.dmp content=metadata_only $ expdp ljf/ljf parfile=dp_exp.par 注: 相同目录中已存在的DUMP文件不会被覆盖, 除非使用REUSE_DUMPFILES参数. 停止和重启动任务 通过在导出过程中按CTRL-C进入expdb提示符: Export&#62; 退出 Export&#62; exit_client 重启动并连接正在运行的任务 expdp ljf/ljf [...]]]></description>
			<content:encoded><![CDATA[<p>数据泵(Data Pump)提供了一个基于服务端数据导出和导入工具. 对于原导入和导出工具有了重大结构和功能上的增强. 数据泵允许停止和重启动任务, 查看运行中任务状态, 对导入导出数据进行结束.</p>
<p>数据泵做为服务进程运行, 极大提高了性能(同原导入导出工具比较)因为数据不再由客户端程序处理, 数据泵还可并行运行, 更进一步增强了性能.</p>
<p><strong>创建目录</strong></p>
<p>数据泵要求为将创建和读取的数据文件和日志文件创建目录. 外部目录必须存在.</p>
<p>SQL&gt; create directory DPXFER as &#8216;/Temp/DataPumpXfer&#8217;; <br />Directory created. <br />SQL&gt; grant read, write on directory DPXFER to rjb; <br />Grant succeeded.</p>
<p><strong>启动任务</strong></p>
<p>可通过PARFILE参数在expdp中使用参数文件(参数说明通过<strong>expdp help=y</strong>查看). <br />如创建一个名为dp_exp.par的文件: <br />directory=dpxfer <br />dumpfile=metadata_only.dmp <br />content=metadata_only</p>
<p>$ expdp ljf/ljf parfile=dp_exp.par</p>
<p><strong>注:</strong> 相同目录中已存在的DUMP文件不会被覆盖, 除非使用REUSE_DUMPFILES参数.</p>
<p><strong>停止和重启动任务</strong></p>
<p>通过在导出过程中按CTRL-C进入expdb提示符: <br />Export&gt;</p>
<p>退出 <br />Export&gt; exit_client</p>
<p>重启动并连接正在运行的任务 <br />expdp ljf/ljf attach=SYS_EXPORT_SCHEMA_01</p>
<p>显示正运行任务的状态 <br />Export&gt; continue_client</p>
<p>挂起任务 <br />Export&gt; stop_job</p>
<p>重运行任务 <br />Export&gt; start_job</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aease.org/2008/11/using-data-pump-export.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Oracle Backup 方法</title>
		<link>http://www.aease.org/2008/10/oracle-backup.html</link>
		<comments>http://www.aease.org/2008/10/oracle-backup.html#comments</comments>
		<pubDate>Fri, 03 Oct 2008 07:58:21 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://192.168.100.15/blog/2008/10/oracle_backup.html</guid>
		<description><![CDATA[备份数据库三个标准的方法: exports, offline backups(离线备份), online backups(在线备份), exports是逻辑备份, 另两方法为物理备份. 物理备份首选工具为RMAN. 备份策略应包含物理和逻辑备份, 生产库以物理备份为主, 逻辑备份为辅. Logical Backups Data Pump Export 与Data Pump Import , 使用XML文件. 注: Oracle Import和Export工具在11g中仍可以安装, 但鼓励使用Data Pump Export与Data Pump Import代替. 全库导出将导出数据库的所有对象, 包含表空间, 数据文件和用户, 可从导出数据中导入部分或者全部数据, 在做全库导入时这些对象都将被创建, 利用表空间和用户的重建有利于重新指定数据库对象的物理分布. 如果从导出文件中导入部分数据, 需要在导入前设置好表空间, 数据文件和数据的所有者. Physical Backups Offline Backups 在数据库正常关闭情况下, 即shutdown命令使用normal, immediate或transactional选项.当数据库脱机时, 备份下面文件: 所有的数据文件 所有的控制文件 所有归档重做日志文件 init.ora文件或SPFILE Online Backups 数据库必须为ARCHIVELOG模式. 提供完整的时间点恢复以及在文件系统备份期间保持数据库打开状态. [...]]]></description>
			<content:encoded><![CDATA[<p>备份数据库三个标准的方法: exports, offline backups(离线备份), online backups(在线备份), exports是逻辑备份, 另两方法为物理备份. 物理备份首选工具为RMAN.</p>
<p>备份策略应包含物理和逻辑备份, 生产库以物理备份为主, 逻辑备份为辅.</p>
<p><strong>Logical Backups</strong></p>
<p>Data Pump Export 与Data Pump Import , 使用XML文件.</p>
<p><strong>注:</strong> Oracle Import和Export工具在11g中仍可以安装, 但鼓励使用Data Pump Export与Data Pump Import代替.</p>
<p>全库导出将导出数据库的所有对象, 包含表空间, 数据文件和用户, 可从导出数据中导入部分或者全部数据, 在做全库导入时这些对象都将被创建, 利用表空间和用户的重建有利于重新指定数据库对象的物理分布. 如果从导出文件中导入部分数据, 需要在导入前设置好表空间, 数据文件和数据的所有者.</p>
<p><strong>Physical Backups</strong></p>
<p><strong>Offline Backups</strong></p>
<p>在数据库正常关闭情况下, 即shutdown命令使用normal, immediate或transactional选项.当数据库脱机时, 备份下面文件:</p>
<p>所有的数据文件 <br />所有的控制文件 <br />所有归档重做日志文件 <br />init.ora文件或SPFILE</p>
<p><strong>Online Backups</strong></p>
<p>数据库必须为ARCHIVELOG模式. 提供完整的时间点恢复以及在文件系统备份期间保持数据库打开状态.</p>
<p>将每个表空间设为备份状态, 备份数据文件, 恢复表空间为正常状态. <br />注: 如果使用RMAN工具, 则不需要手动设置表空间为备份状态. RMAN读取数据块方式类似于ORACLE的查询. <br />备份如下文件: <br />所有数据文件 <br />所有归档重做日志 <br />控制文件, 使用alter database backup controlfile <br />SPFILE</p>
<p>RMAN在备份整个数据库或者SYSTEM表空间时自动备份控制文件与SPFILE.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aease.org/2008/10/oracle-backup.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>10G RAC ASM无法启动</title>
		<link>http://www.aease.org/2008/09/10g-rac-asm.html</link>
		<comments>http://www.aease.org/2008/09/10g-rac-asm.html#comments</comments>
		<pubDate>Mon, 08 Sep 2008 13:55:10 +0000</pubDate>
		<dc:creator>wind</dc:creator>
				<category><![CDATA[Oracle]]></category>

		<guid isPermaLink="false">http://192.168.100.15/blog/2008/09/10g_rac_asm.html</guid>
		<description><![CDATA[一数据库服务器意外断电, 重启发现无法启动ASM: [Rac10g01][/home/oracle]$ srvctl start asm -n rac10g01 PRKS-1009 : 无法启动节点 &#34;rac10g01&#34;, [PRKS-1009 : 无法启动节点 &#34;rac10g01&#34;, [CRS-1028: Dependency analysis failed because of: CRS-0223: Resource 'ora.rac10g01.ASM1.asm' has placement error.] 上的 ASM 实例 &#34;+ASM1&#34;] 上的 ASM 实例 &#34;+ASM1&#34; &#160; [PRKS-1009 : 无法启动节点 &#34;rac10g01&#34;, [CRS-1028: Dependency analysis failed because of: CRS-0223: Resource 'ora.rac10g01.ASM1.asm' has placement error.] 上的 ASM [...]]]></description>
			<content:encoded><![CDATA[<p>一数据库服务器意外断电, 重启发现无法启动ASM:</p>
<p>[Rac10g01][/home/oracle]$<strong> srvctl start asm -n rac10g01      <br /></strong>PRKS-1009 : 无法启动节点 &quot;rac10g01&quot;, [PRKS-1009 : 无法启动节点 &quot;rac10g01&quot;, [CRS-1028: Dependency analysis failed because of:     <br />CRS-0223: Resource 'ora.rac10g01.ASM1.asm' has placement error.] 上的 ASM 实例 &quot;+ASM1&quot;] 上的 ASM 实例 &quot;+ASM1&quot;     <br />&#160; [PRKS-1009 : 无法启动节点 &quot;rac10g01&quot;, [CRS-1028: Dependency analysis failed because of:     <br />CRS-0223: Resource 'ora.rac10g01.ASM1.asm' has placement error.] 上的 ASM 实例 &quot;+ASM1&quot;]</p>
<p><strong>试着采用如下方法解决:</strong>     <br />[Rac10g01][/home/oracle]$<strong> export</strong> ORACLE_SID=+ASM1     <br />[Rac10g01][/home/oracle]$<strong> sqlplus / as sysdba</strong> </p>
<p>SQL*Plus: Release 10.2.0.1.0 &#8211; Production on Tue Sep 9 02:27:08 2008 </p>
<p>Copyright (c) 1982, 2005, Oracle.&#160; All rights reserved. </p>
<p>Connected to an idle instance. </p>
<p>SQL&gt; <strong>startup      <br /></strong>ASM instance started </p>
<p>Total System Global Area&#160;&#160; 92274688 bytes    <br />Fixed Size&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 1217884 bytes     <br />Variable Size&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 65890980 bytes     <br />ASM Cache&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; 25165824 bytes     <br />ASM diskgroups mounted     <br />SQL&gt; <strong>exit</strong>&#160; <br />Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 &#8211; Production     <br />With the Partitioning, Real Application Clusters, Oracle Label Security, OLAP     <br />and Data Mining Scoring Engine options     <br />[Rac10g01][/home/oracle]$<strong> srvctl status asm -n rac10g01      <br /></strong>ASM 实例 +ASM1 正在节点 rac10g01 上运行。</p>
<p>启动数据库成功.</p>
<p><span id="more-140"></span></p>
<p><strong></strong></p>
<p><strong>还可以采用crs相关命令解决:</strong></p>
<p>1. ./crs_stat -t    <br />ora&#8230;.SM1.asm application ONLINE <strong>UNKNOWN     <br /></strong>状态为UNKNOWN</p>
<p>./crsctl check crs    <br />CSS appears healthy     <br />CRS appears healthy     <br />EVM appears healthy     <br />正常</p>
<p>2. 执行:    <br />./crs_stop -all     <br />./crs_start -all     <br />./crs_stat -t     <br />ora&#8230;.SM1.asm application ONLINE <strong>OFFLINE</strong></p>
<p>3. 启动ASM    <br />srvctl start asm -n rac10g01 -i +ASM1</p>
]]></content:encoded>
			<wfw:commentRss>http://www.aease.org/2008/09/10g-rac-asm.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
