- Steps to recover a database: Create a new user, new database schema, creating a database file directory, uploading a backup file, and restoring the database.
New user
2.1. Log in to iseries, select users and groups below to select all users to create a new user.
2.2. Enter the user name.
2.3. Select the ability to set privileges for security management, password expiration for never.
2.4. Select the job, set the international encoding character set to be identified as: 1388-simplified Chinese (GBK) mixed byte.
2.5. After the setup is complete, determine the new user, then find the new user in the user list, select Properties, and then cancel the user's option to change the password at the next logon. You can solve the problem of login need to change password.
New Database Schema
3.1. Using the newly created user login, select database, s104a95r, mode. Click the right mouse button and select New.
Create a database file directory
4.1. Open the start or configure session tool in IBM Personal communications. Sign in with a new user.
4.2. Create a new backup database file directory (back) and backup files (week)
Enter the following command:
CRTLIB back
CRTSAVF Back/week
Uploading Backup files
5.1. Log in to the DB2 AS400 server using the FTP tool.
5.2. Enter username/password: Qsecofr/password.
5.3. Enter the following command:
ftp> pwd
257 "QGPL" is the current library.
Ftp> CD Back
257 "Back" is the current library.
Ftp> bin (must be uploaded using binary)
Representation type is binary IMAGE.
ftp> LCD c \
Local directory now C:.
Ftp> PUT WEEK. SAVF
PORT subcommand request successful.
Retrieving member WEEK in the file WEEK in the library back.
$ File Transfer completed successfully.
ftp: Received 582912 bytes, spents 0.09Seconds 6201.19kbytes/sec.
Ftp> quit
Recovering a Database
Run the command in the startup or configuration session tool in IBM Personal communications:
Rstlib savlib (dbname) DEV (*SAVF) SAVF (back/file) rstlib (newdbname)
dbname: The name of the database originally backed up;
Back/file: Refers to the database backup file uploaded by Qsys.lib\
Newdbname: Revert to the new database name
DB2 AS400 Database Recovery