How to know database name and schema name

Hi ,
Once after logging in the database,how is it possible to know the current database and schema which we r using?Is there any system table where we can get the database names and schema names?
please help me out.itz urgent.
Regards,
Sravan

Probably not.
If the database name is the name of the current database, it would be essentially redundant. If the database name is the name of some other database, in order to get the names of all the tables in the specified schema, you could create a database link to the remote system (which assumes you have a login and password to the remote database with appropriate privileges, that the database server's tnsnames.ora file has an entry for the remote database, etc) and query the remote data dictionary tables. Even if you could do that, however, you could not dynamically create triggers on the remote database since DDL over a database link.
In theory, you could also load an appropriate JDBC driver into the database and write a Java stored procedure that would connect to the remote database (again, with an appropriate user name & password, host name, and port number) and issue DDL against that remote database. I have a hard time believing, however, that this would be a particularly beneficial approach. It would be easier just to put the appropriate code into each database that needs triggers generated or to have a separate Java application that generates triggers for a number of different databases.
Justin

Similar Messages

  • How to know database name and schema name by providing package name?

    Hi,
    Could someonw will help me to get database name and schema name by providing package name ?
    I have used the query : select * from all_objects where object_name='Package_name'; but it simply returns schema name where as i need DB name and username.
    --Prajakta

    but it simply returns schema name where as i need DB name and username.
    i want to retrive the DB name for package name
    Based on your questions, I wonder if you are used to working in SQL Server? (The server, database, and schema are part of the 4-part  name of an object, independent of any user.)
    In SQL Server, schema and username are two separate physical concepts.  "Schema" is purely logical in Oracle: a user which owns objects is often called a "schema".
    In Oracle, "database" is roughly equivalent to the SQL Server concept  "server" (what you log in to).  It is not part of the naming path to a specific object  (unless there is a database link involved, but there is no indication that's what you have here).  In Oracle you connect to an Instance (or Service) and people often call this the "database", but there is a fine semantic distinction there (separate topic). 
    Once connected in Oracle, you fully-qualify an object by only a 2-part owner and object name (possibly 3-part if a database link is involved user.object@link).
    12c added another wrinkle to all of this, but I'll assume this question was more basic than that, because you likely would have mentioned if this was a 12c question.

  • How to find the tablespace name and schema name from a dump file

    Good day to all,
    I recived a dump file from a client with oracle 11g, and I need do get the tablespace and schema name from the dump file. How can I do that?
    Thanks.
    Flávio Melo
    Edited by: 933141 on 09/05/2012 07:41

    user12038066 wrote:
    Use imp utility, it generates DDL for both tables and indexes. So you will get tablespace info for both.
    Use impdp utility, it generates DDL for indexes only. So you will miss tablesapce info for tables.
    Haven't found a workaround for impdp utility. Anyone knows?Are you sure you are using the impdp utility correctly? Because if you do, then sqlfile should have all gory details.

  • How to know the nos. and variable name from Jframe ?

    Hello Everyone,
    I have just started java programming. I have one form (using jframe) and there are nos. of components like text field, radio buttons, list box, buttons etc.).
    I want to know nos. and type of components (text field, radio buttons, button etc..) and variable name of these components ?
    Is there any way class / method or technique for the same ?
    With Thanks !
    Prashant Shukla

    Since if you are dealing strictly swing here, and no mixed in awt, all you have is JComponents, then where's the problem ... why do you even need to know which JComponent it is?
    This what you have?
    class StuffWithListeners  extends JFrame  implements ActionListener, KeyListener {
      StuffWithListeners() {
        jb = new JButton("GO");
        ta = new JTextArea(10,20);
        jb.addActionListener(this);
        ta.addKeyListener(this);
      public void actionPerformed(ActionEvent ae) {
      public void KeyPressed(KeyEvent ke) {
    }Edited by: abillconsl on Dec 14, 2007 5:23 PM
    null

  • How can find  database field and table name

    how can find the underline database field name,table name from java page. Example. in oracle apps when we go purchaseing super user then supplier base then supplier and find supplier detail .

    Hi,
    depends on your model. If you work with ADF BC then you can use ViewLinks to access parent or detail infromation programmatically. See the developer guides for more information. Note that you wont access the tables directly but the collections that represent the records
    Frank

  • How to get the column name and table name from xml file

    I have one XML file, I generated xsd file from that xml file but the problem is i dont know table name and column name. So my question is how can I retrieve the data from that xml file?

    Here's an example using binary XML storage (instead of Object-Relational storage as described in the article).
    begin
      dbms_xmlschema.registerSchema(
        schemaURL       => 'my_schema.xsd'
      , schemaDoc       => xmltype(bfilename('TEST_DIR','my_schema.xsd'), nls_charset_id('AL32UTF8'))
      , local           => true
      , genTypes        => false
      , genTables       => true
      , enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_CONTENTS
      , options         => dbms_xmlschema.REGISTER_BINARYXML
    end;
    genTables => true : means that a default schema-based XMLType table will be created during registration.
    enableHierarchy => dbms_xmlschema.ENABLE_HIERARCHY_CONTENTS : indicates that a repository resource conforming to the schema will be automatically stored in the default table.
    If the schema is not annotated, the name of the default table is system-generated but derived from the root element name :
    SQL> select table_name
      2  from user_xml_tables
      3  where xmlschema = 'my_schema.xsd'
      4  and element_name = 'employee';
    TABLE_NAME
    employee1121_TAB
    (warning : the name is case-sensitive)
    To annotate the schema and control the naming, modify the content to :
    <?xml version="1.0" encoding="UTF-8" ?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xdb="http://xmlns.oracle.com/xdb">
      <xs:element name="employee" xdb:defaultTable="EMPLOYEE_XML">
        <xs:complexType>
    Next step : create a resource, or just directly insert an XML document into the table.
    Example of creating a resource :
    declare
      res  boolean;
      doc  xmltype := xmltype(
    '<employee>
      <details>
        <emp_id>1</emp_id>
        <emp_name>SMITH</emp_name>
        <emp_age>40</emp_age>
        <emp_dept>10</emp_dept>
      </details>
    </employee>'
    begin
      res := dbms_xdb.CreateResource(
               abspath   => '/public/test.xml'
             , data      => doc
             , schemaurl => 'my_schema.xsd'
             , elem      => 'employee'
    end;
    The resource has to be schema-based so that the default storage mechanism is triggered.
    It could also be achieved if the document possesses an xsi:noNamespaceSchemaLocation attribute :
    SQL> declare
      2 
      3    res  boolean;
      4    doc  xmltype := xmltype(
      5  '<employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      6             xsi:noNamespaceSchemaLocation="my_schema.xsd">
      7    <details>
      8      <emp_id>1</emp_id>
      9      <emp_name>SMITH</emp_name>
    10      <emp_age>40</emp_age>
    11      <emp_dept>10</emp_dept>
    12    </details>
    13   </employee>'
    14   );
    15 
    16  begin
    17    res := dbms_xdb.CreateResource(
    18             abspath   => '/public/test.xml'
    19           , data      => doc
    20           );
    21  end;
    22  /
    PL/SQL procedure successfully completed
    SQL> set long 5000
    SQL> select * from "employee1121_TAB";
    SYS_NC_ROWINFO$
    <employee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceS
      <details>
        <emp_id>1</emp_id>
        <emp_name>SMITH</emp_name>
        <emp_age>40</emp_age>
        <emp_dept>10</emp_dept>
      </details>
    </employee>
    Then use XMLTABLE to shred the XML into relational format :
    SQL> select x.*
      2  from "employee1121_TAB" t
      3     , xmltable('/employee/details'
      4         passing t.object_value
      5         columns emp_id   integer      path 'emp_id'
      6               , emp_name varchar2(30) path 'emp_name'
      7       ) x
      8  ;
                                     EMP_ID EMP_NAME
                                          1 SMITH

  • How to get the class name and field name dynamically

    Hi
    I have a class (ex: Contract) the fields (ex : a,b,c) .i need to get the class name and field name dynamically
    ex
    if( validation file for the field Contract.a){
    return contract.a;
    }else if(validation file for the field Contract.b){
    return contract.b;
    how to pass the field name and object dynamically
    Please help me .............
    Thanks in Advance..
    Edited by: 849614 on Aug 11, 2011 6:49 AM

    YoungWinston wrote:
    maheshguruswamy wrote:
    Agreed, but IMO, i still feel its best if there is no tie in between consumer class level details and the database it talks to. A service layer is needed in between them.Sounds like you've done a bit of this before. Me, I've either been a modeller/DBA, doling out data, or a nuts and bolts programmer (and actually more toolmaker than apps, but did a bit of that too).
    Do you know of a good book about the "middle ground" (ie, these service layers)? I understand it empirically, but haven't had a lot of exposure to it.
    Winston
    Edited by: YoungWinston on Aug 11, 2011 10:34 PM
    PS: Apologies. Edited my previous post, presumably while you were composing your reply, when I finally realized what '.filed' meant.Most of my work is in web development, never been a DBA :) . The biggest 'concern' in my shop is 'separation of concerns'. The UI group reports up to a different IT head, the DB group reports up to a different IT head and so on. The looser the coupling between these systems, the lesser the project costs (Integration, QA etc) are. Martin Fowler's books contain good information about separation of concerns in an enterprise environment. The two books which i recommend are
    [url http://www.amazon.com/Patterns-Enterprise-Application-Architecture-Martin/dp/0321127420]Enterprise Application Architecture and
    [url http://www.amazon.com/Enterprise-Integration-Patterns-Designing-Deploying/dp/0321200683/ref=pd_sim_b_1]Enterprise Integration Patterns

  • How to get the column name and table name with value

    Hi All
    I have one difficult requirement
    I have some column values and they have given some alias column names but i need to find the correct column name and table name from the database.
    For example value is "SRI" and i dont know the table and exact column name so is there any possibilities to find the column name and table name for the given value
    Thanks & Regards
    Srikkanth.M

    Searching all the database for a word...
    Courtesy of michaels...
    michaels>  var val varchar2(5)
    michaels>  exec :val := 'as'
    PL/SQL procedure successfully completed.
    michaels>  select distinct substr (:val, 1, 11) "Searchword",
                    substr (table_name, 1, 14) "Table",
                    substr (t.column_value.getstringval (), 1, 50) "Column/Value"
               from cols,
                    table
                       (xmlsequence
                           (dbms_xmlgen.getxmltype ('select ' || column_name
                                                    || ' from ' || table_name
                                                    || ' where upper('
                                                    || column_name
                                                    || ') like upper(''%' || :val
                                                    || '%'')'
                                                   ).extract ('ROWSET/ROW/*')
                       ) t
    --        where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
           order by "Table"or
    11g upwards
    SQL> select table_name,
           column_name,
           :search_string search_string,
           result
      from (select column_name,
                   table_name,
                   'ora:view("' || table_name || '")/ROW/' || column_name || '[ora:contains(text(),"%' || :search_string || '%") > 0]' str
              from cols
             where table_name in ('EMP', 'DEPT')),
           xmltable (str columns result varchar2(10) path '.')
    TABLE_NAME                     COLUMN_NAME                    SEARCH_STRING                    RESULT   
    DEPT                           DNAME                          es                               RESEARCH 
    EMP                            ENAME                          es                               JAMES    
    EMP                            JOB                            es                               SALESMAN 
    EMP                            JOB                            es                               SALESMAN 
    4 rows selected.

  • How to find the column name and table name with a value

    Hi All
    How to find the column name and table name with "Value".
    For Example i have value named "Srikkanth" This value will be stored in one table and in one column i we dont know the table how to find the table name and column name
    Any help is highly appricatable
    Thanks & Regards
    Srikkanth.M

    2 solutions by Michaels (the latter is 11g upwards only)...
    michaels>  var val varchar2(5)
    michaels>  exec :val := 'as'
    PL/SQL procedure successfully completed.
    michaels>  select distinct substr (:val, 1, 11) "Searchword",
                    substr (table_name, 1, 14) "Table",
                    substr (t.column_value.getstringval (), 1, 50) "Column/Value"
               from cols,
                    table
                       (xmlsequence
                           (dbms_xmlgen.getxmltype ('select ' || column_name
                                                    || ' from ' || table_name
                                                    || ' where upper('
                                                    || column_name
                                                    || ') like upper(''%' || :val
                                                    || '%'')'
                                                   ).extract ('ROWSET/ROW/*')
                       ) t
    --        where table_name in ('EMPLOYEES', 'JOB_HISTORY', 'DEPARTMENTS')
           order by "Table"or
    SQL> select table_name,
           column_name,
           :search_string search_string,
           result
      from cols,
           xmltable(('ora:view("'||table_name||'")/ROW/'||column_name||'[ora:contains(text(),"%'|| :search_string || '%") > 0]')
           columns result varchar2(10) path '.'
    where table_name in ('EMP', 'DEPT')
    TABLE_NAME           COLUMN_NAME          SEARCH_STRING        RESULT   
    DEPT                 DNAME                ES                   RESEARCH 
    DEPT                 DNAME                ES                   SALES    
    EMP                  ENAME                ES                   JONES    
    EMP                  ENAME                ES                   JAMES    
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   SALESMAN 
    EMP                  JOB                  ES                   PRESIDENT
    EMP                  JOB                  ES                   SALESMAN 
    9 rows selected.

  • How to find Field Name and Table Name

    Hi All,
    I got some output values from the legacy system with me but need to know whats the actual field name and table name to which i need to transfer these values. How can i do it, since which theres is not field name or despcription given for the data.
    Is there any way i can do it.
    Points will be rewarded for all useful answers.
    Regards
    AB

    Hi All,
    I got some output values from the legacy system with me but need to know whats the actual field name and table name to which i need to transfer these values. How can i do it, since which theres is not field name or despcription given for the data.
    Is there any way i can do it.
    Points will be rewarded for all useful answers.
    Regards
    AB
    Hi Abuser,
            now u have legacy data. now u want to do upload this data from legacy to r/3 by using one sap transaction. yes ok na..
      first of all u want to know the data is relevant to the which transaction...
       without knowing the transaction u cant trasfer the data..
    then open transaction put cursor on i/p field and click on f1
    and find out the field name & table..
    this is one method to find the field name and table name.

  • How to find table name and field name thru Tcode

    Hi,
         how to find out table name and field names thru transaction code..........plz point out step by step.

    Hi
    I am not getting your question... as i understand, if you go to SE84 tcode you can get it.
    Go to SE84.Select ABAP Dictionary sub tree. Double click on "database tables'. Give some number in "Maximum number of hits”. DONT GIVE ANY OTHER INPUTS. Just press F8. You will get all table names.
    For fields also do like this by selecting FIELDS sub tree.
    Reward if it is useful.
    Thanks
    Siva Kumar

  • How do find Process name and Node name in a workflow ?

    Hi,
    For logging exceptions, how do I elegantly find the
    process name and node name in a workflow.
    Thanks
    -Anil

    The service location of the process is available on the interface returned
    by
    context.getService() in the process. That contains the full process path
    (including process project name).
    On the node, I don't know...
    Robert
    "Anil Varma" <[email protected]> wrote in message
    news:31361182.1091122588490.JavaMail.root@jserv5...
    Hi,
    For logging exceptions, how do I elegantly find the
    process name and node name in a workflow.
    Thanks
    -Anil

  • How to add a service account in SQL Server to display the "Service Account Name" and "Display Name"

    Can someone
    help with steps on how to add the following in SQL Server 2012 environments?<o:p></o:p>
    "Service Account Name" and "Display Name"<o:p></o:p>
    Your help will be greatly appreciated.<o:p></o:p>
    leonie6214

    Hello,
    Is the following article what you are looking for?
    http://msdn.microsoft.com/en-us/library/ms345578.aspx
    If not, could you explain a little bit more what you want to accomplish?
    Hope this helps.
    Regards,
    Alberto Morillo
    SQLCoffee.com

  • How to show rating dots and file name underneath thumbnail in Bridge CS4 preview workspace?

    How to show rating dots and file name underneath thumbnail in Bridge CS4 preview workspace?

    Thank you! That was it. The option to change it is not available in preferences (though I believe it was in early CS versions). It's hidden in a dropdown menu associated with an icon at the top. It sure wasn't easy to find, and I probably would not have done so without your lead. Thanks again!

  • How to change host name and domain name in installed Cisco Meeting Place Express 2.0?

    Hi
    I have  Cisco Meeting Place Express 2.0 installed on server. Meting Place uses Linux (Red Hat) as base operation system. Please tell me how I can change host name and domain name for Meeting Place Express application to integrate it into corporate domain infrastructure.
    Thanks in advance!!!
    Sincerely yours
    Sergey Bondarenko

    Hi
    Thanks for your attention for my humble problem.
    I have performed Meeting Place Express configuration through the “net” command.
    But now unfortunately I can't connect to meeting place through web browser. I just get blank page.
    Though I can reach the server with help of ssh. I think my DNS works properly because I can resolve the ip address of  cumpxvoice .uclab.com and cumpxweb. uclab.com with help of dig command.
    Have you any idea?
    A lot of thanks in advance!!
    Sincerely yours Sergey Bondarenko
    Here I have printed the net configuration output of Cisco meeting Place Express:
    [root@cumpxvoice root]# net
    This is the MeetingPlace Express network configuration utility.
    Up to the point where you save changes, it is safe to hit ^C to get
    out at any time, in which case nothing will have changed.
    1) List current configuration
    2) Configure Ethernet port 1
    3) Configure Ethernet port 2
    4) Configure service bindings
    5) Set host names
    6) Set domain name
    7) Configure DNS service
    8) Configure NTP service
    9) Configure routing
    10) Done
    Select: 1
    Primary/audio host name: cumpxvoice
    HTTP host name:          cumpxvoice
    RTMP host name:          cumpxweb
    Domain name:             uclab.com
    Service bindings:
    Audio:                   port 1 (eth0)
    Web browsing (HTTP):     port 1 (eth0)
    Web conferencing (RTMP): port 2 (eth1)
    Port 1 (device eth0):
    IP Address:      10.62.60.116
    Network mask:    255.255.255.0
    Default gateway: 10.62.60.1
    Link setting:    autoneg on
    Port 2 (device eth1):
    IP Address:      10.62.60.117
    Network mask:    255.255.255.0
    Default gateway: 10.62.60.1
    Link setting:    autoneg on
    Static routes:
    Destination      Gateway          Network mask     Port
    0.0.0.0          10.62.60.1       0.0.0.0          1
    DNS Servers:
    10.62.60.115
    10.0.1.4

Maybe you are looking for

  • I cannot download my old itunes library to my new ipod - please help!!!!

    Unfortunately in August 2006 someone nicked my Ipod mini - thanks! So my insurance co. replaced it with an ipod nano. I've installed the new software disk that came with my ipod nano and hooked up with the old itunes library to my new ipod nano. Simp

  • Text disappearing using Preview to edit PDF

    I had an attorney draw up a contract for my company a few years back and I would like to make some changes to the contract, all relatively minor.  When I open the file I am able to make changes to certain "cells" but other text boxes dissappear when

  • Error installing IDS: ABAP Process of Instance IDS/DVEBMGS00 (ABAP:UNKNOWN) did not start after 10 minutes

    Hi All, Im installing EHP6 on windows server 2008 r2 (VM ware 10). After getting past my initial problems, im stuck on step 21/29. Create Instance. Im getting the attached error. I can make out from this file that it is network related issue, but can

  • Remote connection to folder applescript throwing error after 10.6.7 update

    I have the following applescript steps that have worked perfectly until we updated the two server machines it runs between (one is a file server, the other is a client machine running filemaker server): --set initial values to the filesystem variable

  • SUn Java with MX7

    The Paypal integration guide says that I need to install SUn Java JRE 1.3.1_02. I have done that and updated the CF administrator JVM path to point to it, but COld FUsion will not start. ANy ideas? I also tried installing 1.4_15 and it wont start wit