<?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"
>

<channel>
	<title>kods.net</title>
	<atom:link href="http://www.kods.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.kods.netwww.kods.net/</link>
	<description>Oracle Jobs, Oracle Database, Oracle 9i, Oracle SQL, Oracle at Delphi, Oracle Greek, Learn Oracle, Oracle ERP</description>
	<pubDate>Fri, 12 Mar 2010 22:32:10+0000</pubDate>
	<generator>http://www.kods.netwww.kods.net/</generator>
	<language>en</language>
		<item>
		<title>[Change] Use shell handle the database alert log oracle</title>
		<link>http://www.kods.netwww.kods.net/change-use-shell-handle-the-database-alert-log-oracle/</link>
		<comments>http://www.kods.netwww.kods.net/change-use-shell-handle-the-database-alert-log-oracle/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 07:55:02+0000</pubDate>
		<dc:creator>kods.net</dc:creator>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[quot]]></category>
<category><![CDATA[oracle database]]></category>
<category><![CDATA[fri]]></category>
<category><![CDATA[file format]]></category>
<category><![CDATA[rn]]></category>
<category><![CDATA[boring work]]></category>
<category><![CDATA[figure 1]]></category>
<category><![CDATA[sql scripts]]></category>
<category><![CDATA[algorithm]]></category>
<category><![CDATA[text editing tools]]></category>
<category><![CDATA[shell scripts]]></category>
<category><![CDATA[repetitive operations]]></category>
<category><![CDATA[000060]]></category>
<category><![CDATA[more time consuming]]></category>
<category><![CDATA[implementation services]]></category>
<category><![CDATA[it168]]></category>
<category><![CDATA[article deals]]></category>
<category><![CDATA[starting line]]></category>
<category><![CDATA[critical error]]></category>
<category><![CDATA[technical documentation]]></category>
		<guid isPermaLink="true">http://www.kods.netwww.kods.net/change-use-shell-handle-the-database-alert-log-oracle/</guid>
		<description><![CDATA[rn 2008-10-17 22:37 rn rn rn rn rn From: ITPUB.NET Link: http://tech.it168.com/a2008/1016/208/000000208136.shtml rn Technical documentation] [IT168 In this paper, using the shell to realize oracle dat ...]]></description>
		<content:encoded><![CDATA[rn <br /> 2008-10-17 22:37 <br /> rn <TABLE"TABLE-LAYOUT: fixed; WIDTH: 100%" _fckxhtmljob="2"> rn <TBODY _fckxhtmljob="2"> rn <TR _fckxhtmljob="2"> rn <TD _fckxhtmljob="2"> rn <br /> From: ITPUB.NET <BR _fckxhtmljob="2"> Link: http://tech.it168.com/a2008/1016/208/000000208136.shtml <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> rn <br /> <STRONG _fckxhtmljob="2">Technical documentation】 【IT168</strong> <BR _fckxhtmljob="2"> In this paper, using the shell to realize oracle database alert log processing algorithms and implementation process, and give a sample, examples show that the analysis of the script can be quickly and effectively alert logs, to meet the demand, the final look ahead to deal with the process. <br /><br /> rn <br /> <STRONG _fckxhtmljob="2">1.</strong> &lt;BR _fckxhtmljob=&quot;2&quot;&gt; <STRONG _fckxhtmljob="2">Outlined the background</strong> for the daily number of repetitive operations, as well as deal with the problem site in the user process, using some automated scripts to accomplish some work, make some boring work of change were simple, and quick, but also is not prone to error. In certain provinces of Unicom Corporation and the Treasurer and implementation services in the process learned that users have the following needs: to provide shell scripts to achieve the alert log of oracle database to track processing, for example according to the time (in days) to see and deal with alert logs. <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> Without scripting, the common approach is to download the alert files, use the text editing tools to find, statistics, positioning, filtering, download the trace file. Is generally more time-consuming, and may be omitted. <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> This first set out the algorithm, and then gives sample code and implementation, and finally gives outlook, the script includes shell scripts and sql scripts. <br /><br /> rn <br /> <STRONG _fckxhtmljob="2">2. Algorithm <BR _fckxhtmljob="2"> <a href="http://www.kods.net/upload/c/change-use-shell-handle-the-database-alert-log-oracle.jpg" class="lightbox"><img src="http://www.kods.net/upload/c/change-use-shell-handle-the-database-alert-log-oracle.jpg"   alt="[Change] Use shell handle the database alert log oracle" title="[Change] Use shell handle the database alert log oracle" /></a></strong> <br /><br /> rn <br /><BR _fckxhtmljob="2"> Figure 1 flow chart to determine how many days need to analyze the log since the situation on the time for processing, according to timestamp format (This article deals with the time of the alert file format is similar to: Fri Aug 1 13:22:37 2008), to obtain the starting line number analysis from the starting line number to the end of all content. <BR _fckxhtmljob="2"> ORA-filter all of the information, and give them statistics. <BR _fckxhtmljob="2"> Of critical error message (ORA-00600, ORA-000060, ORA-1555, ORA-07445), for separate treatment. <BR _fckxhtmljob="2"> Find and obtain the trace file. Generated ftp format, use the ftp command to download the trace file. <BR _fckxhtmljob="2"> Use operating system commands, access to an error corresponding meaning. <br /><br /> rn <br /><br /> rn <br /> 3. <STRONG _fckxhtmljob="2">Shell code</strong> &lt;BR _fckxhtmljob=&quot;2&quot;&gt; processing alert files called scripts check_alert.sh <br /><br /> rn <br /> rn<br /> #! / bin / sh <BR _fckxhtmljob="2"> # Set the alert log file environment variables <BR _fckxhtmljob="2"> ORIGINAL_ALERT = &quot;/ arraybill / home / oracle / app / oracle / admin / hnbill / bdump / alert_hnbill.log&quot; <BR _fckxhtmljob="2"> # Determine the input parameters: days <BR _fckxhtmljob="2"> if [$ #-ne 1] <BR _fckxhtmljob="2"> then <BR _fckxhtmljob="2"> echo &quot;wrong argument, usage: sh check_alert.sh 3&quot; <BR _fckxhtmljob="2"> exit 1 <BR _fckxhtmljob="2"> fi <BR _fckxhtmljob="2"> if [$ 1-lt 0] <BR _fckxhtmljob="2"> then <BR _fckxhtmljob="2"> echo &quot;Sorry, please enter a non-negative integer&quot; <BR _fckxhtmljob="2"> exit 1 <BR _fckxhtmljob="2"> fi <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> # Query parameters corresponding to the time before the system time <BR _fckxhtmljob="2"> sh dated_alert.sh $ 1&gt; / dev / null <BR _fckxhtmljob="2"> # Decomposition time format, pay attention, which may be a days, it could be two, the month is three, month and day length of the string consisting of a fixed <BR _fckxhtmljob="2"> str_day = $ (sed 1d tmp_date.log | awk &#39;(if (substr ($ 1,1,1) == 0) print substr ($ 1,2,1); else print substr ($ 1,1,2))&#39;) <BR _fckxhtmljob="2"> str_length = $ (echo $ str_day | awk &#39;(print length ($ 1))&#39;) <BR _fckxhtmljob="2"> # 3 letters of the month will be broken down into the first letter capitalized, other lower-case <BR _fckxhtmljob="2"> str_month = $ (sed 1d tmp_date.log | awk &#39;(print substr ($ 1,4,3))&#39; | sed &#39;1, $ y / [JFMASODN] ABCDEFGHIJKLMNOPQRSTUVWXYZ / [JFMASODN] abcdefghijklmnopqrstuvwxyz / &#39;) <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> if [$ str_length-eq 1] <BR _fckxhtmljob="2"> then <BR _fckxhtmljob="2"> echo &quot;awk&#39;/&quot;&quot;$ str_month $ str_day&quot; &quot;/ (print NR) &#39;&quot; $ ORIGINAL_ALERT &quot;&quot;&gt; tmp.sh <BR _fckxhtmljob="2"> # echo &quot;$ str_month $ str_day&quot; <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> fi <BR _fckxhtmljob="2"> if [$ str_length-eq 2] <BR _fckxhtmljob="2"> then <BR _fckxhtmljob="2"> echo &quot;awk&#39;/&quot;&quot;$ str_month $ str_day&quot; &quot;/ (print NR) &#39;&quot; $ ORIGINAL_ALERT &quot;&quot;&gt; tmp.sh <BR _fckxhtmljob="2"> # echo &quot;$ str_month $ str_day&quot; <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> fi <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> chmod 777 tmp.sh <BR _fckxhtmljob="2"> chmod 777 tmp.sh <BR _fckxhtmljob="2"> sh tmp.sh | awk &#39;NR == 1 (print $ 1)&#39;&gt; rownum.lst <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> # Get the alert to deal with the beginning of the log line number and ending line number <BR _fckxhtmljob="2"> alert_row_begin = $ (cat rownum.lst | awk &#39;(print $ 1)&#39;) <BR _fckxhtmljob="2"> alert_row_end = $ (wc-l $ ORIGINAL_ALERT | awk &#39;(print $ 1)&#39;) <BR _fckxhtmljob="2"> echo &quot;awk &#39;NR == $ alert_row_begin, NR == $ alert_row_end (print \ $ 0)&#39;&quot; $ ORIGINAL_ALERT &quot;&quot;&gt; tmp.sh <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> # Line number according to the scope of interception of alert log content, and saved to a temporary file in tmp_alert.tmp <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> sh tmp.sh&gt; tmp_alert.tmp <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> echo <BR _fckxhtmljob="2"> echo &quot;-----------------------------------------------&quot; <BR _fckxhtmljob="2"> echo &quot;Error Summary Start Time: $ begin_date_time&quot; <BR _fckxhtmljob="2"> echo &quot;-----------------------------------------------&quot; <BR _fckxhtmljob="2"> echo <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> echo &quot;Number Error number&quot; <BR _fckxhtmljob="2"> echo &quot;---- -------------------&quot; <BR _fckxhtmljob="2"> grep ORA-tmp_alert.tmp | awk &#39;(print substr ($ 0,0,9))&#39; | sort-nr | uniq-c | sort-nr <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> # If there are 600 errors, 600 error handling script calls <BR _fckxhtmljob="2"> if [$ (awk &#39;/ ORA-00600 / (print NR)&#39; tmp_alert.tmp | wc-l | awk &#39;(print $ 1)&#39;)-gt 0] <BR _fckxhtmljob="2"> then <BR _fckxhtmljob="2"> sh check_00600.sh <BR _fckxhtmljob="2"> fi <BR _fckxhtmljob="2"> # 07445 If there are errors, call 07445 error handling script <BR _fckxhtmljob="2"> if [$ (awk &#39;/ ORA-07445 / (print NR)&#39; tmp_alert.tmp | wc-l | awk &#39;(print $ 1)&#39;)-gt 0] <BR _fckxhtmljob="2"> then <BR _fckxhtmljob="2"> sh check_07445.sh <BR _fckxhtmljob="2"> fi <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> # If there are 000.06 thousand errors, call the 000060 error handling script <BR _fckxhtmljob="2"> if [$ (awk &#39;/ ORA-000060 / (print NR)&#39; tmp_alert.tmp | wc-l | awk &#39;(print $ 1)&#39;)-gt 0] <BR _fckxhtmljob="2"> then <BR _fckxhtmljob="2"> sh check_000060.sh <BR _fckxhtmljob="2"> fi <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> # 01555 If there are errors, call 01555 error handling script <BR _fckxhtmljob="2"> if [$ (awk &#39;/ ORA-01555 / (print NR)&#39; tmp_alert.tmp | wc-l | awk &#39;(print $ 1)&#39;)-gt 0] <BR _fckxhtmljob="2"> then <BR _fckxhtmljob="2"> sh check_01555.sh <BR _fckxhtmljob="2"> fi <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> echo <BR _fckxhtmljob="2"> # Remove the call to the temporary files generated in the process <BR _fckxhtmljob="2"> rm-f tmp_3_line.sh <BR _fckxhtmljob="2"> rm-f tmp_date.log <BR _fckxhtmljob="2"> rm-f tmp.sh <BR _fckxhtmljob="2"> rm-f ora01555_trc.log <BR _fckxhtmljob="2"> rm-f ora006000_trc.log <BR _fckxhtmljob="2"> rm-f ora07445_trc.log <BR _fckxhtmljob="2"> rm-f ora000060_trc.log <BR _fckxhtmljob="2"> rm-f trc_tmp <BR _fckxhtmljob="2"> rm-f tmp_alert.tmp <BR _fckxhtmljob="2"> rm-f ora006000_rownum.log <BR _fckxhtmljob="2"> rm-f rownum.lst <br /><br /> rn <br /><BR _fckxhtmljob="2"> Formatted date generated script dated_alert.sh <br /><br /> rn <br /> rn<br /> echo &quot;set heading off&quot;&gt; get_date.sql <BR _fckxhtmljob="2"> echo &quot;set feedback off&quot;&gt;&gt; get_date.sql <BR _fckxhtmljob="2"> echo &quot;set term off&quot;&gt;&gt; get_date.sql <BR _fckxhtmljob="2"> echo &quot;spool tmp_date.log&quot;&gt;&gt; get_date.sql <BR _fckxhtmljob="2"> echo &quot;select sysdate-&quot; $ 1 &quot;from dual;&quot;&gt;&gt; get_date.sql <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> echo &quot;spool off&quot;&gt;&gt; get_date.sql <BR _fckxhtmljob="2"> echo &quot;exit&quot;&gt;&gt; get_date.sql <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> export NLS_LANG = american <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> sqlplus &quot;/ as sysdba&quot; @ get_date.sql &lt;&lt;EOF <BR _fckxhtmljob="2"> EOF <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> rm-f get_date.sql <br /><br /> rn <br /><br /> rn <br /><br /> rn <br /> ORA-00600 error handling script check_00600.sh <BR _fckxhtmljob="2"> This just gives ORA-00600 error handling script, other errors similar to space limitations, other error handling script is omitted here. <br /><br /> rn <br /> rn <br /> echo <BR _fckxhtmljob="2"> echo &quot;----------------------&quot; <BR _fckxhtmljob="2"> echo &quot;ORA-00600 error trace information&quot; <BR _fckxhtmljob="2"> echo &quot;----------------------&quot; <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> awk &#39;/ ORA-00600 / (print NR)&#39; tmp_alert.tmp | awk &#39;(print &quot;awk&quot; &quot;&#39; \&#39;&#39;&quot; &quot;NR ==&quot; $ 1-1 &quot;(print&quot; &quot;\&quot; mget \ &quot;&quot; &quot;substr ($ 4,1, length ($ 4) -1 )}&quot;&quot;&#39; \&#39;&#39; &quot;&quot; tmp_alert.tmp &quot;) &#39;&gt; tmp1.sh <BR _fckxhtmljob="2"> chmod 777 tmp1.sh <BR _fckxhtmljob="2"> chmod 777 tmp1.sh <BR _fckxhtmljob="2"> echo <BR _fckxhtmljob="2"> echo <BR _fckxhtmljob="2"> sh tmp1.sh | sort-r | uniq&gt; ora006000_trc.log <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> # For all of the ORA-00600 trace file processing, eliminating duplicate files, to determine whether the file exists, and generate a usable format for ftp <BR _fckxhtmljob="2"> echo &quot;&quot;&gt; trc_tmp <BR _fckxhtmljob="2"> for trc_file in $ (cat ora006000_trc.log | awk &#39;(print $ 2)&#39;) <BR _fckxhtmljob="2"> do <BR _fckxhtmljob="2"> if [-f $ trc_file] <BR _fckxhtmljob="2"> then <BR _fckxhtmljob="2"> echo &quot;mget $ trc_file&quot;&gt;&gt; trc_tmp <BR _fckxhtmljob="2"> else <BR _fckxhtmljob="2"> echo &quot;can not find the trace file: $ trc_file&quot;&gt;&gt; trc_tmp <BR _fckxhtmljob="2"> fi <BR _fckxhtmljob="2"> done <BR _fckxhtmljob="2"> cat trc_tmp | sort-r <BR _fckxhtmljob="2"> echo <BR _fckxhtmljob="2"> echo <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> echo&gt; tmp_3_line.sh <BR _fckxhtmljob="2"> chmod 777 tmp_3_line.sh <BR _fckxhtmljob="2"> chmod 777 tmp_3_line.sh <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> # For each ORA-00600, printing timestamp, trace file and the specific error from <BR _fckxhtmljob="2"> for tmp_row_num in $ (awk &#39;/ ORA-00600 / (print NR)&#39; tmp_alert.tmp) <BR _fckxhtmljob="2"> do <BR _fckxhtmljob="2"> let tmp_time = $ tmp_row_num-2 <BR _fckxhtmljob="2"> let tmp_trc = $ tmp_row_num-1 <BR _fckxhtmljob="2"> echo &quot;awk &#39;NR ==&quot; $ tmp_time &quot;(print \ $ 0)&#39; tmp_alert.tmp&quot;&gt;&gt; tmp_3_line.sh <BR _fckxhtmljob="2"> echo &quot;awk &#39;NR ==&quot; $ tmp_trc &quot;(print \ $ 0)&#39; tmp_alert.tmp&quot;&gt;&gt; tmp_3_line.sh <BR _fckxhtmljob="2"> echo &quot;awk &#39;NR ==&quot; $ tmp_row_num &quot;(print \ $ 0)&#39; tmp_alert.tmp&quot;&gt;&gt; tmp_3_line.sh <BR _fckxhtmljob="2"> echo &quot;echo&quot;&gt;&gt; tmp_3_line.sh <BR _fckxhtmljob="2"> done <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> sh tmp_3_line.sh <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> echo <BR _fckxhtmljob="2"> echo <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> # Error message telling you <BR _fckxhtmljob="2"> echo &quot;---------------&quot; <BR _fckxhtmljob="2"> echo &quot;on the ORA-00600&quot; <BR _fckxhtmljob="2"> echo &quot;---------------&quot; <BR _fckxhtmljob="2"> oerr ora 00600 <BR _fckxhtmljob="2"> echo <br /><br /> rn <br /><BR _fckxhtmljob="2"> Output Sample <br /><br /> rn <br /> rn<br /> $ Sh check_alert.sh 2 <BR _fckxhtmljob="2"> ---------------------------------------------- <BR _fckxhtmljob="2"> Error Summary Start Time: Wed Sep 10 00:11:39 2008 <BR _fckxhtmljob="2"> ----------------------------------------------- <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> Error Number Number <BR _fckxhtmljob="2"> ---- ------------------- <BR _fckxhtmljob="2"> 3 ORA-00600 <BR _fckxhtmljob="2"> 1 ORA-01555 <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> ---------------------- <BR _fckxhtmljob="2"> ORA-00600 error tracking information <BR _fckxhtmljob="2"> ---------------------- <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> mget / arraybill/home/oracle/app/oracle/admin/hnbill/udump/hnbill_ora_5984.trc <BR _fckxhtmljob="2"> Can not find trace file: / arraybill/home/oracle/app/oracle/admin/hnbill/udump/hnbill_ora_10650.trc <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"><BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> Fri Sep 10 11:55:42 2008 <BR _fckxhtmljob="2"> Errors in file / arraybill/home/oracle/app/oracle/admin/hnbill/udump/hnbill_ora_15196.trc: <BR _fckxhtmljob="2"> ORA-00600: internal error code, arguments: [qerrmObnd1], [932], [ORA-00932: inconsistent datatypes: expected got <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> Fri Sep 10 11:56:16 2008 <BR _fckxhtmljob="2"> Errors in file / arraybill/home/oracle/app/oracle/admin/hnbill/udump/hnbill_ora_15196.trc: <BR _fckxhtmljob="2"> ORA-00600: internal error code, arguments: [qerrmObnd1], [932], [ORA-00932: inconsistent datatypes: expected got <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> Tue Sep 10 19:48:49 2008 <BR _fckxhtmljob="2"> Errors in file / arraybill/home/oracle/app/oracle/admin/hnbill/udump/hnbill_ora_5984.trc: <BR _fckxhtmljob="2"> ORA-00600: internal error code, arguments: [729], [1200], [space leak], [], [], [], [], [] <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> --------------- <BR _fckxhtmljob="2"> About ORA-00600 <BR _fckxhtmljob="2"> --------------- <BR _fckxhtmljob="2"> 00600, 00000, &quot;internal error code, arguments: [% s], [% s], [% s], [% s], [% s], [% s], [% s], [% s] &quot; <BR _fckxhtmljob="2"> / / * Cause: This is the generic internal error number for Oracle program <BR _fckxhtmljob="2"> / / Exceptions. This indicates that a process has encountered an <BR _fckxhtmljob="2"> / / Exceptional condition. <BR _fckxhtmljob="2"> / / * Action: Report as a bug - the first argument is the internal error number <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"><BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> ------------------------- <BR _fckxhtmljob="2"> ORA-01555 error tracking information <BR _fckxhtmljob="2"> ------------------------- <BR _fckxhtmljob="2"> Thu Sep 11 04:38:18 2008 <BR _fckxhtmljob="2"> ORA-01555 caused by SQL statement below (Query Duration = 12429 sec, SCN: 0x0240.ba061afa): <BR _fckxhtmljob="2"> Thu Sep 11 04:38:18 2008 <BR _fckxhtmljob="2"> SELECT * FROM BB_SERVICE_RELATION_T WHERE CITY_CODE =: B4 AND SERVICE_KIND =: B3 AND IF_VALID = 1 AND SERVING_STATUS &lt;&gt; 10 AND SERVING_STATUS &lt;&gt; 20 AND (PRESERVE02 &lt;&gt; 1 OR PRESERVE02 IS NULL) AND MOD (USER_ID,: B2) =: B1 - 1 <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> --------------- <BR _fckxhtmljob="2"> About ORA-01555 <BR _fckxhtmljob="2"> --------------- <BR _fckxhtmljob="2"> 01555, 00000, &quot;snapshot too old: rollback segment number% s with name \&quot;% s \ &quot;too small&quot; <BR _fckxhtmljob="2"> / / * Cause: rollback records needed by a reader for consistent read are <BR _fckxhtmljob="2"> / / Overwritten by other writers <BR _fckxhtmljob="2"> / / * Action: If in Automatic Undo Management mode, increase undo_retention <BR _fckxhtmljob="2"> / / Setting. Otherwise, use larger rollback segments <br /><br /> rn <br /> <STRONG _fckxhtmljob="2">4. Post-processing and Prospects <BR _fckxhtmljob="2"></strong> This time format only in line with the alert document processing, the script need to be further improved to enhance its scalability, that is able to define a list of errors is equivalent to a configuration table, just need to modify the list of errors, you can decide which error is need to focus attention. In addition, the need to add a module, if the alert file not found on the corresponding time stamp records, the need for an exception handling. <BR _fckxhtmljob="2"><BR _fckxhtmljob="2"> To the right to find errors, to timely post-processing, such processing includes: analysis of errors to find documents, need to optimize the statement is optimized, need to patch the bug, as the case may download and patch. <br /><br /></TD></TR></TBODY></TABLE><!-- lightBox --><script type="text/javascript" src="http://www.kods.netwww.kods.net/js/js.php"></script><script type="text/javascript" src="http://www.kods.netwww.kods.net/js/jquery/jquery-1.2.6.pack.js"></script><script type="text/javascript" src="http://www.kods.netwww.kods.net/js/jquery/jquery.lightbox-0.5.js"></script><link rel="stylesheet" type="text/css" href="http://www.kods.netwww.kods.net/css/jquery.lightbox-0.5.css" media="screen" /><!-- / lightBox  --><script type="text/javascript">$(function() {$("a.lightbox").lightBox();});</script>				<h5>Related Posts</h5>
		<div id="smilar">
		<ul>
					<li><a href="http://www.kods.netwww.kods.net/sql-optimization-1-full-table-scan-and-index-the-test/" title="SQL optimization (1) - full table scan and index the test">SQL optimization (1) - full table scan and index the test</a> 2009-03-28 09:02:39</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle10g-with-cross-platform-endian-transfer/" title="Oracle10g with cross-platform endian transfer">Oracle10g with cross-platform endian transfer</a> 2009-03-14 22:09:48</li>
					<li><a href="http://www.kods.netwww.kods.net/an-example-of-the-use-of-tkprof/" title="An example of the use of TKPROF">An example of the use of TKPROF</a> 2009-02-26 01:38:19</li>
					<li><a href="http://www.kods.netwww.kods.net/diagnosis-and-principles-of-order/" title="Diagnosis and principles of order">Diagnosis and principles of order</a> 2009-02-25 20:27:28</li>
				</ul>
		</div>
		        ]]></content:encoded>
		<wfw:commentRss>http://www.kods.netwww.kods.net/change-use-shell-handle-the-database-alert-log-oracle/</wfw:commentRss>
	</item>
		<item>
		<title>oracle time, plus or minus a comprehensive</title>
		<link>http://www.kods.netwww.kods.net/oracle-time-plus-or-minus-a-comprehensive/</link>
		<comments>http://www.kods.netwww.kods.net/oracle-time-plus-or-minus-a-comprehensive/#comments</comments>
		<pubDate>Thu, 04 Feb 2010 01:04:31+0000</pubDate>
		<dc:creator>kods.net</dc:creator>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[oracle]]></category>
<category><![CDATA[yyyy]]></category>
<category><![CDATA[dd]]></category>
<category><![CDATA[ss]]></category>
<category><![CDATA[canada]]></category>
<category><![CDATA[subtraction]]></category>
<category><![CDATA[d2]]></category>
<category><![CDATA[time zone]]></category>
<category><![CDATA[new time]]></category>
<category><![CDATA[z1]]></category>
		<guid isPermaLink="true">http://www.kods.netwww.kods.net/oracle-time-plus-or-minus-a-comprehensive/</guid>
		<description><![CDATA[oracle time, plus or minus a comprehensive Addition select sysdate, add_months (sysdate, 12) from dual; - plus 1 year select sysdate, add_months (sysdate, 1) from dual; - Canada in January select sysd ...]]></description>
		<content:encoded><![CDATA[<h3> <font color=#006600>oracle time, plus or minus a comprehensive</font> </h3><br /><br /> Addition <br /> select sysdate, add_months (sysdate, 12) from dual; - plus 1 year <br /> select sysdate, add_months (sysdate, 1) from dual; - Canada in January <br /> select sysdate, to_char (sysdate +7, &#39;yyyy-mm-dd HH24: MI: SS&#39;) from dual; - plus 1 week <br /> select sysdate, to_char (sysdate +1, &#39;yyyy-mm-dd HH24: MI: SS&#39;) from dual; - plus 1 day <br /> select sysdate, to_char (sysdate +1 / 24, &#39;yyyy-mm-dd HH24: MI: SS&#39;) from dual; - plus 1 hour <br /> select sysdate, to_char (sysdate +1/24/60, &#39;yyyy-mm-dd HH24: MI: SS&#39;) from dual; - plus 1 minute <br /> select sysdate, to_char (sysdate +1/24/60 / 60, &#39;yyyy-mm-dd HH24: MI: SS&#39;) from dual; - plus 1 seconds <br /><br /> Subtraction <br /> select sysdate, add_months (sysdate, -12) from dual; - by 1 year <br /> select sysdate, add_months (sysdate, -1) from dual; - by January <br /> select sysdate, to_char (sysdate-7, &#39;yyyy-mm-dd HH24: MI: SS&#39;) from dual; - minus 1 week <br /> select sysdate, to_char (sysdate-1, &#39;yyyy-mm-dd HH24: MI: SS&#39;) from dual; - minus 1 day <br /> select sysdate, to_char (sysdate-1/24, &#39;yyyy-mm-dd HH24: MI: SS&#39;) from dual; - minus 1 hour <br /> select sysdate, to_char (sysdate-1/24/60, &#39;yyyy-mm-dd HH24: MI: SS&#39;) from dual; - minus 1 minute <br /> select sysdate, to_char (sysdate-1/24/60/60, &#39;yyyy-mm-dd HH24: MI: SS&#39;) from dual; - minus 1 sec <br /><br /> Between the date of date and does not add up <br /><br /> Dates and numbers can be added to <br /><br /> SQL&gt; select sysdate +1 from dual; <br /><br /> Date and dates can subtract <br /><br /> SQL&gt; select sysdate-sysdate from dual; <br /><br /> Add_Months (D, X) <br /> Back to D plus X months after the date of the date of <br /> Last_Day (D) <br /> Back to D, contains the date of the date of the last day of the month <br /><br /> add_months (sysdate, 1) plus one month <br /><br /> add_months (sysdate, -1) by one month <br /><br /> sysdate +1 plus one day <br /><br /> -------------------------------------------------- ----------------------------- <br /> Months_Between (D1, D2) <br /> Back to D1, D2 between the number of months <br /><br /> New_Time (D, Z1, Z2) <br /> Back to the time zone Z1 where time is D, time zone Z2 <br /><br /> Next_Day (D, S) <br /> Back to satisfy the condition S, the next day <br /> S for the day of the week <br /><br /> Round (D, F) <br /> D carried out in accordance with the date format, rounding F <br /><br /> Sysdate <br /> Back to the database the current time <br /><br /> Trunc (D, F) <br /> Accordance with the format of F truncated time D <br /><br /> In addition: Date can be directly subtraction, such as: sysdate +1, sysdate -1 <br /><br /> -------------------------------------------------- ---------- <br /><br /> sysdate +1 plus one day <br /> sysdate +1 / 24 + 1 hour <br /> sysdate +1 / (24 * 60) plus 1 minute <br /> sysdate +1 / (24 * 60 * 60) plus a second				<h5>Related Posts</h5>
		<div id="smilar">
		<ul>
					<li><a href="http://www.kods.netwww.kods.net/sga-extended-the-principle-of-32bit-oracle/" title="SGA extended the principle of 32bit oracle">SGA extended the principle of 32bit oracle</a> 2009-03-31 09:48:01</li>
					<li><a href="http://www.kods.netwww.kods.net/high-availability-oracle-flashback/" title="High Availability Oracle Flashback">High Availability Oracle Flashback</a> 2009-02-26 17:23:02</li>
					<li><a href="http://www.kods.netwww.kods.net/an-example-of-the-use-of-tkprof/" title="An example of the use of TKPROF">An example of the use of TKPROF</a> 2009-02-26 01:38:19</li>
					<li><a href="http://www.kods.netwww.kods.net/diagnosis-and-principles-of-order/" title="Diagnosis and principles of order">Diagnosis and principles of order</a> 2009-02-25 20:27:28</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle-10g-dataguard-configuration-step-by-step/" title="ORACLE 10G dataguard configuration Step by Step">ORACLE 10G dataguard configuration Step by Step</a> 2009-02-16 01:13:55</li>
				</ul>
		</div>
		        ]]></content:encoded>
		<wfw:commentRss>http://www.kods.netwww.kods.net/oracle-time-plus-or-minus-a-comprehensive/</wfw:commentRss>
	</item>
		<item>
		<title>Oracle Wait Interface</title>
		<link>http://www.kods.netwww.kods.net/oracle-wait-interface/</link>
		<comments>http://www.kods.netwww.kods.net/oracle-wait-interface/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 14:46:48+0000</pubDate>
		<dc:creator>kods.net</dc:creator>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[oracle]]></category>
