oracle database 19c ora-01017 invalid username/password - oracle-sqldeveloper

I create user with
CREATE USER "C##XXXXX" IDENTIFIED BY "PasWordorSomthingLikeThat"
DEFAULT TABLESPACE "XXX_TABLE_SPACE"
TEMPORARY TABLESPACE "XXX_TABLE_SPACE_TEMP";
but from oracleSqlDeveloper I can't login into my user And find ORA-01017 Invalid Username/Password when connecting to 11g database from 9i client but he said to change security!
is that oracle set this option for the access database useless? what can i do to login my oracle database without change security parameters?
error:
ora-01017 invalid username/password

The parameter mentioned in your link is not valid for 19c. Try not using quotation marks in your create user command:
CREATE USER C##XXXXX IDENTIFIED BY PasWordorSomthingLikeThat
DEFAULT TABLESPACE XXX_TABLE_SPACE
TEMPORARY TABLESPACE XXX_TABLE_SPACE_TEMP;
And double-check your connect string to make sure you're connecting to the right CDB or PDB for the account.

Related

Google cloud postgresql - can’t \connect to database as postgresql user

postgres user cannot connect to a database created by postgres user.
postgres=> CREATE DATABASE mydb ENCODING 'UTF8' ;
CREATE DATABASE
postgres=> \connect "mydb";
FATAL: Peer authentication failed for user "postgres"
Previous connection kept
Is this related to google cloud version of postgresql ?
When you create a new Cloud SQL for PostgreSQL instance, you must set a password for the default user account ‘postgres’ [1]. “Peer authentication is only available for local connections” [2]. The authentication method field ‘auth-method’ in pg_hba.conf file should be using ‘md5’ instead of ‘peer’ [2] as a password is set for the default user account. A similar error is answered here [3].
https://cloud.google.com/sql/docs/postgres/create-manage-users#user-root
https://www.postgresql.org/docs/current/static/auth-pg-hba-conf.html
Getting error: Peer authentication failed for user "postgres", when trying to get pgsql working with rails

Connecting sqlite database to firebird

Below command used for connecting database through Firebird SQL.
CONNECT "C:\Users\vkaja\Desktop\testing_mysql\newdb.db"
In newdb.db file Schema, data are dumped from SQLite.
Here newdb.db has read-write permission. But error projected here is not a valid username and password.
Statement failed, SQLCODE = -902
Firebird doesn't care about the extension of the database file. fdb is 'standard', and gdb is historical, but it could be anything. However the database you are connecting to must be a Firebird database. You can't just open a database file from a different database system (eg SQLite).
Your problem is one of authentication: you are trying to authenticate without a username + password combination, and if you haven't set the appropriate environment variables, it means Firebird tries to authenticate with an empty user and password, which doesn't exist for your Firebird install. In general you also get this error if you use a username and password that is not known to Firebird.
But even if you fix the authentication problem, you would immediately get a different error: invalid database (or similar), because the file is not a Firebird database.

No privilege for this operation

