Trouble connecting to Oracle database with sqlplus and OS authentication - oracle

I am a read-only user to an oracle database, and the DBA gave me two accounts, one with a specific user name and password, and another with OS authentication. The OS authentication is supposed to let me connect by authenticating with my active directory user account that I use to login to my laptop, where I am then running sqlplus.
I can connect and start querying just fine with this command, which shows it is picking up my tnsnames file:
sqlplus username/password#database
However, the version to connect with OS authentication doesn't work:
sqlplus /#database
ERROR: ORA-01017: invalid username/password; logon denied
Am I doing something obviously wrong? I checked in powershell that my user and domain name are the user and domain name that was set up for OS authentication for this database.
I did another test, this time using powershell to do the connection and again with my AD login that should work:
Add-Type -Path "C:\Windows\Microsoft.NET\Oracle.ManagedDataAccess\Oracle.ManagedDataAccess.dll"
#This connection string works for the normal authenticated account
$connectionString = "User Id=$username;Password=$password;Data Source=$datasource"
#But this one gives me ORA-01017 invalid username/password
$connectionString = "User Id=/;Data Source=$datasource"
$connection = New-Object Oracle.ManagedDataAccess.Client.OracleConnection($connectionString)
$connection.open()
I also made sure that SQLNET.AUTHENTICATION_SERVICES= (NTS) is in the sqlnet.ora file
Any thoughts?

When you connect from putty or shell you need to login to the sever first using OS authentication. Then you can use sqlplus authentication to connect sqlplus.

Related

Oracle 11g XE - Can't login and database is down

Just installed Oracle 11g XE (Windows), but can't connect in SQL Developer or run any command in CLI.
When try to connect in CLI using SYS or SYSTEM with password defined during the install, get the following error:
ORA-12638: credential retrieval failed
When I tray to connect via SQL Developer (tried via SID and Service Name, hostname=localhost, port=1521, SID=xe), get this error:
Status : Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in
connect descriptor
Already tried change SQLNET.AUTHENTICATION_SERVICES = (NTS) to (NONE) in sqlnet.ora file. When I do this, get the following error when try to connect with the SYS or SYSTEM user and password:
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
Already tried every solution in Google results, like reinstall, stop and start services... Mostly ask for first connect in CLI to make some changes, but even this I can't accomplish.
Any suggestions on how connect to the database?
Found the solution:
I was installing in my company Windows user domain.
First uninstall any instance of Oracle XE 11g.
Switch to a local administrator Windows user and install Oracle XE 11g.
Sign off and back to company Windows user.
Edit the file C:\oraclexe\app\oracle\product\11.2.0\server\network\ADMIN\sqlnet.ora (or equivalent to your installation path). Change SQLNET.AUTHENTICATION_SERVICES = (TNS) to SQLNET.AUTHENTICATION_SERVICES = (NONE).
This change will allow you connect to database from you company Windows user.
As seen here: Error ORA-12638 in Oracle Database 11g
Try the following: Open command window, cd to Oracle bin directory, enter sqlplus /nolog. If you get a prompt enter connect / as sysdba. If you get connected then you can try "startup".
- -
Did you try to start the Oracle RDBMS service via Services (services.msc)?
Do you use an spfile? Check the registry for ORA_SID_NAME_PFILE that is different from default location of $ORACLE_HOME/dbs. Also check the default location. Use only the default location or the registry entry removing either the registry entry or the file in the default location depending on which you want to use.

ORA-28040: No matching authentication protocol exception with orcale19c

I am facing this issue in oracle19c.
I have added the following to sqlnet.ora
SQLNET.ALLOWED_LOGON_VERSION_CLIENT = 8
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
as well as
SQLNET.AUTHENTICATION_SERVICES = (NONE)
But I am getting:
ORA-01017: invalid username/password: logon denied
I read all over stackoverflow to re-create the password.
I have even tried creating password file as well as changing the password of the user by alter command.
Can any one help me out with the exact steps to re-create password.
You can create a password file using orapwd utility.
Users are added to the password file when they are granted the SYSDBA, SYSOPER, SYSASM, SYSKM, SYSDG or SYSBACKUP privilege.
By default, SYS is the only user that has SYSDBA and SYSOPER privileges. Creating a password file via orapwd enables the remote users to connect with admin privileges.
The basic command to create the password file is
orapwd file=<Password file name> entries=<nnumber of entries allowed> force=<y/n>
There should be no space around =.
Here, You should use force=y to permits overwriting an existing password file.
Cheers!!

