How to get SID thro sql

Hi
I want to connect some data base i know ip i know port no but i don't have sid.
can i retrivew SID from sql. by logging to database.

Which SID? There is the Oracle instance System ID and there is an Oracle client's Session ID. Both are, confusingly, called SIDs.
The instance SID can be obtained using:
select value from v$parameter where name='instance_name'
The current session's SID can be obtained using:
select sid from v$mystat where rownum = 1

Similar Messages

  • How to get the real SQL statement from a preparedstatement?

    Hi,
    I am trying to log the actual SQL sent to database by the preparedStatement. Since the original SQL I used to prepare the statement has a lot of "?" in it, after setting all the parameters in the preparedStatement, I want to get the final SQL statement executed. Is there a way to get it? Probably the SQL will depend on different drivers.
    Thanks in advance.

    Thanks, changhsu. I tried the tracing technique. But it only prints out the original SQL statement sent to the preparedStatement. The following is part of the log file:
    ======================================================================
    --------NetDirect JSQLConnect Version:2.2708--------
    2002-04-10 14:23:54.818 (1) Connection attempt number 1 Connection ID:1 for host:perseus
    2002-04-10 14:23:55.429 (1) JSQLConnect(2.2708) Trial license - expires on:Thu Apr 25 17:47:32 CDT 2002, unlimited connections
    2002-04-10 14:23:55.449 (2) Connection allocated from pool ID:2
    2002-04-10 14:23:55.72 (2) [Thread[Thread-6,5,main], IO:88cb4, Dbc:1346]] SELECT SHARED_DRIVES FROM EPM_PREFS WHERE PRODUCT='PE'
    2002-04-10 14:23:57.913 (2) Connection closed and returned to connection pool ID:2
    2002-04-10 14:23:58.193 (3) Connection attempt number 2 Connection ID:3 for host:perseus database:epm20 SQL6.5:false
    2002-04-10 14:23:58.203 (3) [Thread[Thread-6,5,main], IO:88cb3, Dbc:1347]] use epm20 set quoted_identifier,ansi_null_dflt_on,ansi_padding on set textsize 2147483647 set transaction isolation level read committed set implicit_transactions off
    2002-04-10 14:24:00.356 (4) Connection allocated from pool ID:4
    2002-04-10 14:24:01.168 (4) [Not Loged In@localhost, IO:88cb2, Dbc:1347]] PreparedStatement::prepare stmt:SELECT PASSWD FROM RESOURCE_INFO WHERE USER_ID=? AND DELETE_FLG IS NULL
    2002-04-10 14:24:01.448 (4) [Not Loged In@localhost, IO:88cb2, Dbc:1347]] RPC:sp_prepare
    2002-04-10 14:24:01.488 (4) [Not Loged In@localhost, IO:88cb2, Dbc:1347]] RPC:sp_execute
    =======================================================================
    I did not try to trace in SQL Server 7. I will have to find out how to do that first.
    Thanks again.

  • How to get SID of the runtime WebAS

    Hi all,
    is it possible to get the SID of the runtime WebAS (Java Stack Installation) via API-Call?
    Regards,
    Markus.

    Hi Markus,
    Check How to get WAS Installation Number and  System Id?
    Best regards, Maksim Rashchynski.

  • How to get side palettes to expand downwards ?

    Hi,
    question on CS4 Palettes.
    18inch Eizo screen crt with 1024x768res.
    CS2 had palettes at the right hand side, e.g. info or hostory or layers, that expanded downwards. I am used to having my image fill the screen up to the palettes at right in CS2. In CS4 instead they occupy my screen space to the left of the menu when expanded and cover the very thing I am trying to work on.  We have the palette and its contents side by side, twice the screen space used up to what could be.  I have only just over half my screen left workable, especially if I open the layers palette with many layers as I normally have. How can I get them to expand downwards. Is it my settings or is there no choice ?  If its the new design, this is the sort of thing that might exist in an early version of a program before developers changed it in a new release and got more money out of us via an upgrade to obtain such a novel improvement.
    Envirographics

    Read the online help on how to create workspaces and dock panles in groups. none of what you describe is any problem, you just need to custimze your workspace.
    Mylenium

  • How to get the correct sql command in oracle?

    Hi sir,
    i am using this query in sql that is :
    SELECT C.*,ISNULL(P.Comp_Name,'') + ' (' + ISNULL(P.Comp_ID,'') + ')' Parent FROM Comp_Master C LEFT JOIN Comp_Master P ON C.Parent_ID = P.Comp_ID Where C.Comp_ID='004'
    so i am getting in parent column value like this: "PARIS GROUP (001)"
    but the same command i converted in sql developer that is:
    SELECT C.* ,NVL(P.Comp_Name, ' ') || ' (' || NVL(P.Comp_ID, ' ') || ')' as Parent FROM Comp_Master C LEFT JOIN Comp_Master P ON C.Parent_ID = P.Comp_ID WHERE C.Comp_ID ='004'
    but not getting in parent column value its coming only ( )
    help me.
    thanks

    Welcome to Oracle.
    It has manuals.
    http://tahiti.oracle.com/
    Choose your version, which you continue to keep a mystery
    E.g.
    http://www.oracle.com/pls/db112/homepage
    Including Oracle SQL syntax
    http://docs.oracle.com/cd/E11882_01/server.112/e26088/toc.htm
    Which you will find useful since Oracle does not run Microsoft SQL as you continue to find over and over again.
    And there is a 2 day getting started as a developer guide, which you appear to desperately need,
    http://docs.oracle.com/cd/E11882_01/appdev.112/e10766/toc.htm
    If you have any specific questions about anything you read in there, come back in a couple of days after you have finished reading them.

  • How to get the exact sql developer which used for data migration?

    Hi all,
    Hope doing well,
    Sir i seen a link for data migration that is : http://www.oracle.com/technetwork/developer-tools/sql-developer/sql-server-connection-viewlet-swf-089886.html
    in this link when they are connecting to sql database so after clicking on new connection four tab is showing that is oracle, access, my sql, sql server.
    i downloaded latest version of sql developer which version is: 3.02.09.30 when i opened this i am not getting those option.
    and one more thing i am not getting miragation menu name in menu items.
    please help me.
    thanks and regards

    Hi,
    To connect to non-Oracle databases from SQL*Developer youneed to download the relevant JDBC driver.
    This is detailed in the documentation in the User Guide -
    http://docs.oracle.com/cd/E35137_01/appdev.32/e35117.pdf
    in the section -
    Database: Third Party JDBC Drivers
    The Third Party JDBC Drivers pane specifies drivers to be used for connections to third-party (non-Oracle) databases, such as IBM DB2, MySQL, Microsoft SQL Server, or Sybase Adaptive Server. (You do not need to add a driver for connections to Microsoft Access databases.) To add a driver, click Add Entry and select the path for the driver:
    ■For IBM DB2: the db2jcc.jar and db2jcc_license_cu.jar files, which are available from IBM
    ■For MySQL: a file with a name similar to mysql-connector-java-5.0.4-bin.jar, in a directory under the one into which you unzipped the download for the MySQL driver
    ■For Microsoft SQL Server or Sybase Adaptive Server: jtds-1.2.jar, which is included in the jtds-1.2-dist.zip download
    ■For Teradata: tdgssconfig.jar and terajdbc4.jar, which are included (along with a readme.txt file) in the TeraJDBC__indep_indep.12.00.00.110.zip or TeraJDBC__indep_indep.12.00.00.110.tar download
    To find a specific third-party JDBC driver, see the appropriate website (for example, http://www.mysql.com for the MySQL Connector/J JDBC driver for MySQL, http://jtds.sourceforge.net/ for the jTDS driver for Microsoft SQL Server and Sybase Adaptive Server, or search at http://www.teradata.com/ for the JDBC driver for Teradata). For MySQL, use the MySQL 5.0 driver, not 5.1 or later, with SQL Developer release 1.5.
    You must specify a third-party JDBC driver or install a driver using the Check for Updates feature before you can create a database connection to a third-party database of that associated type. (See the tabs for creating connections to third-party databases in the Create/Edit/Select Database Connection dialog box.)
    Regards,
    Mike

  • How to get connected MS SQL from Oracle

    I need to connect MS SQL Server (MSDE exactly) to Oracle 8.1.7
    and operate it from Oracle side (some clever data imports from
    client's sql server machine to bigger Oracle server). I tried to
    use ODBC from client to oracle and works fine, but I need "the
    other way". Any Ideas?
    Please help,
    yours HG

    http://asktom.oracle.com/pls/ask/f?p=4950:8:442320::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:1139834557335,%7Bodbc%7D

  • How to get SID (SAPSYSTEMNAME) property of j2ee engine

    Hello colleagues,
    could anybody help us with the following point:
    in our development we have to determine the SAP system ID (SID)of j2ee server instance.
    As far as I remember in ABAP world there is a corresponding system variable.
    Unfortunately I failed to find something like that for j2ee server (i have to note we are talking about 6.40)
    Sorry if my question is a common place
    Thank you in advance,
    Regards,
    Ilya Rudakov

    Hi Ilya,
    It seems that I didn't get your question right. Sorry about that.
    I have no idea about what APIs to use to get the SAPSYSTEMNAME parameter. My <b>guess</b> is, however, that this API is part of the J2EE Engine core and therefore not available for external developments.
    But... let's wait if somebody knows that for sure!
    Regards,
    Ivo

  • How to Get Side-Panel is Gnome 3 ?

    i installed gnome 3 but something is lacking :-/ side-panel , it comes in some additional package ?

    Gnome has its own words for describing the UI elements. Please look at the pictures on the gnome help page and report back what exactly is missing.
    Also use the words from the help page to describe it.
    If you want to have a permanently visible dash on the left, you need modifications, as it is not included in gnome per default.
    gnome-shell help

  • How to get physical SQL query

    Hi All,
    How to get the physical SQL query for the OBIEE reports.
    Thanks in advance,
    Haree.

    Hi Anitha,
    Thanks for your reply,
    I am getting XML script in log file. (Settings > Administration > Manage Sessions > View Log).
    How to get physical SQL query ?
    Thanks,
    Haree

  • How to get Arabic dates in SQL*Plus?

    I want to do a very simple thing.
    I want to type in Arabic and Display dates in Arabic.
    Instead i get ????? ??????? ????? ??????? ? ? ???????, ????? for this?
    Why is this?
    I then changed my Windows XP "Regional and Language Options" all to Arabic. Now, I get AR (Arabic) in my language selection bar at the bottom of the Desktop. When I choose AR I can type Arabic in Notepad. ُ
    Even HERE I can type in Arabic: فغحث غخعق ةثسسشلث اثقث
    But in Sql*PLus I get ????? ??????? ????? ??????? ? ? ???????, ?????
    If I choose AR in SQL Plus and type in Arabic I get garbage characters?
    How to get Arabic in Sql*Plus?
    SQL> SHOW USER
    USER is "ARABDTEST"
    SQL> SELECT * FROM v$version;
    BANNER
    Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production
    PL/SQL Release 11.1.0.6.0 - Production
    CORE    11.1.0.6.0      Production
    TNS for 32-bit Windows: Version 11.1.0.6.0 - Production
    NLSRTL Version 11.1.0.6.0 - Production
    SQL> SELECT * FROM nls_session_parameters;
    PARAMETER                      VALUE
    NLS_LANGUAGE                   AMERICAN
    NLS_TERRITORY                  AMERICA
    NLS_CURRENCY                   $
    NLS_ISO_CURRENCY               AMERICA
    NLS_NUMERIC_CHARACTERS         .,
    NLS_CALENDAR                   GREGORIAN
    NLS_DATE_FORMAT                DD-MON-RR
    NLS_DATE_LANGUAGE              AMERICAN
    NLS_SORT                       BINARY
    NLS_TIME_FORMAT                HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT           DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT        DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY              $
    NLS_COMP                       BINARY
    NLS_LENGTH_SEMANTICS           BYTE
    NLS_NCHAR_CONV_EXCP            FALSE
    17 rows selected.
    SQL> ALTER SESSION set NLS_DATE_LANGUAGE = 'ARABIC';
    Session altered.
    SQL> SELECT TO_CHAR(SYSDATE, 'RRRR/MM/DD YEAR MONTH DAY MON DY AM PM DL') FROM dual;
    TO_CHAR(SYSDATE,'RRRR/MM/DDYEARMONTHDAYMONDYAMPMDL')
    2013/04/08 TWENTY THIRTEEN ?????  ???????  ?????  ???????  ? ? ???????, ????? 08, 2013
    SQL> ALTER SESSION set NLS_DATE_LANGUAGE = 'AMERICAN';
    Session altered.
    SQL>  SELECT TO_CHAR(SYSDATE, 'RRRR/MM/DD YEAR MONTH DAY MON DY AM PM DL') FROM dual;
    TO_CHAR(SYSDATE,'RRRR/MM/DDYEARMONTHDAYMONDYAMPMDL')
    2013/04/08 TWENTY THIRTEEN APRIL     MONDAY    APR MON PM PM Monday, April 08, 2013
    SQL> SELECT * FROM nls_database_parameters;
    PARAMETER                      VALUE
    NLS_LANGUAGE                   AMERICAN
    NLS_TERRITORY                  AMERICA
    NLS_CURRENCY                   $
    NLS_ISO_CURRENCY               AMERICA
    NLS_NUMERIC_CHARACTERS         .,
    NLS_CHARACTERSET               WE8MSWIN1252
    NLS_CALENDAR                   GREGORIAN
    NLS_DATE_FORMAT                DD-MON-RR
    NLS_DATE_LANGUAGE              AMERICAN
    NLS_SORT                       BINARY
    NLS_TIME_FORMAT                HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT           DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT             HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT        DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY              $
    NLS_COMP                       BINARY
    NLS_LENGTH_SEMANTICS           BYTE
    NLS_NCHAR_CONV_EXCP            FALSE
    NLS_NCHAR_CHARACTERSET         AL16UTF16
    NLS_RDBMS_VERSION              11.1.0.6.0
    20 rows selected.

    I am not sure SQL*Plus in character mode can display Arabic characters on Windows. OTN NLS_LANG FAQ http://www.oracle.com/technetwork/products/globalization/nls-lang-099431.html#_Toc105389288 says:
    >
    if you are testing with "special" characters please DO use the GUI and not the "DOS box" sqlplus.exe !
    >
    SQL*Plus GUI is not available with 11G: you should use SQL Developer.

  • How to get the SQL statement

    I cannot figure how to get the text(SQL statement) from a system view(i guess it is in a system view... but witch??). 'Till now i have the sql_address and the sql_hash_value..
    I know it is possible.. EM does it ... so i should be able to do the same..
    ps:I use 9.2

    v$sql ?

  • 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

  • Get rid of SQL ID from database

    1. The SQL query is running nore than 30 mints with SQL ID aaaaabbb7RRRR . we killed the seesion and clear cache
    again we ran the query, the query is assigned to same sql ID aaaaabbb7RRRR we killed the seesion and clear cache
    ran query one more time it is assigned to same ID again
    anyone know how to get rid of SQL id from Database
    Edited by: user8680248 on 19/04/2010 22:32

    user8680248 wrote:
    I have shutdown the database and restarted , I can see the query assigened to teh same SQL IDYou seem to think SQL_ID is uniquely generated for each SQL Statement.
    I'd come to he conclusion that it is derived from the hash value of the SQL statement. Which to me means that the same SQL statement would result in the same SQL_ID. Some internet hits that support my way of thinking are
    http://www.experts-exchange.com/Database/Oracle/10.x/Q_23843388.html
    http://blog.tanelpoder.com/2009/02/22/sql_id-is-just-a-fancy-representation-of-hash-value/
    http://www.slaviks-blog.com/2010/03/30/oracle-sql_id-and-hash-value/
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:10353453905351
    from which I note that Tanel shows a way of converting the Hash value (derived directly from the statement) to the SQL_ID, and Tom says "sql_id survives database instance restarts and reloads."

  • First simple report/app - how do I edit the sql in it?

    I finally have some time to play with my newly installed htmldb 2.0, and created a quick sample page with a tabular report and queried a table via dblink with some sql I entered in. When I run the app I get a sql error, but for the life of me I can't find out how to get at the sql to edit it.
    Where do I find (and how do I edit) the sql I just entered in?

    When you create this kind of region you can edit the SQL by go to the page definition and clicking on the name you've given to the region in the Regions section of the page rendering.
    This will bring you to the region definition page (you should see /f?p=4000:4651 in the URL of your browser). Then you can go to the region source and edit the SQL there.
    Hope that helps.
    Earl

Maybe you are looking for

  • 15 concurrent users and JBO-35007 row currency has changed

    Hi! Something for the weekend :) I have an ADF/BC 10.1.3.3. application on 10.1.3.3. Oracle AS. I use a jazn security with users and roles stored in database tables. While testing with one or two users I never ran into the same problem as we had this

  • Create Title from File Name

    Is there a way to automatically transfer the file name to the title of the image? Can it be done with a script in the export cations folder? If it can, does anyone have a script?

  • No appropriate default constructor c++

    Hi, have been trying to read up on it but I need some help to understand it, here's my code. What should I do to make it work and how should I try to think about it in the future? cheers Law.h #include <iostream> #include <string> using namespace std

  • SharePoint mail handler could not extract attachment from a certain type of eml emails

    I found out why SharePoint mail handler could not extract attachment from a certain type of eml emails. The eml emails not working me were constructed with this structure, using one attachment as example: If I removed the highlighted red part, it jus

  • Game program - simon sez

    I have a simple game program call simon sez. I have the code completely written, but i cant figure out why its not working. I have the area in the program that is not working right and have add ********* where the problem area is. Can anyone figure o