Special character (!, exclamation mark) in DB2 user password gives error when starting i2 Analyze or connecting from DB2 command console - passwords

The following error occurs when starting i2 Analyze with example deployment
(some parts of error messages are in Finnish because of the Windows localization settings, sorry about that)
setup -t startLiberty
java.sql.SQLInvalidAuthorizationSpecException: [jcc][t4][2013][11249][4.17.29] On ilmennyt yhteyden käyttöoikeusvirhe. Syy: Käyttäjätunnus tai tunnussana ei kelpaa. ERRORCODE=-4214, SQLSTATE=28000 DSRA0010E: SQL State = 28000, Error Code = -4 214
I believe the error is more closely related to DB2(10.5 FP7) & Windows(W12R2) than i2 Analyze itself because when connecting from DB2 command console (db2cmd) and giving both username and password (with !) within a single line:
connect to WRITESTORE user db2admin using <SomePasswordWith!>
The error shown in console is as follows:
SQL0104N Järjestelmä on löytänyt merkkijonoa "<tunnus>" seuraavan
tunnistamattoman sanakkeen "!". Odotettuja sanakkeita ovat esimerkiksi
seuraavat: "NEW". SQLSTATE=42601
Anyhow, if password (with character !) is given only when prompted eg:
connect to WRITESTORE user db2admin
and giving password when asked, user is logged in without an error.
Also when connecting to DB2 with IBM DataStudio gives no error.
So, using passwords without special characters is a workaround for the issue.

http://www-01.ibm.com/support/docview.wss?uid=swg21303153
Username/password with special characters need to be quoted when using them through CLP within db2prompt
Lainausmerkkeihin :)
connect to WRITESTORE user db2admin using '<SomePasswordWith!>'

Related

How do I fix postgres'> when I try to create a new role in my aws rds

when I try to run the command create role new_user with passowed 'passowrd' login; it just gives me postgres'> on a new line. I am logged in as a superuser in aws postgres rds. what does this mean and how do I fix this?
That means that your typing on the command line is as sloppy as your typing in Stackoverflow, and you didn't close the single quotes properly. Now psql is waiting for you to continue the string input.
Reset the query buffer by hitting Ctrl+C and start again, taking care that you balance the quotes.
Perhaps the password contains a single quote, which you would have to escape by doubling it.
Let me remark that setting a password like this is unsafe: the password is visible on your screen, will end up in your history file, is sent over the line in clear text and may end up in the PostgreSQL log. Use \password to set the password, then you also don't have to worry about escaping single quotes.

Hana Sap B1: Execute query using hdbuserstore - * 10: invalid username or password SQLSTATE: 28000

Actually I'm working in Hana DB and Suse Enterprise Server, my objective is use the Scripting and Cronjob to automatize some tasks.
Using hdbuserstore located in /usr/sap/hdbclient I've created and profile for create a HANA command line secure connection, check this link.
My profile works perfect, I did:
Create a user backup into HanaDB, using
*create user backup password Aa12345678*
Then, I've added BACKUPS PRIVILEGES to it:
*grant BACKUP ADMIN to backup*
Later, I've used ./hdbuserstore to create a profile to use via command line:
./hdbuserstore SET back5prf localhost:30015 backup Aa12345678
Then list the profile: ./hdbuserstore LIST
DATA FILE : /root/.hdb/hanab1/SSFS_HDB.DAT
KEY BACK2PRF
ENV : NDB#hanab1:30015
USER: backups
KEY BACK3PRF
ENV : hanab1:30015
USER: backups
KEY BACK5PRF
ENV : localhost:30015
USER: backup
KEY BACKUPSTORE
ENV : localhost:30015
USER: backups
How you guys can see, the profile is ready. Finally when I tried to use the following command:
./hdbsql -U BACK5PRF "SELECT * FROM SCHEMAS"
The system returns the following message:
* 10: invalid username or password SQLSTATE: 28000
Why I'm getting this error event the user and password are ok?
There is other way to execute HANA SQL query without enter into the hdbsql console to automate via Scripting?
This error message can have several causes:
actual wrong user name/password
user account is locked (you need to unlock it in the user management)
user account is a restricted user and not allowed to connect via ODBC/JDBC or from anywhere "outside" SAP HANA
I suggest you make sure that the user works in SAP HANA studio and then setup the cron job.
I had the same issue, the cause was that I used a $ in my password which gets treated as special character in linux (and there more special characters).
So in this case one solution is not to use any character that a treated as special characters or to escape them which in my case resulted the following command for hdbuserstore:
hdbuserstore SET BKADMIN 1xx.x.x.xx:30015 ADMIN_BACKUP password\$12
Check the thread on answer.sap.com.

H2 - Split file option in server mode

Using H2 database, is it possible to use the split file option while in (SSL) server mode and using encryption? If so, how can I do it?
I created a split database using this JDBC string:
jdbc:h2:split:28:/g:/db_split;CIPHER=AES
It is stated that a split database always needs the :split option afterwards, which seems true because I get errors about corrupted files when connecting with
jdbc:h2:ssl://g:/db_split;CIPHER=AES
General error: "java.lang.NumberFormatException: Zero length string" [50000-170] HY000/50000
But when I attach the appropriate option, another error follows:
jdbc:h2:split:ssl://g:/db_split;CIPHER=AES
IO Exception: "java.io.IOException: A sintaxe do nome do arquivo, do nome do diretório ou do rótulo do volume está incorreta"; "ssl://g:/db_split.h2.db" [90031-170] 90031/90031 (Error message localized in Portuguese - something like "The syntax for file name, folder name or volume label is incorrect")
Is there a way to make these options coexist? I am considering AUTO_SERVER, but it would be a lousy option.
For the server mode, use:
jdbc:h2:tcp://localhost/split:28:/g:/db_split;CIPHER=AES
When using SSL:
jdbc:h2:ssl://localhost/split:28:/g:/db_split;CIPHER=AES
For embedded mode, use:
jdbc:h2:split:28:/g:/db_split;CIPHER=AES

Can't Connect To a user whose name contains a space Character

I have a user in Oracle whose name is: Human Resources
in-browser i can connect to it just fine.
However, in SQL command Line, i can't.. there's a problem with the space character
I can connect to system, and other users, I'm quite sure the problem is in the space character.
Additional Details :
Things i've already tried:
"Human Resources"
'Human Resources'
[Human Resources]
Also tried {}, (), **
This worked for me:
SQL> connect
Enter user-name: "Human Resources"#mydb
Enter password:
Connected.

sqlTool.rc contais password in plain text

I want to stop my HSQL DB from command line using command
java -jar hsqldb/lib/sqltool.jar --rcfile=sqltool.rc --sql "shutdown;" localhost-sa-myPassword
This command expects sqlTool.rc file which contains DB related information like user id and password. This RC file contains password in plain text.
Is there any way to hide that password in RC file?
Or is there any way to encrypt this RC file and use it?
Or is it possible to forcibly stop the server without giving id/pwd?
Any other approach is also welcome as long as password is not visible in plain text
Thanks in advance
I got alternative approach for this.
Connection c = DriverManager.getConnection(
"jdbc:hsqldb:file:/opt/db/testdb;shutdown=true", "SA", "");
create the connection as mentioned above.
Then execute sql query as given below
stmt.execute("shutdown");
This will shutdown the HSQL DB