I'm using DB2 Express C v 10.5
I'm trying to create databases with names "BACKUP", "BACKUPTEST", "BACKUP_TEST" and even "TEST_BACKUP".
In all above cases DB2 throws error as below:
SQL1001N "BACKUPTEST" is not a valid database name. SQLSTATE=2E000
I tried with following command, it didn't work.
> db2 create database BACKUP
or
> db2 create database "BACKUP"
This shows an error as:
"SQL1001N "BACKUP_TEST" is not a valid database name. SQLSTATE=2E000"
1 Answer 1
There's no restriction on the specific name, other than it must be 8 characters or less. So BACKUP
works just fine as a database name:
$ db2level
DB21085I This instance or install (instance name, where applicable:
"db2inst1") uses "64" bits and DB2 code release "SQL10055" with level
identifier "0606010E".
Informational tokens are "DB2 v10.5.0.5", "s141128", "IP23633", and Fix Pack
"5".
Product is installed at "/opt/ibm/db2/V10.5.5".
$ db2 "create database backup"
DB20000I The CREATE DATABASE command completed successfully.
-
1Gad, i haven’t seen the 8 character restriction anywhere else. It’s still apparently true in 2025. Backward compatibility with PCDOS or something?Manngo– Manngo2025年03月08日 06:47:47 +00:00Commented Mar 8 at 6:47