Results 1 to 15 of 15
  1. #1
    Join Date
    Apr 2003
    Location
    india
    Posts
    7

    Lightbulb Unanswered: Restoring dropped database

    HI,

    I have a database test1. I dropped it. I want to restore it now. Can I restore the database with out having any skeleton database in the instance. Do I need to first create a database and restore on to it or Can I directly restore it to the instance. Please help. If u know any commands or links having information on this topic, please provide me.

    Thanks in advance

    regards
    --chakri

  2. #2
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: Restoring dropped database

    You can Create a new database from backup ....

    If you are a beginner, I suggest you use Control Centre ....

    In the control centre tree, click on Database ---> Create --> Create from Backup .....

    If you want to use commands, check the restroe database command in command reference ....

    Cheers
    Sathyaram



    Originally posted by chakri_in5
    HI,

    I have a database test1. I dropped it. I want to restore it now. Can I restore the database with out having any skeleton database in the instance. Do I need to first create a database and restore on to it or Can I directly restore it to the instance. Please help. If u know any commands or links having information on this topic, please provide me.

    Thanks in advance

    regards
    --chakri

  3. #3
    Join Date
    Apr 2003
    Location
    india
    Posts
    7

    Re: Restoring dropped database

    Hi,
    we can use control center. It is question rather than a problem.
    I have a backup of a database.

    I want to restore it, using db2 restore.... redirect command.

    Suppose my DBInstance DB2 has a database TEST1

    DB2
    |-- TEST1

    now I take a backup of database and drop it.
    now my instance doesn't has any database.

    Now I can restore my database by creating a new empty database TEST2 in the instance and restoring from backup copy
    DB2
    | --- TEST2 (restore from backup copy of TEST1).
    This can be done.

    My problem is I want to restore with out creating a new empty database TEST2. I just have a backup copy of TEST1 and want to restore it with out creating any new database. Can it be done..?? Is there a restriction from DB2 that we must first have some database in place (like TEST2) before restoring from backup copy..?? Can't we restore with out any skeltal database in place..? Please help..
    thanks and regards
    --chakri

    Originally posted by sathyaram_s
    You can Create a new database from backup ....

    If you are a beginner, I suggest you use Control Centre ....

    In the control centre tree, click on Database ---> Create --> Create from Backup .....

    If you want to use commands, check the restroe database command in command reference ....

    Cheers
    Sathyaram

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: Restoring dropped database

    You can create a new database from backup ...

    You do NOT need to create a database before doing this ....

    Cheers

    Sathyaram



    Originally posted by chakri_in5
    Hi,
    we can use control center. It is question rather than a problem.
    I have a backup of a database.

    I want to restore it, using db2 restore.... redirect command.

    Suppose my DBInstance DB2 has a database TEST1

    DB2
    |-- TEST1

    now I take a backup of database and drop it.
    now my instance doesn't has any database.

    Now I can restore my database by creating a new empty database TEST2 in the instance and restoring from backup copy
    DB2
    | --- TEST2 (restore from backup copy of TEST1).
    This can be done.

    My problem is I want to restore with out creating a new empty database TEST2. I just have a backup copy of TEST1 and want to restore it with out creating any new database. Can it be done..?? Is there a restriction from DB2 that we must first have some database in place (like TEST2) before restoring from backup copy..?? Can't we restore with out any skeltal database in place..? Please help..
    thanks and regards
    --chakri

  5. #5
    Join Date
    Apr 2003
    Location
    Singapore
    Posts
    59

    might have to

    You might have to create a new empty database before restore if some parameters like for example CODEPAGE is something other than default.
    For example i had taken a back up of a database which was created using codepage 1252 and while restore i couldnt do it without creating the empty database with the same codepage. It gave the error
    : codepge does not match with the backup image code page.

    hmmm.. well..say how??

  6. #6
    Join Date
    Apr 2003
    Location
    india
    Posts
    7

    Re: might have to

    thanks a lot. It answered some part of my question. But I am using W2K evaluation version now. I will get the licensed version soon. My codepage is 0. But when I run the command.
    DB2 restore database TEST1 user administrator using password1 redirect and all other syntax, it gives "SQL3282N supplied credentials are not valid."
    I am logged in as Administrator, I could resolve the problem. Please help..
    thanks and regards
    --chakri

    Originally posted by brat4
    You might have to create a new empty database before restore if some parameters like for example CODEPAGE is something other than default.
    For example i had taken a back up of a database which was created using codepage 1252 and while restore i couldnt do it without creating the empty database with the same codepage. It gave the error
    : codepge does not match with the backup image code page.

    hmmm.. well..say how??

  7. #7
    Join Date
    Apr 2003
    Location
    Singapore
    Posts
    59

    Re: might have to

    Hi,
    Am not sure abt the administrator/password1. You must be logged in as a db2instance user, the one that you created while you installed db2 on your system.
    It ususally defaults to db2inst1. you must be logged in as user who is the owner of the db2 instance..
    Can you send me a little more details on your instance name and who ur instance owner is and the instance owners priveleges on the W2k os.

    rgds
    brat


    Originally posted by chakri_in5
    thanks a lot. It answered some part of my question. But I am using W2K evaluation version now. I will get the licensed version soon. My codepage is 0. But when I run the command.
    DB2 restore database TEST1 user administrator using password1 redirect and all other syntax, it gives "SQL3282N supplied credentials are not valid."
    I am logged in as Administrator, I could resolve the problem. Please help..
    thanks and regards
    --chakri

  8. #8
    Join Date
    Apr 2003
    Location
    india
    Posts
    7

    Re: might have to

    Hi,

    I just installed a Default Instance DB2. I created db2admin user account when I was installing the instance. I tried using db2admin account too, but it still gives the same error "Supplied credentials are not valid".

    I am able to attach to the instance. Drop or add the databases. Add tablespaces and do everything using this account. My user manager just displays the user db2admin related to DB2. No other user account related to DB2 is found.

    Does this problem has anything to do with the eval version or the licensed version. I am using the eval version.

    Please help
    thanks and regards
    --chakri

    Originally posted by brat4
    Hi,
    Am not sure abt the administrator/password1. You must be logged in as a db2instance user, the one that you created while you installed db2 on your system.
    It ususally defaults to db2inst1. you must be logged in as user who is the owner of the db2 instance..
    Can you send me a little more details on your instance name and who ur instance owner is and the instance owners priveleges on the W2k os.

    rgds
    brat

  9. #9
    Join Date
    Apr 2003
    Location
    Singapore
    Posts
    59

    Re: might have to

    hmmmm.. Honestly i have never used an eval version, but I am pretty much sure it has to have another account that is the instance owner. db2admin is the adminstrative account for db2. Lemme ask ard, till then can u tell me what ur instance name is??


    Originally posted by chakri_in5
    Hi,

    I just installed a Default Instance DB2. I created db2admin user account when I was installing the instance. I tried using db2admin account too, but it still gives the same error "Supplied credentials are not valid".

    I am able to attach to the instance. Drop or add the databases. Add tablespaces and do everything using this account. My user manager just displays the user db2admin related to DB2. No other user account related to DB2 is found.

    Does this problem has anything to do with the eval version or the licensed version. I am using the eval version.

    Please help
    thanks and regards
    --chakri

  10. #10
    Join Date
    Apr 2003
    Location
    india
    Posts
    7

    Re: might have to

    Hi,
    My instance name is DB2.

    the command db2ilist gives..
    DB2
    DB2CTLSV

    DB2CTLSV is control instnace and I can only see DB2 instance in the control center.

    thanks and regards
    --chakri

    Originally posted by brat4
    hmmmm.. Honestly i have never used an eval version, but I am pretty much sure it has to have another account that is the instance owner. db2admin is the adminstrative account for db2. Lemme ask ard, till then can u tell me what ur instance name is??

  11. #11
    Join Date
    Apr 2003
    Location
    Singapore
    Posts
    59

    Re: might have to

    hey wait a minute, just maybe, have you assigned db2admin in a security policies of the w2k to "act as a part of operating system". Its been a long time since i installed on w2k but i remember doing this step.
    Go to Control center > adminstrative tools
    double click on "local security policy"
    in the window go to "local policies > user rights assignment"
    In the right hand side you will see a policy which reads like " act as part of operating system"
    right click > and click on "securities"
    Add the db2admin user to this policy
    you might have to reboot.
    After that try doing the same steps. If this also doesnt work, then let me know, I'll ask around.
    hope it helps
    rgds
    brat


    Originally posted by brat4
    hmmmm.. Honestly i have never used an eval version, but I am pretty much sure it has to have another account that is the instance owner. db2admin is the adminstrative account for db2. Lemme ask ard, till then can u tell me what ur instance name is??

  12. #12
    Join Date
    Apr 2003
    Location
    Singapore
    Posts
    59

    Re: might have to

    Sorry i didint see your reply abt the instance name.
    Okie you have to do the steps mentioned below.
    for ur current problem:
    you must log in as "db2"
    In db2 there is no way an instance is created without a user assigned to it. By default db2 will be ur user unless u changed it. Log in as db2 and try your stuff
    lemme kno if it doest work, we'll crack it somehow.



    Originally posted by brat4
    hey wait a minute, just maybe, have you assigned db2admin in a security policies of the w2k to "act as a part of operating system". Its been a long time since i installed on w2k but i remember doing this step.
    Go to Control center > adminstrative tools
    double click on "local security policy"
    in the window go to "local policies > user rights assignment"
    In the right hand side you will see a policy which reads like " act as part of operating system"
    right click > and click on "securities"
    Add the db2admin user to this policy
    you might have to reboot.
    After that try doing the same steps. If this also doesnt work, then let me know, I'll ask around.
    hope it helps
    rgds
    brat

  13. #13
    Join Date
    Apr 2003
    Location
    india
    Posts
    7

    Re: might have to

    HI
    the security tokens are granted. When I click my instance and select start admin from the control center, it shows only one user, administrator. I think administrator owns the database. But still the same problem persists.

    I tried to attach the instance using the userid DB2, but I am not able to attach it. It says invalid user or password.
    Is there a way to modify the user and password settings for an instance. Please help.

    thanks and regards
    --chakri

    Originally posted by brat4
    Sorry i didint see your reply abt the instance name.
    Okie you have to do the steps mentioned below.
    for ur current problem:
    you must log in as "db2"
    In db2 there is no way an instance is created without a user assigned to it. By default db2 will be ur user unless u changed it. Log in as db2 and try your stuff
    lemme kno if it doest work, we'll crack it somehow.

  14. #14
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    Re: might have to

    SQL3282N, I believe is related with LDAP ...

    Check db2set -all to see if
    DB2_ENABLE_LDAP=YES

    If so , issue

    db2set DB2_ENABLE_LDAP=

    This will 'unset' the variable ...

    It is only on Unix that each instance is owned by a user with the same name .... On Windows, this is not the case .... Hence, chakri you can use db2admin user id ....

    Cheers

    Sathyaram



    Originally posted by chakri_in5
    HI
    the security tokens are granted. When I click my instance and select start admin from the control center, it shows only one user, administrator. I think administrator owns the database. But still the same problem persists.

    I tried to attach the instance using the userid DB2, but I am not able to attach it. It says invalid user or password.
    Is there a way to modify the user and password settings for an instance. Please help.

    thanks and regards
    --chakri

  15. #15
    Join Date
    Apr 2003
    Location
    india
    Posts
    7

    Re: might have to

    Hey
    At what level the authorization will be taken care of. At the database level or at the instane level (I think it is at the instance level). I am running command

    >db2 restore database TEST1 redirect

    I am logged in as administrator, but the database TEST1 doesn't exist. I want to restore it. Is this problem being caused by this.

    Can we connect to an instance from the command prompt and run our restore command? Is there any db2 command to connect to an instance?
    Please help
    thanks and regards
    --chakri

    Originally posted by sathyaram_s
    SQL3282N, I believe is related with LDAP ...

    Check db2set -all to see if
    DB2_ENABLE_LDAP=YES

    If so , issue

    db2set DB2_ENABLE_LDAP=

    This will 'unset' the variable ...

    It is only on Unix that each instance is owned by a user with the same name .... On Windows, this is not the case .... Hence, chakri you can use db2admin user id ....

    Cheers

    Sathyaram

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •