this is from the first window, i don't know how to find sid, so I use this link
https://asktom.oracle.com/ords/asktom.search?tag=what-is-a-sid-how-to-change-it-how-to-find-out-what-it-is#:~:text=How%20to%20find%20the%20sid,%24thread%22%20will%20do%20that.&text=This%20entry%20describes%20how%20to,instance%2C%20without%20recreating%20the%20database.
[oracle@localhost ~]$ . oraenv
ORACLE_SID = [FREE] ?
The Oracle base remains unchanged with value /opt/oracle
[oracle@localhost ~]$ sqlplus
SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Fri Nov 8 20:11:25 2024
Version 23.5.0.24.07
Copyright (c) 1982, 2024, Oracle. All rights reserved.
Enter user-name: sys as sysdba
Enter password:
Connected to an idle instance.
SQL> startup
ORACLE instance started.
Total System Global Area 1268181352 bytes
Fixed Size 5359976 bytes
Variable Size 553648128 bytes
Database Buffers 704643072 bytes
Redo Buffers 4530176 bytes
Database mounted.
Database opened.
SQL> alter session set container=cdb$root
2 ;
Session altered.
SQL> select instance from v$thread;
INSTANCE
------------------------------
FREE
this is from the second window to connect
[oracle@localhost ~]$ . oraenv
ORACLE_SID = [FREE] ?
The Oracle base has been set to /opt/oracle
[oracle@localhost ~]$ sqlplus sys/oracle@localhost/FREE as sysdba
SQL*Plus: Release 23.0.0.0.0 - for Oracle Cloud and Engineered Systems on Fri Nov 8 20:15:05 2024
Version 23.5.0.24.07
Copyright (c) 1982, 2024, Oracle. All rights reserved.
ERROR:
ORA-01017: invalid credential or not authorized; logon denied
Help: https://docs.oracle.com/error-help/db/ora-01017/
Enter user-name: sys as sysdba
Enter password: oracle
Connected to:
Oracle Database 23ai Free Release 23.0.0.0.0 - Develop, Learn, and Run for Free
Version 23.5.0.24.07
the password is oracle
November 08, 2024 - 5:20 pm UTC
Right, so you're getting the error using password authentication (sqlplus sys/<pwd>@localhost/<root_sid> as sysdba).
The most important thing here - verify you have the correct password!
Assuming this is correct, then MOS note 730067.1 has a big bunch of things you can check. Here's some of the options for verifying password auth is working correctly:
1.Check the value of parameter remote_login_passwordfile. This has to be set to either EXCLUSIVE or SHARED:
SQL> show parameter remote_login_passwordfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
remote_login_passwordfile string EXCLUSIVE
If the parameter is not set correctly then modify it and then restart the database:
SQL> ALTER SYSTEM SET REMOTE_LOGIN_PASSWORDFILE=EXCLUSIVE SCOPE=SPFILE;
2. Check whether the password file with the correct name exists in the right directory/folder and has the right ownership and permissions
On Unix
The password file with the name orapw<ORACLE_SID> must exist in directory $ORACLE_HOME/dbs. If it does not exist then recreate it using the orapwd command
$ > orapwd file=$ORACLE_HOME/dbs/orapw<sid> password= force=y ignorecase=n
The permissions of the file should be the following:
-rw-r----- 1 oracle oinstall 1536 Jul 21 13:50 orapwdv11201