How to reset username and password for oracle

I am using
Run SQL Command Line
to connect with database, previously I am able to connect with username 'system' and password 'root' but when I tried to connect using SQL>connect system/root
it is showing error
ERROR:
ORA-01017: invalid username/password; logon denied
All services are running, after long time I am trying to connect may be I forgot my credentials can anyone help me how to change or reset both username and password I am on windows platform,
I too reset my password few days back.
You can reset your password by this
ALTER USER username IDENTIFIED BY password
Connect to db first
SQL> conn /as sysdba
More information Docs

Default username and password for SQL*Plus in Ubuntu 14.04?

I followed the instructions mentioned to install SQL*Plus from Oracle Instant Client and How to Install SQLPlus.
SQL*Plus is successfully installed on my system but I cannot login and use it. There is a similar question here and here, but it is does not solve my problem.
On googling, most sources said that we enter a password upon installation, but I was neither prompted nor displayed any password. (I can attach terminal screen shots if it is required)
Is there any way I can login and start using SQL*Plus? Is there any default username or password?
I am stuck here: sqlplus username/password#//dbhost:1521/SID
I need a valid username and password. scott/tiger was of no help.
sqlplus / as sysdba gives this -> ERROR: ORA-12162: TNS:net service name is incorrectly specified and prompts me to enter username and password which I don't have.
I originally asked this question on AskUbuntu feeling its more appropriate there. If this question does not belong here, please comment and I will remove it.
EDIT:
I executed these statements after reading from here:
ORACLE_HOME=/u01/oracle; export ORACLE_HOME
ORACLE_SID=asdb; export ORACLE_SID
Now, On executing sqlplus / as sysdba I get the error message
ERROR: ORA-12545: Connect failed because target host or object does not exist
On executing sqlplus64 scott/tiger#//dbhost:1521/SID I get the error message
ERROR: ORA-12154: TNS:could not resolve the connect identifier specified
It does not have anything to do with Ubuntu. When you enter sqlplus / as sysdba sqlplus tries to connect to the local database, which sid and oracle home should be specified by the environment variables ORACLE_SID and ORACLE_HOME. You, obviously, have not defined these variables.
All you need is to get the username, password, host name, where your database is located, port for the listener (the default port is 1521) and the Oracle SID. Then connect with sqlplus username/password#//dbhost:1521/SID. If you know the password for SYS user and have orapwSID file in the $ORACLE_HOME/dbs directory on the server side, you can connect with sys with the following command: sqlplus sys/password#//dbhost:1521/SID as sysdba.
moving everything into instant_client_11_* directory worked for me.

How to reset/change expired password for DB2 Content Manager 8.4.1

I had installed IBM DB2 Content Manager 8.4.1 months ago and now I wanted to access it to continue some more work.
But when I try to log in using System Administration Client, it tells me the password is expired. The error is:
DGL0394A: Error in ::DriverManager.getConnection;[jcc][t4][2012][11248][3.50.152]
Connection authorization failure occurred. Reason: Password expired.
ERRORCODE=-4214,SQLSTATE=28000 (STATE) : ;
[SERVER = icmnsldb, USERID = icmadmin, SQL RC = -4214, SQL STATE = 28000]
I've tried looking thru the config files, using the java update command line.. and I can't find a way to change or reset the password. I can't use System Administration Client to change the passwords, since it won't log me in to begin with. Any other method I can use to reset/change the password for a DB2 CM user?
DB2 uses the operating system to authenticate users, so you need to use the OS tools to reset the icmadmin user's password. Your post is tagged as Windows, so look for the icmadmin user in either the local machine or in the domain if your server belongs to a domain.
Just use the Client for Windows on a desktop machine and not the eClient to login. It will directly notify about a expired password and you can set the new password immediately.
I faced the same issue. I logged in as root and chaged the password for db2 user by passwd . and changed in the WAS console. It worked.
In Windows, click on start > Control Panel > User Accounts > User Accounts > Manage User Accounts.
Here, select the DB2 username and click on Reset Password.
If you are on Docker, you need to perform a docker exec into the DB2 container (Linux) and then change the password for the local user that you are trying to log in to DB2 with. In my case, the name of the user was "myuser". I changed the password by executing
passwd myuser
Note that you are root by default when you exec into the container. Else use
docker exec -u root <containerName> /bin/sh

Resources