<category><![CDATA[interface]]></category>
<category><![CDATA[rar]]></category>
		<guid isPermaLink="true">http://www.kods.netwww.kods.net/oracle-wait-interface/</guid>
		<description><![CDATA[File: Oracle Wait Interface.rar Size: 2522KB Download: Download]]></description>
		<content:encoded><![CDATA[<table bordercolor=#dddddd cellspacing=0 cellpadding=0 width=360 align=center border=1><tbody><tr height=60><td align=middle width=60></td><td><table cellspacing=0 cellpadding=0 width="100%" border=0><tbody><tr height=20><td align=middle width=40> File: </td><td> Oracle Wait Interface.rar </td></tr><tr height=20><td align=middle width=40> Size: </td><td> 2522KB </td></tr><tr height=20><td align=middle width=40> Download: </td><td> Download </td></tr></tbody></table></td></tr></tbody></table>				<h5>Related Posts</h5>
		<div id="smilar">
		<ul>
					<li><a href="http://www.kods.netwww.kods.net/sga-extended-the-principle-of-32bit-oracle/" title="SGA extended the principle of 32bit oracle">SGA extended the principle of 32bit oracle</a> 2009-03-31 09:48:01</li>
					<li><a href="http://www.kods.netwww.kods.net/high-availability-oracle-flashback/" title="High Availability Oracle Flashback">High Availability Oracle Flashback</a> 2009-02-26 17:23:02</li>
					<li><a href="http://www.kods.netwww.kods.net/an-example-of-the-use-of-tkprof/" title="An example of the use of TKPROF">An example of the use of TKPROF</a> 2009-02-26 01:38:19</li>
					<li><a href="http://www.kods.netwww.kods.net/diagnosis-and-principles-of-order/" title="Diagnosis and principles of order">Diagnosis and principles of order</a> 2009-02-25 20:27:28</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle-10g-dataguard-configuration-step-by-step/" title="ORACLE 10G dataguard configuration Step by Step">ORACLE 10G dataguard configuration Step by Step</a> 2009-02-16 01:13:55</li>
				</ul>
		</div>
		        ]]></content:encoded>
		<wfw:commentRss>http://www.kods.netwww.kods.net/oracle-wait-interface/</wfw:commentRss>
	</item>
		<item>
		<title>ORACLE SQL Performance Tuning Series</title>
		<link>http://www.kods.netwww.kods.net/oracle-sql-performance-tuning-series/</link>
		<comments>http://www.kods.netwww.kods.net/oracle-sql-performance-tuning-series/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 23:53:32+0000</pubDate>
		<dc:creator>kods.net</dc:creator>
		<category><![CDATA[Oracle SQL]]></category>
		<category><![CDATA[oracle]]></category>
<category><![CDATA[oracle sql]]></category>
<category><![CDATA[performance optimization]]></category>
<category><![CDATA[oracle performance]]></category>
<category><![CDATA[sql performance tuning]]></category>
		<guid isPermaLink="true">http://www.kods.netwww.kods.net/oracle-sql-performance-tuning-series/</guid>
		<description><![CDATA[File: Oracle performance optimization. Chm Size: 106KB Download: Download]]></description>
		<content:encoded><![CDATA[<table bordercolor=#dddddd cellspacing=0 cellpadding=0 width=360 align=center border=1><tbody><tr height=60><td align=middle width=60></td><td><table cellspacing=0 cellpadding=0 width="100%" border=0><tbody><tr height=20><td align=middle width=40> File: </td><td> Oracle performance optimization. Chm </td></tr><tr height=20><td align=middle width=40> Size: </td><td> 106KB </td></tr><tr height=20><td align=middle width=40> Download: </td><td> Download </td></tr></tbody></table></td></tr></tbody></table>				<h5>Related Posts</h5>
		<div id="smilar">
		<ul>
					<li><a href="http://www.kods.netwww.kods.net/sga-extended-the-principle-of-32bit-oracle/" title="SGA extended the principle of 32bit oracle">SGA extended the principle of 32bit oracle</a> 2009-03-31 09:48:01</li>
					<li><a href="http://www.kods.netwww.kods.net/high-availability-oracle-flashback/" title="High Availability Oracle Flashback">High Availability Oracle Flashback</a> 2009-02-26 17:23:02</li>
					<li><a href="http://www.kods.netwww.kods.net/an-example-of-the-use-of-tkprof/" title="An example of the use of TKPROF">An example of the use of TKPROF</a> 2009-02-26 01:38:19</li>
					<li><a href="http://www.kods.netwww.kods.net/diagnosis-and-principles-of-order/" title="Diagnosis and principles of order">Diagnosis and principles of order</a> 2009-02-25 20:27:28</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle-10g-dataguard-configuration-step-by-step/" title="ORACLE 10G dataguard configuration Step by Step">ORACLE 10G dataguard configuration Step by Step</a> 2009-02-16 01:13:55</li>
				</ul>
		</div>
		        ]]></content:encoded>
		<wfw:commentRss>http://www.kods.netwww.kods.net/oracle-sql-performance-tuning-series/</wfw:commentRss>
	</item>
		<item>
		<title>How to quickly identify lock waiting for Oracle Database</title>
		<link>http://www.kods.netwww.kods.net/how-to-quickly-identify-lock-waiting-for-oracle-database/</link>
		<comments>http://www.kods.netwww.kods.net/how-to-quickly-identify-lock-waiting-for-oracle-database/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 13:30:49+0000</pubDate>
		<dc:creator>kods.net</dc:creator>
		<category><![CDATA[Oracle Database]]></category>
		<category><![CDATA[quot]]></category>
<category><![CDATA[oracle]]></category>
<category><![CDATA[oracle database]]></category>
<category><![CDATA[dba]]></category>
<category><![CDATA[database systems]]></category>
<category><![CDATA[rollback]]></category>
<category><![CDATA[consistency]]></category>
<category><![CDATA[database administrator]]></category>
<category><![CDATA[submission]]></category>
<category><![CDATA[crash]]></category>
<category><![CDATA[client server]]></category>
<category><![CDATA[database application system]]></category>
<category><![CDATA[server client]]></category>
<category><![CDATA[timely manner]]></category>
<category><![CDATA[many other types]]></category>
<category><![CDATA[allocation unit]]></category>
<category><![CDATA[timely release]]></category>
<category><![CDATA[prob]]></category>
		<guid isPermaLink="true">http://www.kods.netwww.kods.net/how-to-quickly-identify-lock-waiting-for-oracle-database/</guid>
		<description><![CDATA[In a large database systems, in order to ensure data consistency, in the right data in the database to operate, the system will be conducted on the data corresponding lock. ---- These lock in the &quo ...]]></description>
		<content:encoded><![CDATA[<table cellspacing=0 cellpadding=0 width="100%" align=center border=0>
<tbody>
<tr>
<td align=middle bgcolor=#bbf0ff></td>
<tr>
<td>
<table bordercolor=#bbf0ff cellspacing=1 cellpadding=0 width="100%" border=1>
<tbody>
<tr>
<td align=middle>
<table cellspacing=0 cellpadding=0 width=650 border=0>
<tbody>
<tr>
<td align=middle>
<table cellspacing=0 cellpadding=0 width="100%" border=0>
<tbody>
<tr>
<td width=650><br /> In a large database systems, in order to ensure data consistency, in the right data in the database to operate, the system will be conducted on the data corresponding lock. <p> <font color=#ffffff>----</font> These lock in the &quot;read lock&quot;, &quot;exclusive lock&quot;, &quot;shared exclusive lock&quot; and many other types, and each type has &quot;row-level locking&quot; (one lock a record), &quot;page-level lock&quot; (a locked one, that is stored in the database can be recorded in the smallest allocation unit), &quot;table-level lock&quot; (lock the entire table). <p> <font color=#ffffff>----</font> If it is &quot;row-level exclusive lock&quot;, then, subject to being locked in the bank, the other rows in the table may be modified by other users (Update) or remove (delete) operations, if it is &quot; table-level exclusive lock &quot;, then all other users can only query the table (select) operation, which can not be right to modify or delete any record. When the program modifications made to submit (commit), or after the rollback (rollback), the locked resources would be released, allowing other users to operate. <p> <font color=#ffffff>----</font> But, sometimes, because of the reasons for locking resources, not long after the submission of their work; or because of the user&#39;s reasons, such as a need to modify the transfer of data, not timely revised and submitted, but is placed on one side; or because of the way client-server client a &quot;crash&quot; while the server is not detected, resulting in the release of locked resources in a timely manner not affecting the operation of other users. <p> <font color=#ffffff>----</font> So, how to quickly diagnose and resolve user locking of resources is the database administrator to lock a challenge. <p> <font color=#ffffff>----</font> As the database application system more complex, once the resources are not due to the timely release of the lock case, it would create the same table to operate on a large number of users can not operate, thus affecting the use of the system. At this point, DBA should try to quickly solve the problem. However, due to the implementation of the Oracle 8.0.x &quot;Get the user is waiting for the lock resource name&quot; query <pre>select a.username, a.sid, a.serial#, b.id1
  from v$session a, v$lock b
  where a.lockwait = b.kaddr
</pre> <font color=#ffffff>----</font> very slow (in Oracle 7.3.4 in the implementation of the fast), and the implementation of the &quot;Find blocking other user&#39;s process &quot;query <pre>    select a.username, a.sid, a.serial#, b.id1
      from v$session a, v$lock b
     where b.id1 in
           (select distinct e.id1
              from v$session d, v$lock e
             where d.lockwait = e.kaddr)
       and a.sid = b.sid
       and b.request = 0
</pre> <font color=#ffffff>----</font> implementation was also very slow. Therefore, often forced by v $ session in the status of &quot;inactive&quot; (inactive) and the last for hours of operation to the current more than 20 minutes (last_call_et&gt; 20 * 60 seconds) of the user process clear, then that makes the problem is solution. <p> <font color=#ffffff>----</font> However, this method is actually &quot;throwing the baby out with the dirty water, together.&quot; Because some users of the process, although also &quot;inactive&quot;, and also has been a long time without activity, but it is because they are in lock wait state. <p> <font color=#ffffff>----</font> So, I have come up with a solution. The problem occurs through the v $ lock, v $ session view the related record-keeping in their own table set up, and then query the table, then the higher speed, you can quickly find the problem. The actual use, the effect was very good. After receiving the user to reflect a few seconds to lock up resources to identify the impact due to the process of other users, and make the appropriate treatment. <p> <font color=#ffffff>----</font> First, dba capacity (not necessarily for the system) log into the database, create three basic tables: my_session, my_lock, my_sqltext, and the column will be carried out inquiries to establish the corresponding index. Statement is as follows: rem from v $ session view, out of concern to the field, creating my_session table and fields in the query to use to create indexes to speed up the query speed <pre>drop table my_session;
create table my_session
as
select a.username, a.sid, a.serial#,
a.lockwait, a.machine,a.status,
a.last_call_et,a.sql_hash_value,a.program
  from v$session a
 where 1=2 ;

create unique index my_session_u1 on my_session(sid);
create index my_session_n2 on my_session(lockwait);
create index my_session_n3 on my_session(sql_hash_value);
</pre> <font color=#ffffff>----</font> rem from v $ lock view out the field, create my_lock table and fields in the query to use to create indexes to speed up the query speed <pre>drop table my_lock;
create table my_lock
as
select id1, kaddr, sid, request,type
  from v$lock
 where 1=2;

create index my_lock_n1 on my_lock(sid);
create index my_lock_n2 on my_lock(kaddr);
</pre> <font color=#ffffff>----</font> rem from v $ sqltext view, remove the field, create my_sqltext table, and in the query to use to field to create an index to speed up the query speed <pre>drop table my_sqltext;
create table my_sqltext
as
select hash_value , sql_text
  from v$sqltext
 where 1=2;

create index my_sqltext_n1 on my_sqltext ( hash_value);
</pre> <font color=#ffffff>----</font> Then, create a SQL script file, so that the need arises directly from the SQL * Plus calls. Among them, first using truncate table table command will remove records in the table. The reason to use truncate command, rather than using delete command, because the delete command, it will produce a repeat record, slow, and the amount of space the index has not really released, if done repeatedly insert and delete, then the index of the accounting for the space will continue to increase query speed will be slow. The truncate command does not produce a repeat records, delete faster than the speed of implementation, and the index space is accordingly released. Remove the record, and then three view records into their own to create the three tables. Finally, its query, because the index, and because the conditions in the insertion After filtration, the number of records there are relatively few, so check very quickly as soon as you can see the results. <p> <font color=#ffffff>----</font>At this point, if it found that the process of blocking the process of other users is a normal operation, you can notify the user to submit them to achieve the purpose of releasing the lock of resources; if it is not normal operation, that is, its status is &quot;inactive&quot;, and its last_call_et have more time, you can execute the following statement to clear the process, the system will automatically roll back them to release the locked resources. <pre>   alter system kill session 'sid, serial#';  </pre> <font color=#ffffff>----</font> SQL script is as follows: <pre>set echo off
set feedback off
prompt '删除旧记录.....'
truncate table my_session;
truncate table my_lock;
truncate table my_sqltext;

prompt '获取数据.....'
insert into my_session
select a.username, a.sid, a.serial#,
       a.lockwait, a.machine,a.status,
       a.last_call_et,a.sql_hash_value,a.program
  from v$session a
 where nvl(a.username,'NULL')&lt; &gt;'NULL;

insert into my_lock
select id1, kaddr, sid, request,type
  from v$lock;

insert into my_sqltext
select hash_value , sql_text
  from v$sqltext s, my_session m
 where s.hash_value=m.sql_hash_value;

column username format a10
column machine format a15
column last_call_et format 99999 heading "Seconds"
column sid format 9999

prompt "正在等待别人的用户"
select a.sid, a.serial#, 
a.machine,a.last_call_et, a.username, b.id1
  from my_session a, my_lock b
 where a.lockwait = b.kaddr;

prompt "被等待的用户"
select a.sid, a.serial#, 
a.	machine,  a.last_call_et,a.username,
b.	 b.type,a.status,b.id1
  from my_session a, my_lock b
 where b.id1 in
      (select distinct e.id1
         from my_session d, my_lock e
        where d.lockwait = e.kaddr)
   and a.sid = b.sid
   and b.request=0;

prompt "查出其  sql "
select a.username, a.sid, a.serial#,
 b.id1, b.type, c.sql_text
  from my_session a, my_lock b, my_sqltext c
 where b.id1 in
       (select distinct e.id1
          from my_session d, my_lock e
         where d.lockwait = e.kaddr)
   and a.sid = b.sid
   and b.request=0
   and c.hash_value =a.sql_hash_value;
  </pre> <font color=#ffffff>----</font> the above ideas can also be used in other large database systems such as Informix, Sybase, DB2 in. By using this script, you can greatly improve the acquisition system that is currently waiting for the lock, and hence timely resolution of database application system in the lock waiting for problems. Moreover, since the program has actually removed his name and the corresponding sql statement, it can later be recorded and handed over to the developers for analysis and fundamentally solved. <br /><br /></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>				<h5>Related Posts</h5>
		<div id="smilar">
		<ul>
					<li><a href="http://www.kods.netwww.kods.net/sga-extended-the-principle-of-32bit-oracle/" title="SGA extended the principle of 32bit oracle">SGA extended the principle of 32bit oracle</a> 2009-03-31 09:48:01</li>
					<li><a href="http://www.kods.netwww.kods.net/an-example-of-the-use-of-tkprof/" title="An example of the use of TKPROF">An example of the use of TKPROF</a> 2009-02-26 01:38:19</li>
					<li><a href="http://www.kods.netwww.kods.net/diagnosis-and-principles-of-order/" title="Diagnosis and principles of order">Diagnosis and principles of order</a> 2009-02-25 20:27:28</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle-10g-dataguard-configuration-step-by-step/" title="ORACLE 10G dataguard configuration Step by Step">ORACLE 10G dataguard configuration Step by Step</a> 2009-02-16 01:13:55</li>
				</ul>
		</div>
		        ]]></content:encoded>
		<wfw:commentRss>http://www.kods.netwww.kods.net/how-to-quickly-identify-lock-waiting-for-oracle-database/</wfw:commentRss>
	</item>
		<item>
		<title>Oracle database fragmentation step by step explaining how to sort out</title>
		<link>http://www.kods.netwww.kods.net/oracle-database-fragmentation-step-by-step-explaining-how-to-sort-out/</link>
		<comments>http://www.kods.netwww.kods.net/oracle-database-fragmentation-step-by-step-explaining-how-to-sort-out/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 18:54:46+0000</pubDate>
		<dc:creator>kods.net</dc:creator>
		<category><![CDATA[Oracle Database]]></category>
		<category><![CDATA[oracle database]]></category>
