I am trying to create a user using DDL in DB2. I tried this:
CREATE USER 'test_user' IDENTIFIED BY 'password';
and I got this error message:
An unexpected token "'test_user'
IDENTIFIED BY 'password'" was found following "CREATE USER ". Expected tokens may include: "<space>".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.24.92
when I remove the apostrophes:
CREATE USER test_user IDENTIFIED BY password
I get this:
An unexpected token "USER" was found following "CREATE ". Expected tokens may include: "VARIABLE".. SQLCODE=-104, SQLSTATE=42601, DRIVER=4.24.92
I have full admin rights and I am running DB2 Warehouse on Cloud Type:Enterprise Plan - Single Node
When you take a look at SQL statements supported by Db2 Warehouse on Cloud, you will notice that there is no CREATE USER statement. Hence the error message.
Check out the section on user management or see the API to create a new user.
Related
A user is unable to create a native stored procedure via IBM data studio and faces -567 rebind authorization error for a particular auth id say DBAXXYY.The schema name is also same as the authid
But I am able to create the stored procedure successfully without any issues using the same authid.
Could any of you kindly help in determining what privilege does the other user lack and what privilege I have different to him? Also, provide the syntax for any grant privilege that will be needed to create the stored procedure from his end using the same authid DBAXXYY.
I tried providing GRANT BINDADD TO DBAXXYY to that authid but still it didn't work.
Error :
Create stored procedure returns SQLCODE: -567, SQLSTATE:42591.
DBAXXYY.SP_SAMP: 0: REBIND AUTHORIZATION ERROR USING
DBAXXYY AUTHORITY PACKAGE =
LOCATION.DBAXXYY.SP_SAMP.(V1) PRIVILEGE = CREATE IN.
SQLCODE=-567, SQLSTATE=42501,
DRIVER=4.18.60
DBAXXYY.SP_SAMP - Deploy failed.
DBAXXYY.SP_SAMP - Roll back completed successfully.
The exception states that the user account lacks the CREATEIN privilege on the target schema. There may be other missing privileges, but you will be able to resolve these either by carefully studing the details of each exception, or by comparing your priviliges with those of the other user. Do that by querying the relvant catalog tables.
For the immediate problem, try:
GRANT CREATEIN ON SCHEMA ... TO ...
(where the first name is the schema name , and the second name is the other user name).
If , on the other hand, your security configuration uses ROLES then you need to grant that privilege to a role which the other user has.
Documentation link, adjust for your version of Db2 and platform.
At last I was able to provide the required privilege to the user and he is now able to create the native stored procedure.
I gave the following grant on the collection DBAXXYY to the auth id DBAXXYY and this solved the problem.
GRANT CREATE IN COLLECTION DBAXXYY TO DBAXXYY; COMMIT;
I am trying to create a link between two schemas in SQL Developer and I have an error. The querie I am executing is:
CREATE DATABASE LINK dblink
CONNECT TO Matecode IDENTIFIED BY Matecode
USING 'Matecode';
Where Matecode it's the remote user, password and database Schema I want to be conected. Like this:
CREATE DATABASE LINK dblink
CONNECT TO remote_user IDENTIFIED BY password
USING 'remote_database';
But I am receiving this error
00000 - "insufficient privileges"
*Cause: An attempt was made to perform a database operation without
the necessary privileges.
*Action: Ask your database administrator or designated security
administrator to grant you the necessary privileges
The password and the user are ok.
Check you have "create database link" privilege to the schema where you are creating the Database link. if the privilege is not granted use below statement as 'sysdba' user to grant the "create database link" and then try to create the database link.
SQL:
grant CREATE DATABASE LINK to username;
I am a new user in SQL Developer Oracle 12c database and when I try to create a new user:
CREATE USER usera IDENTIFIED BY mypsassword
I get this error:
error starting at line 2 in command:
CREATE USER usera IDENTIFIED BY mypsassword
Error at Command Line:2 Column:13
Error report:
SQL Error: ORA-65096: invalid common user or role name
What can I do?
Thanks for your help guys
Without specific knowledge of Oracle it seems to me that Oracle is nudging you to use less generic usernames. Try replacing usera with something else for example pluto.
What is the correct syntax or what are the correct steps for creating a schema in DB2 using JDBC?
When running create schema test1 or create schema test1 authorization db2admin as db2admin, I consistently get DB2 SQL Error: SQLCODE=-552, SQLSTATE=42502, SQLERRMC=DB2ADMIN;CREATE SCHEMA, DRIVER=3.64.106
The exact same command works fine using the DB2 command-line tools.
I found it.
It turns out that for some reason DB2 Express-C does not grant the DBADM privilege to db2admin by default.
This can be fixed by connecting to the DB and then issuing
GRANT DBADM ON DATABASE to db2admin
Thanks Ian Bjorhovde for providing the inspiration spark!
Looks like it is not a matter of Syntax but authentication, you have to check the credentials that you are passing through JDBC:
-552 authorization-id DOES NOT HAVE THE PRIVILEGE TO PERFORM OPERATION operation
http://publib.boulder.ibm.com/infocenter/dzichelp/v2r2/index.jsp?topic=%2Fcom.ibm.db2z9.doc.codes%2Fsrc%2Ftpc%2Fn552.htm
I have created a user but when I try to view a database tables, I'm having the following error messages:
Please note that I am able to login but not having access to the database.
Failed to retrieve data for this request.
(Microsoft.SqlServer.Management.Sdk.Sfc)
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or
batch. (Microsoft.SqlServer.ConnectionInfo)
The SELECT permission was denied on the object 'extended_properties',
database 'mssqlsystemresource', schema
'sys'. (Microsoft SQL Server, Error: 229)
Did you map the login to the user?
EXEC SP_Change_Users_Login 'Update_One','user','login',Null
In the Secutity -> Logins -> userName, check the database is selected in the list or not.
In the Database -> Security -> UserName check the role member has sufficient priviliges.
Check out this one
Another marked an answer
More Links