2009年5月13日星期三

實驗,RAC中的各個node,插入數據的時間oracle是如何考量的?

在第一個node上

[oracle@croracle03 ~]$ date
Fri May 15 03:07:18 HKT 2009

[oracle@croracle03 ~]$ sqlplus / as sysdba;

SQL*Plus: Release 11.1.0.6.0 - Production on Fri May 15 03:07:26 2009

Copyright (c) 1982, 2007, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> create user ractest identified by password;

User created.

SQL> grant dba to ractest;

Grant succeeded.

SQL> conn ractest/password
Connected.

SQL> create table timetest( id number, testdate date);

Table created.

SQL> insert into timetest values (1, sysdate);

1 row created.

SQL> commit;

Commit complete.

SQL> select id, to_char(testdate, 'yyyymmdd HH24:MI:SS') from timetest;

ID TO_CHAR(TESTDATE,
---------- -----------------
1 20090515 03:09:59

SQL> comit;
SP2-0042: unknown command "comit" - rest of line ignored.
SQL> commit;

Commit complete.


在第二個node上:
[oracle@croracle02 ~]$ date
Thu May 14 17:34:06 HKT 2009
[oracle@croracle02 ~]$ sqlplus ractest/password

SQL*Plus: Release 11.1.0.6.0 - Production on Thu May 14 17:34:29 2009

Copyright (c) 1982, 2007, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> insert into timetest values (1, sysdate);

1 row created.

SQL> select id, to_char(testdate, 'yyyymmdd HH24:MI:SS') from timetest;

ID TO_CHAR(TESTDATE,
---------- -----------------
1 20090515 03:09:59
1 20090514 17:34:53

SQL> commit;

Commit complete.

SQL>

在第三個node上:
[oracle@croracle01 ~]$ date
Thu May 14 17:31:11 HKT 2009
[oracle@croracle01 ~]$ sqlplus ractest/password

SQL*Plus: Release 11.1.0.6.0 - Production on Thu May 14 17:31:21 2009

Copyright (c) 1982, 2007, Oracle. All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> insert into timetest values (1, sysdate);

1 row created.

SQL> select id, to_char(testdate, 'yyyymmdd HH24:MI:SS') from timetest;

ID TO_CHAR(TESTDATE,
---------- -----------------
1 20090515 03:09:59
1 20090514 17:34:53
1 20090514 17:31:33

SQL> commit;

Commit complete.

插入的sysdate,應該是node所在系統的date.不知道這個說法對不?

没有评论:

发表评论