SQLPlus Default Database Connection

I have two Oracle databases installed on the same LINUX server. One is a training database that is rarely even running.
When logging in through SQLPlus and only supplying userid and password, the database to which the connect is attempted varies depending on the userid I am currently logged in as under LINUX. Under one userid, SQLPlus even attempts to connect to the idle training database. The 8i documentation indicates that setting the default database for SQLPlus is OS specific. Does anyone know how this is specified under LINUX?

Joseph,
That was one of my guesses, as well, but it doesn't seem to behave consistently.
The .bash_profile files for both the oracle and mdm user are the same, however, the oracle user is able to default to the correct database, whereas mdm cannot.
Here's the profile for mdm:
$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
DISPLAY=localhost:0.0; export DISPLAY
ORACLE_BASE=/usr/oracle; export ORACLE_BASE
ORACLE_HOME=/usr/oracle; export ORACLE_HOME
ORACLE_SID=pmisbk; export ORACLE_SID
#ORACLE_SID=oralin; export ORACLE_SID
ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data; export ORA_NLS33
ORAENV_ASK=NO; export ORAENV_ASK
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib; export LD_LIBRARY_PATH
umask 022
NLS_LANG=american_america.EE8ISO8859P2; export NLS_LANG
#PATH=$PATH:$HOME/bin
PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/ActivePerl-5.6/bin:$PATH:$HOME/bin:$ORACLE_HOME/bin
BASH_ENV=$HOME/.bashrc
USERNAME=""
export USERNAME BASH_ENV PATH
. /usr/local/bin/oraenv
and behavior:
$ echo $ORACLE_SID
pmis
$ sqlplus
SQL*Plus: Release 8.1.6.0.0 - Production on Thu Apr 25 14:01:10 2002
(c) Copyright 1999 Oracle Corporation. All rights reserved.
Enter user-name: mdm
Enter password:
ERROR:
ORA-01034: ORACLE not available
Enter user-name: mdm@pmisbk
Enter password:
Connected to:
Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
SQL> exit
Disconnected from Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
and the .bash_profile for oracle:
$ su - oracle
Password:
$ cat .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
DISPLAY=localhost:0.0; export DISPLAY
ORACLE_BASE=/usr/oracle; export ORACLE_BASE
ORACLE_HOME=/usr/oracle; export ORACLE_HOME
ORACLE_SID=pmis; export ORACLE_SID
#ORACLE_SID=oralin; export ORACLE_SID
ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data; export ORA_NLS33
ORAENV_ASK=NO; export ORAENV_ASK
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib; export LD_LIBRARY_PATH
umask 022
NLS_LANG=american_america.EE8ISO8859P2; export NLS_LANG
CLASSPATH=.:$ORACLE_HOME/jdbc/lib/classes111.zip:$ORACLE_HOME/sqlj/lib/translator.zip; export CLASSPATH
PATH=/usr/local/ActivePerl-5.6/bin:$PATH:$ORACLE_HOME/bin
BASH_ENV=$HOME/.bashrc
USERNAME=""
export USERNAME BASH_ENV PATH
. /usr/local/bin/oraenv
and the behavior:
$ sqlplus
SQL*Plus: Release 8.1.6.0.0 - Production on Thu Apr 25 14:07:47 2002
(c) Copyright 1999 Oracle Corporation. All rights reserved.
Enter user-name: mdm
Enter password:
Connected to:
Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
SQL> exit
Disconnected from Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
Perhaps this is because the Home directory for the oracle user is the same as $ORACLE_HOME.
You may have noticed the connect string for mdm was to pmisbk. That's the alias in the tnsnames.ora file, otherwise if you try using pmis you get:
Enter user-name: mdm@pmis
Enter password:
ERROR:
ORA-12154: TNS:could not resolve service name
and have to enter:
Enter user-name: mdm@pmisbk
Enter password:
Connected to:
Oracle8i Enterprise Edition Release 8.1.6.1.0 - Production
With the Partitioning option
JServer Release 8.1.6.0.0 - Production
SQL> exit
If you specify pmisbk and the ORACLE_SID in the .bash_profile file, when you log into the server it prompts you:
ORACLE_HOME = [usr/oracle] ?
presumably because /etc/oratab does not contain an entry for pmisbk. You can respond with RETURN and the variable contains the correct path, but all the other behavior is as described above.

