Installed DB2 Express C v10.5 and also v11.1 on Windows 10 PC.
Database backup is successful but Restore ends with error with both versions.
I also tried the same using Data Studio 4.1.2, but here also backup is successful but restore command is stuck.
Backup and restore script from Data Studio-
CONNECT TO SAMPLEDB;
QUIESCE DATABASE IMMEDIATE FORCE CONNECTIONS;
CONNECT RESET;
DEACTIVATE DATABASE SAMPLEDB;
BACKUP DATABASE SAMPLEDB TO "E:\Database" COMPRESS EXCLUDE LOGS WITHOUT PROMPTING;
CONNECT TO SAMPLEDB ;
UNQUIESCE DATABASE;
CONNECT RESET;
RESTORE DATABASE SAMPLEDB FROM "E:\Database" TAKEN AT 20161020191200 INTO NEWDB WITHOUT PROMPTING;
This works fine on Windows 7 and 8.
Is this problem specific to Db2 Express C on Windows 10?
Can anyone suggest solution and/or where to read about the compatibilty status.
Added-
Restore from Data studio does not give any error, but is just stuck.
Result of backup and restore script-
db2 => CONNECT TO CBL2010 USER db2admin USING *******
Database Connection Information
Database server = DB2/NT 10.5.5
SQL authorization ID = DB2ADMIN
Local database alias = CBL2010
db2 => QUIESCE DATABASE IMMEDIATE
DB20000I The QUIESCE DATABASE command completed successfully.
db2 => CONNECT RESET
DB20000I The SQL command completed successfully.
db2 => BACKUP DB CBL2010 USER db2admin USING ******* to E:\Backup COMPRESS WITHOUT PROMPTING
Backup successful. The timestamp for this backup image is : 20161024162942
db2 => CONNECT TO CBL2010 USER db2admin USING *******
Database Connection Information
Database server = DB2/NT 10.5.5
SQL authorization ID = DB2ADMIN
Local database alias = CBL2010
db2 => UNQUIESCE DATABASE
DB20000I The UNQUIESCE DATABASE command completed successfully.
db2 => CONNECT RESET
DB20000I The SQL command completed successfully.
db2 => RESTORE DB CBL2010 USER db2admin USING ******* FROM E:\Backup TAKEN AT 20161024162942 INTO CBLBKUP WITHOUT PROMPTING
SQL1092N The requested command or operation failed because the user ID does
not have the authority to perform the requested command or operation. User
ID: "XAXTRANET". SQLSTATE=00000
Here, I am supplying 'db2admin' as the user, but surprisingly the error is for the logged in user 'XAXTRANET'.
Both logged in and supplied user have PC admin rights.
and as per 'get Dbm Cfg' command, the sysadm group is not set -
SYSADM group name (SYSADM_GROUP) =
SYSCTRL group name (SYSCTRL_GROUP) =
SYSMAINT group name (SYSMAINT_GROUP) =
SYSMON group name (SYSMON_GROUP) =
The authorization ID you are specifying as part of the command (RESTORE ... USER db2admin ...) is used to connect to an existing database. Since you seem to be restoring to a new database (...INTO CBLBKUP...), that database has to be created first, which requires an instance attachment, this is where the ID XAXTRANET is coming from.
Try attaching to the instance explicitly before issuing the RESTORE command:
db2 => ATTACH TO DB2 USER db2admin USING whatever
The above assumes you are using the default instance name DB2 -- change it to your actual instance name if needed.
Related
I'm getting error "no permission for read/select access to DATABASE" when I try to connect to a Firebird database with a user different than SYSDBA, lets say user SOM.
If I create a new database with SYSDBA on the same server, then grant access to the objects there to SOM, it is connecting without problem, but for this particular database - not. I tried to give all rights, including to the system objects to SOM (I'm using the great IBExpert where this is possible), no success.
c:\Program Files\Firebird\Firebird_2_5\bin>isql -user SOM -password secret
Use CONNECT or CREATE DATABASE to specify a database
SQL> connect "c:\data\data.fdb";
Database: "c:\data\data.fdb", User: SOM
SQL> select * from exampletable ;
Statement failed, SQLSTATE = 28000
no permission for read/select access to DATABASE
Command error: select * from exampletable
I was unable to find way to grant anything to object DATABASE.
What could be the reason is that the problematic database was restored via gbak, version 2.5 from Firebird 3 database (downgrade on this way from Firebird 3 to 2.5).
A possible solution is to restore the database with user SOM, but I don't want that the user SOM is the owner of the database. If I do a backup and restore with SYSDBA, the same problem comes back again.
Solution provided in the firebird-support mailing list:
Attach as SYSDBA and run
UPDATE RDB$DATABASE SET RDB$SECURITY_CLASS = NULL
have you tried gbak from 2.5 to BACKUP FB 3 database?
FB 3 running
place gbak from 2.5 to fb 3 folder, as gbak25. Or, do as you wish, but gbak from 2.5 need to use fbclient.dll from 3.0
gbak25 -b -g -v db.fdb db.fbk -user ... -pass ...
then restore this backup on 2.5.
I want to shut down one database in a db2 instance with multiple dbs.
I don't want to deactivate the db as it will reconnect when I try to connect. It should be completely shut down so I get a connection error when trying to connect to the db.
This is not a programming question so it can be viewed as off topic.
There are different techniques, each has advantages/disadvantages.
You can quiesce the database and later unquiesce it.
or you can revoke connect rights, and later grant them, but this depends on how well your role separation is done.
or you force off existing applications and then connect in exclusive mode as the instance owner (provided that your applications NEVER connect with instance-owner credentials).
One trick you could use is to temporarily recatalog the database you want to deactivate under a different name; this will prevent applications from connecting to it using the original name, regardless of the authority they use.
First, determine the database path by looking at its catalog entry:
db2 list db directory
The value of the "Local database directory" property is what you need.
Now you can recatalog the database:
db2 uncatalog db orig_db
db2 catalog db orig_db as foobar on <path>
where <path> is the local database directory determined previously.
Once you force all applications currently connected to the database in question you will be able to deactivate the database:
db2 list applications
db2 "force application (<app id 1>, <app id 2>,...)
db2 deactivate db foobar
Later on you can restore the catalog entry to its original value:
db2 uncatalog db foobar
db2 catalog db orig_db on <path>
I'm trying restore db2 database from backup by this command:
RESTORE DATABASE DEKAT02B FROM "/home/db2inst1/.ibm/db2/desktop/" TAKEN AT 20180104111638 WITHOUT PROMPTING
And I had this error:
`Caused by: com.ibm.tivoli.remoteaccess.RemoteAccessAuthException: CTGRI0000E Could not establish a connection to the target machine with the authorization credentials that were provided.`
Im sure that I enter right credentials.
Thanks.
I installed openerp 7 on ubuntu and worked for a while.
When I restarted ubuntu, I opened openerp and tried to login but didn't find the databases I've created before and it took me to the (Database Management) page in order to create a new database as if it were my first time.
I tried to make a duplicate of an existing database as a workaround, but when I wrote the old database name, I got this message:
ProgrammingError: permission denied to copy database "test"
I tried to access postgres using pgadmin and I succeeded and could access all the databases from the pgadmin.
You need to give the access rights on particular database for particular openerp user.
First Create the OpenERP user that will own and run the application
sudo adduser --system --home=/opt/openerp --group openerp
Then Next,
First change to the postgres user so we have the necessary privileges to configure the database.
sudo su - postgres
Now create a new database user. This is so OpenERP has access rights to connect to PostgreSQL and to create and drop databases. Remember what your choice of password is here; you will need it later on:
createuser --createdb --username postgres --no-createrole --no-superuser --pwprompt openerp
Enter password for new role: ********
Enter it again: ********
Finally exit from the postgres user account:
exit
Here is source link http://www.theopensourcerer.com/2012/12/how-to-install-openerp-7-0-on-ubuntu-12-04-lts/
I am using win Vista, and I am trying to backup some Database under DB2.
I am logged in using the Administrator user, and whenever I try to issue the backup command in the "command line processor", I get the following message:
SQL1092N "ADMINISTRATOR" does not have the authority to perform the requested command. SQLSTATE=00000
BTW, I have created a username/password pair (db2admin) while installing the DB2 server.
So, Will this problem will be get solved if I use the db2admin user? And how to connect to the server (local server BTW) using the db2admin user ?
I had this problem recently and this seemed to do the job:
Attach to your [local] node. (the value of your DB2INSTANCE environ variable, mine was 'DB2'):
attach to DB2 user db2admin using mypassword;
If this isn't enough (it didn't seem to be with me), you can also specify the user and password with backup and restore commands:
restore database mydbname user db2admin using mypassword from C:\BACKUPS taken at 20100823132457;
Or manually create the db2admin user with a password on Windows. But I'm not sure if that's the correct option here.