MERGE: unexpected behaviour, oracle 11g
Hi all,
I'm facing a strange behaviour with Merge statement.
In particular in doc Oracle we read:
"MERGE is a deterministic statement. That is, you +*cannot update*+ the same row of the target table multiple times in the same MERGE statement."
My source table has two equal key rows and the "merge statement" merge the row with the last value in the source table.
How Is this possible ?
thank you.
VERSION:
SQL> select * from v$version
2 ;
BANNER
Oracle Database 11g Release 11.2.0.1.0 - 64bit Production
PL/SQL Release 11.2.0.1.0 - Production
CORE 11.2.0.1.0 Production
TNS for 64-bit Windows: Version 11.2.0.1.0 - Production
NLSRTL Version 11.2.0.1.0 - Production
SQL>MERGE, in a dynamic context:
v_sql :=
'MERGE INTO dwh_cdl.dim_cost_hierarchy dim
USING (SELECT DISTINCT TRIM (item_code) id_item,
NVL (TRIM (CATEGORY), ''ND'') CATEGORY,
r1.r1_code r_1,
r2.r2_code r_2,
r3.r3_code r_3,
r4.r4_code r_4,
w.item_description desc_item
FROM '
|| v_wrk
|| ' w INNER JOIN dwh_cdl.lu_r1 r1
ON (w.r_1 = r1.r1_code)
INNER JOIN dwh_cdl.lu_r2 r2
ON (w.r_2 = r2.r2_code)
INNER JOIN dwh_cdl.lu_r3 r3
ON (w.r_3 = r3.r3_code)
INNER JOIN dwh_cdl.lu_r4 r4
ON (w.r_4 = r4.r4_code)
) wrk
ON ( dim.id_item = wrk.id_item
AND dim.category = wrk.category
AND dim.r1_code = wrk.r_1
AND dim.r2_code = wrk.r_2
AND dim.r3_code = wrk.r_3
AND dim.r4_code = wrk.r_4
AND dim.wid_country = '
|| pkg_global.v_country
|| ')
WHEN MATCHED THEN
UPDATE
SET dim.desc_item = wrk.desc_item
WHEN NOT MATCHED THEN
INSERT (wid_item, id_item, CATEGORY, desc_item, type_item,
flag_valid, r1_code, r2_code, r3_code, r4_code,
wid_country, date_in)
VALUES (pkg_util.get_next_val (''DIM_COST_HIERARCHY''), wrk.id_item,
wrk.CATEGORY, wrk.desc_item, NULL, 1, r_1, r_2, r_3, r_4,
|| pkg_global.v_country
|| ', SYSDATE)';
EXECUTE IMMEDIATE v_sql;The USING table has duplicate key rows. So when join with "dim_cost_hierarchy" Oracle should issue error ! But, it doesn't !
It gets the last one row value.
Similar Messages
-
Oracle 11g - Merge PL/SQL issue - Same code work in Oracle10g
Below PL/SQL block stop working after Oracle11g upgrade, working fine in Oracle10g
CREATE TABLE TMP_TABLE1 (P_PROVIDER NUMBER, P_ID NUMBER);
CREATE TABLE TMP_TABLE2 (COL1 NUMBER, COL2 NUMBER);
CREATE TABLE TMP_TABLE3 (COL3 NUMBER, COL4 NUMBER);
BEGIN
FOR i IN (SELECT p_provider p_provider, p_id p_id FROM tmp_table1)
LOOP
MERGE INTO TMP_TABLE2 T
USING ( SELECT I.P_PROVIDER P_PROVIDER,
I.P_ID P_ID FROM DUAL) DDD
ON (T.COL1= DDD.P_PROVIDER AND T.COL2 = DDD.P_ID)
WHEN NOT MATCHED THEN
INSERT (COL1, COL2) VALUES (1, (SELECT x.COL4 FROM TMP_TABLE3 x WHERE x.COL4 = DDD.P_ID));
END LOOP;
END;
Oracle 10g Version:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for Solaris: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
Oracle 11g Version:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
PL/SQL Release 11.2.0.2.0 - Production
CORE 11.2.0.2.0 Production
TNS for Linux: Version 11.2.0.2.0 - Production
NLSRTL Version 11.2.0.2.0 – Production
Oracle11 g Error:
Error at line 5
ORA-06550: line 11, column 93:
PL/SQL: ORA-00904: "DDD"."P_ID": invalid identifier
ORA-06550: line 5, column 7:
PL/SQL: SQL Statement ignored
Script Terminated on line 5.
Is there any patch/work around in Oracle 11g?
Please advice
Thank you
RajWe had a similar issue when our organization upgraded to 11gR2.
It looks like it boils down to a change Oracle made in regards to how it works with correlated subqueries within an insert statement.
Anyway, this thread has a little more information:
Merge Command in 10g vs 11g
And it says to look at Metalink note 1109983.1 (which I can't seem to find).
Anyway, a workaround in thread is suggests (which worked for us) to wrap the insert subquery around a dummy decode clause, and oddly it will work.
eg:
INSERT (COL1, COL2) VALUES (1, (decode(1,1,(SELECT x.COL4 FROM TMP_TABLE3 x WHERE x.COL4 = DDD.P_ID)) ) ) ;
Quite a kludge, but at least it is an immediate fix to the problem, without having to rewrite anything. -
Oracle 11g- Straing behaviour of query after importing from Oracle 10g
Hi,
I have a table in Oracle 10g as follows:
Create Table xyz (col1 varchar2(50), col2 varchar2(50));
With following Data
Col1 Col2
A 320
A 110
A 290
A 380
B ABC
B 256
B LMN
I am running following Query
select * from xyz
Where Col1='A' and Col2=110
It works fine. But when I export this table and import it in Oracle 11g. It says invlid identifier.
But if I enclose 110 in single quotes. It works fine.
Also If I recreate this table in Oracle 11g like
Create table xyz1
as select * from xyz;
Now alos I am able to run this query smoothly.
select * from xyz1
Where Col1='A' and Col2=110
What is wrong exporting this table from 10g to 11g.
Any comments/suggestion??
AarbiThe check in your where clause
Col2=110Is comparing a string (Col2 is defined as a VARCHAR) with a numeric literal, so there will be an implicit conversion taking place from character to number. The query then fails due to the B LMN row when 'LMN' fails number conversion.
I'm guessing there was there an index on the table in your 10g installation which would allow the query to be satisfied without checking the B ABC or B LMN rows but is not present or not used in the 11g installation so a full table scan results in an attempt to convert 'ABC' and 'LMN' to a number. Check the explain plans.
Or it could even just be a difference in the order in which the two conditions in the where clause are evaulated between the two versions.
The solution, as you have already found is to do a string comparision
Col2='110'Edited by: Cyn on Dec 7, 2009 12:38 PM -
Oracle 11g R2 Client Silent Installation Issue (PATH) Windows 7 x86
Hi All,
I'm hoping somebody can shed some light on this issue.
I created a Response file using the 'Save Response File' method during an interactive installation on a Windows 7 Enterprise x86 client. (file enclosed)
I have installed it multiple times now with multiple permutations of the command line (got caught out by the old lower case F in responseFile) but now I'm getting the same error each time (a critical error with the PATH according to the installation log). There is nothing wrong with the path length as the installation works fine in GUI mode and passes the Prereq check.
I launch the command line to install (with Run As Administrator) - "[location of setup.exe]\setup.exe" -nowait -silent -responseFile "[location of response file]\Oracle11gv2.rsp"
RESPONSE FILE:
## Copyright(c) Oracle Corporation 1998,2008. All rights reserved. ##
## Specify values for the variables listed below to customize ##
## your installation. ##
## Each variable is associated with a comment. The comment ##
## can help to populate the variables with the appropriate ##
## values. ##
# Do not change the following system generated value.
oracle.install.responseFileVersion=/oracle/install/rspfmt_clientinstall_response_schema_v11_2_0
# This variable holds the hostname of the system as set by the user.
# It can be used to force the installation to use an alternative
# hostname rather than using the first hostname found on the system
# (e.g., for systems with multiple hostnames and network interfaces).
ORACLE_HOSTNAME=
# Unix group to be set for the inventory directory.
UNIX_GROUP_NAME=
# Inventory location.
INVENTORY_LOCATION=C:\Program Files\Oracle\Inventory
# Specify the languages in which the components will be installed.
# en : English ja : Japanese
# fr : French ko : Korean
# ar : Arabic es : Latin American Spanish
# bn : Bengali lv : Latvian
# pt_BR: Brazilian Portuguese lt : Lithuanian
# bg : Bulgarian ms : Malay
# fr_CA: Canadian French es_MX: Mexican Spanish
# ca : Catalan no : Norwegian
# hr : Croatian pl : Polish
# cs : Czech pt : Portuguese
# da : Danish ro : Romanian
# nl : Dutch ru : Russian
# ar_EG: Egyptian zh_CN: Simplified Chinese
# en_GB: English (Great Britain) sk : Slovak
# et : Estonian sl : Slovenian
# fi : Finnish es_ES: Spanish
# de : German sv : Swedish
# el : Greek th : Thai
# iw : Hebrew zh_TW: Traditional Chinese
# hu : Hungarian tr : Turkish
# is : Icelandic uk : Ukrainian
# in : Indonesian vi : Vietnamese
# it : Italian
# Example : SELECTED_LANGUAGES=en,fr,ja
SELECTED_LANGUAGES=en,en_GB
# Complete path of the Oracle Home
ORACLE_HOME=C:\Oracle\product\11.2.0\client_1
# Complete path of the Oracle Base.
ORACLE_BASE=C:\Oracle
#Name : INSTALL_TYPE
#Datatype : String
#Description: Installation type of the component.
# The following choices are available. The value should contain
# only one of these choices.
# InstantClient : InstantClient
# Administrator : Administrator
# Runtime : Runtime
# Custom : Custom
#Example : INSTALL_TYPE = "Administrator"
oracle.install.client.installType=Custom
# Name : oracle.install.client.customComponents
# Datatype : StringList
# This property is considered only if INSTALL_TYPE is set to "Custom"
# Description: List of Client Components you would like to install
# The following choices are available. You may specify any
# combination of these choices. The components you choose should
# be specified in the form "internal-component-name:version"
# Below is a list of components you may specify to install.
# oracle.sqlj:11.2.0.1.0 -- "Oracle SQLJ"
# oracle.rdbms.util:11.2.0.1.0 -- "Oracle Database Utilities"
# oracle.javavm.client:11.2.0.1.0 -- "Oracle Java Client"
# oracle.sqlplus:11.2.0.1.0 -- "SQL*Plus"
# oracle.dbjava.jdbc:11.2.0.1.0 -- "Oracle JDBC/THIN Interfaces"
# oracle.ldap.client:11.2.0.1.0 -- "Oracle Internet Directory Client"
# oracle.rdbms.oci:11.2.0.1.0 -- "Oracle Call Interface (OCI)"
# oracle.precomp:11.2.0.1.0 -- "Oracle Programmer"
# oracle.xdk:11.2.0.1.0 -- "Oracle XML Development Kit"
# oracle.network.aso:11.2.0.1.0 -- "Oracle Advanced Security"
# oracle.assistants.oemlt:11.2.0.1.0 -- "Enterprise Manager Minimal Integration"
# oracle.oraolap.mgmt:11.2.0.1.0 -- "OLAP Analytic Workspace Manager and Worksheet"
# oracle.network.client:11.2.0.1.0 -- "Oracle Net"
# oracle.ordim.client:11.2.0.1.0 -- "Oracle Multimedia Client Option"
# oracle.ons:11.2.0.0.0 -- "Oracle Notification Service"
# oracle.odbc:11.2.0.1.0 -- "Oracle ODBC Driver"
# oracle.has.client:11.2.0.1.0 -- "Oracle Clusterware High Availability API"
# oracle.dbdev:11.2.0.1.0 -- "Oracle SQL Developer"
# oracle.rdbms.scheduler:11.2.0.1.0 -- "Oracle Scheduler Agent"
# Example : oracle.install.client.customComponents="oracle.precomp:11.2.0.1.0","oracle.ons:11.2.0.0.0","oracle.oraolap.mgmt:11.2.0.1.0","oracle.rdbms.scheduler:11.2.0.1.0"
oracle.install.client.customComponents=oracle.rdbms.util:11.2.0.1.0,oracle.sqlplus:11.2.0.1.0,oracle.dbjava.jdbc:11.2.0.1.0,oracle.rdbms.oci:11.2.0.1.0,oracle.network.client:11.2.0.1.0,oracle.odbc:11.2.0.1.0,oracle.oo4o:11.2.0.1.0,oracle.ntoledb:11.2.0.1.0,oracle.ntoledb.odp_net_2:11.2.0.1.0,oracle.aspnet_2:11.2.0.1.0
#Name : MTS_PORT
#Datatype : int
#Description: Port number to be used for by the Oracle MTS Recovery Service to listen
# for requests. This needs to be entered in case oracle.ntoramts is
# selected in the list of custom components in custom install
#Example : MTS_PORT = 2030
oracle.install.client.oramtsPortNumber=49152
# Host name to be used for by the Oracle Scheduler Agent.
# This needs to be entered in case oracle.rdbms.scheduler is selected in the
# list of custom components during custom install
# Example : oracle.install.client.schedulerAgentHostName = acme.domain.com
oracle.install.client.schedulerAgentHostName=
# Port number to be used for by the Oracle Scheduler Agent.
# This needs to be entered in case oracle.rdbms.scheduler is selected in the
# list of custom components during custom install
# Example: oracle.install.client.schedulerAgentPortNumber = 1500
oracle.install.client.schedulerAgentPortNumber=
LOG FILE TO FOLLOWLOG FILE:
Using paramFile: Z:\Source Media\KM0399 - Oracle 11g\win32_11gR2_client\client\install\oraparam.ini
The commandline for unzip:
Z:\Source Media\KM0399 - Oracle 11g\win32_11gR2_client\client\install\unzip -qqqo ..\stage\Components\oracle.jdk\1.5.0.17.03\1\DataFiles/"*.jar" -d "C:\Users\DESKTO~1\AppData\Local\Temp\OraInstall2013-02-26_08-36-31AM" INFO: Loading data from: jar:file:/C:/Users/DesktopAdmin/AppData/Local/Temp/OraInstall2013-02-26_08-36-31AM/ext/jlib/installcommons_1.0.0b.jar!/oracle/install/driver/oui/resource/ConfigCommandMappings.xml
INFO: Loading beanstore from jar:file:/C:/Users/DesktopAdmin/AppData/Local/Temp/OraInstall2013-02-26_08-36-31AM/ext/jlib/installcommons_1.0.0b.jar!/oracle/install/driver/oui/resource/ConfigCommandMappings.xml
INFO: Restoring class oracle.install.driver.oui.ConfigCmdMappings from jar:file:/C:/Users/DesktopAdmin/AppData/Local/Temp/OraInstall2013-02-26_08-36-31AM/ext/jlib/installcommons_1.0.0b.jar!/oracle/install/driver/oui/resource/ConfigCommandMappings.xml
INFO: Verifying target environment...
INFO: Checking whether the IP address of the localhost could be determined...
INFO: Completed verification of target environment.
INFO: Inventory exists: false
INFO: Registering setup bean
INFO: Validating Response File Z:\Source Media\KM0399 - Oracle 11g\win32_11gR2_client\client\response\Oracle11gv2.rsp
WARNING: Unable to find the namespace URI. Reason: Start of root element expected.
INFO: Setting Response file data to the Installer
WARNING: Unable to find the namespace URI. Reason: Start of root element expected.
INFO: Building Flow
INFO: Building the flow graph
INFO: Loaded state init
INFO: Loaded state clientInstallType
INFO: Loaded state productLanguage
INFO: Loaded state getOracleHome
INFO: Loaded state prereqExecutionDecider
INFO: Loaded state checkPrereqs
INFO: Loaded state postPrereqs
INFO: Loaded state summary
INFO: Loaded state clientCustomInstall
INFO: Loaded state schedulerAgent
INFO: Loaded state mtsDialog
INFO: Loaded state setup
INFO: Loaded state finish
INFO: Linking states
INFO: State[checkPrereqs]: route=success; to=summary
INFO: State[clientCustomInstall]: route=TO_ENDCUSTOM; to=prereqExecutionDecider
INFO: State[clientCustomInstall]: route=TO_ORAMTS; to=mtsDialog
INFO: State[clientCustomInstall]: route=TO_SCHEDULERAGENT; to=schedulerAgent
INFO: State[clientInstallType]: route=ic_no; to=productLanguage
INFO: State[clientInstallType]: route=ic_yes; to=getOracleHome
INFO: State[getOracleHome]: route=INVENTORY_NO; to=prereqExecutionDecider
INFO: State[getOracleHome]: route=INVENTORY_NO_CUSTOM_YES; to=clientCustomInstall
INFO: State[getOracleHome]: route=INVENTORY_YES; to=prereqExecutionDecider
INFO: State[getOracleHome]: route=INVENTORY_YES_CUSTOM_YES; to=clientCustomInstall
INFO: State[init]: route=success; to=clientInstallType
INFO: State[mtsDialog]: route=success; to=prereqExecutionDecider
INFO: State[postPrereqs]: route=CUSTOM; to=clientCustomInstall
INFO: State[postPrereqs]: route=NON_CUSTOM; to=summary
INFO: State[prereqExecutionDecider]: route=executeprereqs; to=checkPrereqs
INFO: State[prereqExecutionDecider]: route=ignoreprereqs; to=summary
INFO: State[productLanguage]: route=productlanguage_yes; to=getOracleHome
INFO: State[schedulerAgent]: route=TO_ENDCUSTOM; to=prereqExecutionDecider
INFO: State[schedulerAgent]: route=TO_ORAMTS; to=mtsDialog
INFO: State[setup]: route=success; to=finish
INFO: State[summary]: route=success; to=setup
INFO: Successfully built the flow
INFO: Opening bean stores from which the beans can be loaded
INFO: Changing the format to extended property file format to merge the flowDataDefaults with the flowDataSource
INFO: Loading beanstore from file:/Z:/Source Media/KM0399 - Oracle 11g/win32_11gR2_client/client/response/Oracle11gv2.rsp
INFO: Translating external format into raw format
INFO: Loaded BeanStore using the flow data source
INFO: Registering the flow data beans
INFO: [INS-07001] Value for property 'INSTALL_TYPE' not found in the bean store.
INFO: [INS-07001] Value for property 'oracle_install_WindowsSystemDirectory' not found in the bean store.
INFO: [INS-07001] Value for property 'oracle_install_LaunchNetCA' not found in the bean store.
INFO: [INS-07001] Value for property 'oracle_install_NoMigration' not found in the bean store.
INFO: [INS-07001] Value for property 'oracle_install_RACInstall' not found in the bean store.
INFO: [INS-07001] Value for property 'oracle_install_db_ConfigurationType' not found in the bean store.
INFO: [INS-07001] Value for property 'oracle_install_db_InstallType' not found in the bean store.
INFO: [INS-07001] Value for property 'oracle_install_db_InstallEdition' not found in the bean store.
INFO: [INS-07001] Value for property 'oracle_install_client_CustomComponents' not found in the bean store.
INFO: [INS-07001] Value for property 'oracle_install_client_OraMTSPortNumber' not found in the bean store.
INFO: [INS-07001] Value for property 'oracle_install_client_SchedulerAgentHostName' not found in the bean store.
INFO: [INS-07001] Value for property 'oracle_install_client_SchedulerAgentPortNumber' not found in the bean store.
INFO: [INS-07001] Value for property 'ORACLE_HOME' not found in the bean store.
INFO: [INS-07001] Value for property 'FROM_LOCATION' not found in the bean store.
INFO: [INS-07001] Value for property 'ORACLE_BASE' not found in the bean store.
INFO: [INS-07001] Value for property 'TOPLEVEL_COMPONENT' not found in the bean store.
INFO: [INS-07001] Value for property 'TopLevelComponentVersion' not found in the bean store.
INFO: [INS-07001] Value for property 'UNIX_GROUP_NAME' not found in the bean store.
INFO: [INS-07001] Value for property 'INVENTORY_LOCATION' not found in the bean store.
INFO: [INS-07001] Value for property 'SELECTED_LANGUAGES' not found in the bean store.
INFO: [INS-07001] Value for property 'COLLECTOR_RESPONSE_FILE' not found in the bean store.
INFO: [INS-07001] Value for property 'MYORACLESUPPORT_USERNAME' not found in the bean store.
INFO: [INS-07001] Value for property 'MYORACLESUPPORT_PASSWORD' not found in the bean store.
INFO: [INS-07001] Value for property 'DECLINE_SECURITY_UPDATES' not found in the bean store.
INFO: [INS-07001] Value for property 'PROXY_HOST' not found in the bean store.
INFO: [INS-07001] Value for property 'PROXY_PORT' not found in the bean store.
INFO: [INS-07001] Value for property 'PROXY_USER' not found in the bean store.
INFO: [INS-07001] Value for property 'PROXY_PWD' not found in the bean store.
INFO: [INS-07001] Value for property 'SECURITY_UPDATES_VIA_MYORACLESUPPORT' not found in the bean store.
INFO: [INS-07001] Value for property 'COLLECTOR_IGNORE_FAILURES' not found in the bean store.
INFO: [INS-07001] Value for property 'COLLECTOR_IGNORE_CONFIGURATION' not found in the bean store.
INFO: [INS-07001] Value for property 'ORACLE_HOSTNAME' not found in the bean store.
WARNING: [INS-07001] Value for property 'oracle_install_WindowsSystemDirectory' not found in the bean store.
WARNING: [INS-07001] Value for property 'oracle_install_LaunchNetCA' not found in the bean store.
WARNING: [INS-07001] Value for property 'oracle_install_NoMigration' not found in the bean store.
WARNING: [INS-07001] Value for property 'oracle_install_RACInstall' not found in the bean store.
WARNING: [INS-07001] Value for property 'oracle_install_db_ConfigurationType' not found in the bean store.
WARNING: [INS-07001] Value for property 'oracle_install_db_InstallType' not found in the bean store.
WARNING: [INS-07001] Value for property 'oracle_install_db_InstallEdition' not found in the bean store.
WARNING: [INS-07001] Value for property 'FROM_LOCATION' not found in the bean store.
WARNING: [INS-07001] Value for property 'TOPLEVEL_COMPONENT' not found in the bean store.
WARNING: [INS-07001] Value for property 'TopLevelComponentVersion' not found in the bean store.
WARNING: [INS-07001] Value for property 'OCMSettings' not found in the bean store.
INFO: Set value for bean ClientSetupBean
INFO: [INS-07001] Value for property 'INSTALL_TYPE' not found in the bean store.
INFO: [INS-07001] Value for property 'oracle_install_WindowsSystemDirectory' not found in the bean store.
INFO: [INS-07001] Value for property 'oracle_install_LaunchNetCA' not found in the bean store.
INFO: [INS-07001] Value for property 'oracle_install_NoMigration' not found in the bean store.
INFO: [INS-07001] Value for property 'oracle_install_RACInstall' not found in the bean store.
INFO: [INS-07001] Value for property 'oracle_install_db_ConfigurationType' not found in the bean store.
INFO: [INS-07001] Value for property 'oracle_install_db_InstallType' not found in the bean store.
INFO: [INS-07001] Value for property 'oracle_install_db_InstallEdition' not found in the bean store.
INFO: [INS-07001] Value for property 'oracle_install_client_CustomComponents' not found in the bean store.
INFO: [INS-07001] Value for property 'oracle_install_client_OraMTSPortNumber' not found in the bean store.
INFO: [INS-07001] Value for property 'oracle_install_client_SchedulerAgentHostName' not found in the bean store.
INFO: [INS-07001] Value for property 'oracle_install_client_SchedulerAgentPortNumber' not found in the bean store.
INFO: [INS-07001] Value for property 'ORACLE_HOME' not found in the bean store.
INFO: [INS-07001] Value for property 'FROM_LOCATION' not found in the bean store.
INFO: [INS-07001] Value for property 'ORACLE_BASE' not found in the bean store.
INFO: [INS-07001] Value for property 'TOPLEVEL_COMPONENT' not found in the bean store.
INFO: [INS-07001] Value for property 'TopLevelComponentVersion' not found in the bean store.
WARNING: Failed to load bean oracle.install.ivw.client.bean.ClientInstallSettings. Reason: [INS-07001] Value for property 'ClientInstallSettings' not found in the bean store.
INFO: Closing bean stores from which the beans can be loaded
INFO: Registering the flow views
INFO: Adding View[type: oracle.install.commons.base.interview.common.view.PrereqGUI viewId: null uiType: null]
INFO: Adding View[type: oracle.install.commons.base.interview.common.view.SummaryGUI viewId: null uiType: null]
INFO: Adding View[type: oracle.install.commons.base.interview.common.view.SetupGUI viewId: null uiType: null]
INFO: Adding View[type: oracle.install.ivw.common.view.ProductLanguageGUI viewId: ProductLanguageUI uiType: null]
INFO: Adding View[type: oracle.install.ivw.client.view.CustomInstallGUI viewId: null uiType: null]
INFO: Adding View[type: oracle.install.ivw.client.view.SchedulerAgentGUI viewId: null uiType: null]
INFO: Adding View[type: oracle.install.ivw.client.view.OraMTSGUI viewId: null uiType: null]
INFO: Adding View[type: oracle.install.ivw.client.view.InstallLocationGUI viewId: null uiType: null]
INFO: Adding View[type: oracle.install.ivw.client.view.InstallTypesGUI viewId: null uiType: null]
INFO: Adding View[type: oracle.install.ivw.client.view.FinishGUI viewId: null uiType: null]
INFO: Initial values of Setup Properties :
PROPERTY VALUE
COLLECTOR_IGNORE_CONFIGURATION false
COLLECTOR_IGNORE_FAILURES false
COLLECTOR_RESPONSE_FILE
DECLINE_SECURITY_UPDATES false
FROM_LOCATION Z:\Source Media\KM0399 - Oracle 11g\win32_11gR2_client\cl
ient\install\../stage/products.xml
INSTALL_TYPE Custom
INVENTORY_LOCATION C:\Program Files\Oracle\Inventory
MYORACLESUPPORT_PASSWORD Protected value, not to be logged
MYORACLESUPPORT_USERNAME
ORACLE_BASE C:\Oracle
ORACLE_HOME C:\Oracle\product\11.2.0\client_1
ORACLE_HOSTNAME GBA-P74444432
PROXY_HOST
PROXY_PORT
PROXY_PWD Protected value, not to be logged
PROXY_USER
SECURITY_UPDATES_VIA_MYORACLESUPPORT true
SELECTED_LANGUAGES {"en","en_GB"}
oracle_install_LaunchNetCA false
oracle_install_NoMigration true
oracle_install_RACInstall false
oracle_install_WindowsSystemDirectory
oracle_install_client_CustomComponents {"oracle.rdbms.util:11.2.0.1.0","oracle.sqlplus:11.2.0.1.
0","oracle.dbjava.jdbc:11.2.0.1.0","oracle.rdbms.oci:11.2
.0.1.0","oracle.network.client:11.2.0.1.0","oracle.odbc:1
1.2.0.1.0","oracle.oo4o:11.2.0.1.0","oracle.ntoledb:11.2.
0.1.0","oracle.ntoledb.odp_net_2:11.2.0.1.0","oracle.aspn
et_2:11.2.0.1.0"}
oracle_install_client_OraMTSPortNumber 49152
oracle_install_db_ConfigurationType
oracle_install_db_InstallEdition EE
oracle_install_db_InstallType
INFO: Launching Oracle Client Installer
INFO: Started executing the flow in SILENT mode
INFO: Waiting for completion of background operations
INFO: Finishing all forked tasks at state init
INFO: Waiting for completion all forked tasks at state init
INFO: All forked task are completed at state init
INFO: Completed background operations
INFO: Executing action at state init
INFO: Completed executing action at state <init>
INFO: Waiting for completion of background operations
INFO: Completed background operations
INFO: Moved to state <init>
INFO: Waiting for completion of background operations
INFO: Completed background operations
INFO: Validating state <init>
WARNING: Validation disabled for the state init
INFO: Completed validating state <init>
INFO: Verifying route success
INFO: Waiting for completion of background operations
INFO: Completed background operations
INFO: Executing action at state clientInstallType
INFO: Completed executing action at state <clientInstallType>
INFO: Waiting for completion of background operations
INFO: Completed background operations
INFO: Moved to state <clientInstallType>
INFO: Waiting for completion of background operations
INFO: Completed background operations
INFO: Validating state <clientInstallType>
WARNING: Validation disabled for the state clientInstallType
INFO: Completed validating state <clientInstallType>
INFO: In Transition of InstallTypesAction:
INFO: Verifying route ic_no
INFO: Waiting for completion of background operations
INFO: Completed background operations
INFO: Executing action at state productLanguage
INFO: Completed executing action at state <productLanguage>
INFO: Waiting for completion of background operations
INFO: Completed background operations
INFO: Moved to state <productLanguage>
INFO: Waiting for completion of background operations
INFO: Completed background operations
INFO: Validating state <productLanguage>
INFO: Using default Validator configured in the Action class oracle.install.ivw.common.action.ProductLanguageAction
INFO: Completed validating state <productLanguage>
INFO: Verifying route productlanguage_yes
INFO: Waiting for completion of background operations
INFO: Completed background operations
INFO: Executing action at state getOracleHome
INFO: Completed executing action at state <getOracleHome>
INFO: Waiting for completion of background operations
INFO: Completed background operations
INFO: Moved to state <getOracleHome>
INFO: Waiting for completion of background operations
INFO: Completed background operations
INFO: Validating state <getOracleHome>
INFO: custom prereq file name: oracle.client_Custom.xml
INFO: refDataFile: Z:\Source Media\KM0399 - Oracle 11g\win32_11gR2_client\client\stage\cvu\oracle.client_Custom.xml
INFO: isCustomRefDataFilePresent: false
INFO: InstallAreaControl exists: false
INFO: Checking:NEW_HOME
INFO: Checking:COMP
INFO: Checking:COMP
INFO: Checking:COMP
INFO: Checking:COMP
INFO: Checking:COMP
INFO: Checking:COMP
INFO: Checking:COMP
INFO: Checking:COMP
INFO: Checking:ORCA_HOME
INFO: Reading shiphome metadata from Z:\Source Media\KM0399 - Oracle 11g\win32_11gR2_client\client\install\..\stage\shiphomeproperties.xml
INFO: Loading beanstore from file:/Z:/Source Media/KM0399 - Oracle 11g/win32_11gR2_client/client/install/../stage/shiphomeproperties.xml
INFO: Translating external format into raw format
INFO: Restoring class oracle.install.driver.oui.ShiphomeMetadata from file:/Z:/Source Media/KM0399 - Oracle 11g/win32_11gR2_client/client/install/../stage/shiphomeproperties.xml
INFO: inventory location isC:\Program Files\Oracle\Inventory
INFO: inventory location isC:\Program Files\Oracle\Inventory
INFO: size estimation for Administratorinstall is 1046.229476928711
INFO: PATH has :==>C:\Users\DESKTO~1\AppData\Local\Temp\OraInstall2013-02-26_08-36-31AM\jdk\jre\bin;.;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\AdminStudio\11.5\Common\
INFO: Completed validating state <getOracleHome>
INFO: InstallLocationAction to INVENTORY_NO_CUSTOM_YES
INFO: Verifying route INVENTORY_NO_CUSTOM_YES
INFO: Waiting for completion of background operations
INFO: Completed background operations
INFO: Executing action at state clientCustomInstall
INFO: Re-loading component config bean
INFO: Loading beanstore from jar:file:/C:/Users/DesktopAdmin/AppData/Local/Temp/OraInstall2013-02-26_08-36-31AM/ext/jlib/instclient.jar!/oracle/install/ivw/client/resource/custom_components.xml
INFO: Translating external format into raw format
INFO: Restoring class oracle.install.commons.base.util.ComponentConfig from jar:file:/C:/Users/DesktopAdmin/AppData/Local/Temp/OraInstall2013-02-26_08-36-31AM/ext/jlib/instclient.jar!/oracle/install/ivw/client/resource/custom_components.xml
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
WARNING: [INS-07001] Value for property 'dependants' not found in the bean store.
INFO: Resolving dependencies
INFO: Completed executing action at state <clientCustomInstall>
INFO: Waiting for completion of background operations
INFO: Completed background operations
INFO: Moved to state <clientCustomInstall>
INFO: Waiting for completion of background operations
INFO: Completed background operations
INFO: Validating state <clientCustomInstall>
INFO: Completed validating state <clientCustomInstall>
INFO: Verifying route TO_ENDCUSTOM
INFO: Waiting for completion of background operations
INFO: Completed background operations
INFO: Executing action at state prereqExecutionDecider
INFO: Completed executing action at state <prereqExecutionDecider>
INFO: Waiting for completion of background operations
INFO: Completed background operations
INFO: Moved to state <prereqExecutionDecider>
INFO: Waiting for completion of background operations
INFO: Completed background operations
INFO: Validating state <prereqExecutionDecider>
WARNING: Validation disabled for the state prereqExecutionDecider
INFO: Completed validating state <prereqExecutionDecider>
INFO: Verifying route executeprereqs
INFO: Waiting for completion of background operations
INFO: Completed background operations
INFO: Executing action at state checkPrereqs
INFO: custom prereq file name: oracle.client_Custom.xml
INFO: refDataFile: Z:\Source Media\KM0399 - Oracle 11g\win32_11gR2_client\client\stage\cvu\oracle.client_Custom.xml
INFO: isCustomRefDataFilePresent: false
INFO: Completed executing action at state <checkPrereqs>
INFO: Waiting for completion of background operations
INFO: Finishing all forked tasks at state checkPrereqs
INFO: Waiting for completion all forked tasks at state checkPrereqs
INFO: Creating PrereqChecker Job for leaf task Physical Memory
INFO: Creating CompositePrereqChecker Job for container task Free Space
INFO: Creating PrereqChecker Job for leaf task Free Space: GBA-P74444432:C:\Users\DESKTO~1\AppData\Local\Temp
INFO: Creating PrereqChecker Job for leaf task Architecture
INFO: Creating PrereqChecker Job for leaf task Environment variable: "PATH"
INFO: CVU tracingEnabled = false
INFO: Nodes are prepared for verification.
INFO: *********************************************
INFO: Physical Memory: This is a prerequisite condition to test whether the system has at least 128MB (131072.0KB) of total physical memory.
INFO: Severity:IGNORABLE
INFO: OverallStatus:SUCCESSFUL
INFO: -----------------------------------------------
INFO: Verification Result for Node:GBA-P74444432
INFO: Expected Value:128MB (131072.0KB)
INFO: Actual Value:1023.5547MB (1048120.0KB)
INFO: -----------------------------------------------
INFO: *********************************************
INFO: Free Space: GBA-P74444432:C:\Users\DESKTO~1\AppData\Local\Temp: This is a prerequisite condition to test whether sufficient free space is available in the file system.
INFO: Severity:IGNORABLE
INFO: OverallStatus:SUCCESSFUL
INFO: -----------------------------------------------
INFO: Verification Result for Node:GBA-P74444432
INFO: Expected Value:130MB
INFO: Actual Value:21.3053GB
INFO: -----------------------------------------------
INFO: *********************************************
INFO: Architecture: This is a prerequisite condition to test whether the system has a certified architecture.
INFO: Severity:CRITICAL
INFO: OverallStatus:SUCCESSFUL
INFO: -----------------------------------------------
INFO: Verification Result for Node:GBA-P74444432
INFO: Expected Value:32-bit
INFO: Actual Value:32-bit
INFO: -----------------------------------------------
INFO: *********************************************
INFO: Environment variable: "PATH": This test checks whether the length of the environment variable "PATH" does not exceed the recommended length.
INFO: Severity:CRITICAL
INFO: OverallStatus:OPERATION_FAILED
INFO: -----------------------------------------------
INFO: Verification Result for Node:GBA-P74444432
WARNING: Result values are not available for this verification task
INFO: All forked task are completed at state checkPrereqs
INFO: Completed background operations
INFO: Moved to state <checkPrereqs>
INFO: Waiting for completion of background operations
INFO: Completed background operations
INFO: Validating state <checkPrereqs>
INFO: Using default Validator configured in the Action class oracle.install.ivw.client.action.PrereqAction
INFO: Adding ExitStatus PREREQUISITES_NOT_MET to the exit status set
SEVERE: [FATAL] [INS-13013] Target environment do not meet some mandatory requirements.
CAUSE: Some of the mandatory prerequisites are not met. See logs for details. C:\Users\DESKTO~1\AppData\Local\Temp\OraInstall2013-02-26_08-36-31AM\installActions2013-02-26_08-36-31AM.log
ACTION: Identify the list of failed prerequisite checks from the log: C:\Users\DESKTO~1\AppData\Local\Temp\OraInstall2013-02-26_08-36-31AM\installActions2013-02-26_08-36-31AM.log. Then either from the log file or from installation manual find the appropriate configuration to meet the prerequisites and fix it manually.
INFO: Advice is ABORT
INFO: Adding ExitStatus INVALID_USER_INPUT to the exit status set
INFO: Completed validating state <checkPrereqs>
INFO: Terminating all background operations
INFO: Terminated all background operations
WARNING: A log of this session is currently saved as: C:\Users\DESKTO~1\AppData\Local\Temp\OraInstall2013-02-26_08-36-31AM\installActions2013-02-26_08-36-31AM.log. Oracle recommends that if you want to keep this log, you should move it from the temporary location to a more permanent location.
INFO: Finding the most appropriate exit status for the current application
INFO: Exit Status is -3
INFO: Shutdown Oracle Client Installer
INFO: Unloading Setup Driver -
External tables in Oracle 11g database is not loading null value records
We have upgraded our DB from Oracle 9i to 11g...
It was noticed that data load to external tables in 9i is rejecting the records with null columns..However upgrading it to 11g,it allows the records with null values.
Is there are way to restrict loading the records that has few coulmns that are null..
Can you please share if this is the expected behaviour in Oracle 11g...
Thanks.Data isn't really loaded to an External Table. Rather, the external table lets you query an external data source as if it were a regular database table. To not see the rows with the NULL value, simply filter those rows out with your SQL statement:
SELECT * FROM my_external_table WHERE colX IS NOT NULL;
HTH,
Brian -
The danger of memory target in Oracle 11g - request for discussion.
Hello, everyone.
This is not a question, but kind of request for discussion.
I believe that many of you heard something about automatic memory management in Oracle 11g.
The concept is that Oracle manages the target size of SGA and PGA. Yes, believe it or not, all we have to do is just to tell Oracle how much memory it can use.
But I have a big concern on this. The optimizer takes the PGA size into consideration when calculating the cost of sort-related operations.
So what would happen when Oracle dynamically changes the target size of PGA? Following is a simple demonstration of my concern.
UKJA@ukja116> select * from v$version;
BANNER
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
PL/SQL Release 11.1.0.6.0 - Production
CORE 11.1.0.6.0 Production
TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
NLSRTL Version 11.1.0.6.0 - Production
-- Configuration
*.memory_target=350m
*.memory_max_target=350m
create table t1(c1 int, c2 char(100));
create table t2(c1 int, c2 char(100));
insert into t1 select level, level from dual connect by level <= 10000;
insert into t2 select level, level from dual connect by level <= 10000;
-- First 10053 trace
alter session set events '10053 trace name context forever, level 1';
select /*+ use_hash(t1 t2) */ count(*)
from t1, t2
where t1.c1 = t2.c1 and t1.c2 = t2.c2
alter session set events '10053 trace name context off';
-- Do aggressive hard parse to make Oracle dynamically change the size of memory segments.
declare
pat1 varchar2(1000);
pat2 varchar2(1000);
va number;
vc sys_refcursor;
vs varchar2(1000);
begin
select ksppstvl into pat1
from sys.xm$ksppi i, sys.xm$ksppcv v -- views for x$ table
where i.indx = v.indx
and i.ksppinm = '__pga_aggregate_target';
for idx in 1 .. 10000000 loop
execute immediate 'select count(*) from t1 where rownum = ' || (idx+1)
into va;
if mod(idx, 1000) = 0 then
sys.dbms_system.ksdwrt(2, idx || 'th execution');
select ksppstvl into pat2
from sys.xm$ksppi i, sys.xm$ksppcv v -- views for x$ table
where i.indx = v.indx
and i.ksppinm = '__pga_aggregate_target';
if pat1 <> pat2 then
sys.dbms_system.ksdwrt(2, 'yep, I got it!');
exit;
end if;
end if;
end loop;
end;
-- As to alert log file,
25000th execution
26000th execution
27000th execution
28000th execution
29000th execution
30000th execution
yep, I got it! <-- the pga target changed with 30000th hard parse
-- Second 10053 trace for same query
alter session set events '10053 trace name context forever, level 1';
select /*+ use_hash(t1 t2) */ count(*)
from t1, t2
where t1.c1 = t2.c1 and t1.c2 = t2.c2
alter session set events '10053 trace name context off';With above test case, I found that
1. Oracle invalidates the query when internal pga aggregate size changes, which is quite natural.
2. With changed pga aggregate size, Oracle recalculates the cost. These are excerpts from the both of the 10053 trace files.
-- First 10053 trace file
PARAMETERS USED BY THE OPTIMIZER
PARAMETERS WITH ALTERED VALUES
Compilation Environment Dump
_smm_max_size = 11468 KB
_smm_px_max_size = 28672 KB
optimizer_use_sql_plan_baselines = false
optimizer_use_invisible_indexes = true
-- Second 10053 trace file
PARAMETERS USED BY THE OPTIMIZER
PARAMETERS WITH ALTERED VALUES
Compilation Environment Dump
_smm_max_size = 13107 KB
_smm_px_max_size = 32768 KB
optimizer_use_sql_plan_baselines = false
optimizer_use_invisible_indexes = true
Bug Fix Control Environment10053 trace file clearly says that Oracle recalculates the cost of the query with the change of internal pga aggregate target size. So, there is a great danger of unexpected plan change while Oracle dynamically controls the memory segments.
I believe that this is a desinged behavior, but the negative side effect is not negligible.
I just like to hear your opinions on this behavior.
Do you think that this is acceptable? Or is this another great feature that nobody wants to use like automatic tuning advisor?
================================
Dion Cho - Oracle Performance Storyteller
http://dioncho.wordpress.com (english)
http://ukja.tistory.com (korean)
================================I made a slight modification with my test case to have mixed workloads of hard parse and logical reads.
*.memory_target=200m
*.memory_max_target=200m
create table t3(c1 int, c2 char(1000));
insert into t3 select level, level from dual connect by level <= 50000;
declare
pat1 varchar2(1000);
pat2 varchar2(1000);
va number;
begin
select ksppstvl into pat1
from sys.xm$ksppi i, sys.xm$ksppcv v
where i.indx = v.indx
and i.ksppinm = '__pga_aggregate_target';
for idx in 1 .. 1000000 loop
-- try many patterns here!
execute immediate 'select count(*) from t3 where 10 = mod('||idx||',10)+1' into va;
if mod(idx, 100) = 0 then
sys.dbms_system.ksdwrt(2, idx || 'th execution');
for p in (select ksppinm, ksppstvl
from sys.xm$ksppi i, sys.xm$ksppcv v
where i.indx = v.indx
and i.ksppinm in ('__shared_pool_size', '__db_cache_size', '__pga_aggregate_target')) loop
sys.dbms_system.ksdwrt(2, p.ksppinm || ' = ' || p.ksppstvl);
end loop;
select ksppstvl into pat2
from sys.xm$ksppi i, sys.xm$ksppcv v
where i.indx = v.indx
and i.ksppinm = '__pga_aggregate_target';
if pat1 <> pat2 then
sys.dbms_system.ksdwrt(2, 'yep, I got it! pat1=' || pat1 ||', pat2='||pat2);
exit;
end if;
end if;
end loop;
end;
/This test case showed expected and reasonable result, like following:
100th execution
__shared_pool_size = 92274688
__db_cache_size = 16777216
__pga_aggregate_target = 83886080
200th execution
__shared_pool_size = 92274688
__db_cache_size = 16777216
__pga_aggregate_target = 83886080
300th execution
__shared_pool_size = 88080384
__db_cache_size = 20971520
__pga_aggregate_target = 83886080
400th execution
__shared_pool_size = 92274688
__db_cache_size = 16777216
__pga_aggregate_target = 83886080
500th execution
__shared_pool_size = 88080384
__db_cache_size = 20971520
__pga_aggregate_target = 83886080
1100th execution
__shared_pool_size = 92274688
__db_cache_size = 20971520
__pga_aggregate_target = 83886080
1200th execution
__shared_pool_size = 92274688
__db_cache_size = 37748736
__pga_aggregate_target = 58720256
yep, I got it! pat1=83886080, pat2=58720256Oracle continued being bounced between shared pool and buffer cache size, and about 1200th execution Oracle suddenly stole some memory from PGA target area to increase db cache size.
(I'm still in dark age on this automatic memory target management of 11g. More research in need!)
I think that this is very clear and natural behavior. I just want to point out that this would result in unwanted catastrophe under special cases, especially with some logic holes and bugs.
================================
Dion Cho - Oracle Performance Storyteller
http://dioncho.wordpress.com (english)
http://ukja.tistory.com (korean)
================================ -
Oracle 11g with OPTIMIZER_MODE=RULE go faster!!
I recently migrated Oracle 9.2.0.8 to Oracle 11g but the querys doesn't work as I hope.
The same query takes 3:20 min aprox using optimizer_mode=ALL_ROWS and 0:20 using optimizer_mode=RULE or using RULE hint.
The query in CBO makes a cartesian product between the indexes of the table.
This is one query and the "autrotrace on" log on Oracle 11g:
SELECT /*+ NO_INDEX (PK0004111303310) */MIN(BASE.ID_SCHED_TASK)+1 I
FROM M4RJS_SCHED_TASKS BASE
WHERE NOT EXISTS
(SELECT BASE2.ID_SCHED_TASK
FROM M4RJS_SCHED_TASKS BASE2
WHERE BASE2.ID_SCHED_TASK>BASE.ID_SCHED_TASK
AND BASE2.ID_SCHED_TASK<BASE.ID_SCHED_TASK+2)
ORDER BY 1 ASC
Execution Plan
Plan hash value: 3937517195
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 14 | | 328 (2)| 00:00:04 |
| 1 | SORT AGGREGATE | | 1 | 14 | | | |
| 2 | MERGE JOIN ANTI | | 495 | 6930 | | 328 (2)| 00:00:04 |
| 3 | INDEX FULL SCAN | PK0004111303310 | 49487 | 338K| | 119 (1)| 00:00:02 |
|* 4 | FILTER | | | | | | |
|* 5 | SORT JOIN | | 49487 | 338K| 1576K| 209 (2)| 00:00:03 |
| 6 | INDEX FAST FULL SCAN| PK0004111303310 | 49487 | 338K| | 33 (0)| 00:00:01 |
Predicate Information (identified by operation id):
4 - filter("BASE2"."ID_SCHED_TASK"<"BASE"."ID_SCHED_TASK"+2)
5 - access("BASE2"."ID_SCHED_TASK">"BASE"."ID_SCHED_TASK")
filter("BASE2"."ID_SCHED_TASK">"BASE"."ID_SCHED_TASK")
Statistics
1 recursive calls
0 db block gets
242 consistent gets
8 physical reads
0 redo size
519 bytes sent via SQL*Net to client
524 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
1 rows processed
Thanks to all !Sorry Mschnatt, I posted the wrong query, i was testing with HINTS, the correct query is your posted query.
1* I analyzed the tables and the result is the same:
This is the query and "autorace on" log using OPTIMIZER_MODE=RULE on Oracle 11g:
SQL> R
1 SELECT MIN(BASE.ID_SCHED_TASK)+1 I
2 FROM M4RJS_SCHED_TASKS BASE
3 WHERE NOT EXISTS
4 (SELECT BASE2.ID_SCHED_TASK
5 FROM M4RJS_SCHED_TASKS BASE2
6 WHERE BASE2.ID_SCHED_TASK>BASE.ID_SCHED_TASK
7 AND BASE2.ID_SCHED_TASK<BASE.ID_SCHED_TASK+2)
8* ORDER BY 1 ASC
I
2
Elapsed: 00:00:00.33
Execution Plan
Plan hash value: 795265574
| Id | Operation | Name |
| 0 | SELECT STATEMENT | |
| 1 | SORT AGGREGATE | |
|* 2 | FILTER | |
| 3 | TABLE ACCESS FULL | M4RJS_SCHED_TASKS |
|* 4 | INDEX RANGE SCAN | PK0004111303310 |
Predicate Information (identified by operation id):
2 - filter( NOT EXISTS (SELECT 0 FROM "M4RJS_SCHED_TASKS" "BASE2"
WHERE "BASE2"."ID_SCHED_TASK"<:B1+2 AND "BASE2"."ID_SCHED_TASK">:B2))
4 - access("BASE2"."ID_SCHED_TASK">:B1 AND
"BASE2"."ID_SCHED_TASK"<:B2+2)
Note
- rule based optimizer used (consider using cbo)
Statistics
0 recursive calls
0 db block gets
101509 consistent gets
0 physical reads
0 redo size
519 bytes sent via SQL*Net to client
524 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
1 rows processed
This is the query and "autorace on" log using OPTIMIZER_MODE=ALL_ROWA on Oracle 11g:
Elapsed: 00:03:14.78
Execution Plan
Plan hash value: 3937517195
| Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 1 | 12 | | 317 (2)| 00:00:04 |
| 1 | SORT AGGREGATE | | 1 | 12 | | | |
| 2 | MERGE JOIN ANTI | | 495 | 5940 | | 317 (2)| 00:00:04 |
| 3 | INDEX FULL SCAN | PK0004111303310 | 49487 | 289K| | 119 (1)| 00:00:02 |
|* 4 | FILTER | | | | | | |
|* 5 | SORT JOIN | | 49487 | 289K| 1176K| 198 (3)| 00:00:03 |
| 6 | INDEX FAST FULL SCAN| PK0004111303310 | 49487 | 289K| | 33 (0)| 00:00:01 |
Predicate Information (identified by operation id):
4 - filter("BASE2"."ID_SCHED_TASK"<"BASE"."ID_SCHED_TASK"+2)
5 - access("BASE2"."ID_SCHED_TASK">"BASE"."ID_SCHED_TASK")
filter("BASE2"."ID_SCHED_TASK">"BASE"."ID_SCHED_TASK")
Statistics
0 recursive calls
0 db block gets
242 consistent gets
0 physical reads
0 redo size
519 bytes sent via SQL*Net to client
524 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
1 sorts (memory)
0 sorts (disk)
1 rows processed
3* This is an example query, the problem persist in other bigger queries.
Thanks for you help -
Oracle 11g/R2 Query Result Cache - Incremental Update
Hi,
In Oracle 11g/R2, I created replica of HR.Employees table & executed the following statement (+Although using SUM() function is non-logical in this case, but just testifying the result+)
STEP - 1
SELECT /+ RESULT_CACHE */ employee_id, first_name, last_name, SUM(salary)*
FROM HR.Employees_copy
WHERE department_id = 20
GROUP BY employee_id, first_name, last_name;
EMPLOYEE_ID FIRST_NAME LAST_NAME SUM(SALARY)
202 Pat Fay 6000
201 Michael Hartstein 13000
Elapsed: 00:00:00.01
Execution Plan
Plan hash value: 3837552314
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 2 | 130 | 4 (25)| 00:00:01 |
| 1 | RESULT CACHE | 3acbj133x8qkq8f8m7zm0br3mu | | | | |
| 2 | HASH GROUP BY | | 2 | 130 | 4 (25)| 00:00:01 |
|* 3 | TABLE ACCESS FULL | EMPLOYEES_COPY | 2 | 130 | 3 (0)| 00:00:01 |
-------------------------------------------------------------------------------------------------- Statistics
0 recursive calls
0 db block gets
0 consistent gets
0 physical reads
0 redo size
*690* bytes sent via SQL*Net to client
416 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
2 rows processed
STEP - 2
INSERT INTO HR.employees_copy
VALUES(200, 'Dummy', 'User','[email protected]',NULL, sysdate, 'MANAGER',5000, NULL,NULL,20);
STEP - 3
SELECT /*+ RESULT_CACHE */ employee_id, first_name, last_name, SUM(salary)
FROM HR.Employees_copy
WHERE department_id = 20
GROUP BY employee_id, first_name, last_name;
EMPLOYEE_ID FIRST_NAME LAST_NAME SUM(SALARY)
202 Pat Fay 6000
201 Michael Hartstein 13000
200 Dummy User 5000
Elapsed: 00:00:00.03
Execution Plan
Plan hash value: 3837552314
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 3 | 195 | 4 (25)| 00:00:01 |
| 1 | RESULT CACHE | 3acbj133x8qkq8f8m7zm0br3mu | | | | |
| 2 | HASH GROUP BY | | 3 | 195 | 4 (25)| 00:00:01 |
|* 3 | TABLE ACCESS FULL| EMPLOYEES_COPY | 3 | 195 | 3 (0)| 00:00:01 |
Statistics
0 recursive calls
0 db block gets
4 consistent gets
0 physical reads
0 redo size
*714* bytes sent via SQL*Net to client
416 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
3 rows processed
In the execution plan of STEP-3, against ID-1 the operation RESULT CACHE is shown which shows the result has been retrieved directly from Result cache. Does this mean that Oracle Server has Incrementally Retrieved the resultset?
Because, before the execution of STEP-2, the cache contained only 2 records. Then 1 record was inserted but after STEP-3, a total of 3 records was returned from cache. Does this mean that newly inserted row is retrieved from database and merged to the cached result of STEP-1?
If Oracle server has incrementally retrieved and merged newly inserted record, what mechanism is being used by the Oracle to do so?
Regards,
Wasif
Edited by: 965300 on Oct 15, 2012 12:25 AM965300 wrote:
Hi,
In Oracle 11g/R2, I created replica of HR.Employees table & executed the following statement (+Although using SUM() function is non-logical in this case, but just testifying the result+)
STEP - 1
SELECT /+ RESULT_CACHE */ employee_id, first_name, last_name, SUM(salary)*
FROM HR.Employees_copy
WHERE department_id = 20
GROUP BY employee_id, first_name, last_name;
EMPLOYEE_ID FIRST_NAME LAST_NAME SUM(SALARY)
202 Pat Fay 6000
201 Michael Hartstein 13000
Elapsed: 00:00:00.01
Execution Plan
Plan hash value: 3837552314
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 2 | 130 | 4 (25)| 00:00:01 |
| 1 | RESULT CACHE | 3acbj133x8qkq8f8m7zm0br3mu | | | | |
| 2 | HASH GROUP BY | | 2 | 130 | 4 (25)| 00:00:01 |
|* 3 | TABLE ACCESS FULL | EMPLOYEES_COPY | 2 | 130 | 3 (0)| 00:00:01 |
-------------------------------------------------------------------------------------------------- Statistics
0 recursive calls
0 db block gets
0 consistent gets
0 physical reads
0 redo size
*690* bytes sent via SQL*Net to client
416 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
2 rows processed
STEP - 2
INSERT INTO HR.employees_copy
VALUES(200, 'Dummy', 'User','[email protected]',NULL, sysdate, 'MANAGER',5000, NULL,NULL,20);
STEP - 3
SELECT /*+ RESULT_CACHE */ employee_id, first_name, last_name, SUM(salary)
FROM HR.Employees_copy
WHERE department_id = 20
GROUP BY employee_id, first_name, last_name;
EMPLOYEE_ID FIRST_NAME LAST_NAME SUM(SALARY)
202 Pat Fay 6000
201 Michael Hartstein 13000
200 Dummy User 5000
Elapsed: 00:00:00.03
Execution Plan
Plan hash value: 3837552314
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
| 0 | SELECT STATEMENT | | 3 | 195 | 4 (25)| 00:00:01 |
| 1 | RESULT CACHE | 3acbj133x8qkq8f8m7zm0br3mu | | | | |
| 2 | HASH GROUP BY | | 3 | 195 | 4 (25)| 00:00:01 |
|* 3 | TABLE ACCESS FULL| EMPLOYEES_COPY | 3 | 195 | 3 (0)| 00:00:01 |
Statistics
0 recursive calls
0 db block gets
4 consistent gets
0 physical reads
0 redo size
*714* bytes sent via SQL*Net to client
416 bytes received via SQL*Net from client
2 SQL*Net roundtrips to/from client
0 sorts (memory)
0 sorts (disk)
3 rows processed
In the execution plan of STEP-3, against ID-1 the operation RESULT CACHE is shown which shows the result has been retrieved directly from Result cache. Does this mean that Oracle Server has Incrementally Retrieved the resultset?
Because, before the execution of STEP-2, the cache contained only 2 records. Then 1 record was inserted but after STEP-3, a total of 3 records was returned from cache. Does this mean that newly inserted row is retrieved from database and merged to the cached result of STEP-1?
If Oracle server has incrementally retrieved and merged newly inserted record, what mechanism is being used by the Oracle to do so?
Regards,
Wasif
Edited by: 965300 on Oct 15, 2012 12:25 AMNo, the RESULT CACHE operation doesn't necessarily mean that the results are retrieved from there. It could be being
written to there.
Look at the number of consistent gets: it's zero in the first step (I assume you had already run this query before) and I would
conclude that the data is being read from the result cache.
In the third step there are 4 consistent gets. I would conclude that the data is being written to the result cache, a fourth step repeating
the SQL should show zero consistent gets and that would be the results being read. -
Oracle 11g Table function returns no records on first call
Hello,
On a Oracle 11g R2 I've a table function ( PIPELINED ) returning rows selected from a table.
The first time the function is selected, in a session ( I've tried to disconnect and log in again ), it returns no rows.
I've tried to log the call using DBMS_OUTPUT and from what I see the select on the table function returns no rows and no output is printed. So I presume Oracle is not calling the function.
The same function on a similar environment ( same db versions, patches and database structure ) works fine. The second environment is a production environment so it has more memory and some other settings enabled.
Does anyone know of settings that can relate to this behaviour ?
Thanks in advance for the help.
Regards,
Stefano MuretThank you for answering so fast.
Here's the function code:
FUNCTION template_parameters (iTemplate IN TEMPLATE_RAW_DATA.TMPL_ID%TYPE := NULL)
RETURN table_type_tmpl_parameters PIPELINED
IS
li_exception INTEGER DEFAULT -20025;
POUT_PARM TABLE_TYPE_TMPL_PARAMETERS;
lt_parms table_type_tmpl_parms_raw;
sParmCheck VARCHAR2(4000);
iOccurrence INTEGER;
BEGIN
pOut_Parm := table_type_tmpl_parameters();
pOut_Parm.EXTEND;
select
tmpl_id
*,tmpl_name*
*,replace(upper(trim(sql_out)),'[SCHEMA].')*
*,UPPER(TRIM(out_tmpl_parms))*
bulk collect into lt_parms
from ref_templates
where tmpl_id = NVL(iTemplate,tmpl_id)
order by tmpl_id;
FOR k IN 1..lt_parms.COUNT
LOOP
pOut_Parm(1).tmpl_id := lt_parms(k).tmpl_id;
pOut_Parm(1).tmpl_name := lt_parms(k).tmpl_name;
FOR i IN 1..2
LOOP
IF i = 1 THEN
sParmCheck := lt_parms(k).sql_out;
ELSE
sParmCheck := lt_parms(k).sql_parms;
END IF;
iOccurrence := 1;
*pOut_Parm(1).parameter_name := regexp_substr(sParmCheck,'\[[^\[]+\]',1,iOccurrence);*
WHILE pOut_Parm(1).parameter_name IS NOT NULL
LOOP
PIPE ROW (pOut_Parm(1));
iOccurrence := iOccurrence + 1;
*pOut_Parm(1).parameter_name := regexp_substr(sParmCheck,'\[[^\[]+\]',1,iOccurrence);*
END LOOP;
END LOOP;
END LOOP;
RETURN;
EXCEPTION
WHEN OTHERS THEN
RAISE_APPLICATION_ERROR(li_exception,SUBSTR(SQLERRM,1,1000));
RETURN;
END template_parameters;
This function is part of a package.
The data on both environments is the same. -
Object Invalidation in Oracle 11g R2
Hi All,
I found a distinct behaviour in oracle 11gR2 which is not even available in previous releases . Let me explain with an example.
--creating a small table
create table TEMPSAMPLE (COL1 VARCHAR2(10),COL2 VARCHAR2(10),COL3 VARCHAR2(15),COL4 VARCHAR2(15));
-- Now Creating an Primary key index for table TEMPSAMPLE
ALTER TABLE TEMPSAMPLE ADD CONSTRAINT PKTEMPSAMPLE PRIMARY KEY (COL1,COL2);
---CREATING A VIEW ON THE ABOVE TABLE
CREATE OR REPLACE VIEW VWTEMPSAMPLE AS
SELECT * FROM TEMPSAMPLE;
-- CREATING A PACKAGE WHICH USES TEMPSAMPLE AND VWTEMPSAMPLE OBJECTS.
CREATE OR REPLACE PACKAGE PKGSAMP AS
VAL1 TEMPSAMPLE.COL1%TYPE;
VAL2 CONSTANT TEMPSAMPLE.COL1%TYPE:='11';
PROCEDURE VERIFYSAMP(INVAL IN NUMBER);
END PKGSAMP;
CREATE OR REPLACE PACKAGE BODY PKGSAMP IS
PROCEDURE VERIFYSAMP(INVAL IN NUMBER)
AS
VAL1 TEMPSAMPLE.COL1%TYPE;
VAL2 CONSTANT TEMPSAMPLE.COL1%TYPE:='11';
BEGIN
VAL1:='RAVI';
FOR RC IN (SELECT * FROM VWTEMPSAMPLE)
LOOP
DBMS_OUTPUT.PUT_LINE('COL1 '||RC.COL1);
DBMS_OUTPUT.PUT_LINE('COL2 '||RC.COL2);
DBMS_OUTPUT.PUT_LINE('COL3 '||RC.COL3);
END LOOP;
INSERT INTO TEMPSAMPLE VALUES('REC05','RAVI','EEE','CK');
DELETE FROM TEMPSAMPLE WHERE COL1='RECO1';
UPDATE TEMPSAMPLE SET COL4='CKR' WHERE COL1='RECO2';
DBMS_OUTPUT.PUT_LINE('VALUE IS '||INVAL);
DBMS_OUTPUT.PUT_LINE('VALUE IS '||VAL1);
END VERIFYSAMP;
END PKGSAMP;
--CREATING A PACKAGE PKGSAMP2 WHICH USES TEMPSAMPLE TABLE ITSELF
CREATE OR REPLACE PACKAGE PKGSAMP2 AS
VAL1 TEMPSAMPLE.COL1%TYPE;
VAL2 CONSTANT TEMPSAMPLE.COL1%TYPE:='11';
PROCEDURE VERIFYSAMP(INVAL IN NUMBER);
END PKGSAMP2;
CREATE OR REPLACE PACKAGE BODY PKGSAMP2 IS
PROCEDURE VERIFYSAMP(INVAL IN NUMBER)
AS
VAL1 TEMPSAMPLE.COL1%TYPE;
VAL2 CONSTANT TEMPSAMPLE.COL1%TYPE:='11';
BEGIN
VAL1:='RAVI';
FOR RC IN (SELECT * FROM TEMPSAMPLE)
LOOP
DBMS_OUTPUT.PUT_LINE('COL1 '||RC.COL1);
DBMS_OUTPUT.PUT_LINE('COL2 '||RC.COL2);
DBMS_OUTPUT.PUT_LINE('COL3 '||RC.COL3);
END LOOP;
INSERT INTO TEMPSAMPLE VALUES('REC05','RAVI','EEE','CK');
DELETE FROM TEMPSAMPLE WHERE COL1='RECO1';
UPDATE TEMPSAMPLE SET COL4='CKR' WHERE COL1='RECO2';
DBMS_OUTPUT.PUT_LINE('VALUE IS '||INVAL);
DBMS_OUTPUT.PUT_LINE('VALUE IS '||VAL1);
END VERIFYSAMP;
END PKGSAMP2;
-- OBJECT STATUS OF PACKAGES
SELECT OBJECT_NAME,OBJECT_TYPE,STATUS FROM USER_OBJECTS WHERE OBJECT_NAME IN ('PKGSAMP','PKGSAMP2','VWTEMPSAMPLE');
OBJECT_NAME OBJECT_TYPE STATUS*
VWTEMPSAMPLE VIEW VALID
PKGSAMP2 PACKAGE BODY VALID
PKGSAMP2 PACKAGE VALID
PKGSAMP PACKAGE BODY VALID
PKGSAMP PACKAGE VALID
Alter table TEMPSAMPLE DISABLE constraint PKTEMPSAMPLE KEEP INDEX;
DROP INDEX PKTEMPSAMPLE;
--OBJECT STATUS OF PACKAGES AFTER DROPPING INDEX
SELECT OBJECT_NAME,OBJECT_TYPE,STATUS FROM USER_OBJECTS WHERE OBJECT_NAME IN ('PKGSAMP','PKGSAMP2','VWTEMPSAMPLE');
OBJECT_NAME OBJECT_TYPE STATUS*
VWTEMPSAMPLE VIEW INVALID
PKGSAMP2 PACKAGE BODY VALID
PKGSAMP2 PACKAGE VALID
PKGSAMP PACKAGE BODY INVALID
PKGSAMP PACKAGE VALID
Alter table TEMPSAMPLE ENABLE constraint PKTEMPSAMPLE;
As per the above process, if we observe that drop of index on a table arel lead to invalidation of view which* depends on that table and all the objects which uses this view will also get invalidated.*
The above invalidation is being occurred only in Oracle 11g R2, due to which we are facing the issue in our application.
We got a procedure where we disable a constraint , drop a index and process the insertion/updation into the tables. After successfull insertion/updation, at finally we are enabling the constraint.
This worked fine with previous releases of oracle 11g R2 , where as we recently migrated to 10g R2 which was leading to invalidation of all packages which uses the view , and in the application which uses previous db sessions are unable to access the invalidated package and raising an exception.
Please provide the solution if any possibleI tested the behavior in 10.2.0.4 and 11.2.0.3
In 10.2.0.4, The view was valid if we disabled the constraint using the keep index option but it became invalid after dropping the index. SO i guess you are making them as unusable and rebuilding them after data load.
in 11.2.0.3, The view became invalid as soon as we disabled the constraint using the keep index option. -
Cannot post SD documents after upgrade to Oracle 11g
Dear Gurus,
Lately I have tried to upgrade database for SAP R/3 Enterprise 4.7 from Oracle 9i (9.2.0.7) to Oracle 11g (11.2.0.2). I have tried some of its features including table and index compression.
Right now my team is testing my server and find out some weird behaviour on its database. They try to create some sales order (VA01) and this action create SD document number. But when we try to check this created document number, SAP server replied weird message. It said that this SD document number is not on database and may have been archived.
When I check on ST22, it said "ORA-01502: index 'SAPWPR.VBAP~0' or partition of such index is in unusable state".
FYI, this index has been rebuild and compressed before.
I have tried to rebuild this index successfully, but still not help. I also have checked its status from SE11 and I cannot find this index on VBPA table.
Any suggestion ?
Ardhian
http://sapbasis.wordpress.comHi Orkun,
This is the log when I try from SE14 :
B-INDXVBPA0
Start background processing for object VBPA (INDX)
Request: Delete and recreate Index VBPA-0 (ADMIN/10.10.11/12:49)
Process: emaprd2ap_5
sql:
DROP INDEX "VBPA~0"
ORA-02429: cannot drop index used for enforcement of unique/primary ke
y
DDL time(___1): ...228.626 milliseconds
VBPA~0 could not be removed
Index VBPA-0 could not be deleted
Request for VBPA could not be executed
ardhian -
Error on .bash_profile _ oracle 11g preparing to install
Dears,
I am preparing to install grid oracle 11g , In the envirment varaible on the oracle user on the .bash_profile I got the below error, please help me to solve it :
ERROR:
./.bash_profile
': not a valid identifier export: `TMPDIR
: command not foundne 19:
': not a valid identifier export: `ORACLE_HOSTNAME
': not a valid identifier export: `ORACLE_UNQNAME
': not a valid identifier export: `ORACLE_BASE
': not a valid identifier export: `GRID_HOME
': not a valid identifier export: `DB_HOME
': not a valid identifier export: `ORACLE_HOME
': not a valid identifier export: `ORACLE_SID
': not a valid identifier export: `ORACLE_TERM
': not a valid identifier export: `BASE_PATH
': not a valid identifier export: `PATH
: command not foundne 30:
': not a valid identifier export: `LD_LIBRARY_PATH
: command not foundne 33:
./.bash_profile: line 46: syntax error: unexpected end of file
The file .bash_profile :
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
# Oracle Settings
TMP=/tmp
export TMP
TMPDIR=$TMP
export TMPDIR
ORACLE_HOSTNAME=ol6-112-rac1.localdomain; export ORACLE_HOSTNAME
ORACLE_UNQNAME=RAC; export ORACLE_UNQNAME
ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE
GRID_HOME=/u01/app/11.2/grid; export GRID_HOME
DB_HOME=$ORACLE_BASE/product/11.2/db_1; export DB_HOME
ORACLE_HOME=$DB_HOME; export ORACLE_HOME
ORACLE_SID=RAC1; export ORACLE_SID
ORACLE_TERM=xterm; export ORACLE_TERM
BASE_PATH=/usr/sbin:$PATH; export BASE_PATH
PATH=$ORACLE_HOME/bin:$BASE_PATH; export PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib; export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib; export CLASSPATH
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
alias grid_env='. /home/oracle/grid_env'
alias db_env='. /home/oracle/db_env'
Note: I check all directories and all are correct and availabe on the server ( oracle linux server 6.3).
Appretiate your help .
Regards
Salmanenv|sort :
CLASSPATH=/u01/app/oracle/product/11.2/db_1/JRE:/u01/app/oracle/product/11.2/db_1/jlib:/u01/app/oracle/product/11.2/db_1/rdbms/jlib
COLORTERM=gnome-terminal
CVS_RSH=ssh
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-c4FSmIcAqV,guid=60fd11073a66582b07812e990000005f
DESKTOP_SESSION=gnome
DISPLAY=:0.0
G_BROKEN_FILENAMES=1
GDM_KEYBOARD_LAYOUT=us
GDM_LANG=en_US.UTF-8
GDMSESSION=gnome
GNOME_DESKTOP_SESSION_ID=this-is-deprecated
GNOME_KEYRING_PID=2231
GNOME_KEYRING_SOCKET=/tmp/keyring-Dgx3GS/socket
GTK_RC_FILES=/etc/gtk/gtkrc:/home/oracle/.gtkrc-1.2-gnome2
HISTCONTROL=ignoredups
HISTSIZE=1000
HOME=/home/oracle
HOSTNAME=ol6-112-rac1.localdomain
LANG=en_US.UTF-8
LESSOPEN=|/usr/bin/lesspipe.sh %s
LOGNAME=oracle
LS_COLORS=rs=0:di=0.... (long words )
MAIL=/var/spool/mail/oracle
ORBIT_SOCKETDIR=/tmp/orbit-oracle
PATH=/u01/app/oracle/product/11.2/db_1/bin:/usr/sbin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin
PWD=/home/oracle/Desktop
QTDIR=/usr/lib64/qt-3.3
QTINC=/usr/lib64/qt-3.3/include
QTLIB=/usr/lib64/qt-3.3/lib
SESSION_MANAGER=local/unix:@/tmp/.ICE-unix/2241,unix/unix:/tmp/.ICE-unix/2241
SHELL=/bin/bash
SHLVL=2
SSH_ASKPASS=/usr/libexec/openssh/gnome-ssh-askpass
SSH_AUTH_SOCK=/tmp/keyring-Dgx3GS/socket.ssh
TERM=xterm
TMP=/tmp
USERNAME=oracle
USER=oracle
_=/usr/bin/env
WINDOWID=48234500
WINDOWPATH=1
XAUTHORITY=/var/run/gdm/auth-for-oracle-Se0hQ1/database
XDG_SESSION_COOKIE=06a46f0a02fd92da98077e5a00000088-1360773632.745291-1559061973 -
ORACLE 11g + PHP5 problem: "fetch out of sequence" on i5/OS AS/400
Hi!
I have a big problem using a database connection to i5 AS/400 with PHP5 OCI8 interface by Oracle 11g:
when doing a simple "select * from (as400_database_link)" I get this return: "fetch out of sequence... preceding line..."
I never had this problem with 9i, old transparent gateway.
BUT:
when doing for example a "select * from (as400_database_link) where rownum < 1000000" it works fine without problems.
Anyone an idea how to eliminate this stupid "where rownum < 100000" behaviour?
I would have to add this in many select statements... ;(
bye,
OliverTach,
how do you call oci_execute ?
try oci_execute($query,OCI_DEFAULT);
I had the same problem with adodb
$q = " select * from elephant@africa";
$db->GetAll($q);
Failed with the same error.
ADODB called oci_execute with OCI_COMMIT_ON_SUCCESS,which caused my error.
$q = " select * from elephant@africa";
$db->BeginTrans();
$db->GetAll($q);
$db->CommitTrans(); (or rollback);
did the job,because BeginTrans changed oci_execute to run with OCI_DEFAULT.
Hope this helps,
gw
Edited by: unficyp123 on Oct 20, 2008 2:51 PM -
hi oracle community,
i've installed the new oracle 11g on rhel5 enterprise linux. i put all necessary packages in place and set all needed kernel parameters as documented.
the installation worked fine, and the OUI created a starter database for me.
listener is configured and started. so everything is pretty good working and
i started to play around with it. to get sqlplus working i had to turn off SELinux
completely.
now the problem: after a few hours of running smoothly, the box is no longer responsive. it seems the whole OS is going to freeze. all my ssh shells did no longer respond. SQL-queries did not respond any longer.
the only thing i can do then is to hard reset the box and reboot. there is nothing of interest in /var/log/messages afterwards. btw. oracle db recovers with no errors from this outage and comes back immediatly. :-)
one more thing to mention: if i reboot into rhel5 without starting oracle 11g database the box runs for days without having the problem.
anyone with an idea about this behaviour? many thanks in advance.
manisanI am REALLY surprised that Oracle Linux installation does not have at least an option for each of the Oracle RDBMS major versions. It should be as easy as download Oracle Linux distribution, select install "Linux for Oracle 11g" and "Linux for Oracle 10g". The installation completes, then install the Oracle RDBMS and OEM software, no fuss, no muss.
-
Oracle 11g client: TNS-illegal ADDRESS parameter
Hi,
I am working on a database application. The application uses OCI interface to connect and query to the Oracle Database
The application used to work with Oracle 10g client, but using Oracle 11gR1 or 11gR2 client application is failing to connecto the Database
The sqlnet.log on client machine is showing following error
Fatal NI connect error 12533, connecting to:
(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vm-oedsdev1)(PORT=1521))(CONNECT_DATA
=(SERVICE_NAME=orcl)(CID=(PROGRAM=_orasrv@bespin)(HOST=bespin)(USER=sgarg))))
VERSION INFORMATION:
TNS for Solaris: Version 11.1.0.6.0 - Production
TCP/IP NT Protocol Adapter for Solaris: Version 11.1.0.6.0 - Production
Time: 07-JUL-2011 05:48:50
Tracing to file: /scratch/sgarg/wrk/bug/OE00175173/oe102b/64bit/trace/cli_8585
.trc
Tns error struct:
ns main err code: 12533
TNS-12533: TNS:illegal ADDRESS parameters
ns secondary err code: 0
nt main err code: 0
nt secondary err code: 0
nt OS err code: 0
Following is my test environment
Platform and OS - Solaris 2.9 SPARC V9
Oracle client version - 11.1.0.6.0
Oracle Server version - 11.1.0.6.0
On Database server which is running on 64 bit Windows, listener log and listener trace have following error logs
listenr.log:
TNS-12502: TNS:listener received no CONNECT_DATA from client.
Following is the header of the listener.log file
TNSLSNR for 64-bit Windows: Version 11.1.0.6.0 - Production on 07-JUL-2011 09:04:56
listener.trc:
The corresponding listner trace has following trace entry
[07-JUL-2011 11:51:51:668] ntt2err: Read unexpected EOF ERROR on 460
The Oracle client (version 11.1.0.6.0) is running on Solrias 64 bit machine.
Please help me understanding why are these errors appearing with Oracle 11g client.
Regards,
SachinHi,
Thanks for your reply, but your assumption is incorrect that I did not read the error message in the documentation. I read it many times, but could not correlate it with any wrongdoing.
solaris64:102b$ oerr TNS 12533
12533, 00000, "TNS:illegal ADDRESS parameters"
// *Cause: An illegal set of protocol adapter parameters was specified. In
// some cases, this error is returned when a connection cannot be made to the
// protocol transport.
// *Action: Verify that the destination can be reached using the specified
// protocol. Check the parameters within the ADDRESS section of
// TNSNAMES.ORA. Legal ADDRESS parameter formats may be found in the
// Oracle operating system specific documentation for your platform.
// Protocols that resolve names at the transport layer (such as DECnet object
// names) are vulnerable to this error if not properly configured or names are
// misspelled.
The above says that, illegal set of protocol adapters was specified...., I am using 'Local Naming (tnsnames.ora)' connection method and using TCP/IP protocol.
Following are the tnsnames.ora content
solaris64:102b$ cat tnsnames.ora
oeora11g1 =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = vm-oedsdev1)(PORT = 1521))
(CONNECT_DATA =
(service_name = orcl)
and the following are the sqlnet.ora content
solaris64:102b$ cat sqlnet.ora
# sqlnet.ora Network Configuration File: /gateways/solaris64/oracle/client/10.2/network/admin/sqlnet.ora
# Generated by Oracle configuration tools.
NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES)
DIAG_ADR_ENABLED=NO
trace_level_client=SUPPORT
trace_directory_client=/scratch/sgarg/wrk/bug/OE00175173/oe102b/64bit/trace
My bad that the information was not enough to comment on anything on the problem.
I think, the above info would be helpful
Thanks,
Sachin
Maybe you are looking for
-
Error while configuring QT--can't capture in FCP HD
I keep getting a message saying "Error occured while configuring QT using the current capture presets, please close FCP and check your hardware configuraton" when I try to capture. All settings are consistent with video output device. I'm upconvertin
-
Change in Purchase Order Release Strategy Values
Dear All, I am in process of changing Purchase Order release strategy values. I have following release strategy - Current Value (Proposed Value) Level 1 - Upto INR 0.1 Mn (Proposed value -
-
MSI NX6200AX-TD256H S-Video output only
I have bought MSI NX6200AX-TD256H card. I wasn't able to switch it to the composite video TV out mode, as I was used to in previous models ( the driver offers just S-Video, Automatic and Component modes). So does this card really lack the composite v
-
Is it ok to charge an itouch using an ipad charger
Is it ok to charge an itouch (3G or 4G) using an (official) ipad charger. It says yes in the instructions but the itouch gets really hot
-
Zen Touch Headphone Jack issue
I am getting the 20gb Zen touch. Ive been hearing post after post about the headphone jack problem on the Zen Xtra's..Has this problem been fixed FOR SURE on the touch models? Anyone have any problems? Thanks!