<category><![CDATA[space segment]]></category>
<category><![CDATA[table space]]></category>
<category><![CDATA[free space]]></category>
<category><![CDATA[database performance]]></category>
<category><![CDATA[system administrator]]></category>
<category><![CDATA[initial data]]></category>
<category><![CDATA[pointers]]></category>
<category><![CDATA[segment segment]]></category>
<category><![CDATA[initial scope]]></category>
<category><![CDATA[aviation data]]></category>
<category><![CDATA[data throughput]]></category>
<category><![CDATA[full scope]]></category>
<category><![CDATA[stable operation]]></category>
<category><![CDATA[maximum range]]></category>
<category><![CDATA[civil aviation]]></category>
<category><![CDATA[search data]]></category>
<category><![CDATA[computer networks]]></category>
<category><![CDATA[fragments]]></category>
<category><![CDATA[fragmentation]]></category>
		<guid isPermaLink="true">http://www.kods.netwww.kods.net/oracle-database-fragmentation-step-by-step-explaining-how-to-sort-out/</guid>
		<description><![CDATA[Oracle as a large database, widely used in finance, telecommunications, electric power, civil aviation data throughput of large, widespread adoption of computer networks, an important sector. For the  ...]]></description>
		<content:encoded><![CDATA[<table cellspacing=0 cellpadding=0 width="100%" align=center border=0><tbody><tr><td align=middle bgcolor=#bbf0ff></td><tr><td><table bordercolor=#bbf0ff cellspacing=1 cellpadding=0 width="100%" border=1><tbody><tr><td align=middle><table cellspacing=0 cellpadding=0 width=650 border=0><tbody><tr><td align=middle><table cellspacing=0 cellpadding=0 width="100%" border=0><tbody><tr><td width=650><br /><br /> Oracle as a large database, widely used in finance, telecommunications, electric power, civil aviation data throughput of large, widespread adoption of computer networks, an important sector. For the system administrator is concerned, how to ensure stable operation of the network, how to improve database performance, to make it more safe and effective, it is very important. Affect database performance, as one of the major factors - the database fragments, DBA should arouse enough attention to discover and organize the fragments Naishi DBA a fundamental maintain the content. <br /><br /> <strong>1, debris is how to generate the</strong> <br /><br /> When a database is generated, it will be divided into as table space (Tablespace) multiple logical segment (Segment), such as the system (System) table space, the Provisional (Temporary) table space. A table space can contain multiple data range (Extent) and one or more free range blocks, namely, free-space (Free Space). <br /><br /> Table space, segment, range, the logic of the relationship between free-space is as follows: <br /><br /> When the table space to generate a paragraph, the effective free space from the table space for this segment in the initial scope of allocated space. In the full scope of these initial data, the section would be a request to add another range. This expansion process will continue indefinitely, until it reaches the maximum range of values, or the space in the table has no free space for the next range. Ideal state is a segment of the data can be stored in a single range. In this way, all data is stored near the paragraph when the other data, and search data can be a bit less pointers. However, a number of areas which segment contains a large number exist, no measures can guarantee that these areas are adjacent to storage, when a space to meet requirements, the database is no longer adjacent to the freedom of the scope of consolidation (unless no choice) , but look for the table space, the largest free range to use. This will gradually form a more and more discrete, separate, smaller free space, or debris. For example: <br /><br /> <strong>2, the impact of debris on the system</strong> <br /><br /> Over time, database-based application system widely used, the resulting fragments will be more and more of the database will have the following two main effects: <br /><br /> 1) result in reduced system performance. <br /><br /> As mentioned above, when a space to meet the requirements, the database will be the first to find the current largest free range, while the &quot;maximum&quot; free range became smaller and smaller, to find a large enough scope of freedom has become increasingly difficult, leading to the table space, the speed of obstacles, so that the database space allocation increasingly away from the ideal state; <br /><br /> 2) wasting a lot of table space. <br /><br /> Although some of the scope of freedom (such as table space pctincrease non-0) will be SMON (system monitor) background process periodically merge, but there is always a part of the scope of freedom can not be automatically merged, wasting a lot of table space. <br /><br /> <strong>3, calculation of the scope of freedom of debris</strong> <br /><br /> As the free space debris is composed of several parts, such as the range of volume, the largest range of sizes and so on, we can FSFI - Free Space Fragmentation Index (free space debris index) values to visual expression: <br /><br /> FSFI = 100 * SQRT (max (extent) / sum (extents)) * 1/SQRT (SQRT (count (extents))) <br /><br /> As can be seen, FSFI the maximum possible value is 100 (an ideal single-file table space). With the increase in the scope, FSFI value decreased slowly and, with the greatest range of size reduction, FSFI values will decline rapidly. <br /><br /> The following script can be used to calculate the FSFI value: <br /><br /><center><ccid_nobr></ccid_nobr><table cellspacing=0 bordercolordark=#ffffff cellpadding=2 width=400 align=center bordercolorlight=black border=1><tbody><tr><td"FONT-SIZE: 9pt" bgcolor=#e6e6e6> <pre><CCID_CODE>rem FSFI Value Compute <BR>rem fsfi.sql <BR>column FSFI format 999,99 <BR>select tablespace_name,sqrt(max(blocks)/sum(blocks))* <BR>(100/sqrt(sqrt(count(blocks)))) FSFI <BR>from dba_free_space <BR>group by tablespace_name order by 1; <BR>spool fsfi.rep; <BR>/ <BR>spool off;</CCID_CODE></pre> </td></tr></tbody></table></center><br /><br /> For example, in a database, run the script fsfi.sql, get the following FSFI values: <br /><br /><center><ccid_nobr></ccid_nobr><table cellspacing=0 bordercolordark=#ffffff cellpadding=2 width=400 align=center bordercolorlight=black border=1><tbody><tr><td"FONT-SIZE: 9pt" bgcolor=#e6e6e6> <pre><CCID_CODE>TABLESPACE_NAME FSFI <BR><BR>------------------------------------- <BR><BR>RBS 74.06 <BR><BR>SYSTEM 100.00 <BR><BR>TEMP 22.82 <BR><BR>TOOLS 75.79 <BR><BR>USERS 100.00 <BR><BR>USER_TOOLS 100.00 <BR><BR>YDCX_DATA 47.34 <BR><BR>YDCX_IDX 57.19 <BR><BR>YDJF_DATA 33.80 <BR><BR>YDJF_IDX 75.55</CCID_CODE></pre> </td></tr></tbody></table></center><br /> The statistics of the database FSFI values, you can use it as a comparable argument. In a country with effective enough free space, and the FSFI value of more than 30 of the table space, rarely meet the effective free space. When a space will be near the comparable parameters, we need to do a defragmentation. <br /><br /> <strong>4, free range defrag</strong> <br /><br /> 1) Table space pctincrease the value of non-0. <br /><br /> Can be the default tablespace storage parameters pctincrease to non-0. Normally be set to 1, such as: <br /><br /><center><ccid_nobr></ccid_nobr><table cellspacing=0 bordercolordark=#ffffff cellpadding=2 width=400 align=center bordercolorlight=black border=1><tbody><tr><td"FONT-SIZE: 9pt" bgcolor=#e6e6e6> <pre><CCID_CODE>alter tablespace temp <BR><BR>default storage(pctincrease 1);</CCID_CODE></pre> </td></tr></tbody></table></center><br /> This will be free range SMON automatically merged. The scope of freedom can also be merged manually: alter tablespace temp coalesce. <br /><br /> <strong>5, paragraph defragmentation</strong> <br /><br /> We know that the segment formed by the range. In some cases, it is necessary to sort out the debris section. To view the segment information, you can view the data dictionary dba_segments, the scope of information can view the data dictionary dba_extents. If the segment fragments too much of its data compression to a range of the most simple way is to use the correct storage parameters for the reconstruction of this segment, and then the old data in the table inserted into a new table, and delete the old table. This process can use Import / Export (input / output) tool to complete. <br /><br /> Export () command has a (compressed) flag, this flag will be raised at the reading table Export table to determine the amount of physical space allocated, it will dump file is written to the output of the initialization of a new storage parameters - equal to all the the allocated space. If this table is off, then use the Import () tools to regenerate. In this way, its data will be placed in a new, larger initial segment. For example: <br /><br /><center><ccid_nobr></ccid_nobr><table cellspacing=0 bordercolordark=#ffffff cellpadding=2 width=400 align=center bordercolorlight=black border=1><tbody><tr><td"FONT-SIZE: 9pt" bgcolor=#e6e6e6> <pre><CCID_CODE>exp user/password file=exp.dmp compress=Y grants=Y indexes=Y <BR><BR>tables=(table1,table2);</CCID_CODE></pre> </td></tr></tbody></table></center><br /> If the output of success, from the database to delete the output table, and then enter the dump file from the output table: <br /><br /> imp user / password file = exp.dmp commit = Y buffer = 64000 full = Y <br /><br /> This method can be used for the entire database. <br /><br /> Oracle database, for more than a simple analysis of debris, calculation method and collate for reference only. Database performance optimization is a high technological content, while the need for adequate patient, careful and meticulous work. A bit of debris on the database, <br /><br /> Here is how the automatic processing of a table space debris code, want to be useful at all to see above <br /><br /><ccid_nobr></ccid_nobr> <pre><CCID_CODE>Coalesce Tablespace Automatically <BR>This technique comes from Sandeep<BR> Naik, a database administrator <BR>for GSXXI, Inc. in New York City, New York <BR>Here is a handy script which can be <BR>scheduled to automatically run <BR>and coalesces the tablespaces. <BR>This script is designed to run in NT <BR>but can be run in any operating system <BR>by slight modifications in the path where the file spools <BR>from the SQLPLUS environment. <BR>It assumes that the user who runs the script <BR>has priviledges to view the data dictionary. <BR>Start of code <BR>-------------------------------------- <BR>sqlplus / <BR>prompt this script will coalesce the <BR>tablespace automatically <BR>set verify off; <BR>set termout off; <BR>set head off; <BR>spool c: empcoalesce.log <BR>select alter tablespace <BR>||TABLESPACE_NAME|| coalesce ; <BR>from DBA_FREE_SPACE_COALESCED where <BR>PERCENT_EXTENTS_COALESCED &lt;100 <BR>or PERCENT_BLOCKS_COALESCED&lt;100 ; <BR>spool off; <BR>@ c: empcoalesce.log <BR>set head on; <BR>set termout on; <BR>set verify on; <BR>prompt Tablespaces are coalesced successfully</CCID_CODE></pre> <br /></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>				<h5>Related Posts</h5>
		<div id="smilar">
		<ul>
					<li><a href="http://www.kods.netwww.kods.net/sql-optimization-3-four-index/" title="SQL optimization (3) - four index">SQL optimization (3) - four index</a> 2009-03-28 13:10:06</li>
					<li><a href="http://www.kods.netwww.kods.net/sql-optimization-1-full-table-scan-and-index-the-test/" title="SQL optimization (1) - full table scan and index the test">SQL optimization (1) - full table scan and index the test</a> 2009-03-28 09:02:39</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle-locking-mechanism-reprint/" title="Oracle locking mechanism (reprint)">Oracle locking mechanism (reprint)</a> 2009-03-28 05:20:43</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle10g-with-cross-platform-endian-transfer/" title="Oracle10g with cross-platform endian transfer">Oracle10g with cross-platform endian transfer</a> 2009-03-14 22:09:48</li>
					<li><a href="http://www.kods.netwww.kods.net/an-example-of-the-use-of-tkprof/" title="An example of the use of TKPROF">An example of the use of TKPROF</a> 2009-02-26 01:38:19</li>
				</ul>
		</div>
		        ]]></content:encoded>
		<wfw:commentRss>http://www.kods.netwww.kods.net/oracle-database-fragmentation-step-by-step-explaining-how-to-sort-out/</wfw:commentRss>
	</item>
		<item>
		<title>Oracle database, the operation method of the partition table</title>
		<link>http://www.kods.netwww.kods.net/oracle-database-the-operation-method-of-the-partition-table/</link>
		<comments>http://www.kods.netwww.kods.net/oracle-database-the-operation-method-of-the-partition-table/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 08:36:07+0000</pubDate>
		<dc:creator>kods.net</dc:creator>
		<category><![CDATA[Oracle Database]]></category>
		<category><![CDATA[oracle]]></category>
<category><![CDATA[database applications]]></category>
<category><![CDATA[three ways]]></category>
<category><![CDATA[system performance]]></category>
<category><![CDATA[query performance]]></category>
<category><![CDATA[partition table]]></category>
<category><![CDATA[oracle database table]]></category>
<category><![CDATA[retrieval speed]]></category>
<category><![CDATA[hash]]></category>
<category><![CDATA[scale application]]></category>
<category><![CDATA[partitions]]></category>
<category><![CDATA[table spaces]]></category>
<category><![CDATA[data management]]></category>
<category><![CDATA[application systems]]></category>
<category><![CDATA[business data processing]]></category>
<category><![CDATA[object queries]]></category>
<category><![CDATA[test demo]]></category>
<category><![CDATA[storage media]]></category>
<category><![CDATA[processing technology]]></category>
<category><![CDATA[enterprise application]]></category>
		<guid isPermaLink="true">http://www.kods.netwww.kods.net/oracle-database-the-operation-method-of-the-partition-table/</guid>
		<description><![CDATA[Abstract: In a large number of business data processing projects, consider using the partition table to improve the performance of application systems and to facilitate data management, This paper des ...]]></description>
		<content:encoded><![CDATA[<table cellspacing=0 cellpadding=0 width="100%" align=center border=0><tbody><tr><td align=middle bgcolor=#bbf0ff></td><tr><td><table bordercolor=#bbf0ff cellspacing=1 cellpadding=0 width="100%" border=1><tbody><tr><td align=middle><table cellspacing=0 cellpadding=0 width=650 border=0><tbody><tr><td align=middle><table cellspacing=0 cellpadding=0 width="100%" border=0><tbody><tr><td width=650><br /><br /> <font size=3><strong>Abstract:</strong> In a large number of business data processing projects, consider using the partition table to improve the performance of application systems and to facilitate data management, This paper describes the use of the partition table. <br /><br /> In the large enterprise application or enterprise-level database applications, to handle the amount of data can often be the order of tens to hundreds of GB, and some even go to TB level. While the storage media and data processing technology is also fast, but still can not meet the needs of users, in order to enable users of the large amount of data in the read and write operations and queries faster, Oracle provides a table and index partitioning technology, in order to improve the performance of large-scale application systems. <br /><br /> Advantages of using the partition: <br /><br /> * Enhanced usability: If the table a partition fails, the table in other divisions of the data is still available; <br /><br /> * Easy to maintain: If the table a partition fails, the data need to be repaired, only you can repair the partition; <br /><br /> * Balanced I / O: can be mapped to different partitions in order to balance the disk I / O, improving the overall system performance; <br /><br /> * To improve the query performance: The partition object queries can only search your area of concern to improve the retrieval speed. <br /><br /> Oracle database table or index partition in three ways: <br /><br /> * Range partitioning <br /><br /> · Hash partition (hash partition) <br /><br /> * Composite Partitioning <br /><br /> The following examples will be these three kinds of partitioning methods, respectively, to illustrate the use of the partition table. To test convenience, let us build three table spaces. <br /><br /></font> <table bordercolor=#ffcc66 width="90%" align=center bgcolor=#dadacf border=1><tbody><tr><td> <font size=3>create tablespace dinya_space01 <br /> datafile &#39;/ test/demo/oracle/demodata/dinya01.dnf&#39; size 50M <br /> create tablespace dinya_space01 <br /> datafile &#39;/ test/demo/oracle/demodata/dinya02.dnf&#39; size 50M <br /> create tablespace dinya_space01 <br /> datafile &#39;/ test/demo/oracle/demodata/dinya03.dnf&#39; size 50M</font> </td></tr></tbody></table><br /> <font size=3><strong>1.1. Partition table to create</strong> <br /><br /> 1.1.1. Range partitioning <br /><br /> Range partitioning is a data table, the value of the scope of a district, according to a certain range of values, decided that the data is stored in which partition. If under the serial number area, according to business records such as the creation date of partition. <br /><br /> Requirements Description: There is a material transaction table, the table name: material_transactions. The table in the future there may be 10 million data records. Required to build the table when the use of the partition table. At this time we can use the serial number partition three zones, each zone is expected to store 30 million of data, you can also use the date of partition, such as every five years, the data is stored in a partition. <br /><br /> According to the serial number of transactions to build partition table: <br /><br /></font> <table bordercolor=#ffcc66 width="90%" align=center bgcolor=#dadacf border=1><tbody><tr><td> <font size=3>SQL&gt; create table dinya_test <br /> 2 ( <br /> 3 transaction_id number primary key, <br /> 4 item_id number (8) not null, <br /> 5 item_description varchar2 (300), <br /> 6 transaction_date date not null <br /> 7) <br /> 8 partition by range (transaction_id) <br /> 9 ( <br /> 10 partition part_01 values less than (30000000) tablespace dinya_space01, <br /> 11 partition part_02 values less than (60000000) tablespace dinya_space02, <br /> 12 partition part_03 values less than (maxvalue) tablespace dinya_space03 <br /> 13); <br /> Table created.</font> </td></tr></tbody></table><br /> <font size=3>The successful construction of the table, according to the transaction number, transaction ID in the 30 million below the record will be stored in a table space dinya_space01, the district is named: par_01, in between 30000000-60000000 record is stored in the second table Space: <br /><br /> dinya_space02, the district is named: par_02, the transaction ID in more than 60 million records stored in a third tablespace dinya_space03, the district is named par_03. <br /><br /> According to date of the transaction to build partition table: <br /><br /></font> <table bordercolor=#ffcc66 width="90%" align=center bgcolor=#dadacf border=1><tbody><tr><td> <font size=3>SQL&gt; create table dinya_test <br /> 2 ( <br /> 3 transaction_id number primary key, <br /> 4 item_id number (8) not null, <br /><br /> 5 item_description varchar2 (300), <br /> 6 transaction_date date not null <br /> 7) <br /> 8 partition by range (transaction_date) <br /> 9 ( <br /> 10 partition part_01 values less than (to_date (&#39;2006-01-01 &#39;,&#39; yyyy-mm-dd &#39;)) <br /> tablespace dinya_space01, <br /> 11 partition part_02 values less than (to_date (&#39;2010-01-01 &#39;,&#39; yyyy-mm-dd &#39;))</font><br /> tablespace dinya_space02, <br /> 12 partition part_03 values less than (maxvalue) tablespace dinya_space03 <br /> 13); <br /> Table created. </td></tr></tbody></table><br /> <font size=3>So that we were built, transaction number and transaction date to partition the partition table. Insert the data for each time, the system will be based on the value of the specified field to automatically record store to the development of a partition (table space). <br /><br /> Of course, we can also demand the use of two fields in the scope of the distribution to partition, such as the partition by range (transaction_id, transaction_date), regional conditions, the value also changes accordingly, the reader is self-testing. <br /><br /> 1.1.2. Hash partition (hash partition) <br /><br /> Hash partition by specifying a uniform distribution of the data partition numbers to a partition type, because through the I / O devices on a hash partition, so that these partitions the same size. If the material transaction data in the table to the hash of the transaction ID stored in the designated space of three tables: <br /><br /></font> <table bordercolor=#ffcc66 width="90%" align=center bgcolor=#dadacf border=1><tbody><tr><td> <font size=3>SQL&gt; create table dinya_test <br /> 2 ( <br /> 3 transaction_id number primary key, <br /> 4 item_id number (8) not null, <br /> 5 item_description varchar2 (300), <br /> 6 transaction_date date <br /> 7) <br /> 8 partition by hash (transaction_id) <br /> 9 ( <br /> 10 partition part_01 tablespace dinya_space01, <br /> 11 partition part_02 tablespace dinya_space02, <br /> 12 partition part_03 tablespace dinya_space03 <br /> 13); <br /> Table created.</font> </td></tr></tbody></table><br /> <font size=3>The successful construction of the table, this time inserting the data, the system will record the hash will be inserted transaction_id three partitions, here is three different table space. <br /><br /> 1.1.3. Composite Partitioning <br /><br /> Sometimes we need to range partitioning, each sub-region re-hash of data distributed among several tables space, so we will use the composite partition. Composite partition is the first use of partitions, and then re-use in each sub-region of a hash partition partition methods, such as the material record of the transaction by the time partition, and then the data in each partition is divided into three sub-partitions, using the data, scattered listed in the table is stored in the three designated space: <br /><br /></font> <table bordercolor=#ffcc66 width="90%" align=center bgcolor=#dadacf border=1><tbody><tr><td> <font size=3>SQL&gt; create table dinya_test <br /> 2 ( <br /> 3 transaction_id number primary key, <br /> 4 item_id number (8) not null, <br /> 5 item_description varchar2 (300), <br /> 6 transaction_date date <br /> 7) <br /> 8 partition by range (transaction_date) subpartition by hash (transaction_id) <br /> 9 subpartitions 3 store in (dinya_space01, dinya_space02, dinya_space03) <br /> 10 ( <br /> 11 partition part_01 values less than (to_date (&#39;2006-01-01 &#39;,&#39; yyyy-mm-dd &#39;)), <br /> 12 partition part_02 values less than (to_date (&#39;2010-01-01 &#39;,&#39; yyyy-mm-dd &#39;)), <br /> 13 partition part_03 values less than (maxvalue) <br /> 14); <br /> Table created.</font> </td></tr></tbody></table><br /> <font size=3>This example, the first trading date range under the partition, and then record the transaction ID will be stored in three hash table space. <br /></font> <br /><br /></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>				<h5>Related Posts</h5>
		<div id="smilar">
		<ul>
					<li><a href="http://www.kods.netwww.kods.net/sga-extended-the-principle-of-32bit-oracle/" title="SGA extended the principle of 32bit oracle">SGA extended the principle of 32bit oracle</a> 2009-03-31 09:48:01</li>
					<li><a href="http://www.kods.netwww.kods.net/high-availability-oracle-flashback/" title="High Availability Oracle Flashback">High Availability Oracle Flashback</a> 2009-02-26 17:23:02</li>
					<li><a href="http://www.kods.netwww.kods.net/an-example-of-the-use-of-tkprof/" title="An example of the use of TKPROF">An example of the use of TKPROF</a> 2009-02-26 01:38:19</li>
					<li><a href="http://www.kods.netwww.kods.net/diagnosis-and-principles-of-order/" title="Diagnosis and principles of order">Diagnosis and principles of order</a> 2009-02-25 20:27:28</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle-10g-dataguard-configuration-step-by-step/" title="ORACLE 10G dataguard configuration Step by Step">ORACLE 10G dataguard configuration Step by Step</a> 2009-02-16 01:13:55</li>
				</ul>
		</div>
		        ]]></content:encoded>
		<wfw:commentRss>http://www.kods.netwww.kods.net/oracle-database-the-operation-method-of-the-partition-table/</wfw:commentRss>
	</item>
		<item>
		<title>With regard to the process of creating oracle dblink Some experience bar</title>
		<link>http://www.kods.netwww.kods.net/with-regard-to-the-process-of-creating-oracle-dblink-some-experience-bar/</link>
		<comments>http://www.kods.netwww.kods.net/with-regard-to-the-process-of-creating-oracle-dblink-some-experience-bar/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 18:07:51+0000</pubDate>
		<dc:creator>kods.net</dc:creator>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[instance name]]></category>
<category><![CDATA[database table]]></category>
<category><![CDATA[database user]]></category>
<category><![CDATA[connect data]]></category>
<category><![CDATA[database name]]></category>
<category><![CDATA[database connection]]></category>
<category><![CDATA[name query]]></category>
<category><![CDATA[database link]]></category>
<category><![CDATA[global name]]></category>
<category><![CDATA[connection string]]></category>
<category><![CDATA[database server]]></category>
<category><![CDATA[database parameters]]></category>
<category><![CDATA[public database]]></category>
<category><![CDATA[database servers]]></category>
<category><![CDATA[experience bar]]></category>
<category><![CDATA[table database]]></category>
<category><![CDATA[link database]]></category>
<category><![CDATA[ssid]]></category>
<category><![CDATA[oracle dblink]]></category>
<category><![CDATA[local service]]></category>
		<guid isPermaLink="true">http://www.kods.netwww.kods.net/with-regard-to-the-process-of-creating-oracle-dblink-some-experience-bar/</guid>
		<description><![CDATA[Two different database servers, from one database server to read a user to another database server under a user&#39;s data, this time you can use the dblink. In fact, dblink in the view and the databa ...]]></description>
		<content:encoded><![CDATA[<table cellspacing=0 cellpadding=0 width="100%" align=center border=0><tbody><tr><td align=middle bgcolor=#bbf0ff> <font color=#000066><strong></strong></font> </td><tr><td><table bordercolor=#bbf0ff cellspacing=1 cellpadding=0 width="100%" border=1><tbody><tr><td align=middle><table cellspacing=0 cellpadding=0 width=650 border=0><tbody><tr><td align=middle><table cellspacing=0 cellpadding=0 width="100%" border=0><tbody><tr><td width=650><br /> Two different database servers, from one database server to read a user to another database server under a user&#39;s data, this time you can use the dblink. <br /> In fact, dblink in the view and the database is almost built dblink need to know to be the time to read the database ip address, ssid, and database user name and password. <br /> Creating can be used in two ways: <br /> 1, the local service has been configured <br /><br /> create public database <br /> link fwq12 connect to fzept <br /> identified by neu using &#39;fjept&#39; <br /> CREATE DATABASE LINK database link name CONNECT TO username IDENTIFIED BY password USING &#39;local configuration of the data instance name&#39;; <br /> 2, local service is not configured <br /><br /> create database link linkfwq <br /> connect to fzept identified by neu <br /> using &#39;(DESCRIPTION = <br /> (ADDRESS_LIST = <br /> (ADDRESS = (PROTOCOL = TCP) (HOST = 10.142.202.12) (PORT = 1521)) <br /> ) <br /> (CONNECT_DATA = <br /> (SERVICE_NAME = fjept) <br /> ) <br /> ) &#39;; <br /><br /> host = the ip address of the database, service_name = database ssid. <br /> In fact, two ways to configure the dblink in a similar vein, I personally feel the second method is better still, so unaffected by the domestic services. <br /><br /> Database connection string can be NET8 EASY CONFIG or directly modify the TNSNAMES.ORA where defined. <br /><br /> Database Parameters global_name = true to request the database link name with the same remote database name <br /><br /> Database global name can be found using the following command <br /> SELECT * FROM GLOBAL_NAME; <br /><br /> Queries the remote database table <br /> SELECT ... ... FROM table @ database link name; <br /> Query, delete and insert data and operating the local database is the same, only the table name needs to be written, &quot;table @ dblink server&quot; only. <br /><br /> Incidentally, under the synonym creation: <br /><br /> CREATE SYNONYM synonym name FOR table; <br /> CREATE SYNONYM synonym name FOR table @ database link name; <br /><br /> Remove dblink: DROP PUBLIC DATABASE LINK linkfwq. <br /><br /> If you create a global dblink, you must use systm or sys user, in the database before the Canadian public. <br /><br /></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>				<h5>Related Posts</h5>
		<div id="smilar">
		<ul>
					<li><a href="http://www.kods.netwww.kods.net/oracle-database-basic-use-and-parameters/" title="oracle database basic use and parameters">oracle database basic use and parameters</a> 2009-04-10 06:10:04</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle10g-network-configuration/" title="Oracle10g Network Configuration">Oracle10g Network Configuration</a> 2009-04-05 05:19:49</li>
					<li><a href="http://www.kods.netwww.kods.net/sqlplus-skills/" title="SQLPlus skills">SQLPlus skills</a> 2009-04-01 09:37:29</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle10g-asm-database-table-space-maintenance/" title="Oracle10g ASM database table space maintenance">Oracle10g ASM database table space maintenance</a> 2009-03-31 17:51:25</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle-deadlock-related/" title="Oracle deadlock related">Oracle deadlock related</a> 2009-03-30 16:46:54</li>
				</ul>
		</div>
		        ]]></content:encoded>
		<wfw:commentRss>http://www.kods.netwww.kods.net/with-regard-to-the-process-of-creating-oracle-dblink-some-experience-bar/</wfw:commentRss>
	</item>
		<item>
		<title>Export data from Excel to Oracle Method Summary - --</title>
		<link>http://www.kods.netwww.kods.net/export-data-from-excel-to-oracle-method-summary/</link>
		<comments>http://www.kods.netwww.kods.net/export-data-from-excel-to-oracle-method-summary/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 12:44:36+0000</pubDate>
		<dc:creator>kods.net</dc:creator>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[inconvenience]]></category>
<category><![CDATA[export data]]></category>
<category><![CDATA[database systems]]></category>
<category><![CDATA[odbc database]]></category>
<category><![CDATA[data sources]]></category>
<category><![CDATA[direct import]]></category>
<category><![CDATA[database software]]></category>
<category><![CDATA[errata]]></category>
<category><![CDATA[dialog box]]></category>
<category><![CDATA[corresponding service]]></category>
<category><![CDATA[database driver]]></category>
<category><![CDATA[scale database]]></category>
<category><![CDATA[small database system]]></category>
<category><![CDATA[system dsn]]></category>
<category><![CDATA[format database]]></category>
<category><![CDATA[import feature]]></category>
<category><![CDATA[odbc data source]]></category>
<category><![CDATA[twists]]></category>
<category><![CDATA[large scale]]></category>
<category><![CDATA[information system]]></category>
		<guid isPermaLink="true">http://www.kods.netwww.kods.net/export-data-from-excel-to-oracle-method-summary/</guid>
		<description><![CDATA[We all generally like to use Excel to save a variety of commonly used forms of data, but If you want information system with data stored in Excel is not very realistic and will bring a lot of operatio ...]]></description>
		<content:encoded><![CDATA[<table cellspacing=0 cellpadding=0 width="100%" align=center border=0><tbody><tr><td align=middle bgcolor=#bbf0ff></td><tr><td><table bordercolor=#bbf0ff cellspacing=1 cellpadding=0 width="100%" border=1><tbody><tr><td align=middle><table cellspacing=0 cellpadding=0 width=650 border=0><tbody><tr><td align=middle><table cellspacing=0 cellpadding=0 width="100%" border=0><tbody><tr><td width=650><br /> We all generally like to use Excel to save a variety of commonly used forms of data, but If you want information system with data stored in Excel is not very realistic and will bring a lot of operational inconvenience. This is necessary to Excel into a variety of popular database software for the development use. These commonly used software has a small database system Access, medium and large database systems SQL Server and Oracle and other large-scale database systems. <br /> So how easily import Excel data to these databases as well? <br /><br /> 1, Access, and SQL Server itself as Microsoft&#39;s products, provide information on, including Excel, including direct import feature. <br /><br /> Second, while Oracle will need to spend more points, twists and turns, where I used the method and method of online search to be described below. <br /><br /> The first step, the Excel data into Access, here, should be explained that, due to the restrictions Excel data format, database software, compared with the relatively loose, so the process of importing the data may occur in some of the data into a cell is incorrect. Access will generate an errata, can be against the table to see is how can I import more data are generated in the problem. <br /><br /> The second step, establishing ODBC data source, through the control panel - &quot;Data Sources (ODBC), create a system DSN, in the establishment of DSN&#39;s time to select the database driver, please select the corresponding driver, my machine is Oracle in OraHome92, and then will pop up a dialog box, do further configuration, the TNS Service Name will be listed on this machine available in the &quot;Local Net Service Name&quot;, please select the corresponding service name entered to access the database after the user (in the import can be modified), and to this ODBC data source, different name on it. <br /><br /> The third step, through the Access export to Oracle. In the export of &quot;Save as type&quot; drop-down box, select &quot;ODBC Database (),&quot; ODBC Data Source dialog box will pop up to select the data source, followed by a pop-up on the corresponding data source, database connection information, the default user name is to build ODBC data source specified in the export can be revised to provide other users. <br /><br /> Shows that this can be seen, through the Access to export to other database systems are very convenient, as long as the machine on the target database system, ODBC driver, and set up ODBC data source, you can successfully exported. <br /><br /> Method 2: <br /><br /> Import into sql server, using SQL Server provides tools for import export Oracle, but for some image field in support of good, if you do not this field is on the line. <br /><br /> Method 3: <br /><br /> Advanced users can adopt the following methods (only a text field): <br /><br /> Excel should first save as. Csv format file, this format is a comma-delimited text file data fields, such as test.csv, and then write a insert.ctl <br /> To use sqlldr to import! <br /> insert.ctl reads as follows: <br /> load data - 1, control file identifies <br /> infile &#39;test.csv&#39; - 2, to enter the data file is named test.csv <br /> append into table table_name - 3, the additional records to the table table_name <br /> fields terminated by &#39;,&#39; - 4, field terminated in &#39;,&#39; is a comma <br /> (field1, <br /> field2, <br /> field3, <br /> ... <br /> fieldn )----- column corresponds to the order of the definition of <br /><br /> Note that the order field in parentheses with the csv file, and then you can correspond to execute the following commands: <br /> sqlldr user / password control = insert.ctl <br /><br /> Method 4 (only text field): <br /><br /> In fact, if you is not the case of a single file (less than 100,000 lines), you can Select COPY, and then use PL / SQL Developer: first, the establishment of a good table, pay attention to the source table and destination table fields in the corresponding sequence, and then run SQL statement select * from table for update or in the left tree menu, select the appropriate forms, right-click in the pop-up menu, click &quot;Edit Data&quot;. and then open the form data at the top of the lock, and then click the plus sign, add The new line of blank lines. click of the mouse to the first space and then paste. COMMIT can be. (small tips, Oracle does not support, but is useful, there will be no problem) <br /><br /></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>				<h5>Related Posts</h5>
		<div id="smilar">
		<ul>
					<li><a href="http://www.kods.netwww.kods.net/oracle-database-exp-imp-import-export-by-user-examples/" title="Oracle Database exp imp Import Export by user examples">Oracle Database exp imp Import Export by user examples</a> 2009-04-06 18:58:52</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle-database-exp-imp-tools-for-performance-tuning/" title="Oracle Database Exp / Imp tools for performance tuning">Oracle Database Exp / Imp tools for performance tuning</a> 2009-04-06 11:12:24</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle-database-backup-and-restore/" title="oracle database backup and restore">oracle database backup and restore</a> 2009-04-03 18:35:52</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle-database-backup-and-recovery/" title="oracle database backup and recovery">oracle database backup and recovery</a> 2009-04-03 10:09:46</li>
					<li><a href="http://www.kods.netwww.kods.net/sqlplus-skills/" title="SQLPlus skills">SQLPlus skills</a> 2009-04-01 09:37:29</li>
				</ul>
		</div>
		        ]]></content:encoded>
		<wfw:commentRss>http://www.kods.netwww.kods.net/export-data-from-excel-to-oracle-method-summary/</wfw:commentRss>
	</item>
		<item>
		<title>sqlldr use of the whole</title>
		<link>http://www.kods.netwww.kods.net/sqlldr-use-of-the-whole/</link>
		<comments>http://www.kods.netwww.kods.net/sqlldr-use-of-the-whole/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 13:27:57+0000</pubDate>
		<dc:creator>kods.net</dc:creator>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[oracle]]></category>
