ORACLE 11g R1 Email Alerts

Hi
I would like to send sql staments result set in a email to mutiple recepients. Result can be in body of email /xls attachment. is there any pl.sql scripts available to perform same in oracle 11g r1.
Thanks
Raj

http://docs.oracle.com/cd/B28359_01/appdev.111/b28419/u_smtp.htm
Examples
The following example illustrates how UTL_SMTP is used by an application to send e-mail. The application connects to an SMTP server at port 25 and sends a simple text message.
DECLARE
  c UTL_SMTP.CONNECTION;
  PROCEDURE send_header(name IN VARCHAR2, header IN VARCHAR2) AS
  BEGIN
    UTL_SMTP.WRITE_DATA(c, name || ': ' || header || UTL_TCP.CRLF);
  END;
BEGIN
  c := UTL_SMTP.OPEN_CONNECTION('smtp-server.acme.com');
  UTL_SMTP.HELO(c, 'foo.com');
  UTL_SMTP.MAIL(c, '[email protected]');
  UTL_SMTP.RCPT(c, '[email protected]');
  UTL_SMTP.OPEN_DATA(c);
  send_header('From',    '"Sender" <[email protected]>');
  send_header('To',      '"Recipient" <[email protected]>');
  send_header('Subject', 'Hello');
  UTL_SMTP.WRITE_DATA(c, UTL_TCP.CRLF || 'Hello, world!');
  UTL_SMTP.CLOSE_DATA(c);
  UTL_SMTP.QUIT(c);
EXCEPTION
  WHEN utl_smtp.transient_error OR utl_smtp.permanent_error THEN
    BEGIN
      UTL_SMTP.QUIT(c);
    EXCEPTION
      WHEN UTL_SMTP.TRANSIENT_ERROR OR UTL_SMTP.PERMANENT_ERROR THEN
        NULL; -- When the SMTP server is down or unavailable, we don't have
              -- a connection to the server. The QUIT call will raise an
              -- exception that we can ignore.
    END;
    raise_application_error(-20000,
      'Failed to send mail due to the following error: ' || sqlerrm);
END;