Similar Messages

  • Trying to get the default database connection

    I'm trying to use the default database connection that the application server has but when I call this method I get an error :
    Connection conn = (new oracle.jdbc.driver.OracleDriver()).defaultConnection();
    java.sql.SQLException: Invalid Oracle URL specified
    Do I have to do some setup? I don't want to hard code the connection URL in my code.
    Thanks,
    Merced

    Hi Avi,
    Thank you so much. I added the following and I was able to get the connection:
    Context ctx = new InitialContext();
    DataSource ds = (DataSource) ctx.lookup("jdbc/DBConnection1CoreDS");
    Connection c = ds.getConnection();
    Currently I'm running it from JDeveloper and the data-source.xml gets generated automatically. How will it work when I deploy this application to the Oracle Application server? Do I have to update or copy data-source.xml? What does "jdbc/DBConnection1CoreDS" mean? I only know that in data-source.xml I have location="jdbc/DBConnection1CoreDS". I don't understand how Context is able to find this. I also deleted this entry from data-souce.xml but it got generated again. I don't understand that either.
    Your help is appreciated.
    Thanks,
    Merced

  • How to use Forms Default Database Connection in java class

    When a form based application is started, a connection is made with underlying database. This is the Default (Primay) Database Connection.
    The problem is I have some of my business logic implemented in a java class. In this class I have to make a another connection with the same database. What I want to do is to use the original Database Connection in the java class. In this I may avoid the overhead of reconnection.
    Could anyone pls guide me in this way...

    you can't share the forms connection. Sorry :(

  • Default Database Connection Strings

    Does anyone know if it is possible to default the database connection strings/setup?
    We are trying to rollout ADI through Citrix and would like to default or pre-install the database connection setup instead of having every user set this up individually.
    I'm assuming there are some registry entries that can be set?
    If anyone has any ideas please share.
    Thanks and Regards,
    Chris
    ([email protected])

    ADI 7.2 included a service to centrally manage database definitions. Instructions on how to setup this service can be found in any of the ADI 7.2 Rollup patches in a file called CENTRAL.TXT (root directory of the patch).

  • Use ADF Default Database Connection

    Hi All,
    I am writing a class that requires to connect to the database and perform some functions. This class is invoked from a button. My challenge is, how can I use the current adf application database connection (jndi) instead of creating another class that returns a connection object?
    Thank you.
    Eric.

    Are you using ADF BC in your application?
    If so you can write an AM Service method that uses the current connection/transaction - and then use that method from your UI button.
    http://download.oracle.com/docs/cd/E16162_01/web.1112/e16182/bcadvgen.htm#BABEIFAI
    and then
    http://blogs.oracle.com/shay/2010/07/am_service_method_-simpledem.html

  • How to make new database connection using Oracle BI Interactive Dashboards

    Hi,
    I install Oracle BI Intelligence on my system.
    I am using Oracle BI Interactive Dashboard. Here we have default database connection.
    but now i want to use it for my own database. Can any body give me guideline how to
    make a new data base connection using this s/w or how to connect to my database so
    that i can make my own reports.
    I am using
    http://www.oracle.com/technology/obe/obe_bi/bi_ee_1013/saw/saw.html
    this link.
    i make odbc connection which is fine.
    but
    Restoring the Business Intelligence Presentation Catalog and Updating Metadata
    The third point blow above heading is not clear.
    Thanks

    Umesh - in order to build Answers and Dashboard content you must first setup a Physical model, then a Business model, followed by a Presentation Catalog/Subject Area.
    All these tasks are carried out using the Repository Administration Utility.
    1) Import your physical tables using OCI/ODBC into the physical layer.
    2) Build your model
    3) Deploy
    Then you're ready to start building answers/dashboards.
    Good Luck.

  • Include default database JDBC driver in CLASSPATH

    Hello,
    We have SAP web application server 6.40 with Oracle 9i as WAS DB and we need to put content of Oracle JDBC Driver Library (default database of WAS) in CLASSPATH, but we can’t include native JDBC Driver. We would need to use the default database driver or resolve it by another form that we can’t see now.
    How can we set up J2EE server for include in CLASSPATH default database JDBC Driver, in this case Oracle?
    Where is located default database driver in SAP web application server?
    Thanks
    Rubén Álvarez

    Hi Brandelik,
    I have to use a third party library who implements internaly a Database connection via JDBC, in this case Oracle. This library use other classes from Oracle Connection Library but it can't find the DB classes.
    I use the DataSource objects but before I need that this third party library can find DB Objects.
    I have added as java library build path, compose it in a .sda and references library in J2EE projects and some other ones things but anything has work.
    I suposed that my problem could be resolved adding library in the CLASSPATH environment variable but I can't add any library DB class to CLASSPATH because this is used for default database connection and make conflicts during server startup. For this reason, I have been looking for the placement of default database connection and then include it into CLASSPATH variable.
    Is this posible?
    Thanks
    Ruben

  • MSSQL Homogeneous System Copy : SAPINST cannot connect to default database

    Hello.
    We want to perform a homogeneous system copy, following Note 151603.
    We have attached the source DB (RP1) to the destination DB (RD4) following the above mentioned Note.
    Now, logged to the server as DOMAIN\rd4adm , we want to execute the SAPINST, as indicated in the Note 683447, but when giving the password for user rd4adm we get a pop up
    Cannot connect to R3SVIL\RD4 [SQL Server]Cannot open user default database. Login failed.
    R3SVIL is the server. Login is done with windows authentication (connected as domain\rd4adm)
    We cannot find a Note descibing this issue and how to fix it, must be something with user : does anybody have suggestion or solution?
    Thanks a lot,
        Dino

    Hi,
    did you apply SAP note 551915 - R/3 won't start after database restore or database copy
    also check Note 806925 - SQL Error 4064: Cannot open user default database
    regards,
    kaushal

  • Sqlplus hangs when connecting to database after applying patch 10.2.0.4

    Hi, I applied the patchset 10.2.0.4 and CPU January 2010 on my 10g database. my server is a windows 2003 x64 with a specif user (oradb)
    When I tried to logon to the database, it took 15 minutes for a normal user to logon and every request is almost as long.
    if I log as SYSDBA everything looks fine.
    I don't see anything relevant in the alert_log or listener.log
    The only thing unusual that I can see is from the view v$session_wait. It looks that there is 26 to 28 processes that are connected with timeout status, the database that I have in lab runs with 11-16 processes.
    Can somebody tell me what can I look for ?
    Thank you

    I use the listener both locally and on remote console but it's always the same behavior :
    cmd> sqlplus sys@production as sysdba // Connect without a glitch
    cmd> sqlplus user1@production // Connect after 15 minutes
    There's nothing in the alert_production.log and listener.log
    Actually, any user that has the SYSDBA privilege is able to connect without any issue. I tried the same thing with test
    cmd> sqlplus test1@production as sysdba
    Edited by: APQ on Jan 17, 2010 8:11 PM

  • 64 bit SAP to 32 bit External Oracle Database connectivity failing

    Dear All,
    We are trying to connect to an external Oracle database thru DBCON method. We are able to connect to Oracle server from our IDES server which is a 32 bit server, but when we are trying to connect our development server which is a 64 bit server, the connectivity is failing.
    we copied the correct 64 bit *.lib file to the SAP server but still same result. We are getting the error message - Work Process restarted. Session terminated.
    the Oracle server we are trying to connect is 32 bit, can this create some problem ?
    kindly any one help us in this reagrd.
    thanks in advance,
    Saurabh.

    Hi Eric,
    thanks for the advice but I am a bit confused as where to execute that sqlplus command/query ?
    in the Oracle server or from SAP and what does system/password@DEV means ??
    can you elaborate on this please.
    here i would like to add that we have connected to the external Oracle server using linked server approach of MS SQL (our SAP default database) and so our connectivity is happening till SQL level i.e. I am able to connect to the Oracle and query it using OpenQuery syntax. the problem is appearing when I am trying to connect from the ABAP level.
    kindly suggest as to what can be the solution of this issue.
    thanks
    Saurabh.

  • Oracle 8i Lite - SQLPlus 8.0 Connect

    I am running Windows 98 and Oracle8i Lite. I have been trying to launch SQLPlus 8.0 from Oracle 8i Lite. I typed SCOTT for a username and TIGER for a password, but I could not figure out what I am supposed to type for the HOST STRING. I researched the on-line documentation that came with the software, but the documentation does not have adequate explanation; it is too general to be helpful. I am not interested in getting connected to any external databse. I am just trying to obtain the SQL prompt SQL>. I would appreciate it if anyone could provide me with suggestions on how to resolve this problem.
    Thanks!
    null

    I am using Windows 2000 Professional and I am experiencing the same problem. I can connect to the POLITE database from Oracle8 Navigator and Oracle ODBC 32bit Test but not from SQL*Plus. Here is what I see:
    Connected to:
    Oracle Open Client Adapter for ODBC 6.0.5.29.0
    Oracle Lite ORDBMS 4.0.1.0.7
    SQL> connect system/mgr@odbc:POLite
    Server not available or version too low for this feature
    Connected.
    SQL> connect system/mgr
    ERROR:
    ORA-12203: TNS:unable to connect to destination
    Warning: You are no longer connected to ORACLE.
    Should I try to upgrade my Open Client Adapater (OCA)? Could it be something with my PATH? How can I set up the default TNS to connect to POLITE? Any suggestions?
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Floyd Teter ([email protected]):
    George,
    Try the following host string: ODBC:POLITE
    Lite typically uses the SID of POLite for installation of the default database, so this host string should do the trick. If not, drop me an email and we'll work through it together.
    Hope this helps!
    FMT
    <HR></BLOCKQUOTE>
    null

  • Cann't find default database

    I install Oracle 8.1.7 on my computer,but it cann't find default database.
    I have been reinstall a lot of time ,except the first time it can get the db in Enterprise Manager Console.
    How can I do ?

    Hi,
    For using oracle enterprise manager console, you would need to connect to a repository. Are you able to connect to the database using sqlplus? What is the error you are getting? The default username and password to connect to enterprise manager console is sysman/oem_temp.
    HTH

  • Error while applying a patch "Unable to get the database connection"

    Dear Experts,
    A patch which got successfully applied is failing Production and the error is kind of surprising to me.
    Apps version is 11.5.10.2
    db version is 10.2.0.4
    The worker log file shows
    Time when worker restarted job: Thu Nov 24 2011 22:14:52
    Start time for file is: Thu Nov 24 2011 22:14:52
    adjava -ms128m -mx256m -nojit oracle.apps.fnd.odf2.FndXdfCmp &un_apps &pw_apps &un_apps &pw_apps &jdbc_protocol &jdbc_db_addr table &fullpath_pa_patch/115
    Reading product information from file...
    Reading language and territory information from file...
    Reading language information from applUS.txt ...
      Temporarily resetting CLASSPATH to:
      "/erp/oracle/prodappl/ad/11.5.0/java/adjri.zip:/usr/java14/jre/lib/charsets.jar:/usr/java14/jre/lib/core.jar:/usr/java14/jre/lib/graphics.jar:/usr/java1
      Calling /usr/java14/bin/java ...
    Exception occured
                  Copyright (c) 2003 Oracle Corporation
                     Redwood Shores, California, USA
             XDF(XML Object Description File) Comparison Utility
                            Version 1
    NOTE: You may not use this utility for custom development
          unless you have written permission from Oracle Corporation.
    Unable to get the database connection using schema username/passwordIo exception: The Network Adapter could not establish the connection
    AD Run Java Command is complete.
                         Copyright (c) 2002 Oracle Corporation
                            Redwood Shores, California, USA
                                        AD Java
                                     Version 11.5.0
    NOTE: You may not use this utility for custom development
          unless you have written permission from Oracle Corporation.
    AD Worker error:
    The above program failed.  See the error messages listed
    above, if any, or see the log and output files for the program.
    Time when worker failed: Thu Nov 24 2011 22:14:53
    {code}
    The error says database connection error.  I am able to connect to the database using sqlplus.  I tried to restart the failed worker, but the same error is repeating. 
    Any help would be appreciated.
    Thanks
    qARS
    Edited by: user7640966 on Nov 24, 2011 9:07 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Hussein,
    One thing which I noticed now is in the apps Tier the
    tnsnames.ora under $TNS_ADMIN
    shows entry like this:
    PROD=
            (DESCRIPTION=
                    (ADDRESS=(PROTOCOL=tcp)(HOST=<appsServerName>)(PORT=1521))
                    (ADDRESS=(PROTOCOL=tcp)(HOST=<dbServer>)(PORT=1521))
                (CONNECT_DATA=
                    (SID=PROD)
            )Actually *(ADDRESS=(PROTOCOL=tcp)(HOST=<appsIPaddress>)(PORT=1521))* this line in the tnsnames.ora is not correct. In fact the appsServerName should be replaced with dbServerName
    I deleted the tnsnames.ora and reran autoconfig but it is again recreating the same entry.
    Any clue how this can be fixed?
    Thanks
    qARS

  • Problem with having several database connection registered in JDEVElOPER

    Hi
    Thank you for reading my post
    I have several AS registered in my Jdeveloper environemtn and several database connections.
    unfortunately some times Jdeveloper can not deploy an application into a server beacause it say that "I failed to create the connection pool", the project has no database stuff at all but Jdeveloper try to register and create connection pools for those connection that i hace registered in the Databse coonnection node.
    It fails because in that particular server which i want to deploy the application i have not add all databases JDBC driver.
    is there any solution for it?
    thanks

    Hi,
    see Tools --> Preferences --> Deployment
    Uncheck the "Bundle default data-sources.xml during deployment
    Frank

  • Creating new Data Source Error - Database connection Failed

    Successfully installed and configured 11.1.1.3.0. Planning and Essbase dev.
    Went to Workspace > Administer > Classing Planning Administration > Manage Data Sources > Create Data Source.
    Entered all info about the application database , etc. Getting error "The database connection failed" (I was able to connect with no problem during the install)
    SQL server 2005 is on the same physical server.
    The diagnostic tool shows database connection passed for planning. A new database was created for the new application.
    The server event viewer shows these errors.
    "Login failed for user 'xxx-hyperion'. The user is not associated with a trusted SQL Server connection."
    Group Policy Error "The client-side extension could not apply computer policy settings for 'Default Domain Policy {xxx}' because it failed with error code '0x80070003 The system cannot find the path specified.' See trace file for more details. "
    The Group Policy client-side extension Group Policy Services failed to execute. Please look for any errors reported earlier by that extension.
    Any help is appreciated.

    Datasource for the application.
    I have created a sql db for this planning application (my datasource). See my first message for more details.
    When you create a new planning application, you need to associate it with a data source. Since this is a new install, I don't have any data sources available yet.
    So, "To create, edit or delete data sources, click Manage Data Source."
    This page lets you validate your connection to the database and essbase server. My essbase server connection validates! The database connection does not validate after I enter all the relevant information.
    SCREEN INFO BELOW
    Fields displayed with an asterisk (*) are mandatory.
    Data Source Name *:
    Data Source Description:
    Select Database Platform
    Microsoft SQL Server
    Application Database
    Server * :
    Port * :
    Database *:
    User *:
    Password *:
    Click "Validate Database Connection"
    ERROR ---> Database connection failed.
    So it does not let me create a data source for my new planning application, so I cannot create a new planning application.
    Thanks in advance.

Maybe you are looking for