Return-Path: <oracle-l-bounce@freelists.org>
X-Original-To: oracle-l@orafaq.com
Delivered-To: oracle-l@orafaq.com
Received: from turing.freelists.org (turing.freelists.org [206.53.239.180])
 by malta2546.startdedicated.com (Postfix) with ESMTPS id EC6C310031013A
 for <oracle-l@orafaq.com>; Wed, 12 Dec 2018 16:59:07 +0100 (CET)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 7597020CA9;
 Wed, 12 Dec 2018 10:57:15 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org;
 s=turing; t=1544630235;
 bh=mizO9QAmRmXE0+dr1FNnqQk0kH2HmqSUPzM+GeJmu9I=;
 h=References:In-Reply-To:From:Date:Subject:To:Cc:Reply-To:List-help:
	 List-unsubscribe:List-Id:List-subscribe:List-owner:List-post:
	 List-archive;
 b=rxQ8sTlUdxEXcqNHRqVautM41yulsbe/tCuWR1EIYkujbg4M2+Ok7Q7VI1BB9QmMT
	 IYiBUmMj3qK6ng1/B0rlBW/NNQBgKfVR838VD5OqM6L5r8F4PE2rhUuORyhwKmCPbU
	 XPsbmrdc85uaxbkG/uO9TquFiwM+Xy3g7bDvE3F4=
