oracle taf type型別為session和select的區別

paulyibinyi發表於2010-01-29

客戶端配置方法
racdb =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST =138.30.0.201)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST =138.30.0.202)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = racdb)
      (FAILOVER_MODE =
        (TYPE = SESSION)
        (METHOD = BASIC)
      )
    )
  )

1.type=session

C:\Documents and Settings\yibin>sqlplus

SQL*Plus: Release 9.2.0.1.0 - Production on 星期四 1月 28 16:01:05 2010

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


連線到:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
racdb1

SQL> set pause on 
SQL> select trigger_name from dba_triggers;


TRIGGER_NAME
------------------------------
DEF$_PROPAGATOR_TRIG
REPCATLOGTRIG
MASTER_AGENT_CHANGE_TRIGGER
METRICS_INSERT_TRIGGER
METRICS_DELETE
TARGET_PROP_DEFS_TR
TARGETS_INSERT_TRIGGER
TARGETS_AVAILABILITY_DEFAULT
CHECK_DUPLICATE_TARGETS
EM_TARGETS_DELETE
RAW_METRICS_AFTER_INSERT

利用PAUSE的暫停功能,然後在另一個會話中關閉當前連線例項:
srvctl stop instance -d racdb -i racdb1

返回剛才執行sql的視窗,按回車繼續:

TRIGGER_NAME
------------------------------
METRIC_ERRORS_CUR_AND_DUPES
BLACKOUT_CHANGE
BLACKOUT_STATUS
INSERT_FLAT_TARGETS
ERROR:
ORA-25401: 無法繼續讀取

 

已選擇15行。

SQL> select instance_name from v$instance;


INSTANCE_NAME
----------------
racdb2

可以看出會話已經切換到例項2,但查詢沒有完成,也就是說select trigger_name from dba_triggers的結果沒有全部出來,
只出來資料庫關閉前的資料

2.type=select
racdb =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST =138.30.0.201)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST =138.30.0.202)(PORT = 1521))
    (LOAD_BALANCE = yes)
    (FAILOVER = ON)
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = racdb)
      (FAILOVER_MODE =
        (TYPE = select)
        (METHOD = BASIC)
      )
    )
  )


C:\Documents and Settings\yibin>sqlplus

SQL*Plus: Release 9.2.0.1.0 - Production on 星期四 1月 28 16:18:36 2010

Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.


連線到:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> select instance_name from v$instance;

INSTANCE_NAME
----------------
racdb1

SQL> set pause on
SQL> select trigger_name from dba_triggers;


TRIGGER_NAME
------------------------------
DEF$_PROPAGATOR_TRIG
REPCATLOGTRIG
MASTER_AGENT_CHANGE_TRIGGER
METRICS_INSERT_TRIGGER
METRICS_DELETE
TARGET_PROP_DEFS_TR
TARGETS_INSERT_TRIGGER
TARGETS_AVAILABILITY_DEFAULT
CHECK_DUPLICATE_TARGETS
EM_TARGETS_DELETE
RAW_METRICS_AFTER_INSERT


TRIGGER_NAME
------------------------------
METRIC_ERRORS_CUR_AND_DUPES
BLACKOUT_CHANGE
BLACKOUT_STATUS
INSERT_FLAT_TARGETS
UPDATE_SOURCE
BLACKOUT_WINDOW_INSERT
HANDLE_RELATED_TARGETS
MGMT_METRIC_COLL_INS
MGMT_METRIC_COLL_DEL
MGMT_CREDS_UPD
MGMT_CREDS_INS_UPD

利用PAUSE的暫停功能,然後在另一個會話中關閉當前連線例項:
srvctl stop instance -d racdb -i racdb1

返回剛才執行sql的視窗,按回車繼續:

TRIGGER_NAME
------------------------------
MGMT_TARGET_CREDS_DEL
MGMT_HOST_CREDS_DEL
MGMT_CONT_CREDS_DEL
MGMT_ENT_CREDS_DEL
MGMT_JOB_CREDS_DEL
MEMBERSHIPS_INSERT_TRIGGER
MEMBER_ADDITION_TRIGGER
MEMBER_DELETION_TRIGGER
EXECPLAN_DELETE_TRIGGER
JOB_SUMM_INS_TRIGGER
JOB_DELETE_TRIGGER


TRIGGER_NAME
------------------------------
JOB_TARGET_INSERT_TRIGGER
JOB_TARGET_DEL_TRIGGER
MGMT_JOB_EXEC_INSERT
MGMT_JOB_EXEC_UPDATE
JOB_CMD_BLK_DELETE_TRIGGER
JOB_EXEC_DELETE_TRIGGER
JOB_EXEC_UPDATE_TRIGGER
MGMT_JOB_PARAM_INSERT
MGMT_JOB_PARAM_DELETE
SEVERITY_DELETE
METRICS_SEVERITY_DUPLICATES


TRIGGER_NAME
------------------------------
MGMT_SEVERITY_UPDATES
SEV_ANNOTATION_INSERT_TR
SEV_ANNOTATION_DELETE_TR
SPACE_METRICS_PURGE_TRIGGER
MGMT_DB_HDM_METRIC_TR
MGMT_SQL_METRIC_TR
XDB_RV_TRIG
XDB$ACL$xd
xdb-log9_TAB$xd
SERVLET$xd
ftp-log14_TAB$xd


TRIGGER_NAME
------------------------------
http-log20_TAB$xd
Folder23_TAB$xd
XDB_PV_TRIG
XDB$STATS$xd
XDB$CONFIG$xd
XDBCONFIG_VALIDATE
AW_DROP_TRG
NO_VM_DDL
NO_VM_DROP_A
AURORA$SERVER$STARTUP
AURORA$SERVER$SHUTDOWN


TRIGGER_NAME
------------------------------
CDC_ALTER_CTABLE_BEFORE
CDC_CREATE_CTABLE_AFTER
CDC_CREATE_CTABLE_BEFORE
CDC_DROP_CTABLE_BEFORE
EXPFIL_RESTRICT_TYPEEVOLVE
EXPFIL_ALTEREXPTAB_MAINT
XDB_PI_TRIG
EXPFIL_DROPOBJ_MAINT
EXPFIL_DROPUSR_MAINT
RLMGR_TRUNCATE_MAINT

已選擇76行。

SQL> select instance_name from v$instance;


INSTANCE_NAME
----------------
racdb2

SQL>

這次不但將會話切到了正常的例項上,而且SELECT的結果也全部出來,
沒有因例項故障而出現錯誤。

這就是TAF下type型別為session和select 的區別

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7199859/viewspace-626323/,如需轉載,請註明出處,否則將追究法律責任。

相關文章