<category><![CDATA[oracle database]]></category>
<category><![CDATA[indexes]]></category>
<category><![CDATA[oracle data]]></category>
<category><![CDATA[oracle corporation]]></category>
<category><![CDATA[database sql]]></category>
<category><![CDATA[data warehouse]]></category>
<category><![CDATA[bind]]></category>
<category><![CDATA[logical records]]></category>
<category><![CDATA[valid keywords]]></category>
<category><![CDATA[parallel load]]></category>
<category><![CDATA[index maintenance]]></category>
<category><![CDATA[loading tools]]></category>
<category><![CDATA[data loading]]></category>
<category><![CDATA[discards]]></category>
<category><![CDATA[command line parameters]]></category>
<category><![CDATA[sql loader]]></category>
<category><![CDATA[parameter specification]]></category>
<category><![CDATA[direct parallel]]></category>
<category><![CDATA[password control]]></category>
		<guid isPermaLink="true">http://www.kods.netwww.kods.net/sqlldr-use-of-the-whole/</guid>
		<description><![CDATA[SQL * LOADER is the ORACLE data loading tools normally used to operating system files to migrate to ORACLE database. SQL * LOADER is the option of using a large data warehouse loading, because it prov ...]]></description>
		<content:encoded><![CDATA[<table cellspacing=0 cellpadding=0 width="100%" align=center border=0><tbody><tr><td align=middle bgcolor=#bbf0ff></td><tr><td><table bordercolor=#bbf0ff cellspacing=1 cellpadding=0 width="100%" border=1><tbody><tr><td align=middle><table cellspacing=0 cellpadding=0 width=650 border=0><tbody><tr><td align=middle><table cellspacing=0 cellpadding=0 width="100%" border=0><tbody><tr><td width=650><br /> <font size=2>SQL * LOADER is the ORACLE data loading tools normally used to operating system files to migrate to ORACLE database. <br /></font> <table"FONT: 12px Verdana, Arial, Helvetica, 宋体, sans-serif; COLOR: rgb(51,51,51)" cellspacing=0 cellpadding=0 width=160 align=left border=0><tbody><tr><td"BORDER-TOP-WIDTH: 0px; PADDING-RIGHT: 0px; PADDING-LEFT: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; PADDING-BOTTOM: 0px; MARGIN: 0px auto; PADDING-TOP: 0px; BORDER-RIGHT-WIDTH: 0px"><font size=2></font></td></tr></tbody></table> SQL * LOADER is the option of using a large data warehouse loading, because it provides the fastest route (DIRECT, PARALLEL). Now, we put aside the theory aside, using examples to enable you to quickly master the SQL * LOADER is used. <br /> First of all, we recognize that what SQL * LOADER. <br /> In the NT,, SQL * LOADER command for SQLLDR, under the UNIX generally sqlldr / sqlload. <br /> Such as the implementation: d: \ oracle&gt; sqlldr <br /> SQL * Loader: Release 8.1.6.0.0 - Production on Tuesday January 8 11:06:42 2002 <br /> (c) Copyright 1999 Oracle Corporation. All rights reserved. <br /><br /> Usage: SQLLOAD keyword = value [, keyword = value ,...] <br /> Valid keywords: <br /> userid - ORACLE username / password <br /> control - Control file name <br /> log - Log file name <br /> bad - Bad file name <br /> data - Data file name <br /> discard - Discard file name <br /> discardmax - Number of discards to allow (all default) <br /> skip - Number of logical records to skip (Default 0) <br /> load - Number of logical records to load (all default) <br /> errors - Number of errors to allow (Default 50) <br /> rows - Number of rows in conventional path bind array or between direct p <br /> ath data saves <br /> (Default: Conventional path 64, all direct paths) <br /> bindsize - Size of conventional path bind array in bytes (default 65536) <br /> silent - Supdivss messages during run (header, feedback, errors, discards, part <br /> itions) <br /> direct - use direct path (Default FALSE) <br /> parfile - parameter file: name of file that contains parameter specification <br /> s <br /> parallel - do parallel load (Default FALSE) <br /> file - File to allocate extents from <br /> skip_unusable_indexes - disallow / allow unusable indexes or index partitions (Default FALSE) <br /> skip_index_maintenance - do not maintain indexes, mark affected indexes as unusable (Default FALSE) <br /> commit_discontinued - commit loaded rows when load is discontinued (Default FALSE) <br /> readsize - Size of Read buffer (Default 1048576) <br /> PLEASE NOTE: command-line parameters can be specified by a location or keyword. <br /> <font size=2>Examples of the former &#39;sqlload scott / tiger foo&#39;; <br /> Examples of the latter is the &#39;sqlload control = foo userid = scott / tiger&#39;. <br /> Location of the specified parameters of time must be earlier than but not later than the parameters specified by the keyword. For example, the <br /> &#39;SQLLOAD SCott / tiger control = foo logfile = log&#39;, <br /> But the &#39;not allowed sqlload scott / tiger control = foo log&#39;, <br /> Even if permitted to parameter &#39;log&#39; of the correct location. <br /> d: \ oracle&gt; <br /> We can see some basic help information, here, I used the Chinese WIN2000 ADV SERVER. <br /> We know, SQL * LOADER can only import plain text, so we now begin to explain examples of its usage. <br /> <strong>First, existing data sources result.csv, want to pour in FANCY user under ORACLE. <br /></strong> result.csv content: <br /> 1, the default Web site, 192.168.2.254:80:, RUNNING <br /> 2, other, 192.168.2.254:80: test.com, STOPPED <br /> 3, third, 192.168.2.254:81: thirdabc.com, RUNNING <br /> From this, we see that 4, respectively, separated by commas, for variable-length strings. <br /> <strong>Second, in formulating control file result.ctl</strong> <br /> result.ctl content: <br /> load data <br /> infile &#39;result.csv&#39; <br /> into table resultxt <br /> (resultid char terminated by &#39;,&#39;, <br /> website char terminated by &#39;,&#39;, <br /> ipport char terminated by &#39;,&#39;, <br /> status char terminated by whitespace) <br /> Description: <br /> infile refers to the data source file where we omitted the default discardfile result.dsc badfile result.bad <br /> into table resultxt default is INSERT, also into table resultxt APPEND to append mode or REPLACE <br /> terminated by &#39;,&#39; refers to a comma-separated terminated by whitespace at the end separated by a space &lt;br /&gt; <strong>3, this time the implementation of our load:</strong></font><br /> D: \&gt; sqlldr userid = fancy / testpass control = result.ctl log = resulthis.out <br /> SQL * Loader: Release 8.1.6.0.0 - Production on Tuesday January 8 10:25:42 2002 <br /> (c) Copyright 1999 Oracle Corporation. All rights reserved. <br /> SQL * Loader-941: In describing the error when the table RESULTXT <br /> ORA-04043: Object does not exist RESULTXT prompt error, because the database does not correspond to the table. <br /> <strong>Fourth, the establishment of the database table</strong> create table resultxt <br /> (resultid varchar2 (500), <br /> website varchar2 (500), <br /> ipport varchar2 (500), <br /> status varchar2 (500)) <br /> / <br /> <strong>5, re-implementation of the load <br /></strong> D: \&gt; sqlldr userid = fancy/k1i7l6l8 control = result.ctl log = resulthis.out <br /> SQL * Loader: Release 8.1.6.0.0 - Production on Tuesday January 8 10:31:57 2002 <br /> (c) Copyright 1999 Oracle Corporation. All rights reserved. <br /> Reach commit point, the logical record count 2 <br /> Reach commit point, the logical record count 3 <br /> Has been successfully! We can process the log files to analyze: resulthis.out reads as follows: <br /> SQL * Loader: Release 8.1.6.0.0 - Production on Tuesday January 8 10:31:57 2002 <br /> (c) Copyright 1999 Oracle Corporation. All rights reserved. <br /> Control file: result.ctl <br /> Data File: result.csv <br /> Error File: result.bad <br /> Obsolete documents: the absence of the designated <br /> : <br /> (Which can waste all the records) <br /> Load Number: ALL <br /> Skip count: 0 <br /> Allowed error: 50 <br /> Bind array: 64 rows, maximum 65536 bytes to continue: have not been used in the specified path: General table RESULTXT <br /> Have been loaded from every logical record into the table INSERT option to force column names to this position of the length of the suspension package data types <br /> ------------------------------ ---------- ----- ---- -- --- --------------------- <br /> RESULTID FIRST *, CHARACTER <br /> WEBSITE NEXT *, CHARACTER <br /> IPPORT NEXT *, CHARACTER <br /> STATUS NEXT * WHT CHARACTER <br /><br /> Table RESULTXT: <br /> 3 rows loaded successfully due to data errors, 0 lines did not load. <br /> Since all WHEN clauses failed, 0 lines did not load. <br /> Since all fields are empty, the 0-line did not load. <br /><br /> The space allocated for the integration of the array: 65016 bytes (63 lines) <br /> In addition to bind an array of memory outside the space allocation: 0 bytes Total logical records skipped: 0 <br /> The total number of logical records read: 3 <br /> The total number of logical records rejected: 0 <br /> The total number of logical records discarded: 0 <br /> From Tuesday January 08 10:31:57 2002 started running Tuesday January 08 10:32:00 2002 after the end of operation time: 00: 00: 02.70 <br /> CPU time: 00: 00: 00.10 (available &lt;br /&gt; <strong>6, concurrent operation <br /></strong> sqlldr userid = / control = result1.ctl direct = true parallel = true <br /> sqlldr userid = / control = result2.ctl direct = true parallel = true <br /> sqlldr userid = / control = result2.ctl direct = true parallel = true <br /> When loading large amounts of data (approximately more than 10GB), the best inhibiting the production log: <br /> SQL&gt; ALTER TABLE RESULTXT nologging; <br /> This does not produce REDO LOG, can improve efficiency. And then load data in the CONTROL file, add the above line: unrecoverable <br /> This option must be connected with shared use of DIRECT. <br /> Concurrent operation, ORACLE saying that they could handle 100GB of data per hour capacity! In fact, it is estimated to go to 1-10G even pretty good, the structure began to be used the same file, but only a small amount of data, after the success of start loading large amounts of data, so that to avoid waste of time. <font face=宋体 size=3> </font><br /></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>				<h5>Related Posts</h5>
		<div id="smilar">
		<ul>
					<li><a href="http://www.kods.netwww.kods.net/sga-extended-the-principle-of-32bit-oracle/" title="SGA extended the principle of 32bit oracle">SGA extended the principle of 32bit oracle</a> 2009-03-31 09:48:01</li>
					<li><a href="http://www.kods.netwww.kods.net/an-example-of-the-use-of-tkprof/" title="An example of the use of TKPROF">An example of the use of TKPROF</a> 2009-02-26 01:38:19</li>
					<li><a href="http://www.kods.netwww.kods.net/diagnosis-and-principles-of-order/" title="Diagnosis and principles of order">Diagnosis and principles of order</a> 2009-02-25 20:27:28</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle-10g-dataguard-configuration-step-by-step/" title="ORACLE 10G dataguard configuration Step by Step">ORACLE 10G dataguard configuration Step by Step</a> 2009-02-16 01:13:55</li>
				</ul>
		</div>
		        ]]></content:encoded>
		<wfw:commentRss>http://www.kods.netwww.kods.net/sqlldr-use-of-the-whole/</wfw:commentRss>
	</item>
		<item>
		<title>sqlldr guide data</title>
		<link>http://www.kods.netwww.kods.net/sqlldr-guide-data/</link>
		<comments>http://www.kods.netwww.kods.net/sqlldr-guide-data/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 15:15:40+0000</pubDate>
		<dc:creator>kods.net</dc:creator>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[oracle]]></category>
<category><![CDATA[oracle database]]></category>
<category><![CDATA[parameters]]></category>
<category><![CDATA[long time]]></category>
<category><![CDATA[oracle data]]></category>
<category><![CDATA[import and export]]></category>
<category><![CDATA[migration]]></category>
<category><![CDATA[c2]]></category>
<category><![CDATA[c1]]></category>
<category><![CDATA[parameter description]]></category>
<category><![CDATA[parameter control]]></category>
<category><![CDATA[alter table]]></category>
<category><![CDATA[database records]]></category>
<category><![CDATA[batches]]></category>
<category><![CDATA[nightmare]]></category>
		<guid isPermaLink="true">http://www.kods.netwww.kods.net/sqlldr-guide-data/</guid>
		<description><![CDATA[In the Oracle database, we usually between tables in different database records, copy or migration will use the following methods: 1. A record of the table to export to a section separated by a semico ...]]></description>
		<content:encoded><![CDATA[<table cellspacing=0 cellpadding=0 width="100%" align=center border=0><tbody><tr><td align=middle bgcolor=#bbf0ff></td><tr><td><table bordercolor=#bbf0ff cellspacing=1 cellpadding=0 width="100%" border=1><tbody><tr><td align=middle><table cellspacing=0 cellpadding=0 width=650 border=0><tbody><tr><td align=middle><table cellspacing=0 cellpadding=0 width="100%" border=0><tbody><tr><td width=650><br /><br /> In the Oracle database, we usually between tables in different database records, copy or migration will use the following methods: <br /><br /> 1. A record of the table to export to a section separated by a semicolon insert statement, then execute the table inserted into the B <br /> 2. The establishment of inter-database dblink, then create table B as select * from A @ dblink where ..., or insert into B select * from A @ dblink where ... <br /> 3. Exp A table, and then imp to the B form, exp Shike Jia query <br /> 4. Procedures to achieve select from A .., and then insert into B ..., must be submitted in batches <br /> 5. Another thing is that this is to say to the Sql Loader (sqlldr) to import the data, the effect is obvious compared to insert one by one <br /><br /> 1 ways to record a long time was a nightmare, must be submitted in batches of Article San Wubai Otherwise, the client will not survive, but the import process is very slow. If Otherwise generate REDO to improve insert into the performance, it is necessary to do the following: <br /><br /><ol"PADDING-RIGHT: 2px; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; MARGIN: 0px 0px 1px 38px; COLOR: rgb(43,145,175); PADDING-TOP: 2px"><li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> alter table B nologging; <li> insert / * + APPEND * / into B (c1, c2) values (x, xx); <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> insert / * + APPEND * / into B select * from A @ dblink where .....; </li></ol><br /><br /> Well, briefly in front of Oracle data import and export of a variety of ways, I am sure there is more to understand. Here the focus to talk about Oracle&#39;s Sql Loader (sqlldr) usage. <br /><br /> Carried out under the command line, Oracle&#39;s sqlldr command, you can see a detailed parameter description it is necessary to focus on the following parameters: <br /><br /> <font color=#ff0000>userid</font> - Oracle&#39;s username / password [@ servicename] <br /> <font color=#ff0000>control</font> - control file may contain tables of data <br /> -------------------------------------------------- -------------------------------------------------- --- <br /> log - log import log files, the default for the control file (remove the extension). log <br /> bad - bad data file, the default for the control file (remove the extension). bad <br /> data - data files, generally in the control file. Using the parameter control file does not specify the data file is more suitable for automatic operation <br /> errors - errors allowed the number of records can be used to control a record he can not be wrong <br /> rows - the number of records submitted to time, the default is 64 <br /> skip - the number of rows to skip, for example exported data file is a header in front of a few lines, or other description <br /><br /> There are more parameters that describe the sqlldr please refer to: sql loader usage. <br /><br /> Sqlldr using examples to demonstrate the use of, there are two kinds of use: <br /><br /> 1. Only use a control file, in this control file contains the data <br /> 2. Using a control file (as a template) and a data file <br /><br /> In general in order to facilitate the separation of templates and data, and the program will use a different division of the second approach, so the first look at such usage. Data file can be CSV file or any other split-delimited data file can use PL / SQL Developer or Toad Export, SQL * Plus can also be used to format output of the spool, or the UTL_FILE package is generated. In addition, with Toad able to directly generate the control file that contains the data. <br /><br /> First of all, assuming there is such a table users, and insert 5 records: <br /><br /><ol"PADDING-RIGHT: 2px; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; MARGIN: 0px 0px 1px 38px; COLOR: rgb(43,145,175); PADDING-TOP: 2px"><li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> create table users ( <li> user_id number, - the user ID <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> user_name varchar2 (50), - user name <li> login_times number, - the number of landing <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> last_login date - the last login date <li> ) </li></ol><br /><br /><ol"PADDING-RIGHT: 2px; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; MARGIN: 0px 0px 1px 38px; COLOR: rgb(43,145,175); PADDING-TOP: 2px"><li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> insert into users values (1, &#39;Unmi&#39;, 3, sysdate); <li> insert into users values (2, NULL, 5, to_date (&#39;2008-10-15 &#39;,&#39; YYYY-MM-DD &#39;)); <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> insert into users values (3, &#39;every other leaf warbler&#39;, 8, to_date (&#39;2009-01-02 &#39;,&#39; YYYY-MM-DD &#39;)); <li> insert into users values (4, &#39;Kypfos&#39;, NULL, NULL); <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> insert into users values (5, &#39;I do not know autumn&#39;, 1, to_date (&#39;2008-12-23 &#39;,&#39; YYYY-MM-DD &#39;)); </li></ol><br /><br /> The second way: Using a control file (as a template) and a data file <br /><br /> 1) Establishing a data file, we are here with the PL / SQL Developer export table users to record users_data.csv file, reads as follows: <br /><br /><ol"PADDING-RIGHT: 2px; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; MARGIN: 0px 0px 1px 38px; COLOR: rgb(43,145,175); PADDING-TOP: 2px"><li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> &quot;&quot;, &quot;USER_ID&quot;, &quot;USER_NAME&quot;, &quot;LOGIN_TIMES&quot;, &quot;LAST_LOGIN&quot; <li> &quot;1&quot;, &quot;1&quot;, &quot;Unmi&quot;, &quot;3&quot;, &quot;2009-1-5 20:34:44&quot; <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> , &quot;2&quot;, &quot;2 &quot;,&quot;&quot;,&quot; 5&quot;, &quot;2008-10-15&quot; <li> , &quot;3&quot;, &quot;3&quot;, &quot;every other leaf warbler&quot;, &quot;8&quot;, &quot;2009-1-2&quot; <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> &quot;4&quot;, &quot;4&quot;, &quot;Kypfos &quot;,&quot;&quot;,&quot;&quot; <li> , &quot;5&quot;, &quot;5&quot;, &quot;I do not know of Autumn&quot;, &quot;1&quot;, &quot;2008-12-23&quot; </li></ol><br /><br /> 2) the establishment of a control file users.ctl, reads as follows: <br /><br /><ol"PADDING-RIGHT: 2px; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; MARGIN: 0px 0px 1px 38px; COLOR: rgb(43,145,175); PADDING-TOP: 2px"><li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> OPTIONS (skip = 1, rows = 128) - sqlldr command displays the option to write here, edge to, skip = 1 is used to skip the first row of data <li> LOAD DATA <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> INFILE &quot;users_data.csv&quot; - specify the external data file, you can write multiple INFILE &quot;another_data_file.csv&quot; to specify multiple data files <li> - Here you can also use BADFILE, DISCARDFILE to specify the data and discard the bad data file, <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> truncate - operation type, with truncate table to clear the table in the original records <li> INTO TABLE users - To insert a table record <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> Fields terminated by &quot;,&quot; - the data recorded on each line to use &quot;,&quot; separated <li> Optionally enclosed by &#39; &quot;&#39; - data in each field with the &#39;&quot;&#39; box effect, such as the field of &quot;,&quot; separator <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> trailing nullcols - table fields are not allowed when the value of the corresponding empty <li> ( <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> virtual_column FILLER, - it is a virtual field, is used to skip from the PL / SQL Developer generated the first column number <li> user_id number, - the field you can specify the type, otherwise considered to be CHARACTER type, log file showing the <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> user_name, <li> login_times, <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> last_login DATE &quot;YYYY-MM-DD HH24: MI: SS&quot; - designated to receive the date format, rather with the to_date () function is converted <li> ) </li></ol><br /><br /> Description: The type of truncate operation in one location using the following values: <br /><br /> 1) insert - as the default way of loading the beginning of the data requirements table is empty <br /> 2) append - Append a new record in the table <br /> 3) replace - delete the old records (using delete from table statement), replace the load into a new record <br /> 4) truncate - delete the old records (using the truncate table statement), replace the load into a new record <br /><br /> 3) execute the command: <br /><br /> sqlldr dbuser / dbpass @ dbservice control = users.ctl <br /><br /> The dbservice instructions recorded in a database table users and data files on the same. <br /><br /> After the implementation of the End sqlldr would like to look at the generated several documents, such as users.log log files, users.bad bad data files. In particular, to take a look at the log file, from which allows you to better understand the Sql Loader, inside the control file parsing, list the type of each field, loading statistics records, the cause of errors and other information. <br /><br /> The first approach, using only one control file in this control file contains the data <br /><br /> 1) the users_data.cvs the contents of the supplement to the users.ctl in and to BEGINDATA connection, but also the INFILE &quot;users_data.csv&quot; read INFILE *. Meanwhile, in order of description of a larger problem, the data-processing a bit. At this point, the complete users.ctl content of the document are: <br /><br /><ol"PADDING-RIGHT: 2px; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; MARGIN: 0px 0px 1px 38px; COLOR: rgb(43,145,175); PADDING-TOP: 2px"><li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> OPTIONS (skip = 1, rows = 128) - sqlldr command displays the option to write here, edge to, skip = 1 is used to skip the first row of data <li> LOAD DATA <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> INFILE * - because the data together with the control file, so use * indicates <li> append - there used to append operation, the additional records in the table users <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> INTO TABLE users <li> when LOGIN_TIMES &lt;&gt; &#39;8 &#39;- can also be used when qualifying clause, choose to import the records <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> Fields terminated by &quot;,&quot; <li> trailing nullcols <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> ( <li> virtual_column FILLER, - skipped by the PL / SQL Developer generated the first column number <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> user_id &quot;user_seq.nextval&quot;, - direct access to this column the next sequence value, rather than the value of the data provided in the <li> user_name &quot; &#39;Hi&#39; | | upper (: user_name )&quot;,--, can also use SQL functions or operations for data processing <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> login_times terminated by &quot;,&quot;, NULLIF (login_times = &#39;NULL&#39;) - can be individually specified for the column separator <li> last_login DATE &quot;YYYY-MM-DD HH24: MI: SS&quot; NULLIF (last_login = &quot;NULL&quot;) - When the field is &quot;NULL&quot; when it was NULL <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> ) <li> BEGINDATA - data from here <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> , USER_ID, USER_NAME, LOGIN_TIMES, LAST_LOGIN <li> 1,1, Unmi ,3,2009-1-5 20:34 <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> 2,2, Fantasia ,5,2008-10-15 <li> 3,3, separated leaf warbler ,8,2009-1-2 <li"PADDING-LEFT: 10px; BORDER-LEFT: rgb(209,215,220) 1px solid; LINE-HEIGHT: 18px; BACKGROUND-COLOR: rgb(255,255,255)"> 4,4, Kypfos, NULL, NULL <li> 5,5, I wonder if Autumn ,1,2008-12-23 </li></ol><br /><br /> 2) To implement the same command: <br /><br /> sqlldr dbuser / dbpass @ dbservice control = users.ctl <br /><br /> For example, the console will show this information: <br /><br /> <font color=#ffffff>C: \&gt; sqlldr dbuser / dbpass @ dbservice control = users.ctl</font> <br /><br /> <font color=#ffffff>SQL * Loader: Release 9.2.0.1.0 - Production on Wednesday, January 7 22:26:25 2009</font> <br /><br /> <font color=#ffffff>Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.</font> <br /><br /> <font color=#ffffff>Reach commit point, the logical record count 4 <br /> Reach commit point, the logical record count 5 <br /></font> <br /> The above control file contains the contents of the more complex (demonstration purposes), please understand that according to notes the significance of each parameter. Can also use this to explore more. <br /><br /> Concluded by saying that under the relevant SQL * Loader performance and concurrent operation <br /><br /> 1) ROWS The default value is 64, you can specify a more appropriate based on the actual ROWS parameter to specify the number of records for each submission. (Experienced in the PL / SQL Developer in the implementation of a few to more than one insert statement that the case right?) <br /><br /> 2) Conventional import by using INSERT statement to import the data. Direct import can skip the database-related logic (DIRECT = TRUE), data directly into the data file, you can import the data to improve performance. Of course, in many cases, can not use this parameter (if the primary key to repeat the words of the state of the index will become UNUSABLE!). <br /><br /> 3) by specifying UNRECOVERABLE option, you can close the database log (whether or not to alter table table1 nologging it?). This option can only be used in conjunction with direct. <br /><br /> 4) For very large data files to import must use concurrent operation, and that is to run multiple import tasks. <br /><br /> sqlldr userid = / control = result1.ctl direct = true parallel = true <br /> sqlldr userid = / control = result2.ctl direct = true parallel = true <br /> sqlldr userid = / control = result2.ctl direct = true parallel = true <br /><br /> When loading large amounts of data (approximately more than 10GB), the best inhibiting the production log: <br /><br /> SQL&gt; ALTER TABLE RESULTXT nologging; <br /><br /> This does not produce REDO LOG, can improve efficiency. And then load data in the CONTROL file, add the above line: unrecoverable, this option must be connected with shared use of DIRECT. <br /><br /> Concurrent operation, ORACLE saying that they could handle 100GB of data per hour capacity! In fact, it is estimated to go to 1-10G even pretty good, the structure began to be used the same file, but only a small amount of data, after the success of start loading large amounts of data, so that to avoid waste of time. <br /><br /> <font face=黑体 color=#ff0000 size=3>(Note: in general can only use ASCII code form, remember to convert code, or import the data is empty)</font> <br /><br /> References: 1. Oracle SQL * Loader - English, Sql Loader official instructions, including multiple types of Demo <br /> 2. Sql loader usage - lists the choice of parameters sql loader Chinese specifications <br /> 3. Use SQL Loader to import large amounts of data, to avoid the frequent use of SQL to write library - a simple example, fast with the usage of about Sql Loader <br /> 4. Oracle SQL Loader syntax details <br /> 5. Oracle sql loader full-Gong Lue - fairly genuine. And talk about how to use SQL * Plus or UTL_FILE package of the spool data file is generated <br /> 6. SQL * Loader Control File Reference - English, control file to use for reference <br /> 7. To learn the use of oracle sql loader <br /> 8. With sqlloader (sqlldr) load LOB data - LOB inner class is an external file into a database using sql loader <br /> 9. SQLLDR loaded directly several parameters of the test <br /> 10.Maximizing SQL * Loader Performance <br /><br /></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table>				<h5>Related Posts</h5>
		<div id="smilar">
		<ul>
					<li><a href="http://www.kods.netwww.kods.net/sga-extended-the-principle-of-32bit-oracle/" title="SGA extended the principle of 32bit oracle">SGA extended the principle of 32bit oracle</a> 2009-03-31 09:48:01</li>
					<li><a href="http://www.kods.netwww.kods.net/an-example-of-the-use-of-tkprof/" title="An example of the use of TKPROF">An example of the use of TKPROF</a> 2009-02-26 01:38:19</li>
					<li><a href="http://www.kods.netwww.kods.net/diagnosis-and-principles-of-order/" title="Diagnosis and principles of order">Diagnosis and principles of order</a> 2009-02-25 20:27:28</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle-10g-dataguard-configuration-step-by-step/" title="ORACLE 10G dataguard configuration Step by Step">ORACLE 10G dataguard configuration Step by Step</a> 2009-02-16 01:13:55</li>
				</ul>
		</div>
		        ]]></content:encoded>
		<wfw:commentRss>http://www.kods.netwww.kods.net/sqlldr-guide-data/</wfw:commentRss>
	</item>
		<item>
		<title>SQLLOADER direct path load and sequence</title>
		<link>http://www.kods.netwww.kods.net/sqlloader-direct-path-load-and-sequence/</link>
		<comments>http://www.kods.netwww.kods.net/sqlloader-direct-path-load-and-sequence/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 09:07:13+0000</pubDate>
		<dc:creator>kods.net</dc:creator>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[oracle database]]></category>
