Obtaining TNS entries from PL/SQL

I read somewhere that one can get TNS entry definitions via PL/SQL.
We currently develope/maintain a project on Oracle 9.2.0 which interconnects to at least 3 other projects running oracle instances. The problem here is that we have multiple development, testing, BC/DR and production instances to keep track of. and we need to know the dblink definitions that each of our instances connects to. Obviously we can get the tnsname of the dblink from "select * from all_db_links", but using tnsping returns the definition of that tnsentry from our local client (ugh). we need to be able to write a small stored function to query the tns definition from the server itself to ensure we have the correct definition relayed.
Is this possible?

Not really... not in a nice clean and robust way.
PL/SQL itself does not have a command or standard package to enumurate the local list of TNS aliases in the tnames.ora file. And using UTL_FILE and parsing the tnsnames.ora file is not trivial.
Question though is why use the tnsnames.ora file on the server in the first place? If you db connectivity and management is driven at application level, then dealing with the actual db connection data externally (in a flat file) is a problem. So don't. Deal with it inside Oracle itself.
You can define a db link in Oracle using the actual connection string itself (which is what the TNS alias refers to).
E.g.
create database link orcl_test connect to scott identified by tiger using
'(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=10.0.0.1)(PORT=1527))) (CONNECT_DATA=(SID=orcl)(SERVER=shared)))';
At application level you can control the type of connection ito service name,/SID, TAF, shared/dedicated and so on.
Obviously there are pro's and con's both ways - using a tnsnames.ora file versus using the connection string directly. But in certain cases the pro's outweigh the con's.