X-Virus-Scanned: Debian amavisd-new at turing.freelists.org
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 4d8H94fUGZzk; Wed, 12 Dec 2018 10:57:15 -0500 (EST)
Received: from turing.freelists.org (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 4D16120B32;
 Wed, 12 Dec 2018 10:57:00 -0500 (EST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=freelists.org;
 s=turing; t=1544630232;
 bh=mizO9QAmRmXE0+dr1FNnqQk0kH2HmqSUPzM+GeJmu9I=;
 h=References:In-Reply-To:From:Date:Subject:To:Cc:Reply-To:List-help:
	 List-unsubscribe:List-Id:List-subscribe:List-owner:List-post:
	 List-archive;
 b=h7DfjzN+Dz1KPCc20gS3lAgcnbQ0wx50FS5kcpfMBUUEtJFkVRfUZAt97e/NkgXIx
	 y/ORghm+6iRP0LepQFuvF2zeNQn5iy3/t9Y2prbpAQwmf6taYFS1EMTUSLZEWD7ut0
	 nghC9iVMTqKGV1WPNl+2EibNZv6LiskbPbMu6/lA=
Received: with ECARTIS (v1.0.0; list oracle-l); Wed, 12 Dec 2018 10:55:38 -0500 (EST)
Received: from localhost (localhost [127.0.0.1])
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 5462721E2A
 for <oracle-l@freelists.org>; Wed, 12 Dec 2018 10:55:38 -0500 (EST)
Authentication-Results: turing.freelists.org; dkim=pass
 reason="2048-bit key; unprotected key"
 header.d=pythian-com.20150623.gappssmtp.com header.i=@pythian-com.20150623.gappssmtp.com
 header.b=AbafOOM0; dkim-adsp=none (unprotected policy);
 dkim-atps=neutral
Received: from turing.freelists.org ([127.0.0.1])
 by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 85i_fojhq7ru for <oracle-l@freelists.org>;
 Wed, 12 Dec 2018 10:55:38 -0500 (EST)
Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (No client certificate requested)
 by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id E602A21DCC
 for <oracle-l@freelists.org>; Wed, 12 Dec 2018 10:55:37 -0500 (EST)
Received: by mail-wr1-f66.google.com with SMTP id r10so18188347wrs.10
        for <oracle-l@freelists.org>; Wed, 12 Dec 2018 07:55:37 -0800 (PST)
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:mime-version:references:in-reply-to:from:date
         :message-id:subject:to:cc;
        bh=lXMmC+SwtnmovRhkiN3Tn6HZIRekDNCQZOklV/3Mv2c=;
        b=XWK1NVLUJO3DYd2f5w35LY7Tpgl4F0Z7qIOdxMxNgKnzgNlyrDvxkaNCZg4EFpJPoS
         GMDkUleEjP2x4Baa6tAaSDKboCnw5vyJf8gmqRWu3qnAjVKNyfkEC0lVL9oXsVSEkwEe
         GOlCfbti7rF8FwdKj/5wWFVMBNAcGAD6GQ475G569vQBd/PJ4xFpfbGimY34+no/upf5
         XDxFS2KO2ospdOaKIaIQEjBcbDXV5wvOiOUyBHy2aPipmkR4L82FiwpD+LeGaFg11pCb
         wk2I11+1PsJL5eI0Aue6ne4bnGoNj8/V+TjpL7nXBAtdAjtG1PGMwVTCsGxJrzvYTPc/
         +x0A==
X-Gm-Message-State: AA+aEWZcRIcLNI2FUbhSMy3frdUpU3Gx9yu5yw/hhAGNO2rA6mWnZMDj
 8993NGYeZvXPkj9mcHLLgH11u22XBzzyI6ib3qd1+dxxsZRP6YfcFlYNYAgF3eRUSwsKT4waKpp
 IXs0KtzYlIdGU5pw3U0EanJ7F5bU01NCm
X-Google-Smtp-Source: AFSGD/WP31sSq+MT3UeCXVAjRCIMpzPgFdAvUuVqR0RTMoCUYQ9zth3v61Obr1JJvp8UHzNkEuBSovJIJKhmv6lmgcA=
X-Received: by 2002:adf:e509:: with SMTP id j9mr18994903wrm.76.1544630136664;
 Wed, 12 Dec 2018 07:55:36 -0800 (PST)
MIME-Version: 1.0
References: <CAEhBma6Ztg7gq7T5F9ywXSxcLj46HGG5JRkOdEvnKuRarucOQQ@mail.gmail.com>
 <CAEhBma5KpQ+VPw4c=eLpDuG=6aBLG3QmRZX5UsrrHgfjDOtrkw@mail.gmail.com>
In-Reply-To: <CAEhBma5KpQ+VPw4c=eLpDuG=6aBLG3QmRZX5UsrrHgfjDOtrkw@mail.gmail.com>
From: Jose Rodriguez <jrodriguez2@pythian.com>
Date: Wed, 12 Dec 2018 16:55:00 +0100
Message-ID: <CAGV8MGpMimSiw9fWmv7smbY6U1tb5emaHM5mE70CeQJc+6K=DA@mail.gmail.com>
Subject: Re: the time zone of systimestamp is not match the user_scheduler_jobs
To: joanhsieh08@gmail.com
Cc: ORACLE-L <oracle-l@freelists.org>
Content-Type: multipart/alternative; boundary="0000000000009b1270057cd53a19"
X-archive-position: 72875
X-ecartis-version: Ecartis v1.0.0
Sender: oracle-l-bounce@freelists.org
Errors-to: oracle-l-bounce@freelists.org
X-original-sender: jrodriguez2@pythian.com
Precedence: normal
Reply-To: jrodriguez2@pythian.com
List-help: <mailto:ecartis@freelists.org?Subject=help>
List-unsubscribe: <oracle-l-request@freelists.org?Subject=unsubscribe>
List-software: Ecartis version 1.0.0
List-Id: oracle-l <oracle-l.freelists.org>
X-List-ID: oracle-l <oracle-l.freelists.org>
List-subscribe: <oracle-l-request@freelists.org?Subject=subscribe>
List-owner: <mailto:>
List-post: <mailto:oracle-l@freelists.org>
List-archive: <http://www.freelists.org/archives/oracle-l>
X-list: oracle-l
--0000000000009b1270057cd53a19
Content-Type: text/plain; charset="UTF-8"

This is a simple PL/SQL code I use when I want to fit a TZ into a scheduled
job. There may be better options, of course, but this one just works for me:


DECLARE
  v_start_date timestamp with time zone;
BEGIN

  select localtimestamp at time zone 'US/Eastern' into v_start_date from
dual;

  DBMS_SCHEDULER.CREATE_JOB (
    job_name        => 'OWNER.SCHEDULED_JOB_NAME',
    job_type        => 'PLSQL_BLOCK',
    job_action      => 'BEGIN NULL; END; ',
    start_date      => v_start_date,
    repeat_interval => 'freq=weekly;byday=Wed;byhour=10;byminute=00',
    enabled         => TRUE);
END;
/


[image: Pythian] <http://www.pythian.com/>
*Jose Rodriguez* | Oracle Project Engineer | [image: LinkedIn]
<https://www.linkedin.com/company/pythian>
*t* +1 613 565 8696 <+1+613+565+8696> *ext.* 1393
*m* +34 607 55 49 91 <+34+607+55+49+91>
jrodriguez2@pythian.com
*www.pythian.com* <https://www.pythian.com/>
[image: Pythian] <https://www.pythian.com/email-footer-click>


On Wed, 12 Dec 2018 at 16:49, Joan Hsieh <joanhsieh08@gmail.com> wrote:

> SELECT dbtimezone FROM DUAL;
>
> DBTIMEZONE
> ------------------
> -05:00
>
> Thanks for the response.
> Is it possible to change the scheduler_job match the dbtimezone? we can't
> shutdown database to change the timezone.
>
> Thanks,
>
> Joan
>
> On Wed, Dec 12, 2018 at 9:55 AM Joan Hsieh <joanhsieh08@gmail.com> wrote:
>
>> Hi Listers,
>>
>> we have some dbms_scheduler_jobs failed due to the timestamp is not
>> correct. it throw out tons of errors of ORA-08186: invalid timestamp
>> specified .
>> The last_start_date from user_scheduler_jobs returns -4:00,
>> 12-DEC-18 10.43.17.198623 AM -04:00
>>
>> but the systimestamp from dual returns -5:00. what we should do to get it
>> sync.?
>>
>> SQL> select systimestamp from dual;
>>
>> SYSTIMESTAMP
>>
>> ---------------------------------------------------------------------------
>> 12-DEC-18 09.47.28.000075 AM -05:00
>>
>> Thank you so much.
>>
>> Joan
>>
>>

-- 


--






--0000000000009b1270057cd53a19
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">This is a simple PL/SQL code I use when I=
 want to fit a TZ into a scheduled job. There may be better options, of cou=
rse, but this one just works for me:<div><br></div><div><div></div><br><div=
><div class=3D"hljs php" style=3D"display:block;overflow-x:auto;padding:0.5=
em;color:rgb(51,51,51);background:rgb(248,248,248);font-family:monospace"><=
div><span class=3D"hljs-keyword" style=3D"font-weight:bold">DECLARE</span><=
/div><div>=C2=A0 v_start_date timestamp with time zone;</div><div>BEGIN</di=
v><div>=C2=A0=C2=A0</div><div>=C2=A0 select localtimestamp at time zone <sp=
an class=3D"hljs-string" style=3D"color:rgb(136,0,0)">&#39;US/Eastern&#39;<=
/span> into v_start_date from dual;</div><div><br></div><div>=C2=A0 DBMS_SC=
HEDULER.CREATE_JOB (</div><div>=C2=A0 =C2=A0 job_name=C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =3D&gt; <span class=3D"hljs-string" style=3D"color:rgb(136,0,0)">&#3=
9;OWNER.SCHEDULED_JOB_NAME&#39;</span>,</div><div>=C2=A0 =C2=A0 job_type=C2=
=A0 =C2=A0 =C2=A0 =C2=A0 =3D&gt; <span class=3D"hljs-string" style=3D"color=
:rgb(136,0,0)">&#39;PLSQL_BLOCK&#39;</span>,</div><div>=C2=A0 =C2=A0 job_ac=
tion=C2=A0 =C2=A0 =C2=A0 =3D&gt; <span class=3D"hljs-string" style=3D"color=
:rgb(136,0,0)">&#39;BEGIN NULL; END; &#39;</span>,</div><div>=C2=A0 =C2=A0 =
start_date=C2=A0 =C2=A0 =C2=A0 =3D&gt; v_start_date,</div><div>=C2=A0 =C2=
=A0 repeat_interval =3D&gt; <span class=3D"hljs-string" style=3D"color:rgb(=
136,0,0)">&#39;freq=3Dweekly;byday=3DWed;byhour=3D10;byminute=3D00&#39;</sp=
an>,</div><div>=C2=A0 =C2=A0 enabled=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0=3D&g=
t; <span class=3D"hljs-keyword" style=3D"font-weight:bold">TRUE</span>);</d=
iv><div>END;</div><div>/=C2=A0</div><div></div></div></div><br><div><br></d=
iv><div><div dir=3D"ltr" class=3D"gmail_signature"><div dir=3D"ltr"><div><d=
iv dir=3D"ltr"><div><div dir=3D"ltr"><table cellpadding=3D"0" cellspacing=
=3D"0" style=3D"color:rgb(51,51,51);font-family:Arial,sans-serif;font-size:=
14px"><tbody><tr><td colspan=3D"2"><a href=3D"http://www.pythian.com/" styl=
e=3D"background-color:transparent" target=3D"_blank"><img src=3D"https://ww=
w.pythian.com/wp-content/uploads/2016/08/pythian-email-logo.png" alt=3D"Pyt=
hian" style=3D"width: 80px; height: 25px;"></a></td><td style=3D"width:10px=
"></td><td valign=3D"top" style=3D"background:rgb(199,31,75);width:2px"></t=
d><td style=3D"width:10px"></td><td style=3D"padding-bottom:4px"><div style=
=3D"font-family:Arial,sans-serif;color:black;line-height:1.5em;font-size:12=
px;margin-bottom:5px"><span style=3D"line-height:normal"><strong style=3D"c=
olor:rgb(199,31,75)">Jose Rodriguez</strong>=C2=A0|=C2=A0<span style=3D"whi=
te-space:nowrap">Oracle Project Engineer</span>=C2=A0|=C2=A0<a href=3D"http=
s://www.linkedin.com/company/pythian" style=3D"background-color:transparent=
" target=3D"_blank"><img src=3D"https://www.pythian.com/wp-content/uploads/=
2016/08/email-linkedin-icon.png" alt=3D"LinkedIn" style=3D"width: 15px; hei=
ght: 15px; border: none;"></a>=C2=A0</span><span><br><strong style=3D"color=
:rgb(199,31,75)">t</strong>=C2=A0<a href=3D"tel:+1+613+565+8696" style=3D"b=
ackground-color:transparent;text-decoration:none;color:black" target=3D"_bl=
ank">+1 613 565 8696</a>=C2=A0<span><strong style=3D"color:rgb(199,31,75)">=
ext.</strong>=C2=A0<a href=3D"tel:1393" style=3D"background-color:transpare=
nt;text-decoration:none;color:black" target=3D"_blank">1393</a></span></spa=
n>=C2=A0<span><br><strong style=3D"color:rgb(199,31,75)">m</strong>=C2=A0<a=
 href=3D"tel:+34+607+55+49+91" style=3D"background-color:transparent;text-d=
ecoration:none;color:black" target=3D"_blank">+34 607 55 49 91</a></span>=
=C2=A0<br><a href=3D"mailto:jrodriguez2@pythian.com" style=3D"background-co=
lor:transparent;text-decoration:none;color:black" target=3D"_blank">jrodrig=
uez2@pythian.com</a>=C2=A0<br><a href=3D"https://www.pythian.com/" style=3D=
"background-color:transparent;text-decoration:none;color:black" target=3D"_=
blank"><strong>www.pythian.com</strong></a></div><a href=3D"https://www.pyt=
hian.com/email-footer-click" style=3D"background-color:transparent" target=
=3D"_blank"><img src=3D"https://www.pythian.com/wp-content/uploads/2016/09/=
email-signature.gif" alt=3D"Pythian" style=3D"width: 160px; height: 15px; b=
order: none;"></a></td></tr></tbody></table></div></div></div></div></div><=
/div></div><br></div></div></div><br><div class=3D"gmail_quote"><div dir=3D=
"ltr">On Wed, 12 Dec 2018 at 16:49, Joan Hsieh &lt;<a href=3D"mailto:joanhs=
ieh08@gmail.com">joanhsieh08@gmail.com</a>&gt; wrote:<br></div><blockquote =
class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px sol=
id rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><pre class=3D"gmail-=
m_3162240256586033848gmail-oac_no_warn" dir=3D"ltr" style=3D"box-sizing:bor=
der-box;overflow:auto;font-family:&quot;Courier New&quot;,Courier,monospace=
;font-size:15.4px;padding:5px;margin-top:0px;margin-bottom:10px;line-height=
:1.42857;color:rgb(51,51,51);word-break:normal;background:rgb(238,238,238);=
border:1px solid rgb(170,170,170);border-radius:6px">SELECT dbtimezone FROM=
 DUAL;</pre><pre class=3D"gmail-m_3162240256586033848gmail-oac_no_warn" dir=
=3D"ltr" style=3D"box-sizing:border-box;overflow:auto;padding:5px;margin-to=
p:0px;margin-bottom:10px;line-height:1.42857;word-break:normal;background:r=
gb(238,238,238);border:1px solid rgb(170,170,170);border-radius:6px"><font =
color=3D"#333333" face=3D"Courier New, Courier, monospace"><span style=3D"f=
ont-size:15.4px">DBTIMEZONE
------------------
-05:00</span></font><span style=3D"color:rgb(51,51,51);font-family:&quot;Co=
urier New&quot;,Courier,monospace;font-size:15.4px">
</span></pre><div>Thanks for the response.=C2=A0</div><div>Is it possible t=
o change the scheduler_job match the dbtimezone? we can&#39;t shutdown data=
base to change the timezone.</div><div><br></div><div>Thanks,</div><div><br=
></div><div>Joan</div></div><br><div class=3D"gmail_quote"><div dir=3D"ltr"=
>On Wed, Dec 12, 2018 at 9:55 AM Joan Hsieh &lt;<a href=3D"mailto:joanhsieh=
08@gmail.com" target=3D"_blank">joanhsieh08@gmail.com</a>&gt; wrote:<br></d=
iv><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bord=
er-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div =
dir=3D"ltr"><div dir=3D"ltr">Hi Listers,<div><br></div><div>we have some db=
ms_scheduler_jobs failed due to the timestamp is not correct. it throw out =
tons of errors of=C2=A0<span style=3D"color:rgb(31,73,125);font-family:Cali=
bri,sans-serif;font-size:11pt">ORA-08186: invalid timestamp
specified</span>=C2=A0.=C2=A0</div><div>The last_start_date from user_sched=
uler_jobs returns -4:00,</div><div><div>12-DEC-18 10.43.17.198623 AM -04:00=
</div></div><div><br></div><div>but the systimestamp from dual returns -5:0=
0. what we should do to get it sync.?</div><div><br></div><div><div>SQL&gt;=
 select systimestamp from dual;</div><div><br></div><div>SYSTIMESTAMP</div>=
<div>----------------------------------------------------------------------=
-----</div><div>12-DEC-18 09.47.28.000075 AM -05:00</div></div><div><br></d=
iv><div>Thank you so much.</div><div><br></div><div>Joan</div><div><br></di=
v></div></div></div>
</blockquote></div>
</blockquote></div>

<br>
<p>--</p><p><br><br></p><p></p>
--0000000000009b1270057cd53a19--
--
http://www.freelists.org/webpage/oracle-l