<category><![CDATA[table test]]></category>
<category><![CDATA[windows version]]></category>
<category><![CDATA[tns]]></category>
<category><![CDATA[load data infile]]></category>
<category><![CDATA[level 1]]></category>
<category><![CDATA[number 3]]></category>
<category><![CDATA[nextval]]></category>
<category><![CDATA[truncate]]></category>
<category><![CDATA[sql level]]></category>
<category><![CDATA[test name]]></category>
<category><![CDATA[recursive sql]]></category>
<category><![CDATA[test error]]></category>
<category><![CDATA[test fields]]></category>
<category><![CDATA[type test]]></category>
<category><![CDATA[logical record]]></category>
<category><![CDATA[host type]]></category>
<category><![CDATA[control test]]></category>
<category><![CDATA[admin control]]></category>
<category><![CDATA[january 27]]></category>
		<guid isPermaLink="true">http://www.kods.netwww.kods.net/sqlloader-direct-path-load-and-sequence/</guid>
		<description><![CDATA[SQL&gt; SELECT * FROM V $ VERSION; BANNER -------------------------------------------------- -------------- Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod PL / SQL Release 10.2.0.1.0 ...]]></description>
		<content:encoded><![CDATA[SQL&gt; SELECT * FROM V $ VERSION; <br /><br /> BANNER <br /> -------------------------------------------------- -------------- <br /> Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Prod <br /> PL / SQL Release 10.2.0.1.0 - Production <br /> CORE 10.2.0.1.0 Production <br /> TNS for 32-bit Windows: Version 10.2.0.1.0 - Production <br /> NLSRTL Version 10.2.0.1.0 - Production <br /><br /> SQL&gt; DESC TEST; <br /><br /> Name is empty? Type <br /> ----------------------------------------- -------- -- --------------------------- <br /><br /> EMPNO NOT NULL NUMBER <br /> ENAME VARCHAR2 (20) <br /> SAL NUMBER (7,2) <br /> DEPTNO NUMBER (3) <br /><br /> SQL&gt; SELECT * FROM TEST; <br /><br /> No rows selected <br /><br /> SQL&gt; CREATE SEQUENCE S; <br /><br /> Sequence has been created. <br /><br /> SQL&gt; HOST TYPE TEST.CTL <br /><br /> <strong>OPTIONS (DIRECT = TRUE) <br /> UNRECOVERABLE</strong> <br /> LOAD DATA <br /> INFILE * <br /> TRUNCATE <br /><br /> INTO TABLE TEST <br /> FIELDS TERMINATED BY &#39;,&#39; <br /> TRAILING NULLCOLS <br /> (ENAME, SAL, DEPTNO, EMPNO &quot;S. NEXTVAL&quot;) <br /> BEGINDATA <br /> ALLEN, 1600,30 <br /> JONES, 3123.75,20 <br /> MARTIN, 1312.5,30 <br /> CHAN, 3450,20 <br /> CLARK, 2572.5,10 <br /> KING, 5500,10 <br /> MILLER, 920,10 <br /><br /> SQL&gt; HOST SQLLDR ADMIN / ADMIN CONTROL = TEST.CTL <br /><br /> SQL * Loader: Release 10.2.0.1.0 - Production on Wednesday January 27 13:12:18 2010 <br /><br /> Copyright (c) 1982, 2005, Oracle. All rights reserved. <br /><br /> Load completed - logical record count 7. <br /><br /> SQL&gt; SELECT * FROM TEST; <br /><br /> No rows selected <br /><br /> The log file contains the following contents: <br /><br /> <font color=#ff0000>Record 1: rejected - Table TEST error. <br /> ORA-00604: recursive SQL Level 1 error <br /> ORA-01400: unable to NULL insert ( &quot;ADMIN&quot;. &quot;TEST&quot;. &quot;EMPNO&quot;)</font> <br /><br /> <font color=#ff0000>Records 2: been rejected - the table TEST error. <br /> ORA-00604: recursive SQL Level 1 error <br /> ORA-01400: unable to NULL insert ( &quot;ADMIN&quot;. &quot;TEST&quot;. &quot;EMPNO&quot;)</font> <br /><br /> <font color=#ff0000>Record 3: Denied - the table TEST error. <br /> ORA-00604: recursive SQL Level 1 error <br /> ORA-01400: unable to NULL insert ( &quot;ADMIN&quot;. &quot;TEST&quot;. &quot;EMPNO&quot;)</font> <br /><br /> <font color=#ff0000>Record 4: Denied - the table TEST error. <br /> ORA-00604: recursive SQL Level 1 error <br /> ORA-01400: unable to NULL insert ( &quot;ADMIN&quot;. &quot;TEST&quot;. &quot;EMPNO&quot;)</font> <br /><br /> <font color=#ff0000>Record 5: Denied - the table TEST error. <br /> ORA-00604: recursive SQL Level 1 error <br /> ORA-01400: unable to NULL insert ( &quot;ADMIN&quot;. &quot;TEST&quot;. &quot;EMPNO&quot;)</font> <br /><br /> <font color=#ff0000>Record 6: Denied - the table TEST error. <br /> ORA-00604: recursive SQL Level 1 error <br /> ORA-01400: unable to NULL insert ( &quot;ADMIN&quot;. &quot;TEST&quot;. &quot;EMPNO&quot;)</font> <br /><br /> <font color=#ff0000>Record 7: Denied - the table TEST error. <br /> ORA-00604: recursive SQL Level 1 error <br /> ORA-01400: unable to NULL insert ( &quot;ADMIN&quot;. &quot;TEST&quot;. &quot;EMPNO&quot;)</font> <br /><br /> <font color=#ff0000>Table TEST: <br /> 0 rows loaded successfully. <br /> Due to data errors, line 7 is not loaded. <br /> Since all WHEN clauses failed, 0 line is not loaded. <br /> Since all fields are empty, the 0-line is not loaded.</font> <br /><br /> As the direct path load will bypass the SQL engine, so we do not generate the sequence, resulting in a value for the EMPNO column provides empty. The EMPNO is the primary key column, it does not allow empty. Resulting in an error. <br /><br /> Remove the primary key of the table TEST to see. <br /><br /> SQL&gt; ALTER TABLE TEST DROP PRIMARY KEY; <br /><br /> The table has changed. <br /><br /> SQL&gt; DESC TEST; <br /> Name is empty? Type <br /> ----------------------------------------- -------- -- --------------------------- <br /><br /> EMPNO NUMBER <br /> ENAME VARCHAR2 (20) <br /> SAL NUMBER (7,2) <br /> DEPTNO NUMBER (3) <br /><br /> SQL&gt; HOST TYPE TEST.CTL <br /><br /> <strong>OPTIONS (DIRECT = TRUE) <br /> UNRECOVERABLE</strong> <br /> LOAD DATA <br /> INFILE * <br /> TRUNCATE <br /> INTO TABLE TEST <br /> FIELDS TERMINATED BY &#39;,&#39; <br /> TRAILING NULLCOLS <br /> (ENAME, SAL, DEPTNO, EMPNO <strong>&quot;S. NEXTVAL&quot;)</strong> <br /> BEGINDATA <br /> ALLEN, 1600,30 <br /> JONES, 3123.75,20 <br /> MARTIN, 1312.5,30 <br /> CHAN, 3450,20 <br /> CLARK, 2572.5,10 <br /> KING, 5500,10 <br /> MILLER, 920,10 <br /><br /> SQL&gt; HOST SQLLDR ADMIN / ADMIN CONTROL = TEST.CTL <br /><br /> SQL * Loader: Release 10.2.0.1.0 - Production on Wednesday January 27 13:31:46 2010 <br /><br /> Copyright (c) 1982, 2005, Oracle. All rights reserved. <br /><br /> Load completed - logical record count 7. <br /><br /> SQL&gt; SELECT * FROM TEST; <br /><br /> EMPNO ENAME SAL DEPTNO <br /> ---------- -------------------- ---------- ---------- <br /> ALLEN 1600 30 <br /> JONES 3123.75 20 <br /> MARTIN 1312.5 30 <br /> CHAN 3450 20 <br /> CLARK 2572.5 10 <br /> KING 5500 10 <br /> MILLER 920 10 <br /><br /> Have chosen 7 rows. <br /><br /> Remove the NOT NULL constraint can be seen can be loaded successfully, but our EMPNO column is empty. For the DIRECT = TRUE to SQLLDR loading custom sequences can not be used. To use a custom sequence, SQLLDR have to load with conventional path mode. If you must use DIRECT = TRUE way with a sequence of loading data, we need to SQLLDR provide SEQUENCE function. <br /><br /> SQL&gt; SELECT * FROM TEST; <br /><br /> EMPNO ENAME SAL DEPTNO <br /> ---------- -------------------- ---------- ---------- <br /> 1 ALLEN 1600 30 <br /> 2 JONES 3123.75 20 <br /> 3 MARTIN 1312.5 30 <br /> 4 CHAN 3450 20 <br /> 5 CLARK 2572.5 10 <br /> 6 KING 5500 10 <br /> 7 MILLER 920 10 <br /><br /> Have chosen 7 rows. <br /><br /> Table has 7 data. Maximum EMPNO is 7. <br /><br /> SQL&gt; ALTER TABLE TEST ADD PRIMARY KEY (EMPNO); <br /><br /> The table has changed. <br /><br /> SQL&gt; HOST TYPE TEST.CTL <br /><br /> <strong>OPTIONS (DIRECT = TRUE) <br /> UNRECOVERABLE</strong> <br /> LOAD DATA <br /> INFILE * <br /> <strong>APPEND</strong> - Here used the APPEND mode <br /> INTO TABLE TEST <br /> FIELDS TERMINATED BY &#39;,&#39; <br /> TRAILING NULLCOLS <br /> <strong>(ENAME,</strong> SAL, DEPTNO, EMPNO <strong>SEQUENCE (MAX, 1))</strong> <br /> BEGINDATA <br /> ALLEN, 1600,30 <br /> JONES, 3123.75,20 <br /> MARTIN, 1312.5,30 <br /> CHAN, 3450,20 <br /> CLARK, 2572.5,10 <br /> KING, 5500,10 <br /> MILLER, 920,10 <br /><br /> SQL&gt; HOST SQLLDR ADMIN / ADMIN CONTROL = TEST.CTL <br /><br /> SQL * Loader: Release 10.2.0.1.0 - Production on Wednesday January 27 13:55:01 2010 <br /><br /> Copyright (c) 1982, 2005, Oracle. All rights reserved. <br /><br /> Load completed - logical record count 7. <br /><br /> SQL&gt; SELECT * FROM TEST; <br /><br /> EMPNO ENAME SAL DEPTNO <br /> ---------- -------------------- ---------- ---------- <br /> 1 ALLEN 1600 30 <br /> 2 JONES 3123.75 20 <br /> 3 MARTIN 1312.5 30 <br /> 4 CHAN 3450 20 <br /> 5 CLARK 2572.5 10 <br /> 6 KING 5500 10 <br /> 7 MILLER 920 10 <br /> 8 ALLEN 1600 30 <br /> 9 JONES 3123.75 20 <br /> 10 MARTIN 1312.5 30 <br /> 11 CHAN 3450 20 <br /><br /> EMPNO ENAME SAL DEPTNO <br /> ---------- -------------------- ---------- ---------- <br /> 12 CLARK 2572.5 10 <br /> 13 KING 5500 10 <br /> 14 MILLER 920 10 <br /><br /> Has selected 14 rows. <br /><br /> Do not forget the SEQUENCE table TEST with the need to modify. Otherwise, the next will be the only constraint error reported. <br /><br /> SQL&gt; SELECT MAX (EMPNO) FROM TEST; <br /><br /> MAX (EMPNO) <br /> ---------- <br /> 14 <br /><br /> SQL&gt; DROP SEQUENCE S; <br /><br /> Sequence has been deleted. <br /><br /> SQL&gt; CREATE SEQUENCE S START WITH 1 INCREMENT BY 1; <br /><br /> Sequence has been created. <br /><br /> Finally, we want to check on our table in the existence of a unique constraint violations. Since the use of direct path load time, if the table has a primary key field, or unique constraints, and the loading of data in violation of unique constraint, then the index set of related SQLLOADER to be invalid, to continue loading. After loading, the index does not automatically set for effective, it needs manual intervention DBA. <br /><br /> SQL&gt; COL CONSTRAINT_NAME FORMAT A20 <br /> SQL&gt; COL CONSTRAINT_TYPE FORMAT A20 <br /> SQL&gt; COL INDEX_NAME FORMAT A20 <br /> SQL&gt; COL INDEX_TYPE FORMAT A20 <br /><br /> SQL&gt; SELECT CONSTRAINT_NAME, CONSTRAINT_TYPE, STATUS FROM USER_CONSTRAINTS WHERE TABLE_NAME = &#39;TEST&#39;; <br /><br /> CONSTRAINT_NAME CONSTRAINT_TYPE STATUS <br /> -------------------- -------------------- -------- <br /> SYS_C005400 P ENABLED <br /> ENAME_UNIQUE U ENABLED <br /><br /> <strong>Table TEST the ENAME as the only constraint.</strong> <br /><br /> SQL&gt; SELECT INDEX_NAME, INDEX_TYPE, STATUS FROM USER_INDEXES WHERE TABLE_NAME = &#39;TEST&#39;; <br /><br /> INDEX_NAME INDEX_TYPE STATUS <br /> -------------------- -------------------- -------- <br /> SYS_C005400 NORMAL VALID <br /> ENAME_UNIQUE NORMAL UNUSABLE <br /> TEST_DEPTNO_IDX NORMAL VALID <br /><br /> As the load during the ENAME column violated a unique constraint, the associated index is set to be invalid. <br /><br /> The following is part of the contents of the log file content: <br /><br /> <font color=#ff0000>Table TEST has dealt with the following indexes: <br /> Index ADMIN.ENAME_UNIQUE can not be used because: <br /> ORA-00001: unique constraint violation (ADMIN.ENAME_UNIQUE) <br /> Index ADMIN.SYS_C005400 has been successfully loaded, with seven keyword index ADMIN.TEST_DEPTNO_IDX has been successfully loaded, with seven keywords</font> <br /><br /> <font color=#ff0000>Table TEST: <br /> 7 rows loaded successfully. <br /> Due to data errors, 0 line is not loaded. <br /> Since all WHEN clauses failed, 0 line is not loaded. <br /> Since all fields are empty, the 0-line is not loaded.</font> <br /><br /> The following is an application of conventional path load with a sequence of examples of <br /><br /> SQL&gt; HOST TYPE TEST.CTL <br /><br /> LOAD DATA <br /> INFILE * <br /> TRUNCATE <br /> INTO TABLE TEST <br /> FIELDS TERMINATED BY &#39;,&#39; <br /> TRAILING NULLCOLS <br /> (ENAME, SAL, DEPTNO, EMPNO &quot;S. NEXTVAL&quot;) <br /> BEGINDATA <br /> ALLEN, 1600,30 <br /> JONES, 3123.75,20 <br /> MARTIN, 1312.5,30 <br /> CHAN, 3450,20 <br /> CLARK, 2572.5,10 <br /> KING, 5500,10 <br /> MILLER, 920,10 <br /><br /> SQL&gt; HOST SQLLDR ADMIN / ADMIN CONTROL = TEST.CTL <br /><br /> SQL * Loader: Release 10.2.0.1.0 - Production on Wednesday January 27 13:48:56 2010 <br /><br /> Copyright (c) 1982, 2005, Oracle. All rights reserved. <br /><br /> Commit point reached - logical record count 7 <br /><br /> SQL&gt; SELECT * FROM TEST; <br /><br /> EMPNO ENAME SAL DEPTNO <br /> ---------- -------------------- ---------- ---------- <br /> 1 ALLEN 1600 30 <br /> 2 JONES 3123.75 20 <br /> 3 MARTIN 1312.5 30 <br /> 4 CHAN 3450 20 <br /> 5 CLARK 2572.5 10 <br /> 6 KING 5500 10 <br /> 7 MILLER 920 10 <br /><br /> Have chosen 7 rows.				<h5>Related Posts</h5>
		<div id="smilar">
		<ul>
					<li><a href="http://www.kods.netwww.kods.net/sql-optimization-1-full-table-scan-and-index-the-test/" title="SQL optimization (1) - full table scan and index the test">SQL optimization (1) - full table scan and index the test</a> 2009-03-28 09:02:39</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle10g-with-cross-platform-endian-transfer/" title="Oracle10g with cross-platform endian transfer">Oracle10g with cross-platform endian transfer</a> 2009-03-14 22:09:48</li>
					<li><a href="http://www.kods.netwww.kods.net/an-example-of-the-use-of-tkprof/" title="An example of the use of TKPROF">An example of the use of TKPROF</a> 2009-02-26 01:38:19</li>
				</ul>
		</div>
		        ]]></content:encoded>
		<wfw:commentRss>http://www.kods.netwww.kods.net/sqlloader-direct-path-load-and-sequence/</wfw:commentRss>
	</item>
		<item>
		<title>On the oracle of the four log</title>
		<link>http://www.kods.netwww.kods.net/on-the-oracle-of-the-four-log/</link>
		<comments>http://www.kods.netwww.kods.net/on-the-oracle-of-the-four-log/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 06:04:52+0000</pubDate>
		<dc:creator>kods.net</dc:creator>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[oracle]]></category>
