Re: Current Timestamp over DB Link

From: Nigel Thomas <nigel.cl.thomas_at_googlemail.com>
Date: Wed, 18 Jun 2014 13:49:34 +0100
Message-ID: <CAGRZYUfQb=Dqc=iWm6ifWA3Un9BuFGk8H8fjUe76HCT+0_4Vww_at_mail.gmail.com>



Maris

The optimiser selects a row from the remote table but executes the function systimestamp locally.

You can either:

select systimestamp, systimestamp_at_remotedb from dual

or create a view on the remote database:

create view vtime as select systimestamp remote_time from dual;

and then select from it:

select systimestamp local_time, remote_time from vtime_at_remotedb

HTH Nigel

On 18 June 2014 13:02, Maris Elsins <elmaris_at_gmail.com> wrote:

> HI All,
>
> I'm trying to compare the local and remote timestamps to assess the time
> offset between 2 DBs, but this query gives the local timestamp only:
>
> SQL> select systimestamp local_time, (select systimestamp from
> dual_at_REMOTE_DB) remote_time from dual;
>
> LOCAL_TIME
> ---------------------------------------------------------------------------
> REMOTE_TIME
> ---------------------------------------------------------------------------
> 18-JUN-14 07.00.06.611471 AM -05:00
> 18-JUN-14 07.00.06.611471 AM -05:00
>
> Can anyone suggest a way to retrieve the current timestamp from a remote
> DB over DB Link?
>
> ---
> Maris Elsins
> _at_MarisElsins <https://twitter.com/MarisElsins>
> www.facebook.com/maris.elsins
>
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Wed Jun 18 2014 - 14:49:34 CEST

Original text of this message