I am very much new to oracle database, please forgive me for any technical errors in my question. I am using oracle 19c and I think my password for "system" user is different than the password for "sysdba". At the time of installation I used the same password every time but now while connecting to system or "\ as sysdba" , there is no problem connecting but when I type the password for "orcl_listener" or "orcl" or "sysdba" , the password is wrong . for example:
conn sysdba
Enter password:
ERROR:
ORA-01017: invalid username/password; logon denied
when I create a new connection in SQL Developer, I use a username as a system, and the password is correct.
success
when I create a new connection in SQL Developer, I use username as \ as sysdba and password is correct .success
when I create a new connection in SQL Developer, I use username as sysdba and password is correct .not success and error says Status: Failure -Test failed: ORA-01017: invalid username/password; logon denied
.I am such a new user, if possible please provide me basic details of oracle databases in the simplest ways.
Now the second problem is that after creating a new connection in SQL developer using system username as its password is working, I expanded connection and at the bottom, I right-clicked on other users and created a new user with username "hr" and here it says "ORA-65096: invalid common user or role name".when I used c## as prefix no error occurs but I don't want any c##, it means it has to be a local user but where is option to create a local user?
please help me.
To understand common users and local users you have first to understand multitenant architecture in Oracle: container database (CDB) and pluggable databases (PDB).
In multitenant architecture you can only create a local user in a PDB.
To create a local user connected with SQL*Plus as user SYS:
Check your current CDB/PDB
show con_name
List existing PDBS
show pdbs
Go to an existing PDB:
alter session set container=mypdb;
Check your current PDB
show con_name
Create a local user in the current PDB and grant some basic privileges:
create user myuser identified by "mypwd" quota unlimited on tablespace myts;
grant create session to myuser;
grant create table to myuser;
To connect directly with SQL*Plus to this PDB you must use the Oracle Net service for this PDB:
sqlplus myuser/mypwd#myhost:myport/mypdb
Related
I am working on a project and I have access to SQL Server as external user with limited privileges.
When I want to create a login for example with this command, I get permission denied:
CREATE LOGIN [login] WITH PASSWORD=N'test', DEFAULT_DATABASE=[master],
DEFAULT_LANGUAGE=[us_english], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF)
However when I try to create a login with this command I can make it and also I have privileges now to enable xp_cmd shell as well:
EXECUTE('EXECUTE(''CREATE LOGIN [test5] WITH PASSWORD=N''''test'''',
DEFAULT_DATABASE=[master], CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF'') AT "hostname\domain"')
EXECUTE('EXECUTE(''ALTER SERVER ROLE [sysadmin] ADD MEMBER [test5]'')
EXECUTE('EXECUTE(''ALTER SERVER ROLE [db_owner] ADD MEMBER [test5]'')
Can someone please explain why is that?
EXECUTE('string sql statement') AT "hostname\domain" == the 'string sql statement' is a pass-through command executed at the linked server "hostname/domain".
Has someone created a loop-back linked server (a linked server that points to the sql instance itself)?
Linked servers have their own security configuration/settings. If the security of the linked server is configured (for any login) to be made under the security context of a privileged login(eg. sa) then exec('') at linkedserver will be executed with way more/elevated permissions (than expected). This is a major security issue/hole.
Check the security of the linked server and change accordingly (and do you really need a loopback linked server?)
I am new to Oracle JDeveloper. I have to create a database on Oracle JDeveloper, but it is showing the error:
Test failed: ORA-28000: the account is locked.
I checked with SQL*Plus, and it is not entering the database account.
How do I fix this?
The HR account is locked and you cannot connect to it until you have unlocked it.
Log in to Oracle (either in JDeveloper, SQL Plus or any other client) as a privileged user (i.e. run SQLPLUS / AS SYSDBA from the command prompt) and run the command:
ALTER USER HR ACCOUNT UNLOCK;
I tried to find answer to this question but I didn't find any.
I just installed Oracle 11g XE2 on Windows 8.1 PC.
then, I could login to Application express at http://127.0.0.1:8080/apex/apex_admin with username: ADMIN and password given at time of installation.
But when I try to use same username/password to login to SQL command line through start menu (from same local computer) it gives me
ORA-01017: invalid username/password; logon denied
Failed attempts
So, I created a new workspace. while creating workspace it let me create new schema and administrator user for schema.
Then, I again tried to login to SQL command line using following command and new user credentials but still can't login.
CONNECT username/password
I tried to create new user form Application express home->workspace Task->create user with Account privileges as
Workspace INTERNAL
Default Schema APEX_040000
User is an administrator: No
User is a developer: Yes
Application Builder Access Yes
SQL Workshop Access Yes
Team Development Access Yes
Account Availability Unlocked
but I still can't login to sql command line with new user and same command
CONNECT username/password
this is the first time I am trying to install a database. Please help me.
Thanks.
My postgreSQL configuration is a bit messed up, and I currently need to login to a database using the command psql -U myUsername myDbName. I only have one database that I created with that username, so I always login to that database. Is there a way that I can create a new database while within another database?
I tried the command CREATE DATABASE dbname; while within the database but that didn't work.
As stated in the comments above, the error ERROR: permission denied to create database indicates that the "Not every user has authorization to create new databases. If PostgreSQL refuses to create databases for you then the site administrator needs to grant you permission to create databases. Consult your site administrator if this occurs. If you installed PostgreSQL yourself then you should log in for the purposes of this tutorial under the user account that you started the server as." - pgDocs
Thus, in order to access the postgres admin I had to change my pg_hba.conf
from:
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
to:
host all all 127.0.0.1/32 trust
host all all ::1/128 trust
and then run the following in the command prompt:
psql -U postgres
Grant "myUsername" user permissions to create databases i.e:
ALTER ROLE myUsername CREATEROLE CREATEDB;
source: http://www.postgresql.org/docs/current/static/sql-alterrole.html
I am trying to query a database table in postgresql, but every time I run the below query it gives me the INSUFFICIENT PRIVILEGE error. What possibly could be the reason for such permission denied error. Also, I am using pgadmin tool in windows to connect the database which is in Linux environment. Below is the query I am running
> > SELECT appid,hash
> FROM app
> WHERE appid=1;
While running the same query I am getting the below Error
ERROR: permission denied for relation app
********** Error **********
ERROR: permission denied for relation app
SQL state: 42501
The user running the query will need permissions to that table. You can grant them to that user with the GRANT statement. The below is an example that grants to PUBLIC
GRANT SELECT ON tablename TO PUBLIC;
Also I have seen SELinux cause isses and places such as here mention it. I am not exactly sure of the command to turn SELinux off but you can see if it is running by using
selinuxenabled && echo enabled || echo disabled
It simply means that you have no permission to access app table. Request your root or database administrator to grant you the permission to access app table. if your are the root or have granting privilege you can use grant command to grant your self permission to use all sql statements on table or database
For Example:
grant all privileges on database money to cashier;
before that you have to login as root or user that have granting privileges
for more details on this command refer to
http://www.postgresql.org/docs/8.1/static/sql-grant.html
If it's DB2 then go to command console of DB2, select your respective Database and select Authorities option by right click on the Database then add your respective DB2 user and grant required access.
You need to make sure that the user with which you are connecting with also has the "USAGE" access on the schema you are trying to access with the user. I have recently faced an error where I got the dump restored into a database and then had some users to whom I was only supposed to provide the read-only access. I have followed the following steps -
CREATE ROLE myapp_readonly;
GRANT CONNECT ON DATABASE {database} TO myapp_readonly;
GRANT USAGE ON SCHEMA {schema} TO myapp_readonly;
GRANT SELECT ON TABLE {schema}.{table_name} TO myapp_readonly;
GRANT myapp_readonly TO {usre};
After performing these steps when I tried to access the table, had received the following error -
SQL Error [42501]: ERROR: permission denied for schema {schema}
In my case, my users were available already and the schemas and the database were restored recently. After I have provided the "USAGE" access to the schema to the user the error was resolved.