How to connect to database with a schema other than current user?

Dear all,
I would like to know whether it is possible to specify a specific schema while connecting to a database directly by SQL*Plus command. Usually here is what I do (assuming that db01.WORLD is already in tnsnames.ora)
$ sqlplus scott/[email protected], in this case the user is SCOTT and the current schema is also SCOTT. If I want to change the current schema I have to use an ALTER SESSION SET CURRENT_SCHEMA command. So what I would like to know is that whether there is an alternative, that is, proceeding in a way where the user SCOTT connects directly (by using SQL*Plus shell) to a SCHEMA other than SCOTT (in other words, is it possible to specify the desired schema at the connection time, for example user SCOTT who connects under a schema named 'management')
Thanks in advance,
Dariyoosh

The ordinary way to do this is to
1 - grant object privileges from the other schema to scott (Refer to the GRANT command in the online documentation)
2 - create a private synonym in the Scott user (Look up CREATE SYNONYM in the documentation)
The only other solution would be to make sure to create an after login trigger running the alter session command.
Finally two words of advise
1 You are recommended to leave the user Scott alone, and not mess it up with your own additions.
2 You seem to treat this forum as a free Oracle class. As the people responding here are volunteers you are kindly advised to stop doing that and use the online documentation at http://tahiti.oracle.com and read at least the 'Getting Started' document and/or the '2-Day' document for your unknown version of Oracle.
Sybrand Bakker
Senior Oracle DBA

