SQl Developer gets ORA-01017 - oracle

SQL Plus makes login but SQL Developer doesn´t
I am using:
Oracle Database 18c Express Edition Release 18.0.0.0.0 - Production Version 18.4.0.0.0
SQL*Plus: Release 18.0.0.0.0
SQL Developer 20.2.0.175.1842
Using SQL Plus I can make login
user: system as sysdba
psw: oracle
Using SQL Developer I get ORA-01017
But months ago I made login everyday with SQL Developer.
I am using a Windows 10 with a few other users.
How can I make login with SQL Developer again?

It's not obvious but you are using a different connection type in SQL*Plus compared to SQL Developer.
In SQL*Plus you're doing this:
user: system as sysdba
However, in the SQL Developer connection dialog your tipo de conexion is set to Basico. Open the dropdown and choose Sysdba, and you should be fine.
The reason for this is that SYSTEM is a power-user account, and so needs an elevated connection.

Your connection with sqlplus is utilizing os credentials, and is not even checking the username and password. The fact that you are requesting a connection 'as sysdba' tells oracle to see if the requesting OS user is a member of the os group DBA. If it is, let 'm in.
[oracle#vbol83-01 ~]$ sqlplus fubar/thisiswrong as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jan 24 08:31:50 2022
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
SQL>
In fact, you don't even need a username/password at all for this connection:
[oracle#vbol83-01 ~]$ sqlplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Mon Jan 24 08:34:11 2022
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.3.0.0.0
On the other hand, your SQL Dev connection is going across the network, and requires the credentials that are presented match what is in the oracle password file.
I don't know what your system looked like "months ago", or what you might have been doing differently then.

OK, this is not th best solution, but it could be usefull.
I didn´t resolve how to connect SQl Developer using "system" user, but I have how to use SQL Developer.
First, use SQL Plus to create a new user, for example "system_user_1":
alter session set "_ORACLE_SCRIPT"=true;
create user system_user_1 identified by system_user_1;
GRANT RESOURCE TO system_user_1;
grant create session to system_user_1;
grant unlimited tablespace to system_user_1;
grant sysdba to system_user_1;
Then, add new conection to SQL Developer for "system_user_1" as SYSDBA:
Finally you can use "system_user_1" to create new regular users:
alter session set "_ORACLE_SCRIPT"=true;
create user regular_user_1 identified by regular_user_1;
GRANT RESOURCE TO regular_user_1;
grant create session to regular_user_1;
grant unlimited tablespace to regular_user_1;

Related

Connection to Oracle Autonomous Database using sqlplus without wallet

I'm trying to connect to Oracle Autonomous Database using EZ CONNECT string: user/password#host:port/service_name
I have configured the access from the IP addresses I need to connect and set mTLS as not required:
As a result, I can successfully connect to the database when I use the wallet downloaded from the console.
But if I try to connect to the DB using EZ CONNECT string, I get the following error:
sqlplus -l user/password#tcp://adb.us-sanjose-1.oraclecloud.com:1521/service_name_high.adb.oraclecloud.com
SQL*Plus: Release 19.0.0.0.0 - Production on Wed May 25 00:19:38 2022
Version 19.8.0.0.0
Copyright (c) 1982, 2020, Oracle. All rights reserved.
ERROR:
ORA-12547: TNS:lost contact
SP2-0751: Unable to connect to Oracle. Exiting SQL*Plus
Is it possible to connect to Autonomous Database using EZ CONNECT string? If yes, then what am I doing wrong?
Update 1:
I also tried to use a full connect string
sqlplus -l user/pass#'(description= (retry_count=20)(retry_delay=3)(address=(protocol=tcps)(port=1521)(host=adb.us-sanjose-1.oraclecloud.com))(connect_data=(service_name=xxxxxxx_high.adb.oraclecloud.com))(security=(ssl_server_dn_match=yes)(ssl_server_cert_dn="CN=adb.us-sanjose-1.oraclecloud.com, OU=Oracle ADB SANJOSE, O=Oracle Corporation, L=Redwood City, ST=California, C=US")))'
but then the connection fails with the following error ORA-28759: failure to open file.
I suspect that it's some security settings, but I can clearly see that my IP is enabled and since with the same security settings I can connect with mutual TLS and wallet, I don't understand where the problem might be.
You can configure Autonomous to allow connection without a WALLET:
https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/support-tls-mtls-authentication.html
(Which looks like you done that)
However you still need TCPS and not TCP:
https://docs.oracle.com/en/cloud/paas/autonomous-database/adbsa/connect-jdbc-thin-tls.html - and you need to pass the security part, which cannot be passed today in the short format (see connecting without a wallet).
PS: Autonomous Dedicated (ADB-D) allows connecting with pure TCP.

Oracle 12.2: Reset user password is not working

I have tried to import a database-dump that was created with Oracle 12.1 (12c Release 1) into my Oracle 12.2.
There was some problem due to a false or invalid authentication protocol:
ORA-28040: No matching authentication protocol
I found some posts where people had similar problems and tried to fix it by adding the following two lines to my sqlnet.ora
(the file is located in C:\app\oracle\product\12.2.0\dbhome_1\network\admin):
SQLNET.ALLOWED_LOGON_VERSION = 8
SQLNET.ALLOWED_LOGON_VERSION_SERVER = 8
Since then I can not connect with any of my users anymore. I have deleted the two lines above from sqlnet.ora and now my sqlnet.ora only contains the following two lines, just as before:
SQLNET.AUTHENTICATION_SERVICES = (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)
But I cannot connect with any user now. I thought I just have to reset the passwords for all of my users.
So I have tried to reset the passwords for all Oracle users. Therefore I use the cmd and log in to sqlplus as sysdba:
C:\>sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Mi Nov 20 14:14:44 2019
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Standard Edition Release 12.2.0.1.0 - 64bit Production
SQL> select * from all_users where username='CUSTOMER';
USERNAME USER_ID CREATED COM O INH DEFAULT_COLLATION IMP ALL
--------------------------------------------------------------
CUSTOMER 106 10.07.19 NO N NO USING_NLS_COMP NO NO
SQL> alter user CUSTOMER identified by CUST;
User was changed.
SQL> connect CUSTOMER/CUST
ERROR:
ORA-01017 Invalid Username/Password
The same happens if I try to reset the password in the GUI of SQL Developer. I always get ORA-01017.
With another user it worked again, but only after I tried the following:
alter user CUST2 identified by "cust2";
So I had to put the password in double quotes and in the properties of the connection in SQL Developer I used the password cust2 without quotes for the user CUST2. Somehow that worked, but I have tried the following options for the password for the user CUSTOMER: CUST, "CUST", cust, "cust". I have also tried different passwords like TEST, test, "Test", custom, "custom", etc.
But nothing works, I can not connect with the user CUSTOMER anymore.
The SID of my Oracle instance is orcl, and I have also tried the following:
SQL> connect CUSTOMER#orcl/CUST
ERROR:
ORA-12514 –
TNS:listener does not currently know of service requested in connect descriptor
Does someone know how to fix this?

Two Oracle databases on a Windows 2003 server...how to determine which database sqplus / as sysdba connects to?

I've tried setting my login's (which was the login used to install the software long ago) oracle_sid environment to database1, but sqlplus / as sysdba insists on connected to database2. What am I missing?

ORA-01017 Invalid Username/Password whenever creating a new user or connection in Oracle SQL Developer 4.1

Although I have some experience with SQL, my familiarity with it has waned, and I understand this is likely a very basic issue, but I'm having no luck finding any solutions. I'm trying to set up a new connection, but all of my attempts are being blocked. I have 3 connections- one entitled COMPANY, another "System", and a generic test one (they're all blank). The original and main connection was System, and that's where the other connections were created. No matter what I've tried at this point though, I get the same error message: "Status : Failure -Test failed: ORA-01017: invalid username/password; logon denied"
My attempts follow the pattern of entering this into the System worksheet:
CREATE USER user_name
IDENTIFIED BY password;
CREATE SCHEMA user_name
IDENTIFIED BY password;
GRANT all privileges to username;
And entering the desired password and such in the new connection window. No matter what, I get the same error, even when I change the password and username. What might I be doing wrong?
If I understand your question correctly, your Oracle SQL Developer has 3 connections defined and they are blank. Hence you are not able to connect to any of it.
In this case, there are only 2 ways I think of
Find someone who has the password for the connections.
Either you or your DBA should connect to Oracle as SYSDBA and reset the password
alter user your_user identified by new_password;
Example
C:\Users\Utsav>sqlplus /nolog
SQL*Plus: Release 12.1.0.1.0 Production on Sun Jun 11 14:29:52 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
SQL> connect as sysdba
Enter user-name: sys
Enter password:
Connected.
SQL> alter user devdb identified by *****;
User altered.

Connecting SQL developer to Oracle 12c

I am a little new at setting up this Oracle Stuff so hopefully you bear with me.
I installed Oracle on my personal laptop and have verified running from the command prompt that it works fine. I connected using SYS as the user id and I was able to login fine
I installed SQL developer as well
How do I setup a connection from SQL developer to Oracle? I did read the manual. What are the parameters that need to be given for the connection, the user name and the password in case I need to connect to the HR database?
Run SQLPlus, connect as SYS user (use administrator's password you have entered during installation) and unlock HR user and give him a new password:
C:\>sqlplus sys as sysdba
SQL*Plus: Release 12.1.0.2.0 Production on Mon Oct 19 18:10:51 2015
Copyright (c) 1982, 2014, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
SQL> alter user hr identified by new_password;
User altered.
SQL> alter user hr account unlock;
User altered.
If you are using Windows, then run firewall configuration and allow connections to TCP/IP port 1521.
Run SQL Developer and click big green "+" icon in "Connections" panel.
You will see a dialog box like below:
Fill in fields in this form like in the above picture.
SID is your database name you have entered during instalation (default is ORACL).
Click "Test" button to verify if everything is OK, if yes, then click "Save" button to remember connection's configuration, and then click "Connect".
My pluggable database had to be force closed first and then I was able connect successfully.

Resources