SERVICE_NAME and SERVICE_ID

Hi,
what is the difference between SERVICE_NAME uand SERVICE_ID ?
Many thanks.

Hi,
>>SERVICE_NAME
The SERVICE_NAMES is set in the INIT.ORA file and corresponds to (DB_NAME + DOMAIN). For example, if the DB_NAME is 'DB01' and the DOMAIN is 'COM' then, the SERVICE_NAMES will be 'DB01.COM'. Oracle (sometimes!) refers to the SERVICE NAME as the Global Database Name. The SERVICE_NAME is needed when setting up Net8. About TNSNAMES.ORA, SERVICE_NAME is the SERVICE_NAME used in the 'INIT.ORA'.
MYSERVICE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = <SERVER>)(PORT = <PORT>))
    (CONNECT_DATA =
(SERVICE_NAME = <SID>)
>>SERVICE_ID
The SID uniquely identifies an instance.
More information, you can access this link below:
http://www.adp-gmbh.ch/ora/misc/identifiers.html
Cheers

Similar Messages

  • Service_Name and SID

    Hi
    What is the difference between the Service_Name and the SID and when is it used.
    In the Default Listener File we have :
    (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
    Any comments for why/where is it used.
    Thanks

    Hi,
    Serice Name represents the global database name but SID represents instance name. both of them can be used in case of single instance but in RAC envirnoment you will have to specify the SID in case of that you want to login to specific instance of the instances in the RAC envirnoment.
    Here is a sample of a RAC tnsnames entry:
    SEC.GROUP.LOCAL =
    (DESCRIPTION =
    (ENABLE=BROKEN)
    (ADDRESS_LIST =
    (LOAD_BALANCE=ON)
    (FAILOVER=ON)
    (ADDRESS = (PROTOCOL = TCP)(HOST = 193.16.1.162)(PORT = 1521))
    (ADDRESS = (PROTOCOL = TCP)(HOST = 193.16.1.161)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = GRP)
    (FAILOVER_MODE=
    (TYPE=SELECT)
    (METHOD=BASIC)
    in the above example Service name (Global database name is used) if you want to be loged on a specific instance change :
    1. remove the address cluase of the unneeded instances
    2. add (SID=GRPx) cluase where GRPx is the SID of the needed instance.
    Regards;

  • Service_name and servers pool with priority

    Hi,
    Is there a way to define a service name SVC1 on 8 nodes (n1,n2 ...n8) with priority on somes nodes
    and a second service name SVC2 on 4 nodes (n1,n2,n3,n4) ?
    In RAC, a server can not be declare in more than one server pool, but in Exadata is-it the same ?
    Thank's

    Hi,
    you don't need to use server pools. Just create 2 services, one that is preferred on the first 4 nodes, and the other on the remaining 4 nodes. Both services should be available on all nodes. IIUC, this should do what you want to do.

  • Is there a transaction to get ORACLE_SID, SERVICE_NAME and Listener PORT?

    I know this information can be gotten from the Oracle DBAu2019s who set up the database, but in my big company, I even do not know who the DBAu2019s are.
    My Oracle database for SAP BI 7.0 is 10.2. Is it possible to get this information using a SAP BW/BI transaction?
    Thanks.

    > I know this information can be gotten from the Oracle DBAu2019s who set up the database, but in my big company, I even do not know who the DBAu2019s are.
    In that case you really shouldn't bother where the databases are because direct SQL access should be out of discussion.
    > My Oracle database for SAP BI 7.0 is 10.2. Is it possible to get this information using a SAP BW/BI transaction?
    No, there isn't such transaction. Of course not.
    What would it be good for?
    If you need to have this information - better get in touch with the DBAs.
    If the database servers are set up in a sensible way, you cannot access them anyhow.
    They would be located in separate network segments, the listener would block all connection trials that don't come from the application servers .
    There shouldn't be any option for you to even reach those servers without having the permission and the information from those people that are in charge of them.
    regards,
    Lars

  • How to relate java and Oracle

    i have to tried to make programs using java and oracle. if i give the values in the 'insert' statement it is getting updated in the original table in oracle but how to take the values from the text fields of java and insert into the tables in oracle. do we have any methods to convert the values into sql type. pl reply.

    Here is a sample of a Java program that uses JDBC and a PreparedStatement. This particular program does a select, but you can also use this for inserts. I'm not 100% this is what you are looking for, but if it isn't just let me know. I'll help if I can.
    Joel
    For inserts, just replace this code:
    ResultSet rs = ps.executeQuery();
    while (rs.next()) {
      System.out.println(rs.getInt(rs.findColumn("CNT")));
    }with this code (and obviously change the Select string to an Insert String):
    int rowcnt = ps.executeUpdate();Here is the whole program:
    import java.sql.*;
    import java.util.*;
    import java.text.*;
    class dbtest {
        public static void main(String args[]) throws SQLException {
            try {
                String timeString = new String("2000-11-01 23:59:59");
                SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd H:m:s");
                java.util.Date date = format.parse(timeString);
                Timestamp timestamp = new Timestamp(date.getTime());
                DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
                Connection conn =
                    DriverManager.getConnection(
                        "jdbc:oracle:thin:@riker:1521:mydb",
                        "myusername",
                        "mypassword");
                String sql =
                    "SELECT COUNT(*) CNT FROM SERVICE_ALARM "
                        + "WHERE TRANS_STREAM_NODE_ID = ? "
                        + "AND SERVICE_ID = ? "
                        + "AND ALARM_ID = ? "
                        + "AND RAISED > TO_DATE(?,'YYYY-MM-DD HH24:MI:SS')";
                PreparedStatement ps = conn.prepareStatement(sql);
                ps.setString(1, "ROW1");
                ps.setInt(2, 1);
                ps.setString(3, "ROW1");
                String myDate =
                    timestamp.toString().substring(0, timestamp.toString().length() - 2);
                System.out.println("myDate=(" + myDate + ")");
                ps.setString(4, myDate);
                ResultSet rs = ps.executeQuery();
                while (rs.next()) {
                    System.out.println(rs.getInt(rs.findColumn("CNT")));
                rs.close();
                ps.close();
            } catch (Exception e) {
                System.out.println("Java Exception caught, error message=" + e.getMessage());
    }

  • Use of SQL*Loader and Thin Client

    I have a java application that is currently using the thin client. For portability issues, I am unable to use an OCI driver. My application also uses SQL*Loader.
    My big issue is that The Thin client requires the HOST and SID for a connection.
    But, for SQL*Loader to work in a client/server environment it needs to use the SERVICE_NAME and net8. Is there any way to have SQL*Loader use similar information that the thin client is using?
    I know the right solution is to use the OCI drivers, but right now that is not feasible.
    Thanks for any help in advance
    Jeff McNurlan
    Navigation Technologies.

    I assume you are using an ObjectInputStream. Without seeing your code or a snippet I can't be certain...
    The JDBC spec says the following about ObjectInputStream :
    "An ObjectInputStream deserializes primitive data and objects previously written using an ObjectOutputStream"
    Since there was nothing written by ObjectOutputStream, ObjectInputStream has nothing to deserialize and this exception would be raised.

  • Difference between Naming.lookup and Registry.lookup in RMI

    Hi Folks,
    I have an RMI client which tries to look up a remote object using both
    Naming.lookup("//host[:port]/name OR rmi://<host_name>[:<name_service_port>]/<service_name>") and LocateRegistry.getRegistry().lookup("rmi://<host_name>[:<name_service_port>]/<service_name>").
    The first one fails whereas the second one succeeds. I am in a fix as to why it is so.Is there any difference between the lookup methods provided by Naming and Registry?
    The remote object was registered on the server using
    LocateRegistry.createRegistry().rebind("rmi://<host_name>[:<name_service_port>]/<service_name>").

    I suggest you take a look at this site to understand how to ask questions.
    And don't crosspost again

  • Two oracle homes 8 and 10

    Hi,
    on a windows 2003 server I have Oracle 10g and Oracle 8.1.7.
    When we start listener of 10g , it deos not start listener for 8.1.7 data base. For starting 8.1.7 Listener I should go to Oracle_HOME/bin of 8.1.7.
    Is there any way to resolve this in order to start Listener for 8.1.7 with 10g listener ? How to include 8.1.7 Db in SID_LIST_LISTENER of 10g listener.ora?
    The same we can not use SQLPLUS of 10g to connect to 8.1.7 data base . We should do this from 8.1.7ORACLE_HOME/bin. How can I change to be able to connect from every directory ?
    Many thanks.

    Use oracle netmanager to include oracle 8i database service name in to 10g listner or else manually include 8i SID and oracle home in to 10g listner file.
    Netmanager can be started by typing netmgr on command prompt
    e.g
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (PROGRAM = extproc)
    (SID_NAME = orcl)
    (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
    (SID_DESC =
    (GLOBAL_DBNAME = orcl)
    (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
    (SID_NAME = ORCL)
    (SID_DESC =
    (GLOBAL_DBNAME = TSH1)
    (ORACLE_HOME = /data2/oracle/ora8i)
    (SID_NAME = TSH1)
    2)
    in 10g Home you need to configure tnsnames.ora for the 8i database to be connected. Put the 8i server ip and SERVICE_NAME and port in 10g tnsnames.ora file. You can find this file in $ORACLE_HOME/network/admin
    TSH1 =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 172.16.21.29)(PORT = 1521))
    (CONNECT_DATA =
    (SERVICE_NAME = tsh1)
    )

  • Service_name or sid?

    hi,
    in some of our tnsnames.ora we're using service_name, and in some others, we're using sid.
    what is the difference and which should be used when?
    thanks

    This is what Oracle doc(11.2) says for the service.
    >
    A logical representation of a database, which is the way a database is presented to clients. A database can be presented as multiple services and a service can be implemented as multiple database instances. The service name is a string that is the global database name, that is, a name comprising the database name and domain name, entered during installation or database creation. If you are not sure what the global database name is, then you can obtain it from the value of the SERVICE_NAMES parameter in the initialization parameter file.>
    http://download.oracle.com/docs/cd/E11882_01/network.112/e10835/glossary.htm#NETRF1839
    And this is what is for SID
    >
    A name that identifies a specific instance of a running an Oracle database earlier than release 8.1. For any database, there is at least one instance referencing the database.
    For Oracle databases earlier than release 8.1, a SID is used to identify the database. The SID is included in the connect descriptor of a tnsnames.ora file and in the definition of the listener in the listener.ora file.>
    http://download.oracle.com/docs/cd/E11882_01/network.112/e10835/glossary.htm#BGBIAEED
    With the SID, which Sybrand has explained clearly is an older wayout,you are going to connect through the specific instance with very little options for HA solutions like Load Balancing and Fail Over. OTOH SErvice is a "logical gateway" to access the database which is not tied to any specific instance as such. Using the service name, you may connect to any instance which is configured to serve that service. The concept goes in much better conjuction with the RAC environments where we do configure any one active insntance as the preferred instance for the service where it runs in the first place and the other instance(s) as avaialable instance where it can also run in case the primary fails. So using the new syntax of serivices, the HA capabilities are available to you in a complete manner and now , almost all the things of Oracle, including scheduler, resource manager are shifting to services only and Oracle is also recommending people to use service_name parameter to use than the sid.
    HTH
    Aman....

  • WebDAV, XDB and Static File

    How to..
    <OL type="1">
    <LI>Using only what XE offers out-of-box, configure XE/XDB/Listener/whatnot to display static file (e.g index.html) at the root URL: http:// localhost:8080
    <LI>NOT using IE,Create folder in XDB
    </OL>
    thanks
    <span style="font-size:11;">Sorry searched but seems like lots of little pieces of info scattered everywhere,</span

    It can be. In theory the validation that does on when it's updated should catch all bad errors. In general I approach this as follows..
    Get the document out use FTP. Make a backup copy :). Edit using you favorite XML editor. Put back in using FTP. More often than not if it's something I expect to do many times I will create a SQL statement to do the changes and use dbms_xdb.cfgget and cfgupd to do the changes. I also have an xdb_configuration package that get methods for the really common ones. Latest version of the code is shown below...
    alter session set current_schema = XDBPM
    create or replace view DATABASE_SUMMARY_10200
    as
    select d.NAME, p.VALUE "SERVICE_NAME", i.HOST_NAME, n.VALUE "DB_CHARACTERSET"
      from v$system_parameter p, v$database d, v$instance i, nls_database_parameters n
    where p.name = 'service_names'
       and n.parameter='NLS_CHARACTERSET';
    show errors
    grant select on DATABASE_SUMMARY_10200 to public
    create or replace package XDB_CONFIGURATION_10200
    AUTHID CURRENT_USER
    as
    function   getDatabaseSummary return xmltype;
    procedure  folderDatabaseSummary;
    procedure  addSchemaMapping
                   NAMESPACE varchar2,
                   ROOT_ELEMENT varchar2,
                   SCHEMA_URL varchar2
    procedure addMimeMapping
                 EXTENSION varchar2,
                 MAPPING varchar2
    procedure  addServletMapping
                   pattern varchar2,
                   servletname varchar2,
                   dispname varchar2,
                   servletclass varchar2,
                   servletschema varchar2,
                   language varchar2 := 'Java',
                   description varchar2 := '',
                   securityRole xmltype := NULL
      procedure deleteservletMapping
                  servletname varchar2
      procedure setAnonymousAccess
                  STATE varchar2
    end XDB_CONFIGURATION_10200;
    show errors
    create or replace view DATABASE_SUMMARY_XML_10200 of xmltype
    with object id
    'DATABASE_SUMMARY'
    as select XDB_CONFIGURATION_10200.getDatabaseSummary() from dual
    create or replace trigger NO_DML_OPERATIONS_ALLOWED
    instead of insert or update or delete on DATABASE_SUMMARY_XML_10200
    begin
    null;
    end;
    grant select on DATABASE_SUMMARY_XML_10200 to public
    create or replace public synonym DATABASE_SUMMARY_XML for DATA_SUMMARY_XML_10200
    create or replace package body XDB_CONFIGURATION_10200 as
    function getDatabaseSummary
    return XMLType
    as
      summary xmltype;
      dummy xmltype;
    begin
      select dbms_xdb.cfg_get()
      into dummy
      from dual;
      select xmlElement
               "Database",
               XMLAttributes
                 x.NAME as "Name",
                 extractValue(config,'/xdbconfig/sysconfig/protocolconfig/httpconfig/http-port') as "HTTP",
                 extractValue(config,'/xdbconfig/sysconfig/protocolconfig/ftpconfig/ftp-port') as "FTP"
               xmlElement
                 "Services",
                   xmlForest(SERVICE_NAME as "ServiceName")
               xmlElement
                 "NLS",
                   XMLForest(DB_CHARACTERSET as "DatabaseCharacterSet")
               xmlElement
                 "Hosts",
                   XMLForest(HOST_NAME as "HostName")
               xmlElement
                 "VersionInformation",
                 ( XMLCONCAT
                            (select XMLAGG(XMLElement
                               "ProductVersion",
                               BANNER
                            )from V$VERSION),
                            (select XMLAGG(XMLElement
                               "ProductVersion",
                               BANNER
                            ) from ALL_REGISTRY_BANNERS)
      into summary
      from DATABASE_SUMMARY_10200 x, (select dbms_xdb.cfg_get() config from dual);
      summary := xmltype(summary.getClobVal());
      return summary;
    end;
    procedure folderDatabaseSummary
    as
      resource_not_found exception;
      PRAGMA EXCEPTION_INIT( resource_not_found , -31001 );
      targetResource varchar2(256) := '/sys/databaseSummary.xml';
      result boolean;
      xmlref ref xmltype;
    begin
       begin
         dbms_xdb.deleteResource(targetResource,dbms_xdb.DELETE_FORCE);
       exception
         when resource_not_found then
           null;
       end;
       select make_ref(XDBPM.DATABASE_SUMMARY_XML_10200,'DATABASE_SUMMARY')
       into xmlref
       from dual;
       result := dbms_xdb.createResource(targetResource,xmlref);
       dbms_xdb.setAcl(targetResource,'/sys/acls/bootstrap_acl.xml');
    end;
    procedure addServletMapping (pattern varchar2,
                                 servletname varchar2,
                                 dispname varchar2,
                                 servletclass varchar2,
                                 servletschema varchar2,
                                 language varchar2 := 'Java',
                                 description varchar2 := '',
                                 securityRole xmltype := NULL
    as
      xdbconfig xmltype;
    begin
       xdbconfig := dbms_xdb.cfg_get();
       select deleteXML
                xdbconfig,
                '/xdbconfig/sysconfig/protocolconfig/httpconfig/webappconfig/servletconfig/servlet-list/servlet[servlet-name="' || servletname || '"]'
              into xdbconfig
              from dual;
       if (language = 'C') then
         select insertChildXML
                  xdbconfig,
                  '/xdbconfig/sysconfig/protocolconfig/httpconfig/webappconfig/servletconfig/servlet-list',
                  'servlet',
                  xmlElement
                    "servlet",
                    xmlAttributes('http://xmlns.oracle.com/xdb/xdbconfig.xsd' as "xmlns"),
                    xmlForest
                       servletname as "servlet-name",
                       language as "servlet-language",
                       dispname as "display-name",
                       description as "description"
                    securityRole           
           into xdbconfig
           from dual;
       else
         select insertChildXML
                  xdbconfig,
                  '/xdbconfig/sysconfig/protocolconfig/httpconfig/webappconfig/servletconfig/servlet-list',
                  'servlet',
                  xmlElement
                    "servlet",
                    xmlAttributes('http://xmlns.oracle.com/xdb/xdbconfig.xsd' as "xmlns"),
                    xmlForest
                       servletname as "servlet-name",
                       language as "servlet-language",
                       dispname as "display-name",
                       description as "description",
                       servletclass as "servlet-class",
                       servletschema as "servlet-schema"
           into xdbconfig
           from dual;
       end if;
       select deleteXML
                xdbconfig,
                '/xdbconfig/sysconfig/protocolconfig/httpconfig/webappconfig/servletconfig/servlet-mappings/servlet-mapping[servlet-name="' || servletname || '"]'
              into xdbconfig
              from dual;
       select insertChildXML
                xdbconfig,
                '/xdbconfig/sysconfig/protocolconfig/httpconfig/webappconfig/servletconfig/servlet-mappings',
                'servlet-mapping',
                xmltype
                   '<servlet-mapping xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd">
                      <servlet-pattern>'||pattern||'</servlet-pattern>
                      <servlet-name>'||servletname||'</servlet-name>
                    </servlet-mapping>'
         into xdbconfig
         from dual;
      dbms_xdb.cfg_update(xdbconfig);
    end;
    procedure deleteservletMapping (servletname varchar2)
    as
      xdbconfig xmltype;
    begin
       xdbconfig := dbms_xdb.cfg_get();
       select deleteXML
                xdbconfig,
                '/xdbconfig/sysconfig/protocolconfig/httpconfig/webappconfig/servletconfig/servlet-list/servlet[servlet-name="' || servletname || '"]'
              into xdbconfig
              from dual;
       select deleteXML
                xdbconfig,
                '/xdbconfig/sysconfig/protocolconfig/httpconfig/webappconfig/servletconfig/servlet-mappings/servlet-mapping[servlet-name="' || servletname || '"]'
              into xdbconfig
              from dual;
      dbms_xdb.cfg_update(xdbconfig);
    end;
    procedure addSchemaMapping(NAMESPACE varchar2, ROOT_ELEMENT varchar2, SCHEMA_URL varchar2)
    is
      xdbConfig xmltype;
    begin
      xdbConfig := dbms_xdb.cfg_get();
      if (xdbConfig.existsNode('/xdbconfig/sysconfig/schemaLocation-mappings','xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"') = 0) then
        select insertChildXML
                     xdbConfig,
                     '/xdbconfig/sysconfig',
                     'schemaLocation-mappings',
                     xmltype('<schemaLocation-mappings xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"/>'),
                     'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"'
          into xdbConfig
          from dual;
      end if;
      if (xdbConfig.existsNode('/xdbconfig/sysconfig/schemaLocation-mappings/schemaLocation-mapping[namespace="'|| NAMESPACE ||'" and element="'|| ROOT_ELEMENT ||'"]','xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"') = 0) then
        select insertChildXML
                     xdbConfig,
                     '/xdbconfig/sysconfig/schemaLocation-mappings',
                     'schemaLocation-mapping',
                     xmltype('<schemaLocation-mapping xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"><namespace>' || NAMESPACE || '</namespace><element>' || ROOT_ELEMENT || '</element><schemaURL>'|| SCHEMA_URL ||'</schemaURL></schemaLocation-mapping>'),
                     'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"'
          into xdbConfig
          from dual;
      else
        select updateXML
                 xdbConfig,
                 '/xdbconfig/sysconfig/schemaLocation-mappings/schemaLocation-mapping[namespace="'|| NAMESPACE ||'" and element="'|| ROOT_ELEMENT ||'"]/schemaURL/text()',
                 SCHEMA_URL,
                 'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"'
          into xdbConfig
          from dual;
      end if;
      dbms_xdb.cfg_update(xdbConfig);
    end;
    procedure addMimeMapping(EXTENSION varchar2, MAPPING varchar2)
    is
      xdbConfig xmltype;
    begin
      xdbConfig := dbms_xdb.cfg_get();
      if (xdbConfig.existsNode('/xdbconfig/sysconfig/protocolconfig/common/extension-mappings/mime-mappings/mime-mapping[extension="' || EXTENSION || '"]','xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"') = 0) then
        select insertChildXML
                     xdbConfig,
                     '/xdbconfig/sysconfig/protocolconfig/common/extension-mappings/mime-mappings',
                     'mime-mapping',
                     xmltype('<mime-mapping xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd">
                <extension>' || EXTENSION || '</extension>
                <mime-type>' || MAPPING   || '</mime-type>
                </mime-mapping>'),
                     'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"'
          into xdbConfig
          from dual;
      else
        select updateXML
                 xdbConfig,
                 '/xdbconfig/sysconfig/protocolconfig/common/extension-mappings/mime-mappings/mime-mapping[extension="' || EXTENSION || '"]/mime-type/text()',
                 MAPPING,
                 'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"'
          into xdbConfig
          from dual;
      end if;
      dbms_xdb.cfg_update(xdbConfig);
    end;
    procedure setAnonymousAccess(STATE varchar2)
    is
      xdbConfig xmltype;
    begin
      xdbConfig := dbms_xdb.cfg_get();
      if (xdbConfig.existsNode('/xdbconfig/sysconfig/protocolconfig/httpconfig/allow-repository-anonymous-access') = 0) then
        select insertChildXML
                     xdbConfig,
                     '/xdbconfig/sysconfig/protocolconfig/httpconfig',
                     'allow-repository-anonymous-access',
                     xmltype('<allow-repository-anonymous-access xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd">' || lower(STATE) || '</allow-repository-anonymous-access>'),
                     'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"'
          into xdbConfig
          from dual;
      else
        select updateXML
                 xdbConfig,
                 '/xdbconfig/sysconfig/protocolconfig/httpconfig/allow-repository-anonymous-access/text()',
                 lower(STATE),
                 'xmlns="http://xmlns.oracle.com/xdb/xdbconfig.xsd"'
          into xdbConfig
          from dual;
      end if;
      dbms_xdb.cfg_update(xdbConfig);
    end;
    end XDB_CONFIGURATION_10200;
    show errors
    grant execute on XDB_CONFIGURATION_10200 to public
    create or replace public synonym XDB_CONFIGURATION for XDB_CONFIGURATION_10200
    desc XDB_CONFIGURATION
    show errors
    call xdb_configuration.folderDatabaseSummary()
    set echo on
    set pages 100
    set long 10000
    select xdburitype('/sys/databaseSummary.xml').getXML() from dual
    alter session set current_schema = SYS
    /Note that some of these issues (which are non XE specific) are also discussed in the XDB forum
    XML DB

  • Difference between service name and sid

    Hi All,
    1. I am not able to understand the difference between Service_name and SID.
    2. And I have 3 different databases(like 9i,10g,11g) with 3 instances in each(total 6), Can I configure one listener for all the databases and instances, as I have found in some documents that we need to set SID's list in listener.ora file.
    Please help me in this regard,
    Thanks in advance

    Rafi (Oracle DBA) wrote:
    Hi,
    If you wanted to have multiple databases specified you could nest more SID_DESC parameters in the SID_LIST. In the same way, if you wanted to listen on diffrent IP addresses you could use multiple DESCRIPTION sections in the DESCRIPTION_LIST. For example:
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.0.130)(PORT = 1521))
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.20.0.10)(PORT = 1522))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (ORACLE_HOME = /u01/app/oracle/product/10.1.0/db_1)
    (SID_NAME = test)
    (SID_DESC =
    (ORACLE_HOME = /u01/app/oracle/product/10.1.0/db_1)
    (SID_NAME = anotherdb)
    For more details check below link from oracle:
    http://download-west.oracle.com/docs/cd/B12037_01/network.101/b10776/toc.htm
    Best regards,
    Rafi.
    http://rafioracledba.blogspot.com/
    Hi Rafi,
    Thanks for your reply. Can I configure different version databases in same listener file with different port. For example:
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.10.0.130)(PORT = 1521))
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.20.0.10)(PORT = 1522))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (ORACLE_HOME = /u01/app/oracle/product/10.1.0/db_1)
    (SID_NAME = test)
    (SID_DESC =
    (ORACLE_HOME = /u01/app/oracle/product/11.1.0/db_1)
    (SID_NAME = anotherdb)
    Edited by: user7280060 on Jun 15, 2011 2:36 AM
    Edited by: user7280060 on Jun 15, 2011 2:37 AM

  • VBO-1508 and ORA-29902 when trying to configure XML DB

    Hello,
    after installing a fresh Oracle 9i EE System I would like to start using the XML DB part.
    While trying to change the XML DB config using the Oracle Enterprise Manager console I always get an error (see subject).
    There was alrady an Apache 2 installed and running on the server. Therfore I checked the httpd.conf in the Oracle admin dir and can find a Port 7783 and Listen 7783 directive.
    Maybe the EMC still tries to connect using port 8080? If this is true, how can I change this?
    Any suggestions?
    Thanks in advance
    Stephan

    You can create the following package as SYS, and then use the setHTTPPort procedure to change the Port Number...
    create or replace view DATABASE_SUMMARY
    as
    select d.NAME, p.VALUE "SERVICE_NAME", i.HOST_NAME, n.VALUE "DB_CHARACTERSET"
    from v$system_parameter p, v$database d, v$instance i, nls_database_parameters n
    where p.name = 'service_names'
    and n.parameter='NLS_CHARACTERSET';
    show errors
    grant select on DATABASE_SUMMARY to public
    alter session set current_schema = XDB
    create or replace package XDB_CONFIGURATION
    AUTHID CURRENT_USER
    as
    procedure setHTTPport (PORT_NUMBER number);
    procedure setFTPport (PORT_NUMBER number);
    function getDatabaseSummary return xmltype;
    procedure folderDatabaseSummary;
    end XDB_CONFIGURATION;
    show errors
    create or replace package body XDB_CONFIGURATION as
    FTP_XPATH varchar2(256) := '/xdbconfig/sysconfig/protocolconfig/ftpconfig/ftp-port';
    HTTP_XPATH varchar2(256) := '/xdbconfig/sysconfig/protocolconfig/httpconfig/http-port';
    function getDatabaseSummary
    return XMLType
    as
    summary xmltype;
    dummy xmltype;
    begin
    select dbms_xdb.cfg_get()
    into dummy
    from dual;
    select xmlElement
    "Database",
    XMLAttributes
    x.NAME as "Name",
    extractValue(config,'/xdbconfig/sysconfig/protocolconfig/httpconfig/http-port') as "HTTP",
    extractValue(config,'/xdbconfig/sysconfig/protocolconfig/ftpconfig/ftp-port') as "FTP"
    xmlElement
    "Services",
    xmlForest(SERVICE_NAME as "ServiceName")
    xmlElement
    "NLS",
    XMLForest(DB_CHARACTERSET as "DatabaseCharacterSet")
    xmlElement
    "Hosts",
    XMLForest(HOST_NAME as "HostName")
    xmlElement
    "VersionInformation",
    ( XMLCONCAT
    (select XMLAGG(XMLElement
    "ProductVersion",
    BANNER
    )from V$VERSION),
    (select XMLAGG(XMLElement
    "ProductVersion",
    BANNER
    ) from ALL_REGISTRY_BANNERS)
    into summary
    from SYS.DATABASE_SUMMARY x, (select dbms_xdb.cfg_get() config from dual);
    summary := xmltype(summary.getClobVal());
    return summary;
    end;
    procedure folderDatabaseSummary
    as
    result boolean;
    targetResource varchar2(256) := '/sys/databaseSummary.xml';
    xmlref ref xmltype;
    begin
    begin
    dbms_xdb.deleteResource(targetResource,dbms_xdb.DELETE_FORCE);
    exception
    when others then
    null;
    end;
    select make_ref(DATABASE_SUMMARY,'DATABASE_SUMMARY')
    into xmlref
    from DATABASE_SUMMARY;
    result := dbms_xdb.createResource(targetResource,xmlref);
    dbms_xdb.setAcl(targetResource,'/sys/acls/bootstrap_acl.xml');
    end;
    procedure setXDBport(PORT_XPATH varchar2, PORT_NUMBER number)
    as
    config XMLType;
    begin
    config := dbms_xdb.cfg_get();
    select updateXML(config, PORT_XPATH, PORT_NUMBER)
    into config
    from dual;
    dbms_xdb.cfg_update(config);
    commit;
    dbms_xdb.cfg_refresh();
    end;
    -- Create the setHTTPport and setFTPport procudures
    procedure setHTTPport (PORT_NUMBER number)
    as
    begin
    setXDBport(HTTP_XPATH || '/text()', PORT_NUMBER);
    end;
    procedure setFTPport(PORT_NUMBER number)
    as
    begin
    setXDBport(FTP_XPATH || '/text()', PORT_NUMBER);
    end;
    end XDB_CONFIGURATION;
    show errors
    create or replace view DATABASE_SUMMARY of xmltype
    with object id
    'DATABASE_SUMMARY'
    as select xdb_configuration.getDatabaseSummary() from dual
    show errors
    alter package XDB_CONFIGURATION compile
    show errors
    alter view DATABASE_SUMMARY compile
    show errors
    grant select on DATABASE_SUMMARY to public
    create or replace trigger NO_DML_OPERATIONS_ALLOWED
    instead of insert or update or delete on DATABASE_SUMMARY
    begin
    null;
    end;
    show errors
    create or replace public synonym XDB_CONFIGURATION for XDB_CONFIGURATION
    grant execute on XDB_CONFIGURATION to public
    call xdb_configuration.folderDatabaseSummary()
    set echo on
    set long 10000
    select xdburitype('/sys/databaseSummary.xml').getXML() from dual
    alter session set current_schema = SYS

  • Event Notifications: insufficient system memory

    I'm looking for a sanity check.  Service broker and Event Notifications are new to me, so it is possible I'm either abusing or incorrectly using the technology.  I'm experimenting with using Event Notifications and Server Broker to log error messages.  The process works pretty well as long as I don't do something stupid such as stressing the process by calling raiserror in a loop of a 100000 - twice.  It processed for a while, but eventual either SQL Server terminates (sev 25) or I had to force the SQL service to stop by killing it's process via task manager.  I could not connect to SQL Server or stop the service normally.  
    I have several general questions.  I think they are good questions.  Any thoughts or suggestions would be appreciated. 
    1) I'm looking into generating deadlock and blocking email alerts.  It appears that Event Notification is the way to go since there are very few events and I can respond to the event with an email.  Is there a better method to automate blocking and deadlock email alerts that include event details? 
    2) If I wanted to retain some history of errors for the developers, should Event Notifications be avoided if a high number of errors can be generated by a badly formed T-SQL?  Avoid TRC_ERRORS_AND_WARNINGS and USER_ERROR_MESSAGE?  (I could tell the developers not to be stupid, but why would that stop them if it does not stop me?)
    3) Is there a way to efficiently filter a Event Notification from entering the queue before the Receive statement is called?  I get some events that I throw away after receiving them.  For example, perhaps I want all events from all non-system databases without having to add a notification for each single non-system database.  Or I want all errors with severity 11-17 only? 
    4) Is there a trick to filter out events from the procedure activated by the event.  I tried using raiserror to debug a procedure without thinking.  The result was that the queue never was empty because the processing produced more events to process.  As a result, I don't use raiserror and use a try-catch to avoid raising errors in the procedure activated. 
    5) I can receive one message at a time using local variables or receive a batch of messages using a local table.  Is a small batch the best way even if there is memory pressure? 
    6) In the activated procedure I continue processing in a loop until there are no more messages.  This seems to be the most efficient.  Is this always the case?  Should I exit the procedure after a set number (large) of messages have been received?  The procedure would activate again to continue processing? 
    7) Is there any point to using the MAX_QUEUE_READERS setting when processing event notifications?  Should it be 1? 
    8) I currently get the next conversation group id and process its messages within a transaction.  Is this a bad idea with event notifications?  Should I just call Receive and get the next batch?  I don't really care if I lose some messages if things are going badly.  Should I avoid wrapping the receive in a transaction? 
    9) I could run a trace that starts with SQL Server; however, I think my only choice is to log to a file.  Is there a way to trace to a table using SQLTrace without running profiler?  I would like to automate the process and have the data in a table so that it can be easily queried and parsed for each database/team. 
    10) Is there a way to fix my process and handle 100000 messages a minute?  Is there a way to skip messages when it gets to busy?  Can the query generating the messages get throttled - perhaps along with the query designer - before the server gets into trouble?  Query the memory used by a queue and drop/create the queue with a delay if there is an issue? 
    I'm using a single CPU test machine with only 1 GB and 2 GB pagefile and a single disk.  OS: Windows 2003 R2 SP2.  SQL: 9.0.3054 and on 9.0.3228 (update package 6 just came out today).  I could add memory, but I think that would just permit me to queue more message before running into trouble. 
     I'll add code shortly - length limit.

    Here is the activation procedure to "receive" the messages.  I won't bother including the scripts for the two tables.  The 50000 char limit is trouble. 
    CREATE PROCEDURE [monitor].[prReceiveEventNotificationQueue]
    AS
    SET XACT_ABORT ON;
    BEGIN TRY
    WHILE 1=1
    BEGIN
    BEGIN TRANSACTION;
    WAITFOR(GET CONVERSATION GROUP @conversation_group_id
    FROM DBA.monitor.EventNotificationQueue), timeout 10000;
    IF @conversation_group_id IS NULL
    BEGIN
    ROLLBACK;
    BREAK;
    END;
    DELETE FROM @EventNotification;
    RECEIVE TOP (100)
    queuing_order,
    [conversation_group_id],
    message_sequence_number,
    NULLIF([service_name], @service_name_expected),
    service_id,
    NULLIF(service_contract_name, @service_contract_name_expected),
    service_contract_id,
    NULLIF(message_type_name, @message_type_name_expected),
    message_type_id,
    validation,
    CASE WHEN validation = 'X' THEN CAST(message_body AS XML)
    WHEN validation = 'E' THEN CAST('<empty />' AS XML)
    WHEN validation = 'N' THEN CAST('<binary><![CDATA['
    + CAST(message_body as varchar(MAX)) + ']]></binary>' AS XML)
    END,
    NULL,
    --NULL,
    NULL,
    NULL,
    NULL,
    NULL,
    0
    FROM DBA.monitor.EventNotificationQueue
    INTO @EventNotification
    WHERE conversation_group_id = @conversation_group_id;
    SELECT @rowcount = @@ROWCOUNT
    IF @rowcount = 0
    BEGIN
    ROLLBACK;
    BREAK;
    END;
    -- preprocess some fields in the XML used in filtering and statistics
    -- insert new messages into the EventNotification table
    INSERT INTO monitor.EventNotification (
    queuing_order,
    [conversation_group_id],
    message_sequence_number,
    [service_name],
    service_id,
    service_contract_name,
    service_contract_id,
    message_type_name,
    message_type_id,
    validation,
    message_body,
    post_time,
    database_name,
    event_type,
    severity,
    error
    SELECT
    queuing_order,
    [conversation_group_id],
    message_sequence_number,
    [service_name],
    service_id,
    service_contract_name,
    service_contract_id,
    message_type_name,
    message_type_id,
    validation,
    message_body,
    post_time,
    database_name,
    event_type,
    severity,
    error
    FROM @EventNotification
    WHERE ignore = 0;
    COMMIT
    -- Gather statistics
    WAITFOR DELAY '0:00:00:01'
    END;
    END TRY
    BEGIN CATCH
    IF NOT(XACT_STATE() = 0)
    ROLLBACK;
    INSERT INTO DBA.monitor.ErrorLog (
    [number],
    error_message()
    END CATCH;
    RETURN 0;

  • Tabular form update manual

    Dears ,
    i have manual tabular form
    select htmldb_item.checkbox(1,rownum) " ",
           x.service_id,
           x.service_name,
    htmldb_item.checkbox( 4, flag,decode( flag, 1, 1, 0) ) flag
    from (
    select htmldb_item.hidden(2,c.service_id) service_id,
              htmldb_item.text(3,s.service_name)  service_name,
               htmldb_item.checkbox( 4, flag,decode( flag, 1, 1, 0) ) flag
    from  CUST_SERVICES c,SERVICES s
    where c.service_id=s.service_id
    and  c.cust_id=:p6_customer_id) x
    order by 2and make process to save
    Type:     PL/SQL anonymous block
    Process Point : on submit - after computation and validation
    Run Process : once per page visit (defult)
    source code :
    for i in 1..htmldb_application.g_f01.count
    loop
    update CUST_SERVICES set flag = htmldb_application.g_f04(htmldb_application.g_f01(i));
    -- where CUST_ID=:p6_customer_id
    -- and  SERVICE_ID =htmldb_application.g_f02(htmldb_application.g_f01(i));
    end loop;put it's not save , please help

    Hi Phil,
    You can add in the in-built MRU update process that will do this for you. When you add a process, select Data Manipulation then Multi Row Update, then follow the prompts to link it to your table.
    In your code snippet, htmldb_application.g_f01 refers to the first column in your form (even if this is hidden). Normally this is the Primary Key for the table on which the form is based. htmldb_application.g_f02 refers to the second column and so on, although you can assign any number from 1 to 50 to each field when you create the sql statement.
    The replace() function is used because some of the fields will contain %null% which needs to be converted to null before updating the table.
    Regards
    Andy

  • Not able to connect with Oracle server through VBScript without DSN

    Hi
    I have both Oracle9i and Oracle10g clients installed with local system.
    I am able to connect to Oracle Database 11g Enterprise edition server though sqlplus through command prompt and also through AQT without any error.
    As the server has lots of database ,whenever I connect to a particular database through sqlplus from command prompt,I connect as below
    C:>sqlplus username/password@service_name
    and it gets connected without any error.
    When I am trying to connect the same database through VB Script,I am getting ORA-12560 TNS:Protocol Adaptor Error.
    Below is the connection string I am using:
    Database_String = "SERVER=xxxx.vvvn.Com;Driver={Oracle in OraHome92};DATABASE=service_name;user id=userid; password=passowrd"
    I have installed a Oracle10g server in my local system and tried to connect the same way and I was successfully ,but its not working when the server is running remotely.
    Does it make any difference with the version of driver being used ?Should I need to modify my connection string anyway.
    Please help me as to identify the issue.Thank you very much in advance.
    Regards
    Sahina

    check the listener status in server end,
    lsnrctl status
    lsnrctl servicesif not start
    lsnrctl startThanks

Maybe you are looking for