Extracted code from documentation,
create table sales_catalog(
item_id varchar(10) not null primary key,
item_name_desc varchar(50) not null,
item_desc varchar(50));
Error after using SYSDBA as the user in Firebird SQL3.
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
CREATE TABLE SALES_CATALOG failed
There is no privilege for this operation.
I did some experimenting, and the problem seems to be that if you connect to a database using ISQL without specifying a host name, it will use Firebird embedded to connect to the database (previous versions of Firebird didn't do that on Windows).
Firebird embedded does not require a username and password as it assumes that if you have direct read/write access to the database, that you are allowed to connect to it.
When you connect without specifying a username and password (eg using connect 'database.fdb' instead of connect 'database.fdb' user sysdba, Firebird embedded will use your OS username to connect.
This can be checked because ISQL reports the username when connecting:
SQL> connect 'd:\data\db\fb3\dbofnormal.fdb';
Database: 'd:\data\db\fb3\dbofnormal.fdb', User: MARK
Firebird 3 added new metadata privileges, for example creating a table in a database now requires that you are either the owner of the database (the username used in the create database statement), sysdba (or another admin user), or that you have the create table privilege. See also User Privileges for Metadata Changes. In earlier version any user would be allowed to create tables once they had access to the database.
Now on to the problem: the user (in my example MARK), does not have the create table privilege, so attempting to do so will fail:
SQL> create table testmark ( id integer generated by default as identity primary key);
Statement failed, SQLSTATE = 42000
unsuccessful metadata update
-CREATE TABLE TESTMARK failed
-There is no privilege for this operation
There are a few ways to solve this:
Specify a user with sufficient privileges in the connect statement (eg sysdba):
connect 'database.fdb' user sysdba;
Include the host name in the connect statement to connect through Firebird server instead of Firebird embedded, so that you are required to specify user name and password:
connect 'localhost:database.fdb' user sysdba password 'masterkey';
Connect once to your database as sysdba (see first item), and give the necessary privileges to the user (in my case mark):
grant create table to user mark;
From this moment forward this user can create tables (you may need to grant additional privileges, eg create view, create procedure, etc).

IMP-00058: ORACLE error 1017 encountered

I am using Oracle 11g client 32bit on all my servers and i have proceeded with all the dump imports the very same way I am doing here.
Firstly I create the user with default tablespace
Secondly I alter the user quota unlimited on tablespace
Thirdly I grant connect resource dba to the user.
Then I exit from Oracle and this is my import command
C:\Users\romit.poladiya>imp fajbdummy/fa#dmate file='E:\dump\fajblatest.dmp' full=Y;
I have always been doing this and I do not know why I have not been able to import this time. Please assist. Let me know if you require any more information
Thanking the team in advance,
Romit
ORA-01017: invalid username/password; logon denied
Cause: An invalid username or password was entered in an attempt to log on to Oracle. The username and password must be the same as was specified in a GRANT CONNECT statement. If the username and password are entered together, the format is: username/password.
Cure: Use the correct username & password. Check the system to make sure that the username exists, and set the password if necessary.
The following issue can be closed as I was able to do the tnsping but unfortunately my oracle went into an Idle Instance while I was connecting. Earlier it was not an issue and I have no idea whatever happened and the the oracle just went into Shutdown

Non-superuser cannot connect if the server does not request a password while using dblink

I want to do some cross database references in my application. Briefly, i have two databases called meta and op. I want to do some select query from meta to a table in op database like below but getting the below error. I tried with password and without password. by the way caixa user is a non-super user and my target server (op db server is having MD5 authentication mode.)
meta=> select * from dblink('dbname=op password=caixa','SELECT op_col from op_table') AS t(op_col varchar);
ERROR: password is required
DETAIL: Non-superuser cannot connect if the server does not request a password.
HINT: Target server's authentication method must be changed.
What the HINT in the above error message suggests? do i need to change the server's auth mode? Without changing the server's auth mode (MD5) can't i run the above query?
From documentation:
Only superusers may use dblink_connect to create
non-password-authenticated connections. If non-superusers need this
capability, use dblink_connect_u instead.
and
dblink_connect_u() is identical to dblink_connect(), except that it
will allow non-superusers to connect using any authentication method.
That means your dblink call is using dblink_connect implicitly. Use dblink_connect_u instead or change your auth method to e.g. md5.
Note that you also need grant execute privilege to caixa role, for example by:
GRANT EXECUTE ON FUNCTION dblink_connect_u(text) TO caixa;
GRANT EXECUTE ON FUNCTION dblink_connect_u(text, text) TO caixa;
Working example (after GRANT):
meta=> SELECT dblink_connect_u('conn1', 'dbname=op');
meta=> SELECT * FROM dblink('conn1','SELECT op_col from op_table')
AS t(op_col varchar);
op_col
--------
aaa
bbb
ccc
(3 rows)
meta=> SELECT dblink_disconnect('conn1');
EDIT:
Sorry for slightly misleading answer. Of course you don't need dblink_connect_u for md5 authenticated
connection. There is one possibility I see. PostgreSQL has two different connection types: host and local.
Running:
psql -h localhost ..
incorporates host connection, but
dblink_connect('mycon','dbname=vchitta_op user=caixa password=caixa');
uses local type, so if you have non-password method for local connection (for example ident method or trust), then it returns
ERROR: password is required
DETAIL: Non-superuser cannot connect if the server does not request a password.
HINT: Target server's authentication method must be changed.
Check
dblink_connect('mycon','hostaddr=127.0.0.1 dbname=vchitta_op user=caixa password=caixa')
for host connection. For clarity if possible please post your pg_hba.conf.
I also checked what about CONNECT privilege on vchitta_op DB, but error message is different:
REVOKE CONNECT ON DATABASE vchitta_op FROM PUBLIC;
REVOKE CONNECT ON DATABASE vchitta_op FROM caixa;
SELECT dblink_connect('mycon','dbname=vchitta_op user=caixa password=caixa');
ERROR: could not establish connection
DETAIL: FATAL: permission denied for database "vchitta_op"
DETAIL: User does not have CONNECT privilege.
There's a workaround that did the trick for me. Non-superusers can execute functions with privileges of a superuser if "SECURITY DEFINER" option is set.
( http://www.postgresql.org/docs/9.1/static/sql-createfunction.html )
That means you can create a function (with superuser owner and SECURITY DEFINER option) that does cross-database manipulation (using dblink() without password) and execute it under non-superuser
I have a similar but a different issue. I have two servers with identical postgres.conf and pg_hba.conf. However one on version 9.2.3 and one on 9.2.4
9.2.3
pg_hba.conf has
local all dblinkuser trust
then I connect to database using any ordinary user
theater_map=# select dblink_connect('dbname=TheaterDB user=dblinkuser password=dbl123');
dblink_connect
----------------
OK
(1 row)
success in connection.
9.2.4
my pg_hba.conf has the same entry as above
theater_map=> select dblink_connect('dbname=TheaterDB user=dblinkuser password=dbl123');
ERROR: password is required
DETAIL: Non-superuser cannot connect if the server does not request a password.
HINT: Target server's authentication method must be changed.
NOW
I change my pg_hba.conf on 9.2.4 as below
local all dblinkuser md5
and restart postgres
theater_map=> select dblink_connect('dbname=TheaterDB user=dblinkuser password=dbl123');
dblink_connect
----------------
OK
(1 row)
I Checked the change log between versions 9.2.3 and 9.2.4 but could not find any details.
note: changing auth method from trust to md5 on 9.2.3 does not make any difference and still works.
I found this question googling for same error message, though I use fdw extension rather than db_link. Following steps helped to fix my problem:
find user has no password and set it on - alter user myuser with password 'mypassword'
find authentication method is trust and set it to md5 - vim /var/lib/postgresql/data_/pg_hba.conf
reload pg_hba.conf - SELECT pg_reload_conf(); from psql (log out and log in to verify password is required)
(optionally try access from remote machine, db browser etc.)
setup foreign server and its user mapping - CREATE USER MAPPING FOR CURRENT_USER SERVER myserver OPTIONS (user 'myuser', password 'mypassword');
PostgreSQL 11.10
SELECT ext.column1 from
dblink('hostaddr=192.192.192.192 dbname=yourDbname user=yourUsername password=yourpass',
'select a."column1" from "Table1" a where a."column2"=2')
as ext(column1 text)