If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Cannot restore DB2 backup - error - SQL2040N

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-03-04, 03:40
Prashant K Prashant K is offline
Registered User
 
Join Date: Jun 2004
Posts: 8
Cannot restore DB2 backup - error - SQL2040N

I am trying to restore a database using option 'Database -> create -> database from backup' option of Control Center. after filling in the fields for database name, backup device, backup file date & time, i am not able to successfully restore the database. the message displayed is 'SQL2040N - database alias paramater <dbalias> not valid'. I gave the same alias name as that of the database of which the backup was taken.

SQL2040N - says database alias parameter not valid
DB2 version - 4.0

where am i going wrong ?

Regds
Prashant
Reply With Quote
  #2 (permalink)  
Old 06-03-04, 04:26
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
What name are you giving ?
Are you sure you are on Version 4 ?
What platform are you on ?

Is the backup taken on the same version of the database ?

Cheers
Sathyaram
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #3 (permalink)  
Old 06-03-04, 09:00
dsusendran dsusendran is offline
Registered User
 
Join Date: Apr 2004
Location: Inside Intel
Posts: 165
Talking

As Sathyaram said, the backup DB2 version should be the same as restore DB2 version (fixpaks doesnt matter) additionally the OS family should also be the same. Like you cannot backup on Windows 2000 and restore on Windows XP (I have tried this and it gave me a Bad Container error).

Why dont you go to the command line and do a

RESTORE DATABASE <database> FROM "<Location>" TAKEN AT <timestamp>;

This worked for me.

By the way what OS are you on?

Newbie
Reply With Quote
  #4 (permalink)  
Old 06-03-04, 10:38
Prashant K Prashant K is offline
Registered User
 
Join Date: Jun 2004
Posts: 8
Cannot restore DB2 backup - error - SQL2040N

[QUOTE=sathyaram_s]What name are you giving ? - i am prompted for 'new database name' where i key-in some new name which does not exist on the server where i am restoring the backup.

Are you sure you are on Version 4 ? yes i am on version 4. the backup is also taken on version 4.

What platform are you on ? i am on Win 2K. The version from where the backup is taken is also win 2K.

Is the backup taken on the same version of the database ? yes.

Regds
Prashant
Reply With Quote
  #5 (permalink)  
Old 06-03-04, 23:58
Prashant K Prashant K is offline
Registered User
 
Join Date: Jun 2004
Posts: 8
[QUOTE=sathyaram_s]What name are you giving ? - i am prompted for 'new database name' where i key-in some new name which does not exist on the server where i am restoring the backup.

Are you sure you are on Version 4 ? yes i am on version 4. the backup is also taken on version 4.

What platform are you on ? i am on Win 2K. The version from where the backup is taken is also win 2K.

Is the backup taken on the same version of the database ? yes.

Regds
Prashant
Reply With Quote
  #6 (permalink)  
Old 06-04-04, 00:08
Marcus_A Marcus_A is online now
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,196
There is no verison 4 of DB2 for Windows. IBM went from verson 2.1 to version 5.1 in order to be in synch (version number wise) with DB2 for OS/390.

Maybe you are on fixpak 4 (version unknown). The current release is version 8.1 fixpack 5.
__________________
M. A. Feldman
IBM Certified DBA on DB2 for Linux, UNIX, and Windows
IBM Certified DBA on DB2 for z/OS and OS/390

Last edited by Marcus_A; 06-04-04 at 01:33.
Reply With Quote
  #7 (permalink)  
Old 06-04-04, 01:44
Tony Winch Tony Winch is offline
Registered User
 
Join Date: Jun 2002
Posts: 7
Version and Command

Prashant,

Maybe using the DB2level command would clear the version your on for us.

Next, from the command centre can you use the show command option to capture the restore command for us to see.

Paste this command into the command centre and run it to double check you get the same error.
Reply With Quote
  #8 (permalink)  
Old 06-04-04, 02:44
nitingm nitingm is offline
Registered User
 
Join Date: Jul 2003
Location: Austin, TX, USA
Posts: 278
Sql204

Hi Prashant,

I had posted the same in your last thread so I don't see the need for you to start a new duplicate thread anyways what I had posted is below.

Given below is the explanation of the error.

-----------------------------------------------------
C:\>db2 ? SQL2040N


SQL2040N The database alias parameter "<dbalias>" is not valid
or not specified.

Explanation:

The application calling the Backup or Restore utility has
supplied a database alias parameter that is not valid. The alias
must be 1 to 8 bytes and the characters must be chosen from the
database manager base character set.

User Response:

Reissue the Backup or Restore command with a valid database
alias.
---------------------------------------------------------------------

Try giving a dbalias name which is in between 1-8 characters and I think that should solve your problem
__________________
HTH

Nitin

Ask the experienced rather than the learned
Reply With Quote
  #9 (permalink)  
Old 06-04-04, 07:02
Prashant K Prashant K is offline
Registered User
 
Join Date: Jun 2004
Posts: 8
Hi, Nitin
Thanks for your reply for both the threads (second was created because in first thread the TITLE was not explanatory). anyway, the error discription which u has provided was already available along with the error code. pl find some other solution if possible.
Regds
Prashant
Reply With Quote
  #10 (permalink)  
Old 06-08-04, 02:40
Prashant K Prashant K is offline
Registered User
 
Join Date: Jun 2004
Posts: 8
Dear Sathyaram,
sorry for wrongly putting the version number. I have atually put the Websphere version number and not DB2 version number. Correct info is as below.

What name are you giving ? I am giving 'new database name' ie 'gskjun03'

Are you sure you are on Version 4 ? no, i am on version 7.

What platform are you on ? OS platform of server is 'Win2K' and the OS on the PC where i am trying to restore is 'Windows NT workstation'

Is the backup taken on the same version of the database ? yes, the backup taken is on DB2 version 7

Regds
Prashant
Reply With Quote
  #11 (permalink)  
Old 06-08-04, 02:41
Prashant K Prashant K is offline
Registered User
 
Join Date: Jun 2004
Posts: 8
sorry for wrongly putting the version number. I have atually put the Websphere version number and not DB2 version number. Correct info is as below.

What name are you giving ? I am giving 'new database name' ie 'gskjun03'

Are you sure you are on Version 4 ? no, i am on version 7.

What platform are you on ? OS platform of server is 'Win2K' and the OS on the PC where i am trying to restore is 'Windows NT workstation'

Is the backup taken on the same version of the database ? yes, the backup taken is on DB2 version 7
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On