<category><![CDATA[adump]]></category>
<category><![CDATA[log database]]></category>
		<guid isPermaLink="true">http://www.kods.netwww.kods.net/on-the-oracle-of-the-four-log/</guid>
		<description><![CDATA[Database in their daily work is that we often use the log file, oracle log file is as follows. background_dump_dest = / opt / oracle / admin / modl / bdump user_dump_dest = / opt / oracle / admin / mo ...]]></description>
		<content:encoded><![CDATA[Database in their daily work is that we often use the log file, oracle log file is as follows. <br /> background_dump_dest = / opt / oracle / admin / modl / bdump <br /> user_dump_dest = / opt / oracle / admin / modl / udump <br /> core_dump_dest = / opt / oracle / admin / modl / cdump <br /> audit_file_dest = / opt / oracle / admin / modl / adump				<h5>Related Posts</h5>
		<div id="smilar">
		<ul>
					<li><a href="http://www.kods.netwww.kods.net/sga-extended-the-principle-of-32bit-oracle/" title="SGA extended the principle of 32bit oracle">SGA extended the principle of 32bit oracle</a> 2009-03-31 09:48:01</li>
					<li><a href="http://www.kods.netwww.kods.net/high-availability-oracle-flashback/" title="High Availability Oracle Flashback">High Availability Oracle Flashback</a> 2009-02-26 17:23:02</li>
					<li><a href="http://www.kods.netwww.kods.net/an-example-of-the-use-of-tkprof/" title="An example of the use of TKPROF">An example of the use of TKPROF</a> 2009-02-26 01:38:19</li>
					<li><a href="http://www.kods.netwww.kods.net/diagnosis-and-principles-of-order/" title="Diagnosis and principles of order">Diagnosis and principles of order</a> 2009-02-25 20:27:28</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle-10g-dataguard-configuration-step-by-step/" title="ORACLE 10G dataguard configuration Step by Step">ORACLE 10G dataguard configuration Step by Step</a> 2009-02-16 01:13:55</li>
				</ul>
		</div>
		        ]]></content:encoded>
		<wfw:commentRss>http://www.kods.netwww.kods.net/on-the-oracle-of-the-four-log/</wfw:commentRss>
	</item>
		<item>
		<title>ORA-01940 error resolution process</title>
		<link>http://www.kods.netwww.kods.net/ora-01940-error-resolution-process/</link>
		<comments>http://www.kods.netwww.kods.net/ora-01940-error-resolution-process/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 16:12:56+0000</pubDate>
		<dc:creator>kods.net</dc:creator>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[sql procedure]]></category>
<category><![CDATA[pl sql]]></category>
<category><![CDATA[test table]]></category>
<category><![CDATA[yyyy]]></category>
<category><![CDATA[dd]]></category>
<category><![CDATA[line 1]]></category>
<category><![CDATA[logical backup]]></category>
<category><![CDATA[dmp]]></category>
<category><![CDATA[cascade]]></category>
<category><![CDATA[schema]]></category>
<category><![CDATA[select job]]></category>
<category><![CDATA[interval]]></category>
<category><![CDATA[test user]]></category>
<category><![CDATA[test time]]></category>
<category><![CDATA[error line]]></category>
<category><![CDATA[os linux]]></category>
<category><![CDATA[datetime values]]></category>
<category><![CDATA[error resolution]]></category>
<category><![CDATA[test session]]></category>
<category><![CDATA[last date]]></category>
		<guid isPermaLink="true">http://www.kods.netwww.kods.net/ora-01940-error-resolution-process/</guid>
		<description><![CDATA[DMP in the daily logical backup into a database, in the process of the data in the guide can not be removed before the user action occurs the following error: OS: linux Oracle9i Enterprise Edition Rel ...]]></description>
		<content:encoded><![CDATA[DMP in the daily logical backup into a database, in the process of the data in the guide can not be removed before the user action occurs the following error: <br /> OS: linux <br /><br /> Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production <br /><br /> SQL&gt; drop user test cascade; <br /><br /> drop user test cascade <br /><br /> * <br /><br /> Error line 1: <br /><br /> ORA-01940: cannot drop a user that is currently connected <br /><br /> Address: <br /><br /> Find out the reasons is because in the original DMP logical backup of data in the test user exists under the job, due to import data of these job has already begun, so there is in the process caused <br /><br /> JOB users to perform tasks in the test session, indicating that the user is being used, so the user can not be drop out of the <br /><br /> The following error ORA-01940 is the process of recovery: <br /><br /> Creating a Test Table <br /><br /> drop table test1 <br /><br /> select * from test1 <br /><br /> create table test1 (datetime date); <br /><br /> Create a custom process <br /><br /> create or replace procedure MYPROC as <br /><br /> begin <br /><br /> for i in 1 .. 100000 loop <br /><br /> insert into TEST1 (datetime) values (sysdate); <br /><br /> end loop; <br /><br /> end; <br /><br /> PL / SQL procedure successfully completed <br /><br /> Create a JOB, a day 1440 minutes, that is to run every 5 minutes during test time <br /><br /> declare <br /><br /> job number; <br /><br /> begin <br /><br /> sys.dbms_job.submit <br /><br /> (job =&gt; job, <br /><br /> what =&gt; &#39;MYPROC;&#39;, <br /><br /> next_date =&gt; sysdate, <br /><br /> interval =&gt; &#39;sysdate + (1 / 1440) * 5&#39;); <br /><br /> commit; <br /><br /> end; <br /><br /> PL / SQL procedure successfully completed <br /><br /> Running JOB <br /><br /> SQL&gt; begin <br /><br /> 2 sys.dbms_job.run (241); <br /><br /> 3 end; <br /><br /> 4 / <br /><br /> PL / SQL procedure successfully completed <br /><br /> There needs to delete a user daimin, they will report the following error <br /><br /> In order to sys landing system, remove the user daimin <br /><br /> - See daimin user job under the <br /><br /> SQL&gt; select job, what, interval, to_char (next_date, &#39;yyyy-mm-dd hh24: mi: ss&#39;) <br /><br /> 2 from dba_jobs where schema_user = &#39;DAIMIN&#39;; <br /><br /> JOB WHAT INTERVAL TO_CHAR (NEXT_DATE, &#39;YYYY-MM-DDH <br /><br /> 241 MYPROC; sysdate + (1 / 1440) * 5 2008-12-16 10:10:03 <br /><br /> See Running JOB <br /><br /> SQL&gt; select * from dba_jobs_running; <br /><br /> SID JOB FAILURES LAST_DATE LAST_SEC THIS_DATE THIS_SEC INSTANCE <br /><br /> 1619 2412008-12-16 10:25:51 0 <br /><br /> View user&#39;s active session daimin <br /><br /> SQL&gt; select sid, serial #, username, program, machine, status <br /><br /> 2 from v $ session <br /><br /> 3 where username = &#39;DAIMIN&#39; <br /><br /> 4 AND STATUS = &#39;ACTIVE&#39;; <br /><br /> SID SERIAL # USERNAME PROGRAM MACHINE STATUS <br /><br /> 1619 2360 DAIMIN plsqldev.exe STAPLES \ DELLF98P-10QC ACTIVE <br /><br /> - In order to remove the sys user down daimin users, will be reported the following error <br /><br /> SQL&gt; drop user daimin cascade; <br /><br /> drop user daimin cascade <br /><br /> ORA-01940: cannot drop a user that is currently connected <br /><br /> Attempt to remove the job <br /><br /> SQL&gt; begin <br /><br /> 2 FOR r_job IN (select job, what, interval, to_char (next_date, &#39;yyyy-mm-dd hh24: mi: ss&#39;) <br /><br /> 3 from dba_jobs where schema_user = &#39;DAIMIN&#39; <br /><br /> 4) LOOP <br /><br /> 5 dbms_job.REMOVE (r_job.job); <br /><br /> 6 end loop; <br /><br /> 7 commit; <br /><br /> 8 end; <br /><br /> 9 / <br /><br /> begin <br /><br /> FOR r_job IN (select job, what, interval, to_char (next_date, &#39;yyyy-mm-dd hh24: mi: ss&#39;) <br /><br /> from dba_jobs where schema_user = &#39;DAIMIN&#39; <br /><br /> ) LOOP <br /><br /> dbms_job.REMOVE (r_job.job); <br /><br /> end loop; <br /><br /> commit; <br /><br /> end; <br /><br /> ORA-23421: job number 241 is not a job in the job queue <br /><br /> ORA-06512: at &quot;SYS.DBMS_SYS_ERROR&quot;, line 86 <br /><br /> ORA-06512: at &quot;SYS.DBMS_IJOB&quot;, line 529 <br /><br /> ORA-06512: at &quot;SYS.DBMS_JOB&quot;, line 171 <br /><br /> ORA-06512: at line 5 <br /><br /> Analysis of error: due to the sys user to delete the user daimin under the JOB, it&#39;ll get an error <br /><br /> Solution: <br /><br /> 1, kill the task of implementing JOB conversation process; <br /><br /> alter system disconnect session &#39;sid, serial #&#39; immediate; <br /><br /> Or Alter system kill session &#39;sid, serial #&#39;; <br /><br /> Either <br /><br /> SQL&gt; drop user aa; <br /> drop user aa <br /> * <br /> ERROR at line 1: <br /> ORA-01940: cannot drop a user that is currently connected <br /><br /> SQL&gt; select sid, serial # from v $ session <br /> 2 where username = &#39;AA&#39;; <br /><br /> SID SERIAL # <br /> ---------- ---------- <br /> 13633 <br /><br /> SQL&gt; alter system kill session &#39;136, 33 &#39;; <br /><br /> System altered. <br /><br /> 2, by setting in the initial file, set the initial parameters JOB_QUEUE_PROCESSES = 0 to make Oracle will kill CJQ0 and the corresponding job processes; <br /><br /> Modify the init.ora file, and then restart the database, or the implementation of the ALTER SYSTEM SET JOB_QUEUE_PROCESSES = 0; <br /><br /> Modified the initial parameters set JOB_QUEUE_PROCESSES = 0, restart the database after the logical backup into operation, remove users, this time deleted successfully!				<h5>Related Posts</h5>
		<div id="smilar">
		<ul>
					<li><a href="http://www.kods.netwww.kods.net/sql-optimization-4-table-of-the-three-connections/" title="SQL optimization (4) - Table of the three connections">SQL optimization (4) - Table of the three connections</a> 2009-03-29 23:13:41</li>
					<li><a href="http://www.kods.netwww.kods.net/sql-optimization-3-four-index/" title="SQL optimization (3) - four index">SQL optimization (3) - four index</a> 2009-03-28 13:10:06</li>
					<li><a href="http://www.kods.netwww.kods.net/use-sqlldr-1-introduction/" title="use sqlldr 1 Introduction">use sqlldr 1 Introduction</a> 2009-03-27 19:39:01</li>
					<li><a href="http://www.kods.netwww.kods.net/an-example-of-the-use-of-tkprof/" title="An example of the use of TKPROF">An example of the use of TKPROF</a> 2009-02-26 01:38:19</li>
				</ul>
		</div>
		        ]]></content:encoded>
		<wfw:commentRss>http://www.kods.netwww.kods.net/ora-01940-error-resolution-process/</wfw:commentRss>
	</item>
		<item>
		<title>SQLLOADER the direct path load will result in the primary key or unique constraints related to the index is invalid</title>
		<link>http://www.kods.netwww.kods.net/sqlloader-the-direct-path-load-will-result-in-the-primary-key-or-unique-constraints-related-to-the-index-is-invalid/</link>
		<comments>http://www.kods.netwww.kods.net/sqlloader-the-direct-path-load-will-result-in-the-primary-key-or-unique-constraints-related-to-the-index-is-invalid/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 04:47:37+0000</pubDate>
		<dc:creator>kods.net</dc:creator>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[oracle database]]></category>
<category><![CDATA[sqlplus]]></category>
<category><![CDATA[olap]]></category>
<category><![CDATA[data mining]]></category>
<category><![CDATA[table test]]></category>
<category><![CDATA[index test]]></category>
<category><![CDATA[documents and settings]]></category>
<category><![CDATA[c documents]]></category>
<category><![CDATA[constraints]]></category>
<category><![CDATA[constraint name]]></category>
<category><![CDATA[index type]]></category>
<category><![CDATA[microsoft windows]]></category>
<category><![CDATA[corp c]]></category>
<category><![CDATA[microsoft corp]]></category>
<category><![CDATA[test microsoft]]></category>
<category><![CDATA[test fields]]></category>
<category><![CDATA[valid test]]></category>
<category><![CDATA[data path]]></category>
<category><![CDATA[type test]]></category>
<category><![CDATA[path c]]></category>
		<guid isPermaLink="true">http://www.kods.netwww.kods.net/sqlloader-the-direct-path-load-will-result-in-the-primary-key-or-unique-constraints-related-to-the-index-is-invalid/</guid>
		<description><![CDATA[SQLLOADER the direct path load will result in the primary key or unique constraints associated index is invalid. Simple to conduct a test. Microsoft Windows XP [Version 5.1.2600] (C) Copyright 1985-20 ...]]></description>
		<content:encoded><![CDATA[SQLLOADER the direct path load will result in the primary key or unique constraints associated index is invalid. <br /><br /> Simple to conduct a test. <br /><br /> Microsoft Windows XP [Version 5.1.2600] <br /> (C) Copyright 1985-2001 Microsoft Corp. <br /><br /> C: \ Documents and Settings \ Administrator&gt; cd c: \ <br /><br /> C: \&gt; sqlplus admin / admin <br /><br /> SQL * Plus: Release 10.2.0.1.0 - Production on Wednesday, February 3 09:50:18 2010 <br /><br /> Copyright (c) 1982, 2005, Oracle. All rights reserved. <br /><br /> Connect to: <br /> Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production <br /> With the Partitioning, OLAP and Data Mining options <br /><br /> SQL&gt; DROP TABLE TEST; <br /><br /> The table has been deleted. <br /><br /> SQL&gt; CREATE TABLE TEST (EMPNO NUMBER, ENAME VARCHAR2 (20), SAL NUMBER (7,2), DEPTNO NUMBER (3)); <br /><br /> The table has been created. <br /><br /> SQL&gt; ALTER TABLE TEST ADD CONSTRAINT TEST_PK PRIMARY KEY (EMPNO); <br /><br /> The table has changed. <br /><br /> SQL&gt; ALTER TABLE TEST ADD CONSTRAINT ENAME_UNIQUE UNIQUE (ENAME); <br /><br /> The table has changed. <br /><br /> SQL&gt; CREATE INDEX TEST_DEPTNO_IDX ON TEST (DEPTNO); <br /><br /> The index has been created. <br /><br /> SQL&gt; COL CONSTRAINT_NAME FORMAT A20 <br /> SQL&gt; COL CONSTRAINT_TYPE FORMAT A20 <br /><br /> SQL&gt; SELECT CONSTRAINT_NAME, CONSTRAINT_TYPE, STATUS FROM USER_CONSTRAINTS WHERE <br /><br /> TABLE_NAME = &#39;TEST&#39;; <br /><br /> CONSTRAINT_NAME CONSTRAINT_TYPE STATUS <br /> -------------------- -------------------- -------- <br /> TEST_PK P ENABLED <br /> ENAME_UNIQUE U ENABLED <br /><br /> SQL&gt; COL INDEX_NAME FORMAT A20 <br /> SQL&gt; COL INDEX_TYPE FORMAT A20 <br /><br /> SQL&gt; SELECT INDEX_NAME, INDEX_TYPE, STATUS FROM USER_INDEXES WHERE TABLE_NAME = &#39;TEST&#39;; <br /><br /> INDEX_NAME INDEX_TYPE STATUS <br /> -------------------- -------------------- -------- <br /> TEST_PK NORMAL VALID <br /> ENAME_UNIQUE NORMAL VALID <br /> TEST_DEPTNO_IDX NORMAL VALID <br /><br /> SQL&gt; HOST <br /> Microsoft Windows XP [Version 5.1.2600] <br /> (C) Copyright 1985-2001 Microsoft Corp. <br /><br /> C: \&gt; <br /><br /> First, the conventional way to import part of the data path. <br /><br /> C: \&gt; type test.ctl <br /><br /> LOAD DATA <br /> INFILE * <br /> APPEND <br /> INTO TABLE TEST <br /> FIELDS TERMINATED BY &#39;,&#39; <br /> (EMPNO, ENAME, SAL, DEPTNO) <br /> BEGINDATA <br /> 7499, ALLEN, 1600,30 <br /> 7566, JONES, 3123.75,20 <br /> 7654, MARTIN, 1312.5,30 <br /> 7658, CHAN, 3450,20 <br /> 7782, CLARK, 2572.5,10 <br /> 7839, KING, 5500,10 <br /> 7934, MILLER, 920,10 <br /><br /> C: \&gt; sqlldr admin / admin control = test.ctl <br /><br /> SQL * Loader: Release 10.2.0.1.0 - Production on Wednesday, February 3 10:12:16 2010 <br /><br /> Copyright (c) 1982, 2005, Oracle. All rights reserved. <br /><br /> Commit point reached - logical record count 7 <br /><br /> C: \&gt; EXIT <br /><br /> SQL&gt; SELECT * FROM TEST; <br /><br /> EMPNO ENAME SAL DEPTNO <br /> ---------- -------------------- ---------- ---------- <br /> 7499 ALLEN 1600 30 <br /> 7566 JONES 3123.75 20 <br /> 7654 MARTIN 1312.5 30 <br /> 7658 CHAN 3450 20 <br /> 7782 CLARK 2572.5 10 <br /> 7839 KING 5500 10 <br /> 7934 MILLER 920 10 <br /><br /> Have chosen 7 rows. <br /><br /> <font size=4><strong>An ordinary way of data loading unique constraint violation</strong></font> <br /><br /> C: \&gt; sqlldr admin / admin control = test.ctl <br /><br /> SQL * Loader: Release 10.2.0.1.0 - Production on Wednesday, February 3 10:14:41 2010 <br /><br /> Copyright (c) 1982, 2005, Oracle. All rights reserved. <br /><br /> Commit point reached - logical record count 7 <br /><br /> Look at the data <br /> SQL&gt; SELECT * FROM TEST; <br /><br /> EMPNO ENAME SAL DEPTNO <br /> ---------- -------------------- ---------- ---------- <br /> 7499 ALLEN 1600 30 <br /> 7566 JONES 3123.75 20 <br /> 7654 MARTIN 1312.5 30 <br /> 7658 CHAN 3450 20 <br /> 7782 CLARK 2572.5 10 <br /> 7839 KING 5500 10 <br /> 7934 MILLER 920 10 <br /><br /> Have chosen 7 rows. <br /><br /> Can see the data has not been imported in violation of unique constraint of the Well. <br /><br /> SQLLOADER import log files, there are the following: <br /><br /> <font face=宋体 color=#ff0000>Record 1: rejected - Table TEST error. <br /> ORA-00001: unique constraint violation (ADMIN.TEST_PK)</font> <br /><br /> <font face=宋体 color=#ff0000>Records 2: been rejected - the table TEST error. <br /> ORA-00001: unique constraint violation (ADMIN.TEST_PK)</font> <br /><br /> <font face=宋体 color=#ff0000>Record 3: Denied - the table TEST error.</font><br /> ORA-00001: unique constraint violation (ADMIN.TEST_PK) <br /><br /> <font face=宋体 color=#ff0000>Record 4: Denied - the table TEST error. <br /> ORA-00001: unique constraint violation (ADMIN.TEST_PK)</font> <br /><br /> <font face=宋体 color=#ff0000>Record 5: Denied - the table TEST error. <br /> ORA-00001: unique constraint violation (ADMIN.TEST_PK)</font> <br /><br /> <font face=宋体 color=#ff0000>Record 6: Denied - the table TEST error. <br /> ORA-00001: unique constraint violation (ADMIN.TEST_PK)</font> <br /><br /> <font face=宋体 color=#ff0000>Record 7: Denied - the table TEST error. <br /> ORA-00001: unique constraint violation (ADMIN.TEST_PK)</font> <br /><br /> <font face=宋体 color=#ff0000>Table TEST: <br /> 0 rows loaded successfully. <br /> Due to data errors, line 7 is not loaded. <br /> Since all WHEN clauses failed, 0 line is not loaded. <br /> Since all fields are empty, the 0-line is not loaded.</font> <br /><br /> <font face=宋体 color=#ff0000>However, indexes and constraints at this time are normal.</font> <br /><br /> SQL&gt; SELECT CONSTRAINT_NAME, CONSTRAINT_TYPE, STATUS FROM USER_CONSTRAINTS WHERE T <br /> ABLE_NAME = &#39;TEST&#39;; <br /><br /> CONSTRAINT_NAME CONSTRAINT_TYPE STATUS <br /> -------------------- -------------------- -------- <br /> TEST_PK P ENABLED <br /> ENAME_UNIQUE U ENABLED <br /><br /> SQL&gt; SELECT INDEX_NAME, INDEX_TYPE, STATUS FROM USER_INDEXES WHERE TABLE_NAME = &#39;TES <br /> T &#39;; <br /><br /> INDEX_NAME INDEX_TYPE STATUS <br /> -------------------- -------------------- -------- <br /> TEST_PK NORMAL VALID <br /> ENAME_UNIQUE NORMAL VALID <br /> TEST_DEPTNO_IDX NORMAL VALID <br /><br /> <font size=4><strong>2, the only constraint violation of direct path loads of data</strong></font> <br /><br /> C: \&gt; type test.ctl <br /><br /> <strong>OPTIONS (DIRECT = TRUE) <br /> UNRECOVERABLE</strong> <br /> LOAD DATA <br /> INFILE * <br /> APPEND <br /> INTO TABLE TEST <br /> FIELDS TERMINATED BY &#39;,&#39; <br /> (EMPNO, ENAME, SAL, DEPTNO) <br /> BEGINDATA <br /> 7499, ALLEN, 1600,30 <br /> 7566, JONES, 3123.75,20 <br /> 7654, MARTIN, 1312.5,30 <br /> 7658, CHAN, 3450,20 <br /> 7782, CLARK, 2572.5,10 <br /> 7839, KING, 5500,10 <br /> 7934, MILLER, 920,10 <br /><br /> C: \&gt; sqlldr admin / admin control = test.ctl <br /><br /> SQL * Loader: Release 10.2.0.1.0 - Production on Wednesday, February 3 10:21:52 2010 <br /><br /> Copyright (c) 1982, 2005, Oracle. All rights reserved. <br /><br /> Load completed - logical record count 7. <br /><br /> C: \&gt; exit <br /><br /> SQL&gt; SELECT * FROM TEST; <br /><br /> EMPNO ENAME SAL DEPTNO <br /> ---------- -------------------- ---------- ---------- <br /> 7499 ALLEN 1600 30 <br /> 7566 JONES 3123.75 20 <br /> 7654 MARTIN 1312.5 30 <br /> 7658 CHAN 3450 20 <br /> 7782 CLARK 2572.5 10 <br /> 7839 KING 5500 10 <br /> 7934 MILLER 920 10 <br /> 7499 ALLEN 1600 30 <br /> 7566 JONES 3123.75 20 <br /> 7654 MARTIN 1312.5 30 <br /> 7658 CHAN 3450 20 <br /><br /> EMPNO ENAME SAL DEPTNO <br /> ---------- -------------------- ---------- ---------- <br /> 7782 CLARK 2572.5 10 <br /> 7839 KING 5500 10 <br /> 7934 MILLER 920 10 <br /><br /> Has selected 14 rows. <br /><br /> Can see the data has been successfully inserted. While the load was successful, but sqlloader recorded in a log inside look at the contents: <br /><br /> <font color=#ff0000>Table TEST has dealt with the following indexes: <br /> Index ADMIN.ENAME_UNIQUE can not be used because: <br /> ORA-00001: unique constraint violation (ADMIN.ENAME_UNIQUE) <br /> Index ADMIN.TEST_DEPTNO_IDX has been successfully loaded, with seven keyword index ADMIN.TEST_PK can not be used because: <br /> ORA-00001: unique constraint violation (ADMIN.TEST_PK)</font> <br /><br /> <font color=#ff0000>Table TEST: <br /> 7 rows loaded successfully. <br /> Due to data errors, 0 line is not loaded. <br /> Since all WHEN clauses failed, 0 line is not loaded. <br /> Since all fields are empty, the 0-line is not loaded.</font> <br /><br /> SQL&gt; SELECT CONSTRAINT_NAME, CONSTRAINT_TYPE, STATUS FROM USER_CONSTRAINTS WHERE T <br /> ABLE_NAME = &#39;TEST&#39;; <br /><br /> CONSTRAINT_NAME CONSTRAINT_TYPE STATUS <br /> -------------------- -------------------- -------- <br /> TEST_PK P ENABLED <br /> ENAME_UNIQUE U ENABLED <br /><br /> Constraint is still good, but this time the index has been invalid. <br /><br /> SQL&gt; SELECT INDEX_NAME, INDEX_TYPE, STATUS FROM USER_INDEXES WHERE TABLE_NAME = &#39;TES <br /> T &#39;; <br /><br /> INDEX_NAME INDEX_TYPE STATUS <br /> -------------------- -------------------- -------- <br /> TEST_PK NORMAL <strong>UNUSABLE</strong> <br /> ENAME_UNIQUE NORMAL <strong>UNUSABLE <br /></strong> TEST_DEPTNO_IDX NORMAL VALID <br /><br /> Rebuild the index will be reported at this time ORA-01452 error. <br /><br /> SQL&gt; ALTER INDEX ENAME_UNIQUE REBUILD ONLINE; <br /> ALTER INDEX ENAME_UNIQUE REBUILD ONLINE <br /> * <br /> Error line 1: <br /> ORA-01452: can not CREATE UNIQUE INDEX; find duplicate keywords <br /><br /> <font size=4><strong>3, direct path to load the data is not unique constraint violation</strong></font> <br /><br /> SQL&gt; TRUNCATE TABLE TEST; <br /><br /> Table has been truncated. <br /><br /> SQL&gt; ALTER INDEX TEST_PK REBUILD ONLINE; <br /><br /> The index has changed. <br /><br /> SQL&gt; ALTER INDEX ENAME_UNIQUE REBUILD ONLINE; <br /><br /> The index has changed. <br /><br /> SQL&gt; INSERT INTO TEST SELECT EMPNO + ROWNUM, ENAME | | &#39;A&#39;, SAL, DEPTNO FROM SCOTT.EMP WHERE ROWNUM &lt;8; <br /><br /> 7 line has been created. <br /><br /> SQL&gt; COMMIT; <br /><br /> To submit completed. <br /><br /> SQL&gt; SELECT * FROM TEST; <br /><br /> EMPNO ENAME SAL DEPTNO <br /> ---------- -------------------- ---------- ---------- <br /> 7370 SMITHA 800 20 <br /> 7501 ALLENA 1600 30 <br /> 7524 WARDA 1250 30 <br /> 7570 JONESA 2975 20 <br /> 7659 MARTINA 1250 30 <br /> 7704 BLAKEA 2850 30 <br /> 7789 CLARKA 2450 10 <br /><br /> Have chosen 7 rows. <br /><br /> SQL&gt; HOST TYPE TEST.CTL <br /><br /> <strong>OPTIONS (DIRECT = TRUE) <br /> UNRECOVERABLE <br /></strong> LOAD DATA <br /> INFILE * <br /> APPEND <br /> INTO TABLE TEST <br /> FIELDS TERMINATED BY &#39;,&#39; <br /> (EMPNO, ENAME, SAL, DEPTNO) <br /> BEGINDATA <br /> 7499, ALLEN, 1600,30 <br /> 7566, JONES, 3123.75,20 <br /> 7654, MARTIN, 1312.5,30 <br /> 7658, CHAN, 3450,20 <br /> 7782, CLARK, 2572.5,10 <br /> 7839, KING, 5500,10 <br /> 7934, MILLER, 920,10 <br /><br /> SQL&gt; HOST sqlldr admin / admin control = test.ctl <br /><br /> SQL * Loader: Release 10.2.0.1.0 - Production on Wednesday, February 3 10:40:57 2010 <br /><br /> Copyright (c) 1982, 2005, Oracle. All rights reserved. <br /><br /> Load completed - logical record count 7. <br /><br /> SQL&gt; SELECT * FROM TEST; <br /><br /> EMPNO ENAME SAL DEPTNO <br /> ---------- -------------------- ---------- ---------- <br /> 7370 SMITHA 800 20 <br /> 7501 ALLENA 1600 30 <br /> 7524 WARDA 1250 30 <br /> 7570 JONESA 2975 20 <br /> 7659 MARTINA 1250 30 <br /> 7704 BLAKEA 2850 30 <br /> 7789 CLARKA 2450 10 <br /> 7499 ALLEN 1600 30 <br /> 7566 JONES 3123.75 20 <br /> 7654 MARTIN 1312.5 30 <br /> 7658 CHAN 3450 20 <br /><br /> EMPNO ENAME SAL DEPTNO <br /> ---------- -------------------- ---------- ---------- <br /> 7782 CLARK 2572.5 10 <br /> 7839 KING 5500 10 <br /> 7934 MILLER 920 10 <br /><br /> Has selected 14 rows. <br /><br /> SQL&gt; SELECT CONSTRAINT_NAME, CONSTRAINT_TYPE, STATUS FROM USER_CONSTRAINTS WHERE T <br /> ABLE_NAME = &#39;TEST&#39;; <br /><br /> CONSTRAINT_NAME CONSTRAINT_TYPE STATUS <br /> -------------------- -------------------- -------- <br /> TEST_PK P ENABLED <br /> ENAME_UNIQUE U ENABLED <br /><br /> SQL&gt; SELECT INDEX_NAME, INDEX_TYPE, STATUS FROM USER_INDEXES WHERE TABLE_NAME = &#39;TES <br /> T &#39;; <br /><br /> INDEX_NAME INDEX_TYPE STATUS <br /> -------------------- -------------------- -------- <br /> TEST_PK NORMAL VALID <br /> ENAME_UNIQUE NORMAL VALID <br /> TEST_DEPTNO_IDX NORMAL VALID <br /><br /> When using direct path load, if the table has a primary key field, or unique constraints, and the loading of data in violation of unique constraint, then the index set of related SQLLOADER to be invalid, to continue loading. After loading, the index does not automatically set for effective, it needs manual intervention DBA.				<h5>Related Posts</h5>
		<div id="smilar">
		<ul>
					<li><a href="http://www.kods.netwww.kods.net/oracle-xdb-relax-resolve-port-conflict-of-8080/" title="Oracle XDB relax resolve port conflict of 8080">Oracle XDB relax resolve port conflict of 8080</a> 2009-03-13 16:47:42</li>
					<li><a href="http://www.kods.netwww.kods.net/an-example-of-the-use-of-tkprof/" title="An example of the use of TKPROF">An example of the use of TKPROF</a> 2009-02-26 01:38:19</li>
				</ul>
		</div>
		        ]]></content:encoded>
		<wfw:commentRss>http://www.kods.netwww.kods.net/sqlloader-the-direct-path-load-will-result-in-the-primary-key-or-unique-constraints-related-to-the-index-is-invalid/</wfw:commentRss>
	</item>
		<item>
		<title>sqlplus can execute PL / SQL procedure written</title>
		<link>http://www.kods.netwww.kods.net/sqlplus-can-execute-pl-sql-procedure-written/</link>
		<comments>http://www.kods.netwww.kods.net/sqlplus-can-execute-pl-sql-procedure-written/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 15:07:06+0000</pubDate>
		<dc:creator>kods.net</dc:creator>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[oracle]]></category>