Similar Messages

  • SQL Developer keeps pointing to old TNS entry  Version 2.1.1.64

    Hello,
    We are using SQL Developer and we just changed our database from host X to host Z. We changed the TNS entry to point to host z but Developer keeps pointing to host x. It seems the entry is cached. We tried deleting the connection and restarting the application. Still no luck. My only thought is that the connection is cached. if true can someone point me to the file that contains the connection info? And if not, can someone provide a alternative resolution to the issue?
    Thanks
    Rondale

    I agree with Turloch, I had a similar issue with SQL Developer 3. Even though I had the environment variable TNS_ADMIN, it basically ignored this variable and was referencing the first TNS_NAMES.ora file it found. I had to remove all copies except the one listed in my TNS_ADMIN variable before SQL Developer found the right one.
    It would be nice if the tool would check the TNS_ADMIN variable like other Oracle products do.
    Craig...
    Edited by: CraigB on Aug 31, 2011 11:56 AM

  • SQL Cluster - Unable to obtain IP Address from System Center IP Pool

    Hi everyone,
    we are trying to deploy a SQL cluster into a windows azure pack tenant cloud.
    Our azure pack environment contains:
    - 4X Hyper-V server in a failover cluster
    - 1X SCVMM server
    - multiple WAP server
    Steps we have done:
    -    Windows failover cluster is installed and configured successfully
    -    Quorum disk was configured successfully
    -    SQL server 2014 installation (via static IP) is successfully. But routing between the VMs is not possible.
    -    SQL server 2014 installation (via DHCP) fails at the end of the installation with following error:
            -> We used DHCP to obtain an IP from the scvmm IP pool.
    (01) 2015-04-22 15:29:11 Slp: Running Action: cluster_ip_address_cluster_config_Cpu64
    (01) 2015-04-22 15:29:11 Slp: Action Data:
    (01) 2015-04-22 15:29:11 Slp:   Feature = SQL_Engine_Core_Inst_sql_engine_core_inst_Cpu64
    (01) 2015-04-22 15:29:11 Slp:   Scenario = install
    (01) 2015-04-22 15:29:11 Slp:   Timing = ConfigNonRC
    (01) 2015-04-22 15:29:11 Slp:   ConfigObjectType = Microsoft.SqlServer.Configuration.ClusterConfiguration.ClusterIPAddressPrivateConfigObject
    (01) 2015-04-22 15:29:11 Slp:   FeatureName = SQL_Engine_Core_Inst
    (01) 2015-04-22 15:29:11 Slp:   FeatureCpuType = Cpu64
    (01) 2015-04-22 15:29:11 Slp:   FeaturePackageId = sql_engine_core_inst
    (01) 2015-04-22 15:29:11 Slp:   FeatureClusterState = CompleteFailoverCluster
    (01) 2015-04-22 15:29:11 Slp: Creating IPv4 address 'SQL IP Address 1 (SQLADFS)'.
    (01) 2015-04-22 15:29:11 Slp: Creating cluster resource 'SQL IP Address 1 (SQLADFS)' of type 'IP Address' in group 'SQL Server (ADFS)'
    (01) 2015-04-22 15:29:11 Slp: Bringing IP address resource 'Type='IP Address' NetworkName='Cluster Network 1' Group='SQL Server (ADFS)' Resource='SQL IP Address 1 (SQLADFS)'' online
    (01) 2015-04-22 15:29:11 Slp: Bringing cluster resource 'SQL IP Address 1 (SQLADFS)' online
    (01) 2015-04-22 15:29:12 Slp: Prompting user if they want to retry this action due to the following failure:
    (01) 2015-04-22 15:29:12 Slp: ----------------------------------------
    (01) 2015-04-22 15:29:12 Slp: The following is an exception stack listing the exceptions in outermost to innermost order
    (01) 2015-04-22 15:29:12 Slp: Inner exceptions are being indented
    (01) 2015-04-22 15:29:12 Slp:
    (01) 2015-04-22 15:29:12 Slp: Exception type: Microsoft.SqlServer.Configuration.Cluster.ResourceOnlineException
    (01) 2015-04-22 15:29:12 Slp:     Message:
    (01) 2015-04-22 15:29:12 Slp:         The cluster resource 'SQL IP Address 1 (SQLADFS)' could not be brought online.  Error: There was a failure to call cluster code from a provider. Exception message: Generic failure
    . Status code: 5023. Description: The group or resource is not in the correct state to perform the requested operation.
    (01) 2015-04-22 15:29:12 Slp:         .
    (01) 2015-04-22 15:29:12 Slp:     HResult : 0x86d8003a
    (01) 2015-04-22 15:29:12 Slp:         FacilityCode : 1752 (6d8)
    (01) 2015-04-22 15:29:12 Slp:         ErrorCode : 58 (003a)
    (01) 2015-04-22 15:29:12 Slp:     Data:
    (01) 2015-04-22 15:29:12 Slp:       resourceName = SQL IP Address 1 (SQLADFS)
    (01) 2015-04-22 15:29:12 Slp:       errorMessage = There was a failure to call cluster code from a provider. Exception message: Generic failure . Status code: 5023. Description: The group or resource is not in the correct state
    to perform the requested operation.
    (01) 2015-04-22 15:29:12 Slp:       WatsonData = Microsoft.SqlServer.Configuration.Cluster.ResourceOnlineException@58
    (01) 2015-04-22 15:29:12 Slp:       DisableRetry = true
    (01) 2015-04-22 15:29:12 Slp:     Inner exception type: Microsoft.SqlServer.Configuration.Cluster.ClusterProviderDetailedException
    (01) 2015-04-22 15:29:12 Slp:         Message:
    (01) 2015-04-22 15:29:12 Slp:                 There was a failure to call cluster code from a provider. Exception message: Generic failure . Status code: 5023. Description: The
    group or resource is not in the correct state to perform the requested operation.
    (01) 2015-04-22 15:29:12 Slp:                 .
    (01) 2015-04-22 15:29:12 Slp:         HResult : 0x86d70002
    (01) 2015-04-22 15:29:12 Slp:                 FacilityCode : 1751 (6d7)
    (01) 2015-04-22 15:29:12 Slp:                 ErrorCode : 2 (0002)
    (01) 2015-04-22 15:29:12 Slp:         Data:
    (01) 2015-04-22 15:29:12 Slp:           ExceptionMessage = Generic failure
    (01) 2015-04-22 15:29:12 Slp:           StatusCode = 5023
    (01) 2015-04-22 15:29:12 Slp:           Description = The group or resource is not in the correct state to perform the requested operation.
    (01) 2015-04-22 15:29:12 Slp:           WatsonData = Microsoft.SqlServer.Configuration.Cluster.ClusterProviderDetailedException@2
    (01) 2015-04-22 15:29:12 Slp:         Stack:
    (01) 2015-04-22 15:29:12 Slp:                 at Microsoft.SqlServer.Configuration.Cluster.WmiClusterResource.Online(Int32 timeout)
    (01) 2015-04-22 15:29:12 Slp:                 at Microsoft.SqlServer.Configuration.Cluster.ClusterResource.Online(Int32 timeout)
    (01) 2015-04-22 15:29:12 Slp:         Inner exception type: System.Management.ManagementException
    (01) 2015-04-22 15:29:12 Slp:             Message:
    (01) 2015-04-22 15:29:12 Slp:                         Generic failure
    (01) 2015-04-22 15:29:12 Slp:             HResult : 0x80131501
    (01) 2015-04-22 15:29:12 Slp:             Data:
    (01) 2015-04-22 15:29:12 Slp:               WmiErrorCode = Failed
    (01) 2015-04-22 15:29:12 Slp:               WatsonData = Failed@5023
    (01) 2015-04-22 15:29:12 Slp:               Description = The group or resource is not in the correct state to perform the requested operation.
    (01) 2015-04-22 15:29:12 Slp:               ErrorType = 1
    (01) 2015-04-22 15:29:12 Slp:               Operation = ExecMethod
    (01) 2015-04-22 15:29:12 Slp:               ParameterInfo = MSCluster_Resource.Name="SQL IP Address 1 (SQLADFS)"
    (01) 2015-04-22 15:29:12 Slp:               ProviderName = WinMgmt
    (01) 2015-04-22 15:29:12 Slp:               StatusCode = 5023
    (01) 2015-04-22 15:29:12 Slp:             Stack:
    (01) 2015-04-22 15:29:12 Slp:                         at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
    (01) 2015-04-22 15:29:12 Slp:                         at System.Management.ManagementObject.InvokeMethod(String methodName, ManagementBaseObject
    inParameters, InvokeMethodOptions options)
    (01) 2015-04-22 15:29:12 Slp:                         at Microsoft.SqlServer.Configuration.WMIInterop.Resource.BringOnline(UInt32 TimeOut)
    (01) 2015-04-22 15:29:12 Slp:                         at Microsoft.SqlServer.Configuration.Cluster.WmiClusterResource.Online(Int32 timeout)
    (01) 2015-04-22 15:29:12 Slp: ----------------------------------------
    We have tried to reinstall the servers multiple times, without result.
    Can anyone assist us in this case?
    Thanks
    Kind Regards
    Julian

    Hi Darryl,
    thanks for your supply.
    We don't have an DHCP in the Cloud. System Center DHCP is used for assigning IP addresses and routing inforamtion to the vms.
    This works fine for assigning IP addresses to the vms.
    At my current point of understanding network virtualisation with system Center, we do not have an alternative to this way of assigning IP addresses.
    Kind Regards
    Julian

  • Not using TNS entries correctly

    SQLDeveloper Version 2.1.1.64. I have created TNS aliases to connect to individual RAC instances in my TNSNAMES.ORA file. From SQL*Plus, when I use the TNS alias to connect to a particular instance, I get connected to the correct one. When I use the same TNS alias with SQLDeveloper, it connects me randomly to any instance in the cluster.
    I have correctly defined the location of TNSNAMES.ORA file in the Preferences. I am specifying just one server name and SID in the TNS alias so there is no way that TNS entry can connect to any other instance. I have only one TNSNAMES.ORA file on the entire computer. Oracle client version 11.1.0.7. The TNS alias for each instance is unique in the TNSNAMES.ORA file.
    Any ideas on where SQLDeveloper is getting the wrong connection information from?
    Thanks...
    Arun Gupta

    Actually the driver used depends on the
    Tools -> Preferences -> Database -> Advanced -> Use OCI/Thick drivercheck-box; when you select TNS connection having this unchecked, SQLDeveloper parses your TNS file and then uses the Thin driver to connect.
    I guess since in your situation this does not behave as expected there may be a bug in the thin driver, or in SQLDeveloper interpretation of the TNS file, so try to check the property i mentioned and see if it works OK.

  • DB Connection issue when using alternate address(tns entries)

    I am trying to connect to a oracle db server. Only ready only access is given for this server. the tns entry in tnsnames.ora looks like this..
    dddA = (DESCRIPTION = (ADDRESS = (PROTOCOL=TCP) (HOST=ddd001.corpnet2.com) (PORT=1521)) (CONNECT_DATA = (SERVICE_NAME = ddd.WORLD) (INSTANCE_NAME = dddA)) )
    dddB = (DESCRIPTION = (ADDRESS = (PROTOCOL= TCP) (HOST=ddd002.corpnet2.com) (PORT=1521)) (CONNECT_DATA = (SERVICE_NAME = ddd.WORLD) (INSTANCE_NAME = dddB)) )
    dddC = (DESCRIPTION = (ADDRESS = (PROTOCOL=TCP) (HOST=ddd003.corpnet2.com) (PORT=1521)) (CONNECT_DATA = (SERVICE_NAME = ddd.WORLD) (INSTANCE_NAME = dddC)) )
    dddD = (DESCRIPTION = (ADDRESS = (PROTOCOL=TCP) (HOST=ddd004.corpnet2.com) (PORT=1521)) (CONNECT_DATA = (SERVICE_NAME = ddd.WORLD) (INSTANCE_NAME = dddD)) )
    ddd = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL=TCP) (HOST=ddd001.corpnet2.com) (PORT=1521)) (ADDRESS = (PROTOCOL=TCP) (HOST=ddd002.corpnet2.com) (PORT=1521)) (ADDRESS = (PROTOCOL=TCP) (HOST=ddd003.corpnet2.com (PORT=1521)) (ADDRESS = (PROTOCOL=TCP) (HOST=ddd004.corpnet2.com) (PORT=1521)) (LOAD_BALANCE = YES) ) (CONNECT_DATA = (SERVICE_NAME = ddd.WORLD) (FAILOVER_MODE = (TYPE = select)(METHOD=basic))) )
    The connection string I am using is
    Connection connection=DriverManager.getConnection("jdbc:oracle:thin:@ddd001.corpnet2.com:1521:ddd","userid","pwd");
    I have tried with all the 4 host names..used ddd.world instead of ddd..it did not work..the error message i am getting is
    java.sql.SQLException: Io exception: Connection refused(DESCRIPTION=(TMP=)(VSNNUM=153093632)(ERR=12505)(ERROR_STACK=(ERROR=(CODE=12505)(EMFI=4)))) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210) at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:323) at oracle.jdbc.driver.OracleConnection.<init>(OracleConnection.java:263) at oracle.jdbc.driver.OracleDriver.getConnectionInstance(OracleDriver.java:365) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:260) at java.sql.DriverManager.getConnection(DriverManager.java:512) at java.sql.DriverManager.getConnection(DriverManager.java:171)
    When I try to connect through TOAD i get connected sometimes and sometimes I get ORA 12502 error If anyone has come across a solution,pls let us know.. Thanks

    This sounds like an Oracle issue not a Java one. Does the connection string you're using work from SQLPlus? That error means you've got a bad SID by the way.

  • Delete all entries from the following tables - Follow-up Activities (oracle)

    Hello,
    I performed a homogeneous system copy of our development BW system with the database (oracle 11.2.0.3) from the BW production system!
    I already start the oracle database and the SAP system in the target system/server (development BW system) and I´m doing some follow-up activities. One of this activities is (at the system copy guide 6.2.3.2 Activities at Database Level) is to delete all entries from the following tables:
    DBSTATHORA, DBSTAIHORA, DBSTATIORA, DBSTATTORA
    I tried to delete them using SQL Plus:
    sqlplus /nolog
    SQL> connect /as sysdba
    SQL> delete from DBSTATTORA;
    delete from DBSTATTORA
    ERROR at line 1:
    ORA-00942: table or view does not exist
    ... and it show me that error message.
    This is strange because when I go to transaction SE14 and check the DBSTATTORA I see that table exist and contain a lot of entries!
    Why this is happened in SQL Plus!? I´m running the correct SQL statement for doing this type of task or not?
    How can I delete the entries of that tables? Can I do that using the transaction SE14?
    Can you help me please?
    Thank you,
    samid raif

    Hello
    sqlplus /nolog
    SQL> connect /as sysdba
    SQL> delete from DBSTATTORA;
    delete from DBSTATTORA
    ERROR at line 1:
    ORA-00942: table or view does not exist
    It doesn't surprise me as you are not mentioning the schema name here. Instead it should be
    delete from SAPSR3.DBSTATTORA;
    Assuming the schema owner is SAPSR3. if the owner is different then replace that with the correct one.
    Regards
    RB

  • Failed to obtain/create connection from connection pool after redeploy

    I have a web application (.war) that uses a jdbc connection pool. The application works fine, however after I redeploy it using the administration console I get "Failed to obtain/create connection from connection pool [ Datavision_Pool ]. Reason : null" followed by "Error allocating connection : [Error in allocating a connection. Cause: null]" from javax.enterprise.resource.resourceadapter and I am forced to restart the instance. I am running Sun Java System Application Server 9.1 (build b58g-fcs)
    using a connection pool to a Microsoft SQL 2000 database using inet software's JDBC drivers. I need to be able to redeploy applications without having to restart the instance. Any help is appreciated.

    I have turned on some additional diagnostics and found out some answers and a work-around, but I think that there may be a bug in the way JDBC connection pool classes are loaded. The actual error was a null pointer in the JDBC driver class in the perpareStatement method. The only line in this method is "return factory.createPreparedStatement( this , sql );" and the only possible NPE would be if the factory was null, which should be impossible because it is a static variable and it is initialized when the class is loaded. The problem occurs because we deploy the JDBC driver .jar file within our .war file, for use when a client doesn't have or want to use connection pooling. Apparently, the connection pool must have picked up some of these classes and when the .war was redeployed, the reference to the factory was lost for existing connections (not sure how). If I remove the JDBC .jar file from the .war, it works, but that wasn't an ideal solution, the other way to get it to work was to change the sun-web.xml file to have <class-loader delegate="true">. We previously had it set to false in version 8.1 because of interference with a different version of the apache Tiles classes, which has now been addressed in version 9.1.
    I still think there is an issue, because the connection pool should never use the application specific classloaders. Am I wrong to believe this?

  • Error while calling .svc web service from pl/sql using utl_dbws

    Hello Folks,
    I am calling a .svc web service from pl/sql using utl_dbws and encountering the following error
    javax.xml.rpc.soap.SOAPFaultException: The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).
    Can you help me find what am I doing wrong?
    Thanks
    Rk

    Hi,
    Here are the details
    1. What 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 64-bit Windows: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    2. What error message ... we need the full and complete error stack not your interpretation of it.
    ORA-29532: Java call terminated by uncaught Java exception: javax.xml.rpc.soap.SOAPFaultException: The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Messag
    3. "I am calling means what?" We need the full and complete statement showing the values of all parameters.
    The input to the web-service is a xmltype containing address information and the web-service returns a string
    CREATE OR REPLACE FUNCTION get_id
    RETURN VARCHAR2
    AS
    l_service UTL_DBWS.service;
    l_call UTL_DBWS.CALL;
    l_wsdl_url VARCHAR2 (32767);
    l_namespace VARCHAR2 (32767);
    l_service_qname UTL_DBWS.qname;
    l_port_qname UTL_DBWS.qname;
    l_operation_qname UTL_DBWS.qname;
    l_xmltype_in SYS.XMLTYPE;
    l_xmltype_out SYS.XMLTYPE;
    l_return VARCHAR2 (32767);
    BEGIN
    l_wsdl_url := 'http://test.com/test.svc?wsdl';
    l_namespace := 'http://test.org/';
    l_service_qname := UTL_DBWS.to_qname (l_namespace, 'SName');
    l_port_qname := UTL_DBWS.to_qname (l_namespace, 'BasicHttpBinding_ISName');
    l_operation_qname := UTL_DBWS.to_qname (l_namespace, 'Iden');
    l_service :=
    UTL_DBWS.create_service
    (wsdl_document_location => urifactory.geturi
    (l_wsdl_url),
    service_name => l_service_qname
    l_call :=
    UTL_DBWS.create_call (service_handle => l_service,
    port_name => l_port_qname,
    operation_name => l_operation_qname
    l_xmltype_in :=
    SYS.XMLTYPE
    ('<IdenRequest xmlns:i="http://www.w3.org/XMLSchema-instance" xmlns="http://test.org/SNameIden.WCFService">
    <address />
    <zip>12345</zip>
    <state>AA</state>
    <street>W Test </street>
    </address>
    </IdenRequest>'
    l_xmltype_out :=
    UTL_DBWS.invoke (call_handle => l_call,
    request => l_xmltype_in);
    UTL_DBWS.release_call (call_handle => l_call);
    UTL_DBWS.release_service (service_handle => l_service);
    l_return := l_xmltype_out.EXTRACT ('//Iden/text()').getstringval();
    RETURN l_return;
    END;
    /

  • Help calling a web service from pl/sql

    Hi, i have a web service that is called from a php, i needed to do this but from pl sql:
    this is the call of web service from php:
    <?PHP
    //Variables de prueba - Se tienen que tomar los valores de la base de datos, de la compra y el usuario
    $p_id_emec=urlencode("33355555"); //Identificador del sitio dentro de Pago Fácil
    $p_id_operacion=urlencode("151"); //Identificador unívoco de la compra en el sitio
    $p_id_mone_ecom=urlencode("01"); //Identificador de moneda - '01'=pesos - '02=dolares
    //Inicializa Variables de URL
    $serviceName="Pago XX";
    $protocol="http://";
    // DESARROLLO
    $ipUrl="desa.e-pagoxx.com";
    $port=80;
    //Llamada
    $call="/2130/index.php";
    //Abro la conexion al port
    $URLsola = $protocol.$ipUrl;
    //Concatenacion del string
    $txtURL = $protocol.$ipUrl.$call;
    $txtURL .="?p_id_emec=".$p_id_emec;
    $txtURL .="&p_id_operacion=".$p_id_operacion;
    $txtURL .="&p_id_mone_ecom=".$p_id_mone_ecom;
    $txtURL = $txtURL;
    //* Se comunica con el servidor, pasa los datos y recibe el HTML con el comprobante *//
    $fp = fsockopen($ipUrl, $port, &$errno, &$errstr, 30);
    if(!$fp)
    echo "No me puedo comunicar con $serviceName";
    exit;
    else
    $file=@fopen($URLsola,"r");
    $pageData=file($txtURL);
    for($i=0;$i<count($pageData);$i++)
              $sText.=$pageData[$i];
    @fclose($file);
    @fclose($fp);
    echo($sText);
    ?>
    I need to call this webservice from pl sql
    any ideas?
    thanks!!

    Madhu BR wrote:
    You might want to try the webservice call using utl_http specified here : http://orclpps.blogspot.com/2007/12/invoking-webservices-from-oracle-9i-or.html
    Or even to expand on that to deal with responses larger than 32K...
    -- skeleton code
      PROCEDURE p_soap_request(p_username IN VARCHAR2, p_password IN VARCHAR2, p_proxy IN VARCHAR2) IS
        soap_request  VARCHAR2(30000);
        soap_respond  CLOB;
        http_req      utl_http.req;
        http_resp     utl_http.resp;
        resp          XMLType;
        soap_err      exception;
        v_code        VARCHAR2(200);
        v_msg         VARCHAR2(1800);
        v_len number;
        v_txt Varchar2(32767);
      BEGIN
        IF p_proxy IS NOT NULL THEN
          UTL_HTTP.SET_PROXY(p_proxy);
        END IF;
        -- Define the SOAP request according the the definition of the web service being called
        soap_request:= '<?xml version = "1.0" encoding = "UTF-8"?>'||
                       '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">'||
                       '  <SOAP-ENV:Body>'||
                       '    <m:DownloadRequest xmlns:m="http://www.website.net/messages/GetDetails">'||
                       '      <m:UserName>'||p_username||'</m:UserName>'||
                       '      <m:Password>'||p_password||'</m:Password>'||
                       '    </m:DownloadRequest>'||
                       '  </SOAP-ENV:Body>'||
                       '</SOAP-ENV:Envelope>';
        http_req:= utl_http.begin_request
                  ( 'http://www.website.net/webservices/GetDetailsService.asmx'
                  , 'POST'
                  , 'HTTP/1.1'
        utl_http.set_header(http_req, 'Content-Type', 'text/xml');
        utl_http.set_header(http_req, 'Content-Length', length(soap_request));
        utl_http.set_header(http_req, 'Download', ''); -- header requirements of particular web service
        utl_http.write_text(http_req, soap_request);
        http_resp:= utl_http.get_response(http_req);
        utl_http.get_header_by_name(http_resp, 'Content-Length', v_len, 1); -- Obtain the length of the response
        FOR i in 1..CEIL(v_len/32767) -- obtain response in 32K blocks just in case it is greater than 32K
        LOOP
            utl_http.read_text(http_resp, v_txt, case when i < CEIL(v_len/32767) then 32767 else mod(v_len,32767) end);
            soap_respond := soap_respond || v_txt; -- build up CLOB
        END LOOP;
        utl_http.end_response(http_resp);
        resp:= XMLType.createXML(soap_respond); -- Convert CLOB to XMLTYPE
      END;

  • SharePoint - Error_1_Error occurred in deployment step 'Add Solution': Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was rea

    Hi,
    I am Shanmugavel, SharePoint developer, 
    I am facing the below SharePoint 2013 deployment issue while deploying using VS2012.
    If i will deploy the same wsp or existing wsp
    (last build) using direct powershell deployment, the solution adding properly, but the same timeout exception coming while activation the features.  Please find the below error.
    I tried the below activists:
    1. Restarted my dev server, DB server. 
    2. tried the same solution id different server
    3. tried existing wsp file (last build version)
    4. Deactivated all the features, including project Active deployment configuration.... but still i am facing the same issue.
    I hope this is not coding level issue, because still my code is not start running, before that some problem coming.
    Please help me any one.....  Last two days i am struck because of this...

    What you need to understand is the installation of a WSP does not do much. It just makes sure that you relevant solution files are deployed to the SharePoint farm.
    Next comes the point when you activate the features. It is when the code which you have written to "Activate" certain features for your custom solution.
    Regarding the error you are getting, it typically means that you have more connections (default is I guess 100) open for a SQL database then you are allowed to.
    If you have a custom database and you are opening a connection, make sure you close it as well.
    Look at the similar discussion here:
    The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool
    size was reached[^]
    I would suggest further to look at the
    ULS logs[^] to get better insight.
    Manas Bhardwaj's Stream : www.manasbhardwaj.net

  • Web service call from pl/sql 10g

    I am having problems in calling a web service from pl/sql. This is what I followed
    Here is my wsdl
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions targetNamespace="http://svc" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://svc" xmlns:intf="http://svc" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <wsdl:types>
    <schema elementFormDefault="qualified" targetNamespace="http://svc" xmlns="http://www.w3.org/2001/XMLSchema">
    <element name="name" type="xsd:string"/>
    <element name="location" type="xsd:string"/>
    <element name="getGreetingReturn" type="xsd:string"/>
    </schema>
    </wsdl:types>
    <wsdl:message name="getGreetingResponse">
    <wsdl:part element="impl:getGreetingReturn" name="getGreetingReturn"/>
    </wsdl:message>
    <wsdl:message name="getGreetingRequest">
    <wsdl:part element="impl:name" name="name"/>
    <wsdl:part element="impl:location" name="location"/>
    </wsdl:message>
    <wsdl:portType name="PlsqlS">
    <wsdl:operation name="getGreeting" parameterOrder="name location">
    <wsdl:input message="impl:getGreetingRequest" name="getGreetingRequest"/>
    <wsdl:output message="impl:getGreetingResponse" name="getGreetingResponse"/>
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="PlsqlSSoapBinding" type="impl:PlsqlS">
    <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="getGreeting">
    <wsdlsoap:operation soapAction=""/>
    <wsdl:input name="getGreetingRequest">
    <wsdlsoap:body use="literal"/>
    </wsdl:input>
    <wsdl:output name="getGreetingResponse">
    <wsdlsoap:body use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="PlsqlSService">
    <wsdl:port binding="impl:PlsqlSSoapBinding" name="PlsqlS">
    <wsdlsoap:address location="http://myServer:7001/plsqlsvc/services/PlsqlS"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    Here is my pl/sql
    package body pkg_my_webservice as
    vg_funciton_fnc VARCHAR2(256) := 'getGreeting';
    vg_ws_address VARCHAR2(255) := 'http://myServer:7001/plsqlsvc/services/PlsqlS';
    FUNCTION call_myfuntion(
    vp_parameter1 VARCHAR2,
    vp_parameter2 VARCHAR2)
    RETURN VARCHAR2 AS
    ol_req soap_api.t_request;
    ol_resp soap_api.t_response;
    BEGIN
    -- we initilize a new request
    ol_req := soap_api.new_request(vg_funciton_fnc,
    'xmlns="' || vg_ws_address || '"');
    -- we started to add parameters
    soap_api.add_parameter(ol_req,'name', 'partns:string',
    vp_parameter1);
    soap_api.add_parameter(ol_req,'location', 'partns:string',
    vp_parameter2);
    ol_resp := soap_api.invoke(ol_req, vg_ws_address, vg_funciton_fnc);
    -- we get back the results
    RETURN soap_api.get_return_value(ol_resp, 'getGreetingReturn', -- result tag name
    'xmlns:m="' || vg_ws_address || '"');
    exception WHEN others then
    dbms_output.put_line ( Utl_Http.get_detailed_sqlcode || Utl_Http.Get_Detailed_Sqlerrm);
    return 'exception happened';
    END call_myfuntion;
    end pkg_my_webservice;
    Here is the error
    SQL> /
    PKG_MY_WEBSERVICE.CALL_MYFUNTION('ABC','EFG')
    exception happened
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.or
    g/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchem
    a-instance" xmlns:xsd="http://www.w3.org/1999/XMLSchema"><SO
    AP-ENV:Body><getGreeting xmlns="http://myServer:7001/p
    lsqlsvc/services/PlsqlS" SOAP-ENV:encodingStyle="http://sche
    mas.xmlsoap.org/soap/encoding/"><name xsi:type="string">abc<
    /name><location xsi:type="string">efg</location></getGreetin
    g></SOAP-ENV:Body></SOAP-ENV:Envelope>
    -12535ORA-12535: TNS:operation timed out
    Any help appreciated
    Thanks

    It was found out that the server port was not open from the data-tier.

  • 'Cannot obtain error message from server' when trying to use ODBC

    Post Author: Grant C
    CA Forum: Data Connectivity and SQL
    Hi, I'm developing some reports using Crystal XI on my local PC, using an Oracle 10i back end on a separate server.  The SQL for the report is in a method in an oracle package.
    When I set the datasource location, selecting 'Oracle Server' then entering the details works fine, and the report runs.  However, when I try to use an ODBC connection I get the following error:
    Database Connection Error: 'Cannot obtain error message from server.'
    The ODBC link is set up as a System DSN, which works fine when I test it.  I think I need to use ODBC as some of the reports (which I inherited) seem to fail when run on the Crystal Server, and it seeme to be the ones set up with ODBC which work.
    Any thoughts?  Thanks.

    Hi Mars-
    It sounds like your NI-DAQ installation may have become corrupted. I would suggest uninstalling and reinstalling the DAQmx 7.4 driver to correct this problem and ensure that you're up to date. This download is available here: NI-DAQ 7.4
    If the problem persists you may want to uninstall and reinstall LabVIEW and then NI-DAQ in that order. The error message will usually give an indication as to which VI the error occurred in. Please let us know which VI is failing if you're unable to avoid the error with these suggestions.
    Have a good day-
    Tom W
    National Instruments

  • Trick to remove duplicate entries from tables ?

    hi.
    i have 53tables which are having duplicate entries and names of all 53 tables r listed in top_t table ?
    can any1 provide me solution to show and if possible ask for remove of those duplicates entries from each table if required ?
    daily i am removing duplicates manually ....its too tedious now !
    can any1 help me out ?

    Well, I suppose if the duplication is such that
    SELECT DISTINCT * FROM tablename;gives you the required result, then you could have a procedure that made a copy of the table, deleted/truncated the original, then inserted the distinct values back into it.
    In 10g you could even use flashback to avoid the temp copy - but it also means you can't use TRUNCATE so whether it's any more efficient I'm not sure. But just for fun and since it's urgent:
    CREATE OR REPLACE PROCEDURE dedupe_table
        ( p_table_name user_tables.table_name%TYPE )
    IS
        k_start_timestamp TIMESTAMP := SYSTIMESTAMP;
    BEGIN
        SAVEPOINT start_of_dedupe;
        BEGIN
            EXECUTE IMMEDIATE 'DELETE ' || p_table_name;
        EXCEPTION
            WHEN OTHERS THEN
                ROLLBACK TO start_of_dedupe;
                RAISE_APPLICATION_ERROR
                ( -20000
                , 'Error deleting ' || UPPER(p_table_name) ||
                   CHR(10) || DBMS_UTILITY.FORMAT_ERROR_BACKTRACE
                , TRUE );
        END;
        BEGIN
            EXECUTE IMMEDIATE
            'INSERT INTO ' || p_table_name ||
            ' SELECT DISTINCT * FROM ' || p_table_name || ' AS OF TIMESTAMP :b1'
            USING k_start_timestamp;
        EXCEPTION
            WHEN OTHERS THEN
                ROLLBACK TO start_of_dedupe;
                RAISE_APPLICATION_ERROR
                ( -20000
                , 'Error repopulating ' || UPPER(p_table_name) ||
                   CHR(10) || DBMS_UTILITY.FORMAT_ERROR_BACKTRACE
                , TRUE );
        END;
    END dedupe_table;
    SQL> select * from wr_test;
          COL1 C C
             1 A B
             1 A B
             2 C D
             2 C D
    4 rows selected.
    SQL> BEGIN
      2      dedupe_table('WR_TEST');
      3  END;
      4  /
    PL/SQL procedure successfully completed.
    SQL> select * from wr_test;
          COL1 C C
             1 A B
             2 C D
    2 rows selected.I make no claims for robustness, efficiency or human safety.
    Edited by: William Robertson on Sep 24, 2009 7:12 PM

  • Help me please to migrate from MS SQL to Oracle

    Hi all,
    we are in process of migration from MS SQL to Oracle.
    Please help me to perform the same in Oracle:
    select number+1 as rowid,number*6+1 as rowbeg,number*6+6 as rowend 
    from master.dbo.spt_values
    where type='P'
    Our Oracle version:
    select * from v$version
    BANNER                                                                         
    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 64-bit Windows: Version 11.2.0.2.0 - Production                        
    NLSRTL Version 11.2.0.2.0 - Production                                         
    5 rows selected.

    996831 wrote:
    Here is another solution without "connect by":
    select 1 as rnum, 1 as rowbeg, 6 as rowend from dual
    union all
    select rownum+1 as rnum,rownum*6+1 as rowbeg,rownum*6+6 as rowend
    from all_objects
    1
    1
    6
    2
    7
    12
    3
    13
    18
    4
    19
    24
    5
    25
    30
    6
    31
    36
    7
    37
    42
    (et cetera).
    This needs the user to have access on all_objects view and it will limit the result upto the numbers of objects returned by the all_objects view.

  • Not able to connect remotely via TNS entry

    Hello,
    I need to do clone, so wanted to have remote connectivity to my test database. I brought the test database in nomount. Put the right entries in tnsnames.ora file of the same, yet when i login directly it shows it is in NOMOUNT but when remotely it shows connected to IDLE instance.
    Please help me out.
    Here is some excerpts:
    ==============
    oracle@x523:/oracle/app/oracle/product/10.2.0/db_3/network/admin> sqlplus sys/here2go@TRCN523 as sysdba
    SQL*Plus: Release 10.2.0.4.0 - Production on Thu Aug 9 03:17:59 2012
    Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
    Connected to an idle instance.
    =======================
    oracle@x523:/oracle/app/oracle/product/10.2.0/db_3/network/admin> sqlplus "/as sysdba"
    INSTANCE_NAME STATUS
    TRCN523 STARTED
    Here is my TNS entry:
    ==============
    TRCN =
    (DESCRIPTION =
    (ENABLE = broken)
    (FAILOVER = ON)
    (LOAD_BALANCE = ON)
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = x523.coat.com)(PORT = 63092))
    (CONNECT_DATA =
    # (SERVICE_NAME = TRCN.coat.com)
    (SERVICE_NAME = TRCN523)
    (FAILOVER_MODE = (TYPE = NONE))
    TRCN523 =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = x523.coat.com)(PORT = 63092))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    # (SERVICE_NAME = TRCN.coat.com)
    (SERVICE_NAME = TRCN523)
    (INSTANCE_NAME = TRCN523)
    NET_TRCN_X523 =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = x523.coat.com)(PORT = 63092))
    ============
    Listener:
    =====
    SID_LIST_NET_TRCN_X523 =
    (SID_LIST =
    (SID_DESC =
    (ORACLE_HOME = /oracle/app/oracle/product/10.2.0/db_3)
    (SERVICE_NAME = TRCN.coat.com)
    (SID_NAME = TRCN523)
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /oracle/app/oracle/product/10.2.0/db_3)
    (PROGRAM = extproc)
    ==========================================
    oracle@x523:/oracle/app/oracle/product/10.2.0/db_3/network/admin> tnsping TRCN523
    TNS Ping Utility for Linux: Version 10.2.0.4.0 - Production on 09-AUG-2012 03:21:09
    Copyright (c) 1997, 2007, Oracle. All rights reserved.
    Used parameter files:
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = x523.coat.com)(PORT = 63092)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = TRCN523) (INSTANCE_NAME = TRCN523)))
    OK (0 msec)

    Handle:      784786
    Status Level:      Newbie
    Registered:      Jul 27, 2010
    Total Posts:      211
    Total Questions:      81 (65 unresolved)
    Name      Learner
    Also Close your thread please

Maybe you are looking for