Get port number,host name,service name from database

Is there any way to know the host name,port number, sid and the service name of a particular instance from the database.

> Is there any way to know the host name,port number, sid and the service name
of a particular instance from the database.
Why?
The host name in the HOST_NAME column of V$INSTANCE for example, may not be the hostname/IP address that the local Listener listens for connections on. Or the Listener can listen on that host name/IP and several other local IP addresses.
The port number used for listening for connections by clients, are determined by the Listener's configuration.
Thus if you can explain the requirement for this info, maybe the forum can provide better and more specific answers.

Similar Messages

  • Getting SID with a given service name or host

    Hi.
    I am curious if there is a way or command line to get SID with a given service name or host. I have a service name, but I don't know how to get SID. I know that I can parse the tnsnames.ora file to get it, but if possible, I want to use the more official and safe way.
    I'd appreciated if somebody knows it.

    caesarkim wrote:
    Is there a way to take care of it as one command something like this?
    sqlplus username/password@localhost "SELECT NAME FROM V$DATABASE@SERVICE_NAME"
    Thanks.Make a text file, dbname.sql, that contains lines below
    spool sid_name.txt
    SELECT NAME FROM V$DATABASE@SERVICE_NAME;
    spool off
    exit
    then invoke it like below
    sqlplus username/password@localhost @dbname.sql

  • PAM-KRB5: account:  unable to get host based service name for realm

    I want a custom service to authenticate via PAM with Microsoft Active Directory Services on Windows 2003. kinit appears to work:
    Myserver% klist
    Ticket cache: /tmp/krb5cc_200
    Default principal: [email protected]
    Valid starting Expires Service principal
    Tue 01 Aug 2006 10:42:23 AM CDT Tue 01 Aug 2006 08:42:23 PM CDT krbtgt/[email protected]
    renew until Tue 08 Aug 2006 10:42:23 AM CDT
    Running a sample PAM consumer using 'winsamp' as its service name complains that Kerberos doesn't know the user. syslog reports: PAM-KRB5: account: unable to get host based service name for realm 'EXAMPLE.COM'.
    I'm stuggling to get any additional logging out of either PAM or Kerberos. Any advice appreciated.
    /etc/pam.conf:
    winsamp auth required pam_krb5.so.1 debug
    winsamp password required pam_krb5.so.1 debug
    winsamp account required pam_krb5.so.1 debug
    winsamp session required pam_krb5.so.1 debug
    /etc/krb5/krb5.conf:
    [libdefaults]
    default_realm = EXAMPLE.COM
    default_tkt_enctypes = des-cbc-md5 ; or des-cbc-crc
    default_tgs_enctypes = des-cbc-md5 ; or des-cbc-crc
    [realms]
    EXAMPLE.COM = {
    kdc = mykdc.example.com:88
    admin_server = mykdc.example.com
    default_domain = EXAMPLE.COM
    [domain_realm]
    .example.com = EXAMPLE.COM
    [logging]
    default = FILE:/var/krb5/kdc.log
    kdc = FILE:/var/krb5/kdc.log
    kdc_rotate = {
    # How often to rotate kdc.log. Logs will get rotated no more
    # often than the period, and less often if the KDC is not used
    # frequently.
    period = 1d
    # how many versions of kdc.log to keep around (kdc.log.0, kdc.log.1, ...)
    versions = 10
    [appdefaults]
    kinit = {
    renewable = true
    forwardable= true
    PAM sample application synopsis:
    pam_start("winsamp", "someuser", &conv, &pamh);
    err = pam_authenticate(pamh, 0);
    if (err == PAM_USER_UNKNOWN)
    printf("don't know that user\n"); // <-- we always arrive here
    logout();
    }

    Part of the problem was that the Sun server's domain was not an exact match for the ADS domain. One was XXXX.EXAMPLE.COM and the other was just EXAMPLE.COM. Adding the equiv. domains in krb5.conf improved that situation.
    The sample PAM application still doesn't behave the way I want. When pam.conf is configured to authenticate against /etc/passwd, it works. Not when authenticating against ADS alone. I've come to the conclusion that PAM is for authenticating ONLY access to Solaris accounts.
    My application does not need a Solaris account. Am I using the wrong authentication API?

  • Function Module to get pernr number based on first name and last name

    Hi All,
    What is the Function Module to get pernr number based on first name and last name.
    Could you please help me.
    T@R.
    Vidya

    hi Vidya,
    you can get perner from PA0002 based on firs name and last name.
    use select query and get perner.

  • TT12039: Could not get port number of TimesTen replication agent on remote

    i use the "ttRepAdmin -duplicate -from yymhcc_active -host mt2 -setMasterRepStart -uid musicclub -pwd musicclub -remoteDaemonPort 17001 -keepCG -cacheUid musicclub -cachePwd musicclub -localhost "mt4" yymhcc_standby;"
    TT12039: Could not get port number of TimesTen replication agent on remote host. Either the replication agent was not started, or it was just started and has not communicated its port number to the TimesTen daemon
    at the mt4 machine :
    ping mt2
    PING mt2 (10.25.71.26) 56(84) bytes of data.
    64 bytes from mt2 (10.25.71.26): icmp_seq=1 ttl=64 time=0.138 ms
    64 bytes from mt2 (10.25.71.26): icmp_seq=2 ttl=64 time=0.108 ms
    at mt2
    ttAdmin -query yymhcc_active
    RAM Residence Policy : manual
    Manually Loaded In RAM : True
    Replication Agent Policy : manual
    Replication Manually Started : True
    Cache Agent Policy : manual
    Cache Agent Manually Started : True
    and
    repschemes;
    Replication Scheme Active Standby:
    Master Store: YYMHCC on MT2
    Master Store: YYMHCC_STD on MT4
    Excluded Tables:
    None
    Excluded Cache Groups:
    None
    Excluded sequences:
    None
    Store: YYMHCC on MT2
    Port: 21000
    Log Fail Threshold: (none)
    Retry Timeout: 30 seconds
    Compress Traffic: Disabled
    Store: YYMHCC_STD on MT4
    Port: 20000
    Log Fail Threshold: (none)
    Retry Timeout: 30 seconds
    Compress Traffic: Disabled
    1 replication scheme found.

    when i use: ttRepAdmin -duplicate -from yymhcc -host mt2 -setMasterRepStart -uid musicclub -pwd musicclub -remoteDaemonPort 17001 -keepCG -cacheUid musicclub -cachePwd musicclub -localhost "mt4" yymhcc_standby
    TT8179: Cannot create duplicate store : store already exists
    master odbc config :
    [yymhcc_active]
    Description=For Active Master
    Driver=/usr/local/timesten/TimesTen/tt70/lib/libtten.so
    DataStore=/usr/local/timesten/TimesTen/yymhcc/yymhcc
    DatabaseCharacterSet=ZHS16GBK
    ConnectionCharacterSet=ZHS16GBK
    Authenticate=1
    OracleID=yymhcc
    OraclePWD=mc
    UID=mc
    PWD=mc
    #ipcs memory size(M)
    PermSize=8192
    Connections=2047
    #permsize*20%
    TempSize=1024
    PassThrough=1
    WaitForConnect=0
    Isolation=0
    Logging=1
    DurableCommits=0
    CkptFrequency=600
    CkptLogVolume=256
    #LogBuffSize=256000
    LogBuffSize=524288
    LogFileSize=256
    LogFlushMethod=1
    LogPurge=1
    LockLevel=0
    LockWait=5
    SQLQueryTimeout=5
    RecoveryThreads=16
    subscriber config :
    [yymhcc_standby]
    Driver=/usr/local/timesten/TimesTen/tt70/lib/libtten.so
    #DataStore=/usr/local/timesten/TimesTen/yymhcc_std/yymhstd
    DatabaseCharacterSet=ZHS16GBK
    ConnectionCharacterSet=ZHS16GBK
    Authenticate=1
    OracleID=yymhcc
    OraclePWD=mc
    UID=mc
    PWD=mc
    PermSize=8192
    Connections=2047
    #permsize*20%
    TempSize=1024
    PassThrough=1
    WaitForConnect=0
    Isolation=0
    Logging=1
    DurableCommits=0
    CkptFrequency=600
    CkptLogVolume=256
    #LogBuffSize=256000
    LogBuffSize=524288
    LogFileSize=256
    LogFlushMethod=1

  • How does one find out the database name , service name in a database

    hi,
    how do u find out the database name , service name , SID in a database.
    Please reply.
    Thanks ,
    Regards,
    RC

    This particular information is available in the view V_$PARAMETER owned by SYS. But you can also login with Server Manager as user INTERNAL and run:
    SHOW PARAMETERS
    The entries pertaining to the naming of the database are:
    1. db_name
    2. db_domain
    3. db_name
    4. instance_name
    5. service_names
    GLOBAL_NAME is a static (not changing) Data Dictionary view which has just 1 attribute (column) called GLOBAL_NAME.
    When you run:
    select GLOBAL_NAME from GLOBAL_NAME;
    You are returned the full global name of the database, i.e. the db_name and the db_domain joined together by dot (.) For e.g. if your db_name = mgmt and db_domain = tech.co.in, then your global_name will be MGMT.TECH.CO.IN.
    Ciao.
    null

  • Get the number of tables of a specific database

    Hy, I have to get the number of tables of a specific database. To do this, I connect to the database(mysql) and I get a Connection object.
    I do the next with this object:
    DatabaseMetaData dbmd=connection.getMetaData();
    ResultSet tables=dbmd.getTables(null, null, null, null);
    Now what to do to get the number of tables of the database?-
    Maybe counting the rows of this resultset I would get it
    because each table of the database is represented in one row of
    this ResulSet?
    Thank you!!

    Yes. Count them.

  • How to get the number of issued active certifcates from a CA

    Hi,
    We have a PKI infrastructure still running on Windows Server 2003. How can I get the number of active certificates issued?  I have used the filter option on the issued certifcates node listing the certificates with expiry date after the current
    date, but this list only all the certs without the actual total number of certs.
    Any help is appreciated
    Thanks
    Johan Marais
    JkM6228

    On Wed, 22 Jan 2014 08:57:59 +0000, Martin Rublik wrote:
    certutil -config -view -out "Issued Distinguished Name" -restrict "Certificate Expiration Date > 22. 1. 2013" | findstr Rows
    It will dump CA database look for issued distinguished name (name in the subject of the certificate) and outputs only certificates expiring after 22.1.2013. The output is piped to findstr command that filters the total number of rows.
    There are a couple of problems with the above:
    1. Not every certificate will have a Subject name.
    2. This won't filter out certificates that have been revoked but are still
    time valid.
    3. I couldn't get the "findstr Rows" to return anything and when I look at
    the help for findstr I don't see that as an option for the command.
    This command worked for me, make sure you enter it all on a single line:
    certutil -view -restrict "Disposition=20,NotBefore<January 22 2013" -out
    SerialNumber | findstr /C:"Serial Number:" | findstr /r /n "^" | find /c :"
    Also, if you copy and paste from this post into the cmd window, be careful
    that the quotes and dashes don't get converted into the wrong type.
    Paul Adare - FIM CM MVP
    "for thing in $(fnord $(frob $(./gazonk foo bar baz bletch thud grunt)));
    do
    zot --wodchuck ${thing}; done"
    -- Stig Sandbeck Mathisen making a point about the beauty of shell scripts

  • How  do i get my number files on my iPad from my iMac computer?

    How do I now get my Number 09 files up on my ipad so the will sync in the  cloud?

    If you are running OSX 10.5.7 you cannot use iCloud on your Mac since one of the requirements is that the Mac needs to be running Lion. However, if you are really running 10.5.7 - you can't sync the iPad either since the minimum for that is 10.5.8.
    I will assume that your tagline is incorrect and you can at least sync the iPad with your Mac. And .... you need to have Numbers installed on the iPad so I will assume that you have that installed as well.
    The text below is copied from the kb article below.
    iWorks for iOS: About iTunes File Sharing
    Copying Numbers files from your computer to the iPad using iOS file sharing (Title changed for Numbers)
    Connect your iOS device to your computer using the included Dock Connector to USB cable.
    Open iTunes on your computer.
    Select your iOS device from the Devices section on the left side of iTunes.
    Click the Apps tab and scroll down to the bottom of the page.
    Note: If you do not see the File Sharing section shown in the image below, your iOS device does not have any apps installed which support File Sharing, such as the iWork for iOS apps.
    Under the File Sharing section, you should find a list of apps currently installed on your iOS device that use File Sharing (such as Keynote, Pages, and Numbers for iOS). Select an app to view a list of the files associated with that app on your iOS device.
    You can drag and drop files into the Documents list to send them to the app on your iOS device. You can also click the Add button, locate the file or files you want to send from your computer, and then click the Choose. The files you select will be copied to the app on your iOS device immediately. Select only files that are supported by the iOS app. Once you’ve copied your file(s) to your iOS device from within iTunes, open Keynote, Pages, or Numbers on your iOS device.
    Navigate to the Document Manager screen
    Tap the plus icon in the upper-left corner, and then tap the iTunes icon:
    This will open the "Copy from iTunes" window:
    Tap the file you want to copy and the document will automatically be added to the Document Manager and open.
    (Any compatible file that you’ve copied to your iOS device using File Sharing will be listed in the "Copy from iTunes" window. If the file is not listed, confirm its file type is compatible with the iWork app.)
    Back to my own words now.... You can sync these documents to iCloud using your iPad as long as you set it up in the iCloud settings. If you make changes to this document on the iPad - it will not sync back to the Mac via iCloud. You can sign into your icloud.com account on the Mac - click on iWorks - click on Numbers - select the file - and download the file to the Mac to work on it again - but you can't upload it again unless you are running 10.7.2 on the Mac. You will have to get the file back onto the iPad via file sharing as described above.

  • Forms Listener port number as a service!!!

    How can you specify the port number of the listener when it
    is installed as a service? I tried port=???? but it ignores it
    and default back to 9999...
    null

    Hi Patrick
    Try this on your command prompt
    ff50srv32 port=5555
    You can assign any port. If you don't then it will take the
    default port.
    Hope this will help you.
    Arun
    Patrick Shea (guest) wrote:
    : How can you specify the port number of the listener when it
    : is installed as a service? I tried port=???? but it ignores it
    : and default back to 9999...
    null

  • Port number of Precalculation Service

    Dear SAP Expert
    For any security reason, I will implement a firewall program.
    I have a plan to close all the ports and will make some exception of the application which we use.
    One of the exeception is Precalculation service.
    So, Can you tell me what is port type (TCP or UDP or ... ) and its number ?
    Many thanks for your Info
    regards
    udinpetot

    Hi,
    Precalculation uses the port for RFC communication. It is port number '33xy' where 'xy' is the instance number of the connected backend system.
    I hope this helps.
    Regards,
    Michael

  • Getting virtual memory error when fetching records from database

    HI,
    I am using Oracle as Database and the Oracle JDBC driver. I have simple code which is a select statement but the problem is the resultset dies while fetching the data i.e. 5,50,000. And it gives me the memory error as its storing all in the memory. One of the way which i have serched in the old threads is using the batch method fetching rows at a time but can you tell me how to implement in my code. I am pasting my code.
    The overall functionality of my code is that it's reterving data from database and generating an XML file that would be validated with a DTD.
    //My Code
    public class Invoicef3 implements ExtractF3 {
         final String queryString = "select * from hsbc_f3_statement
    order by bill_no, duplicate,
    invoice_address1,
    invoice_address2,
    invoice_address3,
    invoice_address4,
    invoice_address5,
    invoice_address6,
    main_section, order_1, page,
    section, product_category,
    sub_sect_1, order_2,
    sub_sect_2, child_product,
    sub_sect_3, account,
    line,entry_date, currency, tier";
         public ArrayList process() {
              Connection con = null;
              Statement stmt = null;
              ResultSet rset = null;
              ArrayList arr1 = null;
              try {
                   con =
    ConnectionManager.getConnection();
                   stmt = con.createStatement();
              rset = stmt.executeQuery(queryString);
                   arr1 = new ArrayList();
                   while (rset.next()) {
                        arr1.add(
                             new F3StatementExtract(
                                  rset.getString(1),
                                  rset.getInt(2),
                                  rset.getString(3),
                                  rset.getInt(4),
                                  rset.getInt(5),
                                  rset.getString(6),
                                  rset.getInt(7),
                                  rset.getString(8),
                                  rset.getInt(9),
                                  rset.getString(10),
                                  rset.getInt(11)));
                   rset.close();
                   stmt.close();
              } catch (SQLException e) {
                   e.printStackTrace();
              } finally {
                   ConnectionManager.close(rset);
                   ConnectionManager.close(stmt);
                   ConnectionManager.close(con);
              return arr1;
    }

    The problem is that you are fetching and processing all the rows for the query, which the VM cannot handle given the heap space available. The points you could think over are:
    * Allocate more heap memory (this would help only to a limited extent)
    * Try to process only a few records at a time instead of all of them (there is actually no need to process all the records at a time. Try processing records in lots of say 1000)
    * Avoid selecting all the columns [SELECT *] from the table, if all of them are not going to be used.
    There is a slight change i have done in the code is that i am using two quereies now one is fetching all the Bills and the secondquery is fetching all the data for the relevant BILL.
    //My Code
    public class Invoicef3 implements ExtractF3 {
         /*Query to get distinct bill numbers*/
         final String queryString1 =
              "select distinct(bill_no) from hsbc_print_bills";
         /*Query to get distinct bill numbers statement details*/
         final String queryString =
              "select * from hsbc_f3_statement where bill_no='";
         public ArrayList process() {
              Connection con = null;
              Statement stmt = null;
              ResultSet rset = null;
              ArrayList arr1 = null;
              ArrayList arr2 = null;
              try {
                   con = ConnectionManager.getConnection();
                   stmt = con.createStatement();
                   rset = stmt.executeQuery(queryString1);
                   arr1 = new ArrayList();
                   while (rset.next()) {
                        arr1.add(new F3BillExtract(rset.getString(1))); //generating the Bill_No's
                   System.out.print(arr1.size());
                   rset.close();
                   stmt.close();
                   for (int i = 0; i < arr1.size(); i++) {
                        stmt = con.createStatement();
                        rset =
                             stmt.executeQuery(
                                  queryString
                                       + (((F3BillExtract) arr1.get(i)).getBill_No())
                                       + "'");
                        arr2 = new ArrayList();
                        /*Fetching the statement Details of the particular Bill_No*/
                        while (rset.next()) {
                             arr2.add(
                                  new F3StatementExtract(
                                       rset.getString(1),
                                       rset.getInt(2),
                                       rset.getString(3),
                                       rset.getInt(4),
                                       rset.getInt(5),
                                       rset.getString(6),
                                       rset.getInt(7),
                                       rset.getString(8),
                                       rset.getInt(9),
                                       rset.getString(10),
                                       rset.getInt(11),
                                       rset.getString(12),
                                       rset.getFloat(13),
                                       rset.getDate(14),
                                       rset.getString(15),
                                       rset.getInt(16),
                                       rset.getString(17),
                                       rset.getString(18),
                                       rset.getString(19),
                                       rset.getString(20),
                                       rset.getString(21),
                                       rset.getString(22),
                                       rset.getString(23),
                                       rset.getString(24),
                                       rset.getString(25),
                                       rset.getString(26),
                                       rset.getString(27),
                                       rset.getString(28),
                                       rset.getString(29),
                                       rset.getString(30),
                                       rset.getDate(31),
                                       rset.getDate(32),
                                       rset.getDate(33),
                                       rset.getDate(34),
                                       rset.getString(35),
                                       rset.getString(36),
                                       rset.getString(37),
                                       rset.getString(38),
                                       rset.getString(39),
                                       rset.getString(40),
                                       rset.getFloat(41),
                                       rset.getFloat(42),
                                       rset.getFloat(43),
                                       rset.getInt(44),
                                       rset.getFloat(45),
                                       rset.getString(46),
                                       rset.getString(47)));
                        rset.close();
                        stmt.close();
                        ((F3BillExtract) arr1.get(i)).setArr(arr2);
              } catch (SQLException e) {
                   e.printStackTrace();
              } finally {
                   ConnectionManager.close(rset);
                   ConnectionManager.close(stmt);
                   ConnectionManager.close(con);
              return arr1;
    }

  • PORTING NUMBER/ CANCELLING MY SERVICE

    I GOT A NEW CELL PHONE FOR CHRISTMAS FROM ANOTHER SERVICE PROVIDER AND I WANT TO SWITCH MY VERIZON NUMBER TO MY NEW NON-VERIZON PHONE, BUT MY VERIZON CONTRACT IS NOT OVER UNTIL 1/15/12. HOW CAN I PORT MY NUMBER ONTO MY NEW PHONE NOW WITHOUT CANCELLING MY VERIZON ACCOUNT UNTIL 1/15/12?

    You realize this thread is over two years old?
    in any case your account number is on your Verizon Monthly invoice or from the My Verizon web portal http://www.verizonwireless.com just log in and go to view my bill and the account number is there. Your pin is normally the last four digits of your social security number. However some people have placed tighter security on their account via a secondary pass code word or a different number all together.
    Good Luck

  • How to get the number of minutes or hours from date arithmetic ?

    Thanks in advance,
    I have two date fields that I would like to derive the number of minutes or hours via the following:
    select start_date - end_date from dual;
    How do I get HH:MM results ? Thanks

    If greater than 24 hours you'll need to calculate the hours and minutes as numbers individually. (You can then display them in whatever format you choose)
    SQL> ed
    Wrote file afiedt.buf
      1  with t as (select to_date('6-10-2008 08:00','DD-MM-YYYY HH24:MI') as from_dt, to_date('7-10-2008 12:30','DD-MM-YYYY HH24:MI') as to_dt from dual)
      2  --
      3  select from_dt, to_dt, to_dt-from_dt
      4        ,to_char(trunc(sysdate)+(to_dt-from_dt),'HH24:MI') as hrs_mins
      5        ,trunc((to_dt-from_dt)*24) as hrs
      6        ,trunc((((to_dt-from_dt)*24)-trunc((to_dt-from_dt)*24))*60) as mins
      7* from t
    SQL> /
    FROM_DT           TO_DT             TO_DT-FROM_DT HRS_M        HRS       MINS
    06-OCT-2008 08:00 07-OCT-2008 12:30        1.1875 04:30         28         30
    SQL>

  • Cannot find site to get Serial Number for Photoshop Elements-urchased from Best Buy

    I purchased Photoshop Elements 10 from Best Buy last night. I am trying to access the serial number to activate it, but the site that the label tells you to go to and enter your redemption code is not working. Anyone know how to help?
    Thanks!

    Either wait a while and try the site again, or contact Adobe:
    http://helpx.adobe.com/contact/
    Since it's the long holiday weekend, you might have to wait until Tuesday for Adobe support to be available.
    You should be able to use PSE10 as a trial version until you get a serial number.
    Ken

Maybe you are looking for

  • Are there benefits to streaming Hinted H264?

    Are there any benefits to streaming hinted h264 files?  I'm creating h264 mp4 files using Telestream's Episode and all of the streaming presets are hinted, so the files are twice as large.  When I normally create h264 in quicktime or Adobe Media Enco

  • Java 1.4 bug?

    Hi, I am using jdk1.4.1 java version "1.4.1" Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1-b21) Java HotSpot(TM) Client VM (build 1.4.1-b21, mixed mode) I have a program run in background(use nohup ... &), It runes well under jdk1.3.

  • Cannot re-register ovi account

    Ok so here's my situation, I had an ovi account opened some time back. I then set a different user name for the account. On doing this, for some reason another account was created with all my duplicated details except the user name. So I had two acco

  • My message sounds quit working

    My message sounds stopped working, any suggestion?

  • The general store  in The game takes to long to load

    the general store in the game is taking to long to load. why is that Im trying to buy honor points and gifts for my army in the game