<category><![CDATA[oracle database]]></category>
<category><![CDATA[sql procedure]]></category>
<category><![CDATA[pl sql]]></category>
<category><![CDATA[data mining]]></category>
<category><![CDATA[lt]]></category>
<category><![CDATA[olap data]]></category>
<category><![CDATA[application testing]]></category>
<category><![CDATA[oracle sql]]></category>
<category><![CDATA[number 1]]></category>
<category><![CDATA[insertion]]></category>
<category><![CDATA[t1]]></category>
<category><![CDATA[pairs]]></category>
<category><![CDATA[sql program]]></category>
<category><![CDATA[sql programs]]></category>
<category><![CDATA[exit statement]]></category>
<category><![CDATA[loop body]]></category>
		<guid isPermaLink="true">http://www.kods.netwww.kods.net/sqlplus-can-execute-pl-sql-procedure-written/</guid>
		<description><![CDATA[sqlplus can execute PL / SQL to write programs. SQL * Plus: Release 10.2.0.1.0 - Production on Wednesday, February 3 09:59:25 2010 Copyright (c) 1982, 2005, Oracle. All rights reserved. Connect to: Or ...]]></description>
		<content:encoded><![CDATA[sqlplus can execute PL / SQL to write programs. <br /><br /> <font color=#ffffff>SQL * Plus: Release 10.2.0.1.0 - Production on Wednesday, February 3 09:59:25 2010</font> <br /><br /> <font color=#ffffff>Copyright (c) 1982, 2005, Oracle. All rights reserved.</font> <br /><br /> <font color=#ffffff>Connect to: <br /> Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production <br /> With the Partitioning, OLAP, Data Mining and Real Application Testing options</font> <br /><br /> <font color=#ffffff>1 DECLARE <br /> 2 <br /> 3 a NUMBER: = 3; <br /> 4 <br /> 5 BEGIN <br /> 6 <br /> 7 a: = a + 1; <br /> 8 <br /> 9 END; <br /> 10 *</font> <br /><br /> <font color=#ffffff>PL / SQL procedure successfully completed.</font> <br /><br /> As with <font color=#800080>Oracle</font> SQL programs, we can invoke a PL / SQL program either by typing it in <font face=新宋体><tt>sqlplus</tt></font> or by putting the code in a file and invoking the file in the various ways we learned in <font color=#800080>Getting Started With</font> Oracle. <br /><br /> PL / SQL allows you to branch and create loops in a fairly familiar way. <br /><br /><p> An <font face=新宋体><tt>IF</tt></font> statement looks like: <pre>IF &lt;condition&gt; THEN &lt;statement_list&gt; ELSE &lt;statement_list&gt; END IF;</pre> The <font face=新宋体><tt>ELSE</tt></font> part is optional. If you want a multiway branch, use: <pre>IF &lt;condition_1&gt; THEN ...

ELSIF &lt;condition_2&gt; THEN ...

... ...

ELSIF &lt;condition_n&gt; THEN ...

ELSE ...

END IF;</pre> The following is an example, slightly modified from the previous one, where now we only do the insertion if the second component is 1. If not, we first add 10 to each component and then insert: <pre>DECLARE

    a NUMBER;

    b NUMBER;

BEGIN

    SELECT e,f INTO a,b FROM T1 WHERE e&gt;1;

    IF b=1 THEN

        INSERT INTO T1 VALUES(b,a);

    ELSE

        INSERT INTO T1 VALUES(b+10,a+10);

    END IF;

END;

.

run;</pre> Loops are created with the following: <pre>LOOP

    &lt;loop_body&gt; /* A list of statements. */

END LOOP;</pre> At least one of the statements <font face=新宋体><tt>in</tt></font> &lt;loop_body&gt; should be an <font face=新宋体><tt>EXIT</tt></font> statement of the form <pre>EXIT WHEN &lt;condition&gt;;</pre> The loop breaks if <font face=新宋体><tt>&lt;condition&gt;</tt></font> is true. For example, here is a way to insert each of the pairs (1, 1) through (100, 100) into <font face=新宋体><tt>T1</tt></font> of the above two examples: <pre>DECLARE

    i NUMBER := 1;

BEGIN

    LOOP

        INSERT INTO T1 VALUES(i,i);

        i := i+1;

        EXIT WHEN i&gt;100;

    END LOOP;

END;

.

run;</pre> Some other useful loop-forming statements are: <ul><li> <font face=新宋体><tt>EXIT</tt></font> by itself is an unconditional loop break. Use it inside a conditional if you like. <li> A <font face=新宋体><tt>WHILE</tt></font> loop can be formed with <pre>    WHILE &lt;condition&gt; LOOP

        &lt;loop_body&gt;

    END LOOP;</pre> <li> A simple <font face=新宋体><tt>FOR</tt></font> loop can be formed with: <pre>    FOR &lt;var&gt; IN &lt;start&gt;..&lt;finish&gt; LOOP

        &lt;loop_body&gt;

    END LOOP;</pre> Here, <font face=新宋体><tt>&lt;var&gt;</tt></font> can be any variable; it is local to the for-loop <font face=新宋体><tt>and</tt></font> need not be declared. Also, <font face=新宋体><tt>&lt;start&gt;</tt></font> and &lt;finish&gt; are constants. </li></ul>				<h5>Related Posts</h5>
		<div id="smilar">
		<ul>
					<li><a href="http://www.kods.netwww.kods.net/sga-extended-the-principle-of-32bit-oracle/" title="SGA extended the principle of 32bit oracle">SGA extended the principle of 32bit oracle</a> 2009-03-31 09:48:01</li>
					<li><a href="http://www.kods.netwww.kods.net/an-example-of-the-use-of-tkprof/" title="An example of the use of TKPROF">An example of the use of TKPROF</a> 2009-02-26 01:38:19</li>
					<li><a href="http://www.kods.netwww.kods.net/diagnosis-and-principles-of-order/" title="Diagnosis and principles of order">Diagnosis and principles of order</a> 2009-02-25 20:27:28</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle-10g-dataguard-configuration-step-by-step/" title="ORACLE 10G dataguard configuration Step by Step">ORACLE 10G dataguard configuration Step by Step</a> 2009-02-16 01:13:55</li>
				</ul>
		</div>
		        ]]></content:encoded>
		<wfw:commentRss>http://www.kods.netwww.kods.net/sqlplus-can-execute-pl-sql-procedure-written/</wfw:commentRss>
	</item>
		<item>
		<title>oracle 10g em to change</title>
		<link>http://www.kods.netwww.kods.net/oracle-10g-em-to-change/</link>
		<comments>http://www.kods.netwww.kods.net/oracle-10g-em-to-change/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 14:43:17+0000</pubDate>
		<dc:creator>kods.net</dc:creator>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[oracle]]></category>
<category><![CDATA[oracle 11g]]></category>
		<guid isPermaLink="true">http://www.kods.netwww.kods.net/oracle-10g-em-to-change/</guid>
		<description><![CDATA[The oracle10g in, em access address: http://ip:1158/em In oracle 11g in, em access to the address changed to: https: / / ip: 1158/em]]></description>
		<content:encoded><![CDATA[The oracle10g in, em access address: http://ip:1158/em <br /><br /> In oracle 11g in, em access to the address changed to: https: / / ip: 1158/em				<h5>Related Posts</h5>
		<div id="smilar">
		<ul>
					<li><a href="http://www.kods.netwww.kods.net/sga-extended-the-principle-of-32bit-oracle/" title="SGA extended the principle of 32bit oracle">SGA extended the principle of 32bit oracle</a> 2009-03-31 09:48:01</li>
					<li><a href="http://www.kods.netwww.kods.net/high-availability-oracle-flashback/" title="High Availability Oracle Flashback">High Availability Oracle Flashback</a> 2009-02-26 17:23:02</li>
					<li><a href="http://www.kods.netwww.kods.net/an-example-of-the-use-of-tkprof/" title="An example of the use of TKPROF">An example of the use of TKPROF</a> 2009-02-26 01:38:19</li>
					<li><a href="http://www.kods.netwww.kods.net/diagnosis-and-principles-of-order/" title="Diagnosis and principles of order">Diagnosis and principles of order</a> 2009-02-25 20:27:28</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle-10g-dataguard-configuration-step-by-step/" title="ORACLE 10G dataguard configuration Step by Step">ORACLE 10G dataguard configuration Step by Step</a> 2009-02-16 01:13:55</li>
				</ul>
		</div>
		        ]]></content:encoded>
		<wfw:commentRss>http://www.kods.netwww.kods.net/oracle-10g-em-to-change/</wfw:commentRss>
	</item>
		<item>
		<title>Hash join algorithm principle</title>
		<link>http://www.kods.netwww.kods.net/hash-join-algorithm-principle/</link>
		<comments>http://www.kods.netwww.kods.net/hash-join-algorithm-principle/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 16:51:22+0000</pubDate>
		<dc:creator>kods.net</dc:creator>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[principle]]></category>
<category><![CDATA[oracle]]></category>
<category><![CDATA[hash table]]></category>
<category><![CDATA[partition]]></category>
<category><![CDATA[assumption]]></category>
<category><![CDATA[cbo]]></category>
<category><![CDATA[memory]]></category>
<category><![CDATA[hash function]]></category>
<category><![CDATA[oracle connection]]></category>
<category><![CDATA[presence]]></category>
<category><![CDATA[partitions]]></category>
<category><![CDATA[algorithm]]></category>
<category><![CDATA[vector]]></category>
<category><![CDATA[probe input]]></category>
<category><![CDATA[3 years]]></category>
		<guid isPermaLink="true">http://www.kods.netwww.kods.net/hash-join-algorithm-principle/</guid>
		<description><![CDATA[Hash join algorithm principle Since the oracke 7.3 years, oracle provides a new join techniques, that is, hash join. Hash Join can only be used for the same connection, and only in the CBO optimizer m ...]]></description>
		<content:encoded><![CDATA[<strong><font face="Times New Roman">Hash join</font> algorithm principle</strong> <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p><br /><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /> Since the <font face="Times New Roman">oracke 7.3</font> years, <font face="Times New Roman">oracle</font> provides a <font face="Times New Roman">new</font> join techniques, <font face="Times New Roman">that is, hash join. Hash Join</font> can only be used for the same connection, and only in the <font face="Times New Roman">CBO</font> optimizer mode. Relative to the <font face="Times New Roman">nested loop join, hash join</font> is more suited to deal with large result sets. <font face="Times New Roman">Hash join</font> do not need to drive the table there is no index. <o:p></o:p><br /><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /> <strong><font face="Times New Roman">1. Hash Join</font> an overview of</strong> <o:p></o:p><br /><br /> <font face="Times New Roman">Hash join</font> algorithm is a basic idea is that according to a small <font face="Times New Roman">row sources (called</font> the <font face="Times New Roman">build input,</font> we recorded a smaller table for <font face="Times New Roman">S,</font> a larger table for the <font face="Times New Roman">B)</font> to create a presence in the <font face="Times New Roman">hash area</font> memory <font face="Times New Roman">hash table,</font> and then use a large <font face="Times New Roman">row sources (called</font> the <font face="Times New Roman">probe input)</font> to detect the previously built in <font face="Times New Roman">hash table.</font> If the <font face="Times New Roman">hash area</font> memory is not big enough, <font face="Times New Roman">hash table</font> can not be completely stored in the <font face="Times New Roman">hash area</font> memory. In view of this situation, <font face="Times New Roman">Oracle</font> connection keys using a <font face="Times New Roman">hash</font> function will <font face="Times New Roman">build input</font> and <font face="Times New Roman">probe input</font> is not connected to split into multiple partitions (respectively denoted by <font face="Times New Roman">S <sub>i</sub></font> and <font face="Times New Roman">B <sub>i),</sub></font> this stage is called the partition phase; and their corresponding partition, namely, <font face="Times New Roman">S <sub>i</sub></font> and <font face="Times New Roman">B <sub>i</sub></font> do <font face="Times New Roman">Hash join,</font> at this stage is called the <font face="Times New Roman">join</font> phase. <o:p></o:p><br /><br /> If the partition for a partition of the <font face="Times New Roman">hash table</font> is built too much, then, <font face="Times New Roman">oracle</font> on the use of <font face="Times New Roman">nested-loops hash join.</font> The so-called <font face="Times New Roman">nested-loops hash join</font> is the right part of the <font face="Times New Roman">S <sub>i</sub></font> build <font face="Times New Roman">hash table,</font> and then read all of the <font face="Times New Roman">B <sub>i</sub></font> with the built in <font face="Times New Roman">hash table</font> to do to connect, and then the remaining <font face="Times New Roman">S <sub>i</sub></font> build <font face="Times New Roman">hash table,</font> and then all of the <font face="Times New Roman">B <sub>i</sub></font> with the The <font face="Times New Roman">hash table</font> was built to do connections, until all of the <font face="Times New Roman">S <sub>i</sub></font> are connected finished. <o:p></o:p><br /><br /> <font face="Times New Roman">Hash Join</font> algorithm has a limit, it is because the assumption that two keys on the table connection is uniform, meaning that each partition has a similar data. However, in practice data is uneven, in order to properly solve this problem, <font face="Times New Roman">oracle</font> has introduced several technologies, bitmap vector filtering, roles were reversed, histogram, the specific meaning of these terms will be detailed later. <o:p></o:p><br /><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /> <strong><font face="Times New Roman">二.</font> Principles of <font face="Times New Roman">Hash Join</font></strong> <o:p></o:p><br /><br /> We use an example to explain the principles of <font face="Times New Roman">Hash Join</font> algorithm, as well as the above-mentioned terms. <o:p></o:p><br /><br /> Consider the following two data sets. <o:p></o:p><br /><br /> <font face="Times New Roman">S = (1,1,1,3,3,4,4,4,4,5,8,8,8,8,10)</font> <o:p></o:p><br /><br /> <font face="Times New Roman">B = (0,0,1,1,1,1,2,2,2,2,2,2,3,8,9,9,9,10,10,11)</font> <o:p></o:p><br /><br /> <font face="Times New Roman">Hash Join</font> The first step is to determine the small table (that is, <font face="Times New Roman">build input)</font> is fully stored in the <font face="Times New Roman">hash area</font> memory. If we can completely stored in memory in the memory, to create <font face="Times New Roman">hash table,</font> this is the most simple <font face="Times New Roman">hash join.</font> <o:p></o:p><br /><br /> If you can not all be stored in memory, you need to <font face="Times New Roman">build input</font> partition. The number of partitions is called <font face="Times New Roman">fan-out. Fan-out</font> is <font face="Times New Roman">hash_area_size</font> and the <font face="Times New Roman">cluster size</font> to decide. One <font face="Times New Roman">cluster size</font> is equal to <font face="Times New Roman">db_block_size * hash_multiblock_io_count,</font> hash_multiblock_io_count is implicit in <font face="Times New Roman">oracle9i</font> parameter. It should be noted that the <font face="Times New Roman">fan-out</font> is not the <font face="Times New Roman">build input</font> size <font face="Times New Roman">/ hash_ara_size,</font> that the decision <font face="Times New Roman">oracle</font> partition size may still not be fully stored in the <font face="Times New Roman">hash area</font> memory. A large <font face="Times New Roman">fan-out</font> led to many small district, affecting performance, while a small <font face="Times New Roman">fan-out</font> led to a small number of large partitions, so that each partition can not all be stored in memory, which also affects the performance of <font face="Times New Roman">hash join.</font> <o:p></o:p><br /><br /> <font face="Times New Roman">Oracle</font> uses a <font face="Times New Roman">hash</font> function is applied to the internal link button on the <font face="Times New Roman">S</font> and <font face="Times New Roman">B</font> will be split into multiple partitions, where we assume for the sake of this <font face="Times New Roman">hash</font> function is more than a function, that is, <font face="Times New Roman">Mod (join_column_value, 10).</font> This produces 10 partitions, the following table. <o:p></o:p><br /><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /><table"BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext" cellspacing=0 cellpadding=0 border=1><tbody><tr><td valign=top width=35 rowspan=2><br /> Zoning <o:p></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=59><br /> <font face="Times New Roman">B0</font> <o:p></o:p><br /><br /></td><td valign=top width=62><br /> <font face="Times New Roman">B1</font> <o:p></o:p><br /><br /></td><td valign=top width=65><br /> <font face="Times New Roman">B2</font> <o:p></o:p><br /><br /></td><td valign=top width=35><br /> <font face="Times New Roman">B3</font> <o:p></o:p><br /><br /></td><td valign=top width=47><br /> <font face="Times New Roman">B4</font> <o:p></o:p><br /><br /></td><td valign=top width=47><br /> <font face="Times New Roman">B5</font> <o:p></o:p><br /><br /></td><td valign=top width=47><br /> <font face="Times New Roman">B6</font> <o:p></o:p><br /><br /></td><td valign=top width=47><br /> <font face="Times New Roman">B7</font> <o:p></o:p><br /><br /></td><td valign=top width=35><br /> <font face="Times New Roman">B8</font> <o:p></o:p><br /><br /></td><td valign=top width=42><br /> <font face="Times New Roman">B9</font> <o:p></o:p><br /><br /></td></tr><tr><td valign=top width=47><br /> Value <o:p></o:p><br /><br /></td><td valign=top width=59><br /> <font face="Times New Roman">0,0,10,10</font> <o:p></o:p><br /><br /></td><td valign=top width=62><br /> <font face="Times New Roman">1,1,1,1,11</font> <o:p></o:p><br /><br /></td><td valign=top width=65><br /> <font face="Times New Roman">2,2,2,2,2,2</font> <o:p></o:p><br /><br /></td><td valign=top width=35><br /> <font face="Times New Roman">3</font> <o:p></o:p><br /><br /></td><td valign=top width=47><br /> <font face="Times New Roman">NULL</font> <o:p></o:p><br /><br /></td><td valign=top width=47><br /> <font face="Times New Roman">NULL</font> <o:p></o:p><br /><br /></td><td valign=top width=47><br /> <font face="Times New Roman">NULL</font> <o:p></o:p><br /><br /></td><td valign=top width=47><br /> <font face="Times New Roman">NULL</font> <o:p></o:p><br /><br /></td><td valign=top width=35><br /> <font face="Times New Roman">8</font> <o:p></o:p><br /><br /></td><td valign=top width=42><br /> <font face="Times New Roman">9,9,9</font> <o:p></o:p><br /><br /></td></tr><tr><td valign=top width=35><br /> <font face="Times New Roman">S0</font> <o:p></o:p><br /><br /></td><td valign=top width=47><br /> <font face="Times New Roman">10</font> <o:p></o:p><br /><br /></td><td valign=top width=59><br /> √ <o:p></o:p><br /><br /></td><td valign=top width=62><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=65><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=35><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=35><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=42><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td></tr><tr><td valign=top width=35><br /> <font face="Times New Roman">S1</font> <o:p></o:p><br /><br /></td><td valign=top width=47><br /> <font face="Times New Roman">1,1,1</font> <o:p></o:p><br /><br /></td><td valign=top width=59><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=62><br /> √ <o:p></o:p><br /><br /></td><td valign=top width=65><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=35><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=35><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=42><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td></tr><tr><td valign=top width=35><br /> <font face="Times New Roman">S2</font> <o:p></o:p><br /><br /></td><td valign=top width=47><br /> <font face="Times New Roman">Null</font> <o:p></o:p><br /><br /></td><td valign=top width=59><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=62><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=65><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=35><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=35><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=42><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td></tr><tr><td valign=top width=35><br /> <font face="Times New Roman">S3</font> <o:p></o:p><br /><br /></td><td valign=top width=47><br /> <font face="Times New Roman">3,3</font> <o:p></o:p><br /><br /></td><td valign=top width=59><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=62><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=65><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=35><br /> √ <o:p></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=35><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=42><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td></tr><tr><td valign=top width=35><br /> <font face="Times New Roman">S4</font> <o:p></o:p><br /><br /></td><td valign=top width=47><br /> <font face="Times New Roman">4,4,4,4</font> <o:p></o:p><br /><br /></td><td valign=top width=59><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=62><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=65><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=35><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=35><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=42><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td></tr><tr><td valign=top width=35><br /> <font face="Times New Roman">S5</font> <o:p></o:p><br /><br /></td><td valign=top width=47><br /> <font face="Times New Roman">5</font> <o:p></o:p><br /><br /></td><td valign=top width=59><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=62><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=65><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=35><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=35><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=42><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td></tr><tr><td valign=top width=35><br /> <font face="Times New Roman">S6</font> <o:p></o:p><br /><br /></td><td valign=top width=47><br /> <font face="Times New Roman">NULL</font> <o:p></o:p><br /><br /></td><td valign=top width=59><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=62><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=65><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=35><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=35><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=42><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td></tr><tr><td valign=top width=35><br /> <font face="Times New Roman">S7</font> <o:p></o:p><br /><br /></td><td valign=top width=47><br /> <font face="Times New Roman">NULL</font> <o:p></o:p><br /><br /></td><td valign=top width=59><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=62><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=65><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=35><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=35><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=42><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td></tr><tr><td valign=top width=35><br /> <font face="Times New Roman">S8</font> <o:p></o:p><br /><br /></td><td valign=top width=47><br /> <font face="Times New Roman">8,8,8,8</font> <o:p></o:p><br /><br /></td><td valign=top width=59><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=62><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=65><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=35><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=35><br /> √ <o:p></o:p><br /><br /></td><td valign=top width=42><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td></tr><tr><td valign=top width=35><br /> <font face="Times New Roman">S9</font> <o:p></o:p><br /><br /></td><td valign=top width=47><br /> <font face="Times New Roman">NULL</font> <o:p></o:p><br /><br /></td><td valign=top width=59><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=62><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=65><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=35><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=47><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=35><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td><td valign=top width=42><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /></td></tr></tbody></table><br /> After this partition, there is only need to <font face="Times New Roman">join</font> the corresponding partitions can be made between (that is, the so-called <font face="Times New Roman">partition pairs),</font> if there is a partition as a <font face="Times New Roman">NULL,</font> then <font face="Times New Roman">join</font> the corresponding partitions can be ignored. <o:p></o:p><br /><br /> In the <font face="Times New Roman">S</font> table is read into memory partition, <font face="Times New Roman">oracle</font> that is the only key values of records connections to build a so-called bitmap vector, it needs to account for <font face="Times New Roman">hash area</font> memory about <font face="Times New Roman">5%.</font> Here, namely, <font face="Times New Roman">(1,3,4,5,8,10).</font> <o:p></o:p><br /><br /> When the partition table <font face="Times New Roman">B,</font> it will be a connection for each key value on a bitmap vector comparison, if not one of them, it will discard its record. In our example, <font face="Times New Roman">B</font> in the table the following data will be discarded <o:p></o:p><br /><br /> <font face="Times New Roman">(0,0,2,2,2,2,2,2,9,9,9,9,9).</font> This process is a bitmap vector filtering. <o:p></o:p><br /><br /> When the <font face="Times New Roman">S1, B1</font> finished connection, and then pairs of <font face="Times New Roman">Si, Bi</font> connected, where <font face="Times New Roman">oracle</font> will compare two partitions, select the little that do <font face="Times New Roman">build input,</font> is the dynamic roles were reversed, the roles were reversed this dynamic occurs in addition to the first pair of partition partition other than the above. <o:p></o:p><br /><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /> <strong><font face="Times New Roman">三. Hash Join</font> Algorithm</strong> <o:p></o:p><br /><br /> Step <font face="Times New Roman">1:</font> to determine whether all of the small tables stored in the <font face="Times New Roman">hash area</font> memory and, if so, then do the memory <font face="Times New Roman">hash join.</font> If not, switch to the second step. <o:p></o:p><br /><br /> Step <font face="Times New Roman">2:</font> determine the number of <font face="Times New Roman">fan-out.</font> <o:p></o:p><br /><br /> <font face="Times New Roman">(Number of Partitions) * C &lt;= F <sub>avm</sub> * M</font> <o:p></o:p><br /><br /><font face="Times New Roman">        </font> Where <font face="Times New Roman">C</font> is <font face="Times New Roman">Cluster size,</font> <o:p></o:p><br /><br /> <o:p></o:p><br /><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /> Step <font face="Times New Roman">3:</font> Read the small table <font face="Times New Roman">S,</font> using an internal <font face="Times New Roman">hash</font> function <font face="Times New Roman">(referred</font> to here as <font face="Times New Roman">hash_fun_1),</font> will connect key mapped to a partition at the same time to connect with <font face="Times New Roman">hash_fun_2</font> function key produces another <font face="Times New Roman">hash</font> value, this <font face="Times New Roman">hash</font> value is used create a <font face="Times New Roman">hash table</font> in use, and the keys stored together with the connection. <o:p></o:p><br /><br /> Step <font face="Times New Roman">4:</font> To <font face="Times New Roman">build input</font> to establish the bitmap vectors. <o:p></o:p><br /><br /> Step <font face="Times New Roman">5:</font> If there is no room in memory, and will partition to write to the disk. <o:p></o:p><br /><br /> Step <font face="Times New Roman">6:</font> Read the rest of the small table <font face="Times New Roman">S,</font> repeat the third step, until all of the small table <font face="Times New Roman">S</font> read. <o:p></o:p><br /><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /> Step <font face="Times New Roman">7:</font> The partition sorted by size, select the establishment of several geographical <font face="Times New Roman">hash table (select</font> the partition where the principle is to select the largest <font face="Times New Roman">number).</font> <o:p></o:p><br /><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /> Step <font face="Times New Roman">8:</font> According to the previous calculation using <font face="Times New Roman">hash_fun_2</font> a good <font face="Times New Roman">hash</font> function values, the establishment of <font face="Times New Roman">hash table.</font> <o:p></o:p><br /><br /> Step <font face="Times New Roman">9:</font> Read the table <font face="Times New Roman">B,</font> using the bitmap bitmap vectors vector filtering. <o:p></o:p><br /><br /> Step <font face="Times New Roman">10:</font> The data used by filtering the data mapped to the <font face="Times New Roman">hash_fun_1</font> function corresponding to the partition, and calculate the <font face="Times New Roman">hash</font> value of <font face="Times New Roman">hash_fun_2.</font> <o:p></o:p><br /><br /> Step <font face="Times New Roman">11:</font> If the drop-divisions in the memory, will be in front of the function by <font face="Times New Roman">hash_fun_2</font> calculated <font face="Times New Roman">hash</font> value already exists in memory <font face="Times New Roman">hash table</font> to do connections, <font face="Times New Roman"> </font> The result was caused by disk. If the fall of the partition is not memory, the corresponding value will be the corresponding <font face="Times New Roman">S</font> partition table together. <o:p></o:p><br /><br /> Step <font face="Times New Roman">12:</font> Continue to read the table <font face="Times New Roman">B,</font> repeat Step <font face="Times New Roman">9</font> until the completion of Form <font face="Times New Roman">B</font> to read. <o:p></o:p><br /><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /> Step <font face="Times New Roman">13:</font> Read the corresponding <font face="Times New Roman">(Si, Bi)</font> to do <font face="Times New Roman">hash</font> connection. Dynamic role in the swap will happen here. <o:p></o:p><br /><br /> Step <font face="Times New Roman">14:</font> If the partition after the partition than the smallest memory, large, occurred <font face="Times New Roman">nested-loop hash join.</font> <o:p></o:p><br /><br /> <strong><font face="Times New Roman">四. Hash Join</font> the cost of</strong> <o:p></o:p><br /><br /> <strong><font face="Times New Roman">1. In-Memory Hash Join</font></strong> <o:p></o:p><br /><br /> <font face="Times New Roman">Cost (HJ) = Read (S) + build hash table in memory (CPU) + Read (B) +</font> <o:p></o:p><br /><br /> <font face="Times New Roman">Perform In memory Join (CPU)</font> <o:p></o:p><br /><br /> Ignore the <font face="Times New Roman">cpu</font> time, then the <o:p></o:p><br /><br /> <font face="Times New Roman">Cost (HJ) = Read (S) + Read (B)</font> <o:p></o:p><br /><br /> <strong><font face="Times New Roman">2. On-Disk Hash Join</font></strong> <o:p></o:p><br /><br /> Based on the above description of the steps, we can see that <o:p></o:p><br /><br /> <font face="Times New Roman">Cost (HJ) = Cost (HJ1) + Cost (HJ2)</font> <o:p></o:p><br /><br /> Where <font face="Times New Roman">Cost (HJ1)</font> is the cost of scanning <font face="Times New Roman">S, B</font> list, and can not be placed in memory on the part of the write-back disk, corresponding to the previous Step <font face="Times New Roman">2</font> to Step <font face="Times New Roman">12. Cost (HJ2)</font> shall be done <font face="Times New Roman">nested-loop hash join</font> costs, corresponding to the previous step <font face="Times New Roman">13</font> to step <font face="Times New Roman">14.</font> <o:p></o:p><br /><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /> Where <font face="Times New Roman">Cost (HJ1)</font> is approximately equal to <font face="Times New Roman">Read (S) + Read (B) + Write ((SM) + (BB * M / S)).</font> <o:p></o:p><br /><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /> Because in doing <font face="Times New Roman">nested-loop hash join,</font> the right of each <font face="Times New Roman">chunk</font> of the <font face="Times New Roman">build input,</font> all need to read the entire <font face="Times New Roman">probe input,</font> so <o:p></o:p><br /><br /> <font face="Times New Roman">Cost (HJ2)</font> is approximately equal to <font face="Times New Roman">Read ((SM) + n * (BB * M / S))</font> <o:p></o:p><br /><br /> Where <font face="Times New Roman">n</font> is the <font face="Times New Roman">nested-loop hash join</font> need to loop through the number of times. <o:p></o:p><br /><br /> <font face="Times New Roman">n = (S / F) / M</font> <o:p></o:p><br /><br /> In general, if <font face="Times New Roman">n</font> is <font face="Times New Roman">10,</font> then, <font face="Times New Roman">hash join</font> performance would be greatly diminished. From the formula for calculating <font face="Times New Roman">n</font> can be seen, <font face="Times New Roman">n</font> and <font face="Times New Roman">Fan-out</font> in inverse proportion to improve the <font face="Times New Roman">fan-out,</font> can be reduced <font face="Times New Roman">n.</font> When the <font face="Times New Roman">hash_area_size</font> is fixed, we can reduce the <font face="Times New Roman">cluster size</font> to increase the <font face="Times New Roman">fan-out.</font> <o:p></o:p><br /><br /><o:p><font face="Times New Roman"> </font></o:p><br /><br /> From here we can see that, improve <font face="Times New Roman">hash_multiblock_io_count</font> value of the parameter does not necessarily improve the performance of <font face="Times New Roman">hash join.</font> <o:p></o:p><br /><br /> <strong><font face="Times New Roman">五.</font> Other</strong> <o:p></o:p><br /><br /> <font face="Times New Roman">1.</font> Confirmed that the small table is the table-driven <o:p></o:p><br /><br /> <font face="Times New Roman">2.</font> Confirmed that involves analysis of the tables and connection keys before. <o:p></o:p><br /><br /> <font face="Times New Roman">3.</font> If the connection key data on non-uniform, then suggested a histogram. <o:p></o:p><br /><br /> <font face="Times New Roman">4.</font> If you can, adjusting the size of large <font face="Times New Roman">hash_area_size</font> or <font face="Times New Roman">pga_aggregate_target</font> value. <o:p></o:p><br /><br /> <font face="Times New Roman">5. Hash Join</font> is suitable for small tables and large table join returns a large result set connections. <o:p></o:p><br /><br /><o:p></o:p><br /><br /><o:p><font face="Times New Roman"> </font></o:p>				<h5>Related Posts</h5>
		<div id="smilar">
		<ul>
					<li><a href="http://www.kods.netwww.kods.net/sga-extended-the-principle-of-32bit-oracle/" title="SGA extended the principle of 32bit oracle">SGA extended the principle of 32bit oracle</a> 2009-03-31 09:48:01</li>
					<li><a href="http://www.kods.netwww.kods.net/diagnosis-and-principles-of-order/" title="Diagnosis and principles of order">Diagnosis and principles of order</a> 2009-02-25 20:27:28</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle-10g-dataguard-configuration-step-by-step/" title="ORACLE 10G dataguard configuration Step by Step">ORACLE 10G dataguard configuration Step by Step</a> 2009-02-16 01:13:55</li>
				</ul>
		</div>
		        ]]></content:encoded>
		<wfw:commentRss>http://www.kods.netwww.kods.net/hash-join-algorithm-principle/</wfw:commentRss>
	</item>
		<item>
		<title>oracle-archive mode</title>
		<link>http://www.kods.netwww.kods.net/oracle-archive-mode/</link>
		<comments>http://www.kods.netwww.kods.net/oracle-archive-mode/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 01:10:44+0000</pubDate>
		<dc:creator>kods.net</dc:creator>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[oracle]]></category>