Similar Messages

  • How to connect oracle database with JAVA

    how to connect oracle database with JAVA....
    using j2sdk and Jcreator . which connector to use .. what are the code for that ..

    PLEASE .... Ask in an Oracle Java forum.
    And read the documentaiton. There is a whole document devoted to doing that. http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/toc.htm has examples.
    PLEASE ... do not ask product questions in a forum which clearly has a title saying it is devoted to assisting with download problems.

  • How to connect mySQL database with jdbc

    Who can tell me how to connect mySQL database with jdbc? Thanks

    http://onesearch.sun.com/search/developers/index.jsp?and=connect+mysql&nh=10&phr=&qt=&not=&field=title&since=&col=devforums&rf=0&Search.x=24&Search.y=16

  • How to connect MySql database with JSP

    Dear everyone,
    how to connect MySql database with JSP......

    It's too bad that nobody has ever asked this question before...

  • How to connect sql database with Flash

    Dear Friends,
    Iam working on a quessinarie (assesment) for elearning software. i want to connect sql database with flash and save my records in back end like add, delete, modification of student result and details.
    Kindly help me to connect the sql database. or dot net server. I know how to connect PHP and mysql. But my client dont want php. only sql database and do the add, del, modificaiton.
    Thanks in advance,
    Syed Abdul Rahim

    unfortunately no, i do not know ASP well enough to give any code advice, other than the basic concept:  make a request on a server-side script (such as ASP) via URLLoader - the script receives variable values (if required), runs the DB queries you wish to invoke, and 'returns' the results - pick them up in the URLVariables class via the event handler in Flash and assign them to local properties if needed, etc.
    there are quite a few threads that you could find more specific information on the ASP side, here and elsewhere around the net.

  • How to get User Profile Service information on user OTHER THAN current user?

    So much information on how to autopopulate information for the current user or the logged in user in InfoPath.  But what about other users?  What if there's a field that's 99/100 times going to be the same person, but it's not the person that's
    logged in? 
    I would like not just to autopopulate a person field to be a specific user (which is not the current user), but I'd also like to autopopulate surrounding fields for that user's Title and Department. 
    For instance, consider the following 6 fields.
    1. Current User Name:  
    2. Current User Title:  
    3. Current User Department:
    4. Current User’s Supervisor’s Name:  
    5. Current User’s Supervisor’s Title:  
    6. Current User’s Supervisor’s Department:
    I know how to get the first three; the internet is swarming with that information.
    I'm struggling the last three; searching for this information is impossible without turning up information on current user instead.
    The furthest I've gotten so far is to autopopulate Current User's Supervisor's Name by:
     1. Show Advanced View on Fields pane
     2. Expand my Field (which is really a group) called IT Manager Name
     3. Expand what shows up under that which is pc:Person
     4. Right click AccountId and choose Properties
     5. Set Default value to [our domain]\[IT Manager's ads username]
    This solves how to get that 4th field my example list above Current User's Supervisor's Name to autopopulate, but how do I then get the Title and Department from the value I set in step 5 [our domain]\[IT Manager's ads username]?  Or is there a different/better
    way altogether to go about getting a non-current user's info to autopopulate in InfoPath form fields?
    *UPDATE*
    I just want to clarify that I'm not asking if there's a way to autopopulate the current user's supervisor.  I'm aware that Manager is one of the User Profile service fields.  But the point is that  I want to have a field in which the current
    user fills in a username (different than his or her own), and to have User Profile Service called on that provided username to autopopulate Title and Department in surrounding fields.  The question is about how to call information with User Profile Service
    on any provided username, specifically what steps to take to set this up in InfoPath Designer.

    Have a look at the REST API. You can use the /_api/sp.userprofiles.peoplemanager/getpropertiesfor endpoint to query the user profile service for user profile properties of any user. 
    The API is documented here: https://msdn.microsoft.com/en-us/library/office/dn790354.aspx and here https://msdn.microsoft.com/en-us/library/office/jj163800.aspx
    Regards, Matthew
    MCPD | MCITP
    My Blog
    View
    Matthew Yarlett's profile
    See my webpart on the TechNet Gallery that allows administrative users to upload, crop and format user profile photos. Check it out here:
    Upload and Crop User Profile Photos

  • Error creating dynamic page in an application with a schema other than portal30

    Running 9iAS 1.0.2.2 on Solaris.
    Database 8.1.7.1
    I cannot seem to create a default dynamic page (select 'x' from dual) in an application that has a schema (e.g. test) other
    than portal30. The error seems to be when portal tries to compile the dynamic-page package, it references itself from
    within the package but prefixing the call with the other (test) schema. It never seems to compile? What seems to be the
    problem? Any ideas?

    If you are using any database object other than the applcation owned,then it has to be prefixed with the schema owner.
    For example,
    if the application schema is based on the schema "schema1" (say)
    and your query is based on one of the object on "schema2"
    and if you have necessary privilegves to access that object from schema2, then the compiler wont throw any error.
    Can u explain, what u problem you are experiencing in detail?
    (Also, if u give me the portal version, I can cross-verify that).

  • How to import complete database with all schemas

    I have exported all database using system/manager in oracle 8.
    Now How i can i import all database in oracle 9i with all users, Roles etc...
    I tried to import "Import Entire database=y" using system manager schema but face following errors.
    Schema doesn't exit, Role errors etc.....

    Hi,
    As you are working with Old version of Oracle, then Oracle data pump would not be applicable to in order to carry out. So, in order to complete the export and import from prior version either you need to upgrade the version of Oracle so that you can make use of upgrade tools or either clone it or make sure you create required things prior to import on destination database. Further you can check Oracle support team
    - Pavan Kumar N

  • How to connect Peachtree database with an Excel File

    I have Crytal Report 2008 SP1 for Peachtree Quantum 2010.  I need to make a report that links an Excel 2007 File with Peachtree data files but I have not success.  I could do it with previous version of Crystal .  Could any one help me on this matter?
    Thanks in advance for your time.

    I suggest you contact Peachtree for support. If you can create any other report off of an Access table for example then it's a configuration and/or database connector issue with Peachtree.
    Also verify they support CR 2008.
    Thank you
    Don

  • How to connect external database with SAP

    Hi,
    How to get the data from an external database into SAP by directly linking the SAP Program to the external database.
    Regards
    Guhapriyan

    Hi,
    http://help.sap.com/saphelp_nw04/helpdata/en/58/54f9c1562d104c9465dabd816f3f24/content.htm
    This might help,
    Regards,
    Gaurav

  • How to connect to database with JS in indesign?

    Anyone can tell me how to do or give me some examples?

    Short answer is, "you can't".
    You can connect to a web service by using the Socket object to write http requests.
    If you know the DB's connection protocol, you theoretically could write the interface code using the Socket as well.
    You can create a java class to do it. Call the class, write the data to a file, and then read it. You can do synchronous Java calls on a Mac, on PC they must be asynchronous, which will increase complexity.
    Regards
    Bob

  • How to connect oracle database with mvc3 either can use connection string or dbcontext??? please help me

    hi can anyone please help me??

    Are you using the Oracle ODBC driver? If so, which version?
    Are you writing your own VB application? What API are you using-- ADO? Can you post the code that's making a connection and the exact text of the error message?
    Justin

  • How to park an invoice with a vendor other than the PO vendor ?

    Dear all,
    Can anybody pl give an idea about how i can park an invoice for a vendor which is different from the PO vendor ?
    regds
    amitava

    hi
    go to MIR7
    here give all detials then in details tab change the po vendor to any other and save

  • How to connect to database in JSP

    Hi, all.
    I am using J2EE and cloudscape. I have written all the EJB classes. But now i have no idea that how to connect to database in jsp such as i get user ID from portal, then i connect to database check the existence of user ID and the password then return true or false value. how to write all this in jsp?
    Thanks very much!
    yayun

    this is the required code
    i hope this will help u
    <html>
    <head>
    </head>
    <body>
    <%@ page import="java.sql.*" %>
    <%
    try
    String fu=request.getParameter("username");
    String fp=request.getParameter("password");
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection Con=DriverManager.getConnection("jdbc:odbc:wind","","");
    Statement stmt=Con.createStatement();
    ResultSet rs=stmt.executeQuery("select * from table1 where username='"+fu+"' and password='"+fp+"'");
    if(rs.next())
    %>
    <jsp:forward page="success.jsp"/>
    <%
    else{
    %>
    <jsp:forward page="unsuccess.jsp"/>
    <%
    catch(Exception e)
    %>
    </body>
    </html>

  • How to connect Developer 6i with third party Databases

    How to connect Developer 6i with third party Databases

    Hi,
    Oracle Forms 6i comes with a Oracle Client Adaptor, OCA, that allows you to connect to 3rd party databases. Starting Forms 9i you use gateways.
    Frank

Maybe you are looking for

  • IOS/Android client - Open document from another app

    Hi, Is it possible to call the SAP Mobile Documents client for Android and/or iOS directly opening some specific document? I would like to know if I can integrate Agentry Work Manager with Mobile Documents, so the goal is to have some kind of link fo

  • How to save multiple desktops settings in Mountain Lion

    Hi, if I would like to keep 5 desktops, and put mail on the first one, Safari on the second... How do I save this setting so next time when I start the computer, it will be there?

  • Regarding program rvkusta1

    Hi Eperts , I am facing one problem to remove sone standard code form program  "rvkusta1". when i run this program  the output showing in diffrenent blocks  like Address, cassification .... but my requirement is i have to display only Address ,parten

  • What is the mean of standard and HTML in report generation?

    What is the mean of standard and HTML in report generation?  I  need your help.Thank you! 1110340020

  • Bind option in report. How to change setting in Query Designer?

    Hello, Is there any way of changing the 'Bind display of textx/attributes in data provider result and in value help' in the portal. We can change this option from the report by right clicking on the characteristic -> Properties -> Characteristic -> S