Need Port number for active Host name using java code

Hi All,
I have tnsnames string and I know one of the following Host is working  say Primary-host .
DESCRIPTION =(ADDRESS_LIST= (ADDRESS = (PROTOCOL = TCP)(HOST = Primary-host)(PORT = 1521)) (ADDRESS = (PROTOCOL = TCP)(HOST = Secondary-host)(PORT = 1522)))(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = ORA112DB)))
Could you please help me to get Port number of only primary Side ?. This needs to do because we cannot get port number using any oracle query.
Thanks in advance
JPrashant

You may get client's host IP with
select sys_context('USERENV','IP_ADDRESS') from dual;
You may get client's port with
SELECT port FROM v$session where username = user;
To get connection port you should issue OS command (*nix) like
netstat -n | grep <client_ip>:<client_port>
tcp 0 0 192.168.1.1:1521 132.168.1.2:65432 ESTABLISHED
To run OS command (keeping in mind all possible security consequences) it is possible to write C, java code.
Example -- http://www.oracle.com/technetwork/database/enterprise-edition/calling-shell-commands-from-plsql-1-1-129519.pdf

Similar Messages

  • Setting System DSN for MS Access Database using Java Code

    How to set the system DSN for Access database using Java Code at runtime....???
    Replies are deeply appreciated...

    I found a 3rd Party MS Access JDBC Driver from a Google search. I downloaded and tried the free trial version. It worked fine but we opted not to purchase the full version and went a different route. If you don't find it, let me know and I'll see if I can track down the name of the product we tested.

  • Find current host name using Java

    I am running currently on Oracle 9i app server in a clustered environment. My application has business logic that needs current host name. How can I find out the host name without externalising(like properties file) the information. Is there a java api like
    .getHostName()
    Rama

    try this:
    import java.net.InetAddress;
    public class Foo {
        public static String getLocalhostName() {
            String hostName = "";
         try {
             InetAddress address =
              InetAddress.getLocalHost();
                hostName = address.getHostName();
            } catch (Exception e) {
                // error handle any which way you like
                e.printStackTrace (System.err);
            return hostName;
    }cheers,
    Georg.

  • Stoping System Clock using Java code.

    Is it possible to do so if yes then some code idea for
    Stoping System Clock using Java code.
    [email protected]

    The system clock is controlled from the BIOS, and as such, I don't think even windoze can stop it, though it can be continually reset. I don't believe that Java provides a sufficiently low level of control to set the system clock, although you could use a native method to accomplish the task.
    Why would you want to do such a thing?

  • What port number for Desktop Sharing using in Lync Server 2013 and Lync Online

    Dear All,
          My environment using Lync Server 2013 and Lync online on Office 365. I don't want my user using Desktop Sharing feature. then I need to know what port number for Desktop Sharing using in Lync Server 2013 and Lync Online.
    I will deny this port on personal firewall each client.
          Thank you for your advise.

    Hi,
    I'm not sure you'd be able to do this with ports without impacting other application sharing features such as Q&A, Whiteboard, Poll etc - I'm pretty sure they all come under the same umbrella of ClientAppSharing.
    Ordinarily you would create or modify your conferencing policy to restrict sharing to single programs only using a cmdlet similar to below;
    Set-CsConferencingPolicy -Identity "Global" -EnableAppDesktopSharing SingleApplication
    This would disable desktop sharing but enable users to continue sharing other single programs. If you want to remove that functionality too, then replace the 'SingleApplication' parameter with 'None'. Then users won't be able to share any programs either.
    This is the correct way to do it as the icons will be greyed out for the users. Doing it your way, they would still be able to click them, and it would throw an error - this will lead to a lot more support calls and people assuming a service is broken.
    I hope that helps some.
    Kind regards
    Ben

  • What is the URL that Adobe Acrobat needs to contact for Activation after you enter the serial number

    What is the URL that Adobe Acrobat needs to contact for Activation after you enter the serial number? We need to allow internet access to our users for it.

    there are quite a few but they all are on the adobe.com domain.

  • Is it possible to set a port number for a server as a value from env ?

    Hello,
    I'm using the version 6.1 - sp8 and I'd like to set the port number of a server as a value returned by an environment variable. Will this be achievable somehow through the admin console?
    In fact, I have an environment variable called '$WEB_SERV_PORT'. I'd need this value to be assigned as the port number for a server. The reason why I am trying to do this is coz I have multiple instances running as different batch accounts and each batch account would be having its own '$WEB_SERV_PORT' which would be the port on which iplanet would be running for that batch account.
    I'd appreciate if anyone could help.
    Thank you,
    Presley.

    Hello Sriram,
    Thanks for the info that you have provided. I do agree that what you said would be a better approach.
    However I've got a couple of questions on the approach that you have suggested (Sorry that its a bit off from the main topic). Just wanted to clarify if what I thought is in sync with the approach that you suggested.
    1. As you said, I could setup multiple virtual server within an instance (https-<hostname>) - Does this mean that I am creating "Virtual Server Classes" for each server and through the web-applications tab, assigning the corresponding war file to each Virtual Server Class?
    2. Another approach that came upto my mind is that I could create different instances like (https-virtual server1, https-virtual server2, https-virtual server3 etc..). I am assuming that if I follow this approach, I could have each server allocate memory indiviually to the virtual servers. for eg, I could allocate
    1024 MB to each virtual server where as in the first approach, I would have to make the 1024 MB to share between all the Virtual Server Classes. And also, in the case theres an issue with one server, I could handle the start/ stop etc individually, where as in the 1st approach, all the virtual classes would be affected by the start/stop. Am I assuming it correctly ?
    I'd appreciate if you could let me know.
    Thank you,
    Presley.
    Edited by: pressley on Mar 26, 2008 7:04 AM

  • Where can I get serial number for Lightroom to start using it?

    Hello. I have just created Adobe CC account and purchased a Photography membership plan for Individuals. The price is 9,99 per month and this sum has already been taken from my card. On this page (https://accounts.adobe.com/plans) I can see the confirmation that I have obtained this plan.
    Now I want to use Lightroom but it asks me for serial number. After reading some help I found that I should get serial number from here - https://www.adobe.com/account.html. But on this page it says that "You have no registered products.". So I see no serial number.
    So there's a simple question - where can I get serial number for Lightroom to start using it?

    Jeff, thanks for your answer but it doesn't help. I've successfully passed all checks on page Sign in, activation, or connection errors | CS5.5 and later . My internet connection is ok, hosts file ok, certificates ok, etc. It's not a source of the problem.
    I've found that on page Adobe ID it says that I have free membership. Somehow it turns that my purchased Photography membership plan is not there at all. in order to proof that I really purchased it please see screen from my internet-banking page below:
    Why it is displayed only free membership in my account page and not Photography subscription which was already paid?

  • How do i find the port number for oracle10g

    Hi,
    I have installed oracle10g on my pc running windows XP. I need to get the port number for JDBC drivers used by Java Application when defining a JDBC source.
    Java is running on the same machine.
    When I installed oracle I was given the links (with port numbers) for EM, ULTRA SEARCH and iSQLPLUS, what I need is the ORACLE10g database port number. Anybody know where I get from ?
    Cheers

    thanks for the reply the portlist does not contain the port of oracle. The file is below.
    [i]Ultra Search HTTP port number =5620
    Enterprise Manager Agent Port =
    iSQL*Plus HTTP port number =5560
    Enterprise Manager Console HTTP Port (oracle10) = 5500
    Enterprise Manager Agent Port (oracle10) = 1830
    However searching through some other threads found the port to be 1521, which
    oracle must set during installation and tell anybody, unless this infor is in the log.
    so configured the oracle JDBC driver as below (PE8.2 --> ConnectionPools)
    Datasource Classname = oracle.jdbc.pool.OracleDataSource
    URL = jdbc:oracle:thin:@localhost:1521:oracle10
    User = abc
    Password = abc
    Now able to ping. Cheers

  • Stored procedure for getting host name, host instance and status of that host is it running or stopped.

    Hello all,
    yesterday I got one task in that I have to stored procedure for getting host name, host instance and status of that host is it running or stopped.
    any body knows where exactly, In which table this details are there in BizTalk databases.
    thanks

    Status of the host instance is not stored in the SQL database for you to query the status using stored procedure. You have to either use Powershell or WMI to get the status.
    In SQL, following table contains the details about the host like Name, LoginName, IsDisables etc but status of the host instance is not stored in the database.
    SELECT * FROM BizTalkMgmtDb..adm_HostInstance
    Powershell to get the status:
    http://axonolympus.nl/?page_id=186&post_id=969&cat_id=6&lang=en
    WMI to get the status:
    https://msdn.microsoft.com/en-us/library/aa561820.aspx?f=255&MSPPError=-2147217396
    https://msdn.microsoft.com/en-us/library/aa578621.aspx
    Regards,
    M.R.Ashwin Prabhu
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

  • Technical Monitoring for Logical host name

    Dear experts,
    We are in mid of technical monitoring finalisation.
    one of the interesting thing which i found with respect to the logical host name, we installed SMD agent on Virtual host name and our system is not with HA environment and no clustering. It is just a system with single instance.
    During the managed system configuration all the physical and logical host name reported by SMD autodiscovery, all went fine. But in Technical monitoring shows only virtual host name with the updated alerts , and logical host name only shows grey alert.
    virtual host shows alert here
    logical host name shows grey
    how can i get alert displayed for logical host name too? do i need to do some settings at the OS level , could you guide us?
    Thanks
    Jansi

    Hi Giri Raju Ayyagari,
    I am sorry, seems you are still not able to get my issue, moreover you get diverting my issue
    Here the problem is not at all related to agents on fly. thats the separate topic.
    We are having issue on Logical Host names where there is no HA environment, means only One logical host name created.
    I raised to SAP, l will update once the update from SAP given.
    Best regards
    Jansi

  • How to change the port number for deployment in JAVA Studio Enterprise 8?

    Hi!
    Yesterday i downloaded this new sun java studio enterprise and found it mind blowing.
    Now i find that all my previous applications which were running on port 8080 can't be run on sun java studio enterprise(sjse) 8.
    Can anyone tell me how to change the port number on this software so i won't have to edit all my applications?

    http://docs.sun.com/source/819-0080/install.html
    In the Admin Configuration page (or at the command line), enter the following:
    Admin User Name�Name of the user who administers the server
    Password�Admin user�s password to access the Admin Server (8-character minimum)
    Admin Port�Administration port number for initial server instance
    HTTP Port�Port number to access the default server instance
    HTTPS Port�Secure port number to access the default server instance

  • HT201320 I have an email account through yahoo. I am having trouble setting it upon my iPhone and can't receive or send emails!!!! I contacted Rogers and they said I need to find out the host name of the incoming server, in other words yahoos host name. H

    I have an email account through yahoo. I am having trouble setting it upon my iPhone and can't receive or send emails!!!! I contacted Rogers and they said I need to find out the host name of the incoming server, in other words yahoos host name. Help!!

    Yahoo's servers are notoriously unreliable. Use the "Yahoo" account type when setting it up. If it doesn't work, and you are positive the credentials are correct, wait a while and try again.
    While you're waiting, set up a free gmail or iCloud email account.

  • Does Anyone Know the Standard TCP Port number for "itpc" Protocol?

    Hello,
    I am trying to determine if the TCP port number for “itpc://” protocols is 3689 (iTunes Music Sharing), 443 (iTunes Store), 548 (Personal File Sharing, Apple File Share), or another number. Searching through this form and referring to “Well Known” TCP and UDP Ports Used By Apple Software Products Tech document help point me in the right direction, I have no way of confirming any of the numbers as the standard.
    I have attached the URLs to documents that go further in depth on what I am talking about.
    “Well Known” TCP and UDP Ports Used By Apple Software Products Tech document
    http://docs.info.apple.com/article.html?artnum=106439
    Article explaining iTunes podcast direct links (“itpc://”)
    http://www.apple.com/itunes/store/podcaststechspecs.html
    Thank you for your help.
    Toshiba   Windows XP Pro  

    Hi Krisina ,
    You could seek help referring to the following link and find your serial number easily.
    https://helpx.adobe.com/x-productkb/global/find-serial-number.html
    Regards
    Sukrit Dhingra

  • My iPhone 5 ,iOS 7.0.2 after rstore firmware ,now need old email for activation , but i dont know email and password , what can i do?

    my iPhone 5 ,iOS 7.0.2 after rstore firmware ,now need old email for activation , but i dont know email and password , what can i do?

    Hi mt.ahsan!
    I have a website for you that can help you find that Apple ID, then you can reset the password for it if necessary:
    Apple ID: How to find your Apple ID
    http://support.apple.com/kb/HT5625
    Thanks for using the Apple Support Communities!
    Cheers,
    Braden

Maybe you are looking for

  • ITunes Match colapse in step 2

    When I add new songs to itunes and update itunes match the process freeze in step 2 when almost check all songs except 1 or 2

  • Urgent: how to add additional records to hashed table

    Hi, I want to add records to a hashed table. my code is: data: ipn_pc_zoba type hashed table of tpn_pc_zoba with unique key vbeln. loop at izoba into wzoba. clear wpn_pc_zoba . read table ipn_pc_zoba into wpn_pc_zoba with key vbeln = wzoba-LS_KDAUF.

  • Invisible box on hyperlinks?

    How do you create (or have as the default) hyperlinks that will be invisble when exporting an InDesign CS4 document to Acrobat? Mac OX 10.6.8

  • BT Sport HD: sound stops after a minute or so

    Hi Firstly I was impressed with the launch show last night - well done BT! I have a YouView box and Infinity BB. I tried to watch BT Sport 1 on HD (channel 510), but after a minute the sound stopped. I could change channels and then come back to 510

  • Convert REM Files to MP3 Format?

    I have downloaded several songs via the Amazon MP3 application on my Blackberry Curve 9300.  Little did I know that the songs were downloaded as rem files and not mp3 format?  I cannot upload the files to my desktop or laptop computers nor my Kindle.