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

<channel>
	<title>wd and cc &#187; 高级复制</title>
	<atom:link href="http://wdicc.com/tag/%e9%ab%98%e7%ba%a7%e5%a4%8d%e5%88%b6/feed/" rel="self" type="application/rss+xml" />
	<link>http://wdicc.com</link>
	<description>Happy every day...</description>
	<lastBuildDate>Wed, 01 Feb 2012 03:27:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>oracle 的 job 又遇到问题了</title>
		<link>http://wdicc.com/oracle-jobs/</link>
		<comments>http://wdicc.com/oracle-jobs/#comments</comments>
		<pubDate>Fri, 29 Jun 2007 02:19:24 +0000</pubDate>
		<dc:creator>wd</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Other]]></category>
		<category><![CDATA[job]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[高级复制]]></category>

		<guid isPermaLink="false">http://blog.wdicc.com/wordpress/oracle-jobs/</guid>
		<description><![CDATA[还是高级复制的问题，这次可能是因为job执行过程中，对方机器刚好重启导致的。反正job是卡在那里了，都10多天了。 查看 dba_jobs_running 表，可以看到卡住的job的 job_id 和 sid 。查看 dba_jobs 表，可以看到相应 job 的信息，this_date 如果有数据的话，表示的是 job 开始执行的时间，next_date 是下次执行 job 的时间，如果 job 正常执行完毕，那么 this_date 应该是空的。根据 sid 还可以查看 v$session_wait 和 v$session 里面的这个 job 的一些状态。 尝试了下面的方法来重新运行job，当时好像不好用，不过今天来看的时候，job是执行了。现在也不清楚是不是我这个操作起作用了，真晕。 SQL&#38;gt; exec dbms_job.broken(109,true); &#160; PL/SQL procedure successfully completed. &#160; SQL&#38;gt; commit; &#160; Commit complete. &#160; SQL&#38;gt; select job,sid from dba_jobs_running; &#160; JOB SID ---------- [...]]]></description>
			<content:encoded><![CDATA[<p>还是高级复制的问题，这次可能是因为job执行过程中，对方机器刚好重启导致的。反正job是卡在那里了，都10多天了。</p>
<p>查看 dba_jobs_running 表，可以看到卡住的job的 job_id 和 sid 。查看 dba_jobs 表，可以看到相应 job 的信息，this_date 如果有数据的话，表示的是 job 开始执行的时间，next_date 是下次执行 job 的时间，如果 job 正常执行完毕，那么 this_date 应该是空的。根据 sid 还可以查看 v$session_wait 和 v$session 里面的这个 job 的一些状态。</p>
<p>尝试了下面的方法来重新运行job，当时好像不好用，不过今天来看的时候，job是执行了。现在也不清楚是不是我这个操作起作用了，真晕。</p>
<p>
<div class="wp_syntax"><div class="code"><pre class="txt">SQL&amp;gt; exec dbms_job.broken(109,true);
&nbsp;
PL/SQL procedure successfully completed.
&nbsp;
SQL&amp;gt; commit;
&nbsp;
Commit complete.
&nbsp;
SQL&amp;gt; select job,sid from dba_jobs_running;
&nbsp;
       JOB        SID
---------- ----------
       109        656
&nbsp;
SQL&amp;gt; select saddr,sid,serial#,paddr,username,status from v$session where username = 'REPADMIN';
&nbsp;
SADDR           SID    SERIAL# PADDR    USERNAME                       STATUS
-------- ---------- ---------- -------- ------------------------------ --------
973CF8C4        626         27 98F96BB8 REPADMIN                       ACTIVE
973D2E7C        629         10 98F88670 REPADMIN                       ACTIVE
973F11F4        656         10 98F88174 REPADMIN                       ACTIVE
&nbsp;
SQL&amp;gt; alter system kill session '656,10';
&nbsp;
System altered.
&nbsp;
SQL&amp;gt; select saddr,sid,serial#,paddr,username,status from v$session where username = 'REPADMIN';
&nbsp;
no rows selected
&nbsp;
SQL&amp;gt; select job,sid from dba_jobs_running;
&nbsp;
no rows selected
&nbsp;
SQL&amp;gt; select job,log_user,last_date,next_date from dba_jobs where log_user='REPADMIN';
&nbsp;
       JOB LOG_USER                       LAST_DATE
---------- ------------------------------ -------------------
NEXT_DATE
-------------------
       106 REPADMIN                       2007-06-28 16:25:43
2007-06-28 16:35:43
&nbsp;
       109 REPADMIN                       2007-06-28 16:07:38
4000-01-01 00:00:00
&nbsp;
       110 REPADMIN                       2007-06-28 16:25:43
2007-06-28 16:35:43
&nbsp;
&nbsp;
SQL&amp;gt; exec dbms_job.broken(109,false,sysdate);
&nbsp;
PL/SQL procedure successfully completed.
&nbsp;
SQL&amp;gt; commit;
&nbsp;
Commit complete.
&nbsp;
SQL&amp;gt; select job,log_user,last_date,next_date from dba_jobs where log_user='REPADMIN';
&nbsp;
       JOB LOG_USER                       LAST_DATE
---------- ------------------------------ -------------------
NEXT_DATE
-------------------
       106 REPADMIN                       2007-06-28 16:25:43
2007-06-28 16:35:43
&nbsp;
       109 REPADMIN                       2007-06-28 16:07:38
2007-06-28 16:28:40
&nbsp;
       110 REPADMIN                       2007-06-28 16:25:43
2007-06-28 16:35:43</pre></div></div>

<p>此后就我所知道的，就只能等着了。dbms_job.run(job_id) 也可以让 job 立即执行。关键是看 this_date ，他的值就是开始执行 job 的时间，job 如果执行时间太长，而下次执行又太快的话，可能也会导致问题。所以还可以尝试手动执行 job 看看。 dba_jobs 的 waht 字段就是对于的语句。</p>
]]></content:encoded>
			<wfw:commentRss>http://wdicc.com/oracle-jobs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