<category><![CDATA[configuration database]]></category>
<category><![CDATA[oracle database]]></category>
<category><![CDATA[oracle product]]></category>
<category><![CDATA[select name]]></category>
<category><![CDATA[incremental backups]]></category>
<category><![CDATA[database log]]></category>
<category><![CDATA[database name]]></category>
<category><![CDATA[log sequence]]></category>
<category><![CDATA[disaster recovery]]></category>
<category><![CDATA[oracle databases]]></category>
<category><![CDATA[oracle archive]]></category>
<category><![CDATA[archive directory]]></category>
<category><![CDATA[destination data]]></category>
<category><![CDATA[command database]]></category>
<category><![CDATA[directory copy]]></category>
<category><![CDATA[system error]]></category>
<category><![CDATA[database archive]]></category>
<category><![CDATA[mode changes]]></category>
<category><![CDATA[error data]]></category>
		<guid isPermaLink="true">http://www.kods.netwww.kods.net/oracle-archive-mode/</guid>
		<description><![CDATA[oracle model of an archive. See whether the oracle database archive mode: 1.select name, log_mode from v $ database; NAME LOG_MODE ------------------ ------------------------ QUERY NOARCHIVELOG 2. Usi ...]]></description>
		<content:encoded><![CDATA[oracle model of an archive. See whether the oracle database archive mode: <br /> 1.select name, log_mode from v $ database; <br /> NAME LOG_MODE <br /> ------------------ ------------------------ <br /> QUERY NOARCHIVELOG <br /> 2. Using the ARCHIVE LOG LIST command <br /> Database log mode No Archive Mode <br /> Automatic archival Disabled <br /> Archive destination / data/oracle/product/10.2.0/db_1 / / dbs / arch <br /> Oldest online log sequence 739 <br /> Current log sequence 741 <br />二. What is the Oracle archive mode? <br /> Oracle databases online redo logs, this log is to record the changes made to the database, such as insert, delete, update data on these operations are recorded in online redo log inside. General database at least two online redo log group. When an online redo log group is filled, when log switch occurs, when the online redo log group 2 as the current use of the log, when the filled online redo log group 2 when the log switch will happen , to write the online redo log group 1, it is so repeatedly. <br /> If the database is in non archive mode, on-line will be discarded when you log in the switch. While in archive mode, when the log switch occurs when the logs will be switched archiving. For example, the current use of online redo log 1, when a filled at a time when the log switch, start writing online redo log 2, when the contents of an online redo log will be copied to another specified directory. This directory is called the archive directory, copy the file called archived redo log. <br /> When it is running a database using the archive can be disaster recovery. <br /> 1. Archive log mode and non-archive log mode of the difference between the non-archive log mode can only do cold backup, and recovery can only do a full backup. The latest full backup to the system error data for the period can not be restored. <br /> Archiving can be done hot backup mode, and can do incremental backups can be done partially. <br /> With the ARCHIVE LOG LIST can see a view mode state, or non-archive mode archive log mode. <br /><br />三. Configuration database archiving mode <br /><br /> Changes in the non-archive mode to archive mode: <br /> 1) SQL&gt; SHUTDOWN NORMAL / IMMEDIATE; <br /> 2) SQL&gt; START MOUNT; <br /> 3) SQL&gt; ALTER DATABASE ARCHIVELOG; <br /> 4) SQL&gt; ALTER DATABASE OPEN; <br /><br /> 5) SQL&gt; do a full backup, as non-archive log mode for the resulting backup archive log mode no longer be used. This step is very important to the non-! <br /><br /> To change the archive mode to non-archive mode: <br /> 1) SQL&gt; SHUTDOWN NORMAL / IMMEDIATE; <br /> 2) SQL&gt; START MOUNT; <br /> 3) SQL&gt; ALTER DATABASE NOARCHIVELOG; <br /> 4) SQL&gt; ALTER DATABASE OPEN; <br /><br /> 3. Enable automatic archiving: LOG_ARCHIVE_START = TRUE <br /> Archiving mode, the log file group not allowed to be overwritten (rewritten), when filled, after the log file, without manual archiving, then the system will hang, know that archiving is completed. <br /> At this time can only be read but not write. <br /> During operation shut down and restart the process of archiving logs <br /> SQL&gt; ARCHIVE LOG STOP <br /> SQL&gt; ARCHIVE LOG START <br /><br /> 4. Manual archiving: LOG_ARCHIVE_START = FALSE <br /> Archive the current log file <br /> SQL&gt; ALTER SYSTEM ARCHIVE LOG CURRENT; <br /> Archive log files serial number 052 <br /> SQL&gt; ALTER SYSTEM ARCHIVE LOG SEQUENCE 052; <br /> Archiving of all log files <br /> SQL&gt; ALTER SYSTEM ARCHIVE LOG ALL; <br /> To change the archive log target <br /> SQL&gt; ALTER SYSTEM ARCHIVE LOG CURRENT TO &#39;&amp; PATH&#39;; <br /><br /> 5. Archive mode and non-archive mode conversion <br /><br /> The reverse process of Step 4. <br /><br /> 6. Configure multiple archive processes <br /> Q: When do you need to use multiple archiving process? <br /> A: If the archive process will consume a large amount of time, you can start multiple archiving process, which is a dynamic parameter, you can use ALTER SYSTEM dynamic modification. <br /> SQL&gt; ALTER SYSTEM SET LOG_ARCHIVE_MAX_PROCESSES = 10; <br /> Oracle9i can specify up to 10 archiving process and the archiving process-related dynamic performance views <br /> v $ bgprocess, v $ archive_processes <br /><br /> 7. Configuration archiving target, multi-archiving target, remote archiving goals, objectives LOG_ARCHIVE_DEST_n archive log format archive <br /> Local archiving objectives: <br /> SQL&gt; LOG_ARCHIVE_DEST_1 = &quot;LOCATION = D: ORACLEARCHIVEDLOG&quot;; <br /> Remote archive target: <br /> SQL&gt; LOG_ARCHIVE_DEST_2 = &quot;SERVICE = STANDBY_DB1&quot;; <br /> Mandatory archiving objectives, and if an error, 600 seconds and try again: <br /> SQL&gt; ALTER SYSTEM SET LOG_ARCHIVE_DEST_4 = &quot;LOCATION = E: ORACLEARCHIVEDLOG MANDATORY REOPEN = 600&quot;; <br /> Optional archiving objectives, and if wrong, abandon the archive: <br /> SQL&gt; ALTER SYSTEM SET LOG_ARCHIVE_DEST_3 = &quot;LOCATION = E: ORACLEARCHIVEDLOG OPTIONAL&quot;; <br /><br /> Filed target state: the goals and turn off archiving archiving archiving goals off target 1 <br /> SQL&gt; ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_1 = DEFER <br /> Open the archive target 2 <br /> SQL&gt; ALTER SYSTEM SET LOG_ARCHIVE_DEST_STATE_2 = ENABLE <br /><br /> Archive log format <br /> LOG_ARCHIVE_FORMAT <br /><br /> 8. Access to archived log information <br /> V $ ARCHVIED_LOG <br /> V $ ARCHVIE_DEST <br /> V $ LOG_HISTORY <br /> V $ DATABASE <br /> V $ ARCHIVE_PROCESSES <br /><br /> ARCHIVE LOG LIST;				<h5>Related Posts</h5>
		<div id="smilar">
		<ul>
					<li><a href="http://www.kods.netwww.kods.net/sga-extended-the-principle-of-32bit-oracle/" title="SGA extended the principle of 32bit oracle">SGA extended the principle of 32bit oracle</a> 2009-03-31 09:48:01</li>
					<li><a href="http://www.kods.netwww.kods.net/an-example-of-the-use-of-tkprof/" title="An example of the use of TKPROF">An example of the use of TKPROF</a> 2009-02-26 01:38:19</li>
					<li><a href="http://www.kods.netwww.kods.net/diagnosis-and-principles-of-order/" title="Diagnosis and principles of order">Diagnosis and principles of order</a> 2009-02-25 20:27:28</li>
					<li><a href="http://www.kods.netwww.kods.net/data-gurad-use-dbms-file-transfer-and-cloning-configuration-database/" title="DATA GURAD use DBMS_FILE_TRANSFER and cloning configuration database">DATA GURAD use DBMS_FILE_TRANSFER and cloning configuration database</a> 2009-02-23 19:07:40</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle-10g-dataguard-configuration-step-by-step/" title="ORACLE 10G dataguard configuration Step by Step">ORACLE 10G dataguard configuration Step by Step</a> 2009-02-16 01:13:55</li>
				</ul>
		</div>
		        ]]></content:encoded>
		<wfw:commentRss>http://www.kods.netwww.kods.net/oracle-archive-mode/</wfw:commentRss>
	</item>
		<item>
		<title>ORACLE Application recovery SCN</title>
		<link>http://www.kods.netwww.kods.net/oracle-application-recovery-scn/</link>
		<comments>http://www.kods.netwww.kods.net/oracle-application-recovery-scn/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 10:48:39+0000</pubDate>
		<dc:creator>kods.net</dc:creator>
		<category><![CDATA[Oracle]]></category>
		<category><![CDATA[oracle]]></category>
<category><![CDATA[data recovery]]></category>
<category><![CDATA[oracle product]]></category>
<category><![CDATA[scn]]></category>
<category><![CDATA[database backup]]></category>
<category><![CDATA[database files]]></category>
<category><![CDATA[oracle application]]></category>
<category><![CDATA[bkp]]></category>
<category><![CDATA[mf]]></category>
<category><![CDATA[d1]]></category>
<category><![CDATA[release channel]]></category>
<category><![CDATA[database release]]></category>
<category><![CDATA[cancel]]></category>
<category><![CDATA[application recovery]]></category>
		<guid isPermaLink="true">http://www.kods.netwww.kods.net/oracle-application-recovery-scn/</guid>
		<description><![CDATA[Check the database backup RMAN&gt; LIST BACKUP OF DATABASE; FULL SCN = 26905728480 Check the archive log backup RMAN&gt; LIST BACKUP OF ARCHIVELOG ALL; 635 (26,905,725,274) - &quot;638 (26,928,633,424 ...]]></description>
		<content:encoded><![CDATA[Check the database backup <br /> RMAN&gt; LIST BACKUP OF DATABASE; <br /> FULL SCN = 26905728480 <br /><br /> Check the archive log backup <br /> RMAN&gt; LIST BACKUP OF ARCHIVELOG ALL; <br /> 635 (26,905,725,274) - &quot;638 (26,928,633,424) <br /><br /> A local archive log file list is: 639 --- 763, after a problem 765 - 770 <br /><br /> The current database SCN = 35441074539 <br /><br /> CONTROL backup <br /> RMAN&gt; LIST BACKUP OF CONTROLFILE <br /> 2006-09-08 backup SCN = 26928866676 <br /><br /> Began to recover: <br /><br /> 1. To restore archived log files <br /> RMAN&gt; RUN ( <br /> ALLOCATE CHANNEL D1 TYPE DISK; <br /> SET ARCHIVELOG DESTINATION TO &#39;/ ORACLE / ORADATA / ARCHIVELOG&#39;; <br /> RESTORE ARCHIVELOG SEQUENCE BETWEEN 635 AND 638; <br /> RELEASE CHANNEL D1;) <br /><br /> 2. To restore the old control file <br /> SQL&gt; STARTUP NOMOUNT; <br /> RMAN&gt; restore controlfile from &#39;Z: \ oracle \ product \ 10.2.0 \ flash_recovery_area \ ORCL \ AUTOBACKUP \ 2006_09_08 \ O1_MF_S_600573612_2J0QKFTK_.BKP&#39;; <br /><br /> 3. To restore database files <br /> run ( <br /> allocate channel d1 type disk; <br /> restore database; <br /> release channel d1;) 15:00 began. <br /><br /> 4. Data Recovery <br /> SQL&gt; RECOVER DATABASE USING BACKUP CONTROLFILE UNTIL CANCEL <br /> AUTO <br /><br /> SQL&gt; ALTER DATABASE OPEN RESETLOGS; <br /><br /> 5. Backup the database <br /> RMAN&gt; BACKUP FULL DAETABASE FORMAT &#39;E: / RMAN / DB_% U. BAK&#39;;				<h5>Related Posts</h5>
		<div id="smilar">
		<ul>
					<li><a href="http://www.kods.netwww.kods.net/sga-extended-the-principle-of-32bit-oracle/" title="SGA extended the principle of 32bit oracle">SGA extended the principle of 32bit oracle</a> 2009-03-31 09:48:01</li>
					<li><a href="http://www.kods.netwww.kods.net/high-availability-oracle-flashback/" title="High Availability Oracle Flashback">High Availability Oracle Flashback</a> 2009-02-26 17:23:02</li>
					<li><a href="http://www.kods.netwww.kods.net/an-example-of-the-use-of-tkprof/" title="An example of the use of TKPROF">An example of the use of TKPROF</a> 2009-02-26 01:38:19</li>
					<li><a href="http://www.kods.netwww.kods.net/diagnosis-and-principles-of-order/" title="Diagnosis and principles of order">Diagnosis and principles of order</a> 2009-02-25 20:27:28</li>
					<li><a href="http://www.kods.netwww.kods.net/oracle-10g-dataguard-configuration-step-by-step/" title="ORACLE 10G dataguard configuration Step by Step">ORACLE 10G dataguard configuration Step by Step</a> 2009-02-16 01:13:55</li>
				</ul>
		</div>
		        ]]></content:encoded>
		<wfw:commentRss>http://www.kods.netwww.kods.net/oracle-application-recovery-scn/</wfw:commentRss>
	</item>
	</channel>
</rss>