Similar Messages

  • Cloud Control 12c monitoring Oracle 11g Standard Edition alert.log

    Hi guys.
    I just installed Cloud Control 12c3 and added my cluster database, I have readed many papers, tech docs and tech discuss and now i have a huge confussion about packs, licensing and other fruits. Please help...
    I have four Oracle 11g databases (differents hosts) Standard Edition, and i want monitoring and notificate alert.log errors. For example, if alert.log says "ORA-01438, blablabla" i want a email notification. 
    I read about packs, and says that "diagnostic pack" is needed for alert.log monitoring in Cloud Control 12c. But my version database is Standard Edition without packs, so I CAN'T MONITORING ALERT LOG!!!.
    Question:
      Do I really need Diagnostic Pack for monitoring alert.log with Cloud Control?
      If Diagnostinc Pack is not necessary, how can i monitoring alert.log?
    Thanks

    I do not think you require any pack for alert.log content monitoring but you might need to check with Oracle rep. I am saying so because if you go to the "Alert log content" page and click on management pack for this page, Grid will display a message that this page does not require any pack.
    Go to the Alert log content by "oracle database -> logs -> alert log contents"
    then
    go to SETUP -> management packs -> packs for this page
    You will see the message will be displayed " this pages does not require any pack"
    Can you also provide the doc where it says that this pae needs diagnostic pack?

  • ACL error when sending email from Oracle 11g

    Hi,
    It returned something like "error...ACL security" when I tried to send email from Oracle 11g. Is there any security thing that I need to release in Oracle 11g? I used to send emails from Oracle 10g and didn't find any problem.
    Thanks.
    Andy

    In Database 11g Oracle introduced Network Access Control Lists (ACLs) to protect the database from users using the many internet-capable packages such as UTL_INADDR, UTL_HTTP, UTL_TCP, etc.
    Read all about it in the docs and look at the code demos here:
    http://www.morganslibrary.org/library.html
    under DBMS_NETWORK_ACL_...

  • Starting BPEL when email received - Oracle 11g

    I'm trying to start a BPEL Process with the reception of an email.
    - I'm working with Oracle 11g
    - Usermessagingserver is installed and configured to the correct server and it's working, at least it shows received emails and it's able to send emails from a BPEL process
    In the BPEL that has been done to start with the reception of an email I have the following:
    <partnerLink myRole="Consume_Message_role" name="Inbound" partnerLinkType="ns1:Consume_Message_plt"/>
    Inbound_jms.jca has the following configuration:
    <adapter-config name="Inbound" adapter="Jms Adapter" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
    <connection-factory location="eis/wls/Queue" UIConnectionName="soa-server" UIJmsProvider="WLSJMS" adapterRef=""/>
    <endpoint-activation portType="Consume_Message_ptt" operation="Consume_Message">
    <activation-spec className="oracle.tip.adapter.jms.inbound.JmsConsumeActivationSpec">
    <property name="DestinationName" value="OraSDPM/Queues/OraSDPMEngineRcvQ1"/>
    <property name="UseMessageListener" value="true"/>
    <property name="PayloadType" value="BytesMessage"/>
    </activation-spec>
    </endpoint-activation>
    </adapter-config>
    When usermessagingserver receives an email message, the BPEL doesn’t start and I get this message in the log:
    PM oracle.sdpinternal.messaging.EngineReceivingCoreBean processMessageCommon
    WARNING: There is no application that has registered this address as an access point. Message will not be delivered.
    I have no idea how to configure an access point, I've only found how to De-register from Messaging Client Applications in the usermessagingserver.
    Found this documentation about registering access points, from an sample application of usermessaingserver in [http://download.oracle.com/docs/cd/E12839_01/doc.1111/e13807/ns_java_api.htm|http://download.oracle.com/docs/cd/E12839_01/doc.1111/e13807/ns_java_api.htm]
    but I cannot find where to download the example from the documentation.
    Any help appreciated.

    Does anyone has some input on this issue?
    I want to do the same thing, but I don't know how to...
    Thanks

  • Sending email from apex 4.0 with oracle 11g ee

    Hi,
    I the past when working with apex 3 I was able to work with apex mailsend very nice.
    In apex 4.0 with oracle 11g ee I'm not able to send emails anymore.
    Last error message in the queue is:
    ORA-29279: SMTP permanent error: 550 through this server without authentication.
    the smtp server has not been changed, the code is fine
    How I can go further?
    Many thanks,
    Florin

    This is a different subject:
    Apex Reports and links to external content
    What you are asking should be possible.
    Risk: everyone who uses the link needs to have the same drive mapping if you are using letters on a Windows PC. As long as that is not a usability issue, you are fine.
    I would recommend you review the LINK syntax in the report column.
    Your text seems like you have already attempted this.
    >
    Click Here , i.e. href="file:///E:/Echo Destination/1212040003.docx"
    . . . . . . . from XYZ
    Here I am unable to open this document via click on this column link on report............
    Thanks..To confirm the link syntax you want first, Write a simple HTML file with the link to make sure you have the correct quoting and the link content is correct.
    What does the REPORT resulting HTML look like when you examine it on the page?
    I would expect something like:
    <a href=file:///E:/Echo Destination/1212040003.docx> go to file </a>If the result is different, then we can discuss why it isn't what you are expecting.
    --Tim St.
    http://enkitec.com

  • Configuring email alerts in Ops Center

    Hi all,
    I have been struggling quite a while to get email alerts working from Ops Center with no success in 11g nor 12c. In the Ops Center GUI, Administration -> EC -> Local Users -> configured user to receive all alerts and emails. I have also configured email relay host correctly(checked a million times).
    Sending emails from the host through the email relay works fine, so I'm baffled.
    #mailx -s " Test from Ops Center" "my.email@work" < text-file
    Do I need to configure something else in Ops Center or what am I missing here?

    The email alerts from Ops Center are working for me, I performed...
    1.) You must be able to send email from the command line on the Enterprise Controller to the intended email address, ie;
    # mailx -v [email protected]
    Subject: Email test from Enterprise Controller
    EOT
    <control-d>
    That test must be successful, and the email received!
    2.) Setup the Notification Profile in the BUI...
    Administration > Enterprise Controller > Users
    Highlight the root user, select Configure Notification Profile (the wrench icon)
    Notifications via >> Subscribe to All Notifications
    User Interface > "Problem updates and all Severities"
    Email: > "Problem updates and all Severities"
    Pager: None
    Notifications Delivery Details
    Email: [email protected]
    Pager Address: <blank>
    Mail Host: localhost
    Port: <blank>
    Mail User: root
    Mail Password: <enter the password for root on the EC>
    Connection Security: STARTTLS
    Select: Update Notification Profile
    3.) Go to Assets > Operating System (second level down) of some Asset
    In the center pane select the "Monitoring" tab
    Under "Threshold Monitoring Rules" highlight "Memory Usage Percentage"
    Edit Alert Monitoring Rule Parameters (the pencil)
    Monitor for alert limits continuously
    Toggle: Generate Alert after 1 Minute
    Change Critical MemoryUsage.usedMemoryPercentage > 2%
    Change Warning MemoryUsage.usedMemoryPercentage > 1%
    Apply
    Wait one minute, you should receive an email that resembles the following:
    Notification is generated by (90037): myserver
    ORACLE Enterprise Manager 11g Ops Center Reported Problem
    GlobalZone: myserver
    Problem ID: 425Detection Date: 02/24/2011 05:23:36 GMTSeverity:CriticalState:UnassignedOwner:-Assigned Date: -Problem Description:Memory Usage Percentage has reached 59.4122 on myserverOps Center Server: myserverProblem Link: Click on to be redirected to the reported problem
    https://myserverx:9443/emoc/?objectName=com.xxx.hss.domain%3Aname%3DNORM-myserver-XVM_SATELLITE%2Ctype%3DOperatingSystem&treeId=asset-tree&handler=alarms&alarmId=425Suggested Actions NumberSynopsisAssociated Operational Plan-None

  • Installation of Oracle 11g Release 2 on Windows Server 2008 R2

    Hi:
    When I tried to install 64-bit Oracle 11g Release 2 on a system running 64-bit Windows Server 2008 R2.
    One of the system pre-requisites failed with the following error message:
    Checking operating system requirements ...
    Expected result: One of 5.0,5.1,5.2,6.0
    Actual Result: 6.1
    Check complete. The overall result of this check is: Failed <<<<
    Problem: Oracle Database 11g is not certified on the current operating system.
    Recommendation: Make sure you are installing the software on the correct platform.
    I presume 6.0 is Windows 2008 Server and 6.1 should be Release 2.
    Does this mean that this version is not compatible with Server 2008 Release 2?
    venki
    Edited by: thevenkat on Jan 20, 2010 9:37 PM

    Hans Forbrich wrote:
    [email protected] wrote:
    Does anyone know when we can expect 11g R2 for Windows?No one outside of Oracle officially knows (and they are under NDA)
    No one inside Oracle is permitted to say, or pre-announce release dates for legal reasons.
    Which is why I gave you the link - so you could monitor for yourself.OK, thanks...
    I was just hoping there was an official release date and I just couldn't find it.
    Is there any information about features in 11gR2 for Windows available yet?
    Or can you maybe tell me if it will be possible to mount the new "database filesystem" like we can do on linux?
    I remember oracle did something similar with Oracle ifs (Internet File System) back in Oracle 9i. (or was it 8i?)
    Regards
    Thomas

  • Error while configuring Oracle 11g Forms/Reports Product during istallation

    Dears,
    We are trying to configuring Oracle 11g Forms / Reports during istallation.
    OS using: Win 7 -- 32 bit
    RAM: 4 GB
    We have installed the following modules successfully.
    Following are the steps which we have followed:
    1. Installation of Oracle jdk's --> Successful
    2. Installation of Oracle web Logic Product --> Successful
    3. Installation of Oracle Forms & reports Products ---> Successful
    4. Configuration of Oracle 11g Forms / Reports Products --> Failed
    After performing step 4, we are getting an error in the .out file
    Can anyone please let us know what we have to do for making the step 4 successful.
    Following is the content present in the "install2012-08-30_04-43-55PM.out" file..
    Setting ORACLE_HOME to C:\Oracle\Middleware\frs11.1.2
    Setting Doracle.config.mode to true
    Adding C:\Users\id821839\AppData\Local\Temp\OraInstall2012-08-30_04-43-55PM for deletion.
    Adding to classpath:file:/C:/Users/id821839/AppData/Local/Temp/OraInstall2012-08-30_04-43-55PM/ext/jlib/classic.jar
    Adding to classpath:file:/C:/Users/id821839/AppData/Local/Temp/OraInstall2012-08-30_04-43-55PM/ext/jlib/template.jar
    [email protected]lassicPage.ScreenRes
    configFileName:C:\Users\id821839\AppData\Local\Temp\OraInstall2012-08-30_04-43-55PM\ext\jlib\footprint.xml
    Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
    Reading response file..
    Parse Warning at line number:15
    MYORACLESUPPORT_USERNAME=
    Variables must be defined in a section in the format:VARIABLE_NAME=VALUE. No value found. Ignoring!
    Parse Warning at line number:27
    PROXY_HOST=
    Variables must be defined in a section in the format:VARIABLE_NAME=VALUE. No value found. Ignoring!
    Parse Warning at line number:30
    PROXY_PORT=
    Variables must be defined in a section in the format:VARIABLE_NAME=VALUE. No value found. Ignoring!
    Parse Warning at line number:33
    PROXY_USER=
    Variables must be defined in a section in the format:VARIABLE_NAME=VALUE. No value found. Ignoring!
    Parse Warning at line number:39
    COLLECTOR_SUPPORTHUB_URL=
    Variables must be defined in a section in the format:VARIABLE_NAME=VALUE. No value found. Ignoring!
    Parse Warning at line number:75
    DOMAIN_PORT=
    Variables must be defined in a section in the format:VARIABLE_NAME=VALUE. No value found. Ignoring!
    Parse Warning at line number:90
    STATICPORT INI FILE LOCATION=
    Variables must be defined in a section in the format:VARIABLE_NAME=VALUE. No value found. Ignoring!
    Parse Warning at line number:99
    PROXY HOST NAME=
    Variables must be defined in a section in the format:VARIABLE_NAME=VALUE. No value found. Ignoring!
    Parse Warning at line number:102
    PROXY PORT NO=
    Variables must be defined in a section in the format:VARIABLE_NAME=VALUE. No value found. Ignoring!
    Parse Warning at line number:105
    PROXY BY PASS ADDRESS=
    Variables must be defined in a section in the format:VARIABLE_NAME=VALUE. No value found. Ignoring!
    Validations are enabled for this session.
    Verifying data......
    In processErrorMsgStringOracle Instance
    needWritableDirectory: false
    needWritableDirectory: true
    middlewareHomeLocation:C:\Oracle\Middleware
    weblogicHomeLocation:C:\Oracle\Middleware\wlserver_10.3
    weblogicHome:C:\Oracle\Middleware\wlserver_10.3
    weblogicHomeLocation:C:\Oracle\Middleware\wlserver_10.3
    In processErrorMsgStringInstance Name
    In processErrorMsgStringunknown
    In processErrorMsgStringOracle Home
    In processErrorMsgStringDomain Name
    In processErrorMsgStringunknown
    In processErrorMsgStringAdministrator Password
    In processErrorMsgStringunknown
    In processErrorMsgStringAdministrator User Name
    In processErrorMsgStringunknown
    configuration Failed. Exiting configuration due to data validation failure.+
    outputFile:C:\Program Files\Oracle\Inventory\logs\installProfile2012-08-30_04-43-55PM.log
    in writeProfile method..
    +[ENGINE] Adding C:\Users\id821839\AppData\Local\Temp\OraInstall2012-08-30_04-43-55PM for deletion.+
    Thanks in advance..
    Suhail
    Edited by: 956027 on 30-Aug-2012 23:13
    Edited by: 956027 on 30-Aug-2012 23:14

    Following is the last part of thecontent in .log file
    This is the only part wher I have found the term "error"
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.weblogicQueries.isValidDomainHome] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Fetching the value of domainName+
    +[2012-08-31T08:46:03.570+02:00] [as] [TRACE] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.weblogicQueries.isValidDomainHome] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] [SRC_CLASS: oracle.as.install.common.handlers.weblogicQueries.IsValidDomainHome] [SRC_METHOD: executeHandler] domainName: frsDomain+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.weblogicQueries.isValidDomainHome] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Fetching the value of wlHome+
    +[2012-08-31T08:46:03.570+02:00] [as] [TRACE] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.weblogicQueries.isValidDomainHome] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] [SRC_CLASS: oracle.as.install.common.handlers.weblogicQueries.IsValidDomainHome] [SRC_METHOD: executeHandler] wlHome: C:\Oracle\Middleware\user_projects\domains+
    +[2012-08-31T08:46:03.570+02:00] [as] [TRACE] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.weblogicQueries.isValidDomainHome] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] [SRC_CLASS: oracle.as.install.common.handlers.weblogicQueries.IsValidDomainHome] [SRC_METHOD: executeHandler] mwHome: C:\Oracle\Middleware+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.weblogicQueries.isValidDomainHome] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] errID ====>>>>:INST-07277+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.weblogicQueries.isValidDomainHome] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Error:Error in validating Domain name+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.weblogicQueries.isValidDomainHome] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Cause:Specified Domain name is either not valid or the domain location already has a domain with the same name.+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.weblogicQueries.isValidDomainHome] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Action:Enter a valid Domain name+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.weblogicQueries.isValidDomainHome] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Exiting method executeHandler+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Handler launch end: weblogicQueries.isValidDomainHome+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Handler returned status: FAILED+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Error in validating Domain name+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Setting valueOf(DOMAIN_NAME) to:frsDomain. Value obtained from:USER+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Setting valueOf(DOMAIN_NAME) to:frsDomain. Value obtained from:USER+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Setting valueOf(INVALID_TEXT_CHAR_MSG_STRING) to:unknown. Value obtained from:USER+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Setting valueOf(INVALID_TEXT_CHAR_MSG_STRING) to:unknown. Value obtained from:USER+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Inputs passed to the handler: [ FIELD DOMAIN NAME ( field ) = "Domain Name" ], [ DOMAIN_NAME ( val ) = "frsDomain" ], [ INVALID_TEXT_CHAR_MSG_STRING ( invalidCharMsgString ) = "unknown" ], [ Valid Character List for Farm Name ( regEx ) = "[\p{Alnum}_-]+" ]+
    +[2012-08-31T08:46:03.570+02:00] [as] [TRACE] [] [oracle.as.install.engine.modules.validation] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] [SRC_CLASS: oracle.as.install.engine.modules.handler.engine.HandlerLauncher$LaunchHelper] [SRC_METHOD: launch] Handler class: class oracle.as.install.common.handlers.txtQueries.CheckTxtFieldUsingRegEx+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Handler launch begin: txtQueries.checkTxtFieldUsingRegEX+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.txtQueries.checkTxtFieldUsingRegEX] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Entering method executeHandler+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.txtQueries.checkTxtFieldUsingRegEX] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Fetching the value of isCanBeBlank+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.txtQueries.checkTxtFieldUsingRegEX] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Fetching the value of val+
    +[2012-08-31T08:46:03.570+02:00] [as] [TRACE] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.txtQueries.checkTxtFieldUsingRegEX] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] [SRC_CLASS: oracle.as.install.common.handlers.txtQueries.CheckTxtFieldUsingRegEx] [SRC_METHOD: executeHandler] Value to be tested: frsDomain+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.txtQueries.checkTxtFieldUsingRegEX] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Fetching the value of field+
    +[2012-08-31T08:46:03.570+02:00] [as] [TRACE] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.txtQueries.checkTxtFieldUsingRegEX] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] [SRC_CLASS: oracle.as.install.common.handlers.txtQueries.CheckTxtFieldUsingRegEx] [SRC_METHOD: executeHandler] Text Field name: Domain Name+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.txtQueries.checkTxtFieldUsingRegEX] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Fetching the value of regEx+
    +[2012-08-31T08:46:03.570+02:00] [as] [TRACE] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.txtQueries.checkTxtFieldUsingRegEX] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] [SRC_CLASS: oracle.as.install.common.handlers.txtQueries.CheckTxtFieldUsingRegEx] [SRC_METHOD: executeHandler] Regular Expression: [\p{Alnum}_-]++
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.txtQueries.checkTxtFieldUsingRegEX] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Fetching the value of minlength+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.txtQueries.checkTxtFieldUsingRegEX] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Fetching the value of maxlength+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.txtQueries.checkTxtFieldUsingRegEX] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Fetching the value of invalidCharMsgString+
    +[2012-08-31T08:46:03.570+02:00] [as] [TRACE] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.txtQueries.checkTxtFieldUsingRegEX] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] [SRC_CLASS: oracle.as.install.common.handlers.txtQueries.CheckTxtFieldUsingRegEx] [SRC_METHOD: executeHandler] Invalid Char Msg String: unknown+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.txtQueries.checkTxtFieldUsingRegEX] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Checking the value for minimum length+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.txtQueries.checkTxtFieldUsingRegEX] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Checking the value for maximum length+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.txtQueries.checkTxtFieldUsingRegEX] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Checking the value for invalid characters+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation.oracle.as.install.engine.modules.validation.handler.txtQueries.checkTxtFieldUsingRegEX] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Exiting method executeHandler+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Handler launch end: txtQueries.checkTxtFieldUsingRegEX+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine.modules.validation] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Handler returned status: SUCCESS+
    +[2012-08-31T08:46:03.570+02:00] [as] [NOTIFICATION] [] [oracle.as.install.engine] [tid: 12] [ecid: 0000J_vRUGVCgoL5mRS4yZ1GG5qd000003,0] Setting valueOf(ADMIN_PASSWORD) to:<SECURE>. Value obtained from:USER+

  • Oracle 11g RAC on CentOS 5.2 - Node isnt working after hardware failure

    Hi,
    We have a 2-node Oracle RAC 11g running on identical nodes with Centos 5.2 as operating system.
    Due to a drive failure and a reboot yesterday, the ASM disk, which is onnected via iSCSI, changed from sdd to sdc in name - (the faulty raid drive was removed, thus the change).
    The oracle services didnt start, which appeard perfectly logical at the time, given that the ASM disk suddenly wasnt where it was supposed to be, but even today after a replacement disk was inserted, the RAID rebuilt + with the ASM disk back to its original naming in /dev/; the node doesnt seem to work properly. Some of the oracle services are running, but there seems to be a problem with the listener, which might also explain why the node does not set it's virtual ip after starting up.
    Luckily, the other one is unaffected and is working perfectly fine..
    I'm far from having a clue about oracle, it was sheer luck (that, and the very usable documentation by oracle) that i managed to get that cluster running in the first place... I know my way around linux, so if it's a operating system related problem i'll be able to fix it, but i cant figure out what the problem with oracle is.
    The listener doesnt seem to be running
    [oracle@serv-211 ~]$ lsnrctl status
    LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 08-JUN-2010 11:12:00
    Copyright (c) 1991, 2007, Oracle. All rights reserved.
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    TNS-12541: TNS:no listener
    TNS-12560: TNS:protocol adapter error
    TNS-00511: No listener
    Linux Error: 111: Connection refused
    Manual starting works, but not with the result i hoped for
    [root@serv-211 oracle]# lsnrctl status
    LSNRCTL for Linux: Version 11.1.0.6.0 - Production on 08-JUN-2010 11:32:16
    Copyright (c) 1991, 2007, Oracle. All rights reserved.
    Connecting to (ADDRESS=(PROTOCOL=tcp)(HOST=)(PORT=1521))
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for Linux: Version 11.1.0.6.0 - Production
    Start Date 08-JUN-2010 11:30:42
    Uptime 0 days 0 hr. 1 min. 34 sec
    Trace Level support
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Log File /opt/oracle/11g/diag/tnslsnr/serv-211/listener/alert/log.xml
    Listener Trace File /opt/oracle/11g/diag/tnslsnr/serv-211/listener/trace/ora_22694_140227439994592.trc
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=serv-211)(PORT=1521)))
    The listener supports no services
    The command completed successfully
    [root@serv-211 oracle]#
    While other services appear to be fine
    [oracle@serv-211 ~]$ crsctl check crs
    Cluster Synchronization Services appears healthy
    Cluster Ready Services appears healthy
    Event Manager appears healthy
    I feel a little lost in the vast amount of logfiles, a point in the right direction might actually be enough. I cant image it can be that serious.
    Please assist
    Regards
    Edited by: user9134821 on 08.06.2010 02:39

    Hi,
    As usual, as soon as i post a problem in some board, i find the solution myself.
    Although this way isnt really "linuxy", deleting the listener with the netCA tool and adding a new one solved it.
    Regards.

  • 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: Block Corruption in SYSAUX File

    Hello All,
    I am facing Data corruption issue in the SYSAUX file.
    We are using Oracle 11G (Microsoft 32 bit) and our system is running in noarchivelog mode.
    Following are the errors in the alert log.
    e:\sc\sc15.2\databases\oracleconfig\diag\rdbms\enmscsdb\nm45\trace\nm45_p000_5944.trc
    Corrupt block relative dba: 0x0088a9f8 (file 2, block 567800)
    Fractured block found during buffer read
    Data in bad block:
    type: 6 format: 2 rdba: 0x0088a9f8
    last change scn: 0x0000.0b3bb7c7 seq: 0x1 flg: 0x04
    spare1: 0x0 spare2: 0x0 spare3: 0x0
    consistency value in tail: 0xc7000601
    check value in block header: 0xee6b
    computed block checksum: 0x72c6
    Reread of rdba: 0x0088a9f8 (file 2, block 567800) found same corrupted data
    Thu Jan 22 16:46:44 2009
    SMON: Restarting fast_start parallel rollback
    SMON: ignoring slave err,downgrading to serial rollback
    ORACLE Instance nm45 (pid = 12) - Error 1578 encountered while recovering transaction (9, 11) on object 458.
    Errors in file e:\sc\sc15.2\databases\oracleconfig\diag\rdbms\enmscsdb\nm45\trace\nm45_smon_6492.trc:
    ORA-01578: ORACLE data block corrupted (file # 2, block # 567800)
    ORA-01110: data file 2: 'E:\SC\SC15.2\DATABASES\ORACLECONFIG\SYSAUXNM45.ORA'
    Thu Jan 22 16:46:45 2009
    Trace dumping is performing id=[cdmp_20090122164645]
    Corrupt Block Found
    TSN = 1, TSNAME = SYSAUX
    RFN = 2, BLK = 567800, RDBA = 8956408
    OBJN = 458, OBJD = 458, OBJECT = I_WRI$_OPTSTAT_HH_OBJ_ICOL_ST, SUBOBJECT =
    SEGMENT OWNER = SYS, SEGMENT TYPE = Index Segment
    Following query indicates the corruption is in index.
    SQL> SELECT tablespace_name, segment_type, owner, segment_name FROM dba_extents
    WHERE file_id = 2 and 567800 between block_id AND block_id + blocks - 1;
    TABLESPACE_NAME SEGMENT_TYPE OWNER
    SEGMENT_NAME
    SYSAUX INDEX SYS
    I_WRI$_OPTSTAT_HH_OBJ_ICOL_ST
    ==============
    DBverify output:
    ==============
    E:\SC\SC15.2\Databases\OracleConfig>dbv file=SYSAUXNM45.ORA blocksize=8192
    DBVERIFY: Release 11.1.0.7.0 - Production on Thu Jan 22 16:59:11 2009
    Copyright (c) 1982, 2007, Oracle. All rights reserved.
    DBVERIFY - Verification starting : FILE = E:\SC\SC15.2\Databases\OracleConfig/SY
    SAUXNM45.ORA
    DBV-00200: Block, DBA 8956312, already marked corrupt
    Page 567800 is influx - most likely media corrupt
    Corrupt block relative dba: 0x0088a9f8 (file 2, block 567800)
    Fractured block found during dbv:
    Data in bad block:
    type: 6 format: 2 rdba: 0x0088a9f8
    last change scn: 0x0000.0b3bb7c7 seq: 0x1 flg: 0x04
    spare1: 0x0 spare2: 0x0 spare3: 0x0
    consistency value in tail: 0xc7000601
    check value in block header: 0xee6b
    computed block checksum: 0x72c6
    DBVERIFY - Verification complete
    Total Pages Examined : 1623864
    Total Pages Processed (Data) : 540984
    Total Pages Failing (Data) : 0
    Total Pages Processed (Index): 964944
    Total Pages Failing (Index): 0
    Total Pages Processed (Other): 17849
    Total Pages Processed (Seg) : 0
    Total Pages Failing (Seg) : 0
    Total Pages Empty : 100086
    Total Pages Marked Corrupt : 2
    Total Pages Influx : 1
    Total Pages Encrypted : 0
    Highest block SCN : 190789648 (0.190789648)
    SQL> select * from v$database_block_corruption;
    FILE# BLOCK# BLOCKS CORRUPTION_CHANGE# CORRUPTIO
    2 567800 1 0 FRACTURED
    2 567704 1 0 FRACTURED
    How to resolve this issue.
    Thanks
    With Regards
    Hemant Joshi.

    Drop and re-creating the index would be better than re-building the index.
    Check the metalink note: Identify the corruption extension using RMAN/DBV/ANALYZE etc - 836658.1
    Note 28814.1 - Handling Oracle Block Corruptions in Oracle7/8/8i/9i/10g
    Note 472231.1 - How to identify all the Corrupted Objects in the Database reported by RMAN
    ORA-1578 Main Reference Index for Solutions -830997.1

  • How to Install oracle 11G Solaris 10 NO GUI using command line

    Hello
    I need to install oracle 11G R2 on Solaris 10 but cant use interactive mode i tried the following
    /runInstaller -silent -force -debug FROM_LOCATION="/var/tmp/oracle/database/stageproducts.xml" ORACLE_HOME="/oracle/product"
    As per oracle metalink documentation - however i get the following messages
    [SEVERE] - My Oracle Support Username/Email Address Not Specified
    has anyone installed oracle with no interactive mode how can i do so ?
    thank you

    Have you followed the needed steps in the Install Guide ? http://download.oracle.com/docs/cd/E11882_01/install.112/e17163/app_nonint.htm#BABFEECI
    HTH
    Srini

  • Writing request XQUERY with oracle 11G

    Hi,
    What is exactly the best way to make an XMLTYPE object (column with type XMLType) request with Oracle 11 g ? (Oracle 11g  Release 11.2.0.3.0)
    In different books, we see a lot of different requests.
    Simple example :
    create table contact_file_tbl(filename varchar2(255), xml xmltype);
    insert into contact_file_tbl (filename, xml)
    values ('john_smith.xml', xmltype(bfilename('XML_DIR', 'john_smith.xml'),nls_charset_id('AL32UTF8')));
    Ok for now
    But impossible to make a good query :
    select XMLQuery('declare namespace book="http://xmlbook.com/sample/contact.xsd"; (:
    for $c in /book:contact
    return $c/book:first_name' PASSING a.xml RETURNING CONTENT)
    from contact_file_tbl a;
    returns nothing.
    why this request works ?
    SELECT filename, XMLQuery('toto'
             PASSING xml RETURNING CONTENT) dataResult
      FROM contact_file_tbl;
    Could you send me a request with this example.
    Here the XML document :
    <?xml version="1.0" encoding="UTF-8"?>
    <contact xmlns="http://xmlbook.com/sample/contact.xsd" id="1">
       <category>customer</category>
       <first_name Chinese="约翰">John</first_name>
       <last_name>Smith</last_name>
       <email>[email protected]</email>
       <phone>(512)781-9230</phone>
       <cellphone>(512)781-9230</cellphone>
       <address>
           <street1>1234 sunflower road</street1>
           <city>austin</city>
           <state>texas</state>
           <zipcode>78701</zipcode>
           <country>USA</country>
       </address>
       <references>
         <reference relationship="account manager, tech sales">
           <first_name>robert</first_name>
           <last_name>tian</last_name>
             <email>[email protected]</email>
         </reference>
         <reference relationship="account manager, app sales">
           <first_name>Richard</first_name>
           <last_name>Liu</last_name>
           <email>[email protected]</email>
         </reference>
       </references>
    </contact>
    Thank you very much

    This works fine for me :
    SQL> select XMLQuery(
      2  'declare namespace book="http://xmlbook.com/sample/contact.xsd"; (::)
      3  for $c in /book:contact
      4  return $c/book:first_name'
      5  PASSING a.xml
      6  RETURNING CONTENT
      7  )
      8  from contact_file_tbl a;
    XMLQUERY('DECLARENAMESPACEBOOK
    <first_name xmlns="http://xmlbook.com/sample/contact.xsd" Chinese="??">John</fir
    SQL>
    SQL> select XMLCast(
      2  XMLQuery(
      3  'declare namespace book="http://xmlbook.com/sample/contact.xsd"; (::)
      4  for $c in /book:contact
      5  return $c/book:first_name'
      6  PASSING a.xml
      7  RETURNING CONTENT
      8  )
      9  as varchar2(30)
    10  ) as first_name
    11  from contact_file_tbl a;
    FIRST_NAME
    John
    What's your client tool/version?

  • Oracle 11g R2 to MS Access .mdb (Windows Server 2008 64-bit) problem

    I have a need to make connection from Oracle 11g R2 to MS Access database file (mdb). OS is MS Windows Server 2008 64-bit. My configuration is next:
    1. I made System DNS mikeacs (using c:\windows\sys_wow6\odbcad32.exe) to my access mdb file;
    2. I made initmikeacs.ora file in ora_home\hs\admin folder:
    # HS init parameters
    HS_FDS_CONNECT_INFO = mikeacs
    HS_FDS_TRACE_LEVEL = debug
    HS_FDS_SHAREABLE_NAME = c:\Windows
    3. Listener.ora file is:
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = CLRExtProc)
    (ORACLE_HOME = C:\Oracle\product\11.2.0\dbhome_1)
    (PROGRAM = extproc)
    (ENVS = "EXTPROC_DLLS=ONLY:C:\Oracle\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    (SID_DESC =
    (SID_NAME = mikeacs)
    (ORACLE_HOME = c:\oracle\product\11.2.0\dbhome_1)
    (PROGRAM = dg4odbc)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = cspo02)(PORT = 1521))
    4. Tnsnames.ora is:
    ORACLR_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    (CONNECT_DATA =
    (SID = CLRExtProc)
    (PRESENTATION = RO)
    MIKEACS =
    (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp)(HOST=cspo02)(PORT=1521))
    (CONNECT_DATA=(SID=mikeacs))
    (HS=OK)
    5. After this, I restarted Listener:
    lsnrctl stop;
    lsnrctl start;
    Given feedback:
    STATUS of the LISTENER
    Alias LISTENER
    Version TNSLSNR for 64-bit Windows: Version 11.2.0.1.0 - Production
    Start Date 20-RUJ-2010 14:47:21
    Uptime 0 days 0 hr. 0 min. 3 sec
    Trace Level off
    Security ON: Local OS Authentication
    SNMP OFF
    Listener Parameter File C:\Oracle\product\11.2.0\dbhome_1\network\admin\listener.ora
    Listener Log File c:\oracle\diag\tnslsnr\cspo02\listener\alert\log.xml
    Listening Endpoints Summary...
    (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
    (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=cspo02)(PORT=1521)))
    Services Summary...
    Service "CLRExtProc" has 1 instance(s).
    Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
    Service "mikeacs" has 1 instance(s).
    Instance "mikeacs", status UNKNOWN, has 1 handler(s) for this service...
    The command completed successfully
    6. I created db link: create public database link macs using 'MIKEACS' (connected as sysdba);
    7. tnsping mikeacs:
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION= (ADDRESS=(PROTOCOL=tcp)(HOST=cspo02)(PORT=1521)) (CONNECT_DATA=(SID=mikeacs)) (HS=OK))
    OK (0 msec)
    Then, when I try fire query (connected as sysdba): select * from mytable@macs;
    get result:
    ERROR at line 1:
    ORA-28513: internal error in geterogeneous remote agent
    ORA-02063: preceding line from MACS;
    Although, when I fire the same query, but connected as other user, get next result:
    ERROR at line 1:
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    [Microsoft][ODBC Driver Manager] Data source name not found and no default
    driver specified {IM002}
    ORA-02063: preceding 2 lines from MACS
    Where is my problem? Please help. Thanks in advance!

    That's the problem. DG4ODBC on 64bit Windows is 64bit and thus it also requires a 64bit ODBC driver.
    If you don't find one - maybe you can install DG4ODBC 32bi on a 32bit platform (please do NOT install it on the 64bit Windows machine) and then use this 32biit DG4ODBC with the 32bit ODBC driver.
    Another option would be to purchase a commercial ODBC driver or a bridged ODBC driver.

  • 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 AM

    965300 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.

Maybe you are looking for