- Summary of change procedure
- Detailed procedure
- Error messages that may occur during the operation
This document describes the procedure for changing the path of data files in disk tablespaces and memory checkpoint image files in memory tablespaces.
Change the data file path after securing service downtime.
Summary of change procedure
- Check the current path of the data file
- Stop the Altibase server.
- Change the data file path.
- Copy the data file to the new path.
- Start Altibase server as a control stage.
- Execute the data file path change DDL.
- Start the Altibase server as a service stage.
1. Check the current path of the data file
The verification method differs depending on the disk tablespace and the memory tablespace, so they need to be checked separately. Use the query below to check and write down the output result.
Data file path of disk tablespace
Path to checkpoint image file in memory tablespace
2. Stop the Altibase server
The Altibase server must be stopped as the user needs to physically move the data files.
3. Change the data file default path
- The data file default path refers to the path where the data file will be located if the user specifies only the data file name without specifying a path when creating a tablespace or adding a data file.
- Do this if the user also needs to change the default path when working with data file path change.
Set in the altibase.properties file, find the MEM_DB_DIR, DEFAULT_DISK_DB_DIR properties, and change the default path.
4. Copy the physical data file path
Copy all data files and memory checkpoint image files located in the path identified in "1. Check the current path of the data file" to the path the user wants to change.
파일 수 및 파일 크기를 비교하여 정상적으로 복사되었는지 확인합니다.
Change the original path to another name.
When starting the Altibase server, avoid the possibility of reading the original file and change the original path to a different name for the backup of the original file.
5. Start the Altibase server as a control stage
After connecting to the iSQL with sysdba privileges
Start as a control stage
6. Execute the data file path change DDL
The disk data file and memory checkpoint image file path information are stored in the log anchor file. Execute the DDL statement to change the information known to the log anchor.
How to change the disk data file path
The ALTER DATABASE statement is repeated as many times as the number of all data files checked in "1. Check the current path of data files". The user must enter the same file name by changing only the path.
Check the disk data file change path
Make sure the path has been changed correctly.
Change the memory checkpoint image file path
1. Repeat the ALTER TABLESPACE statement as many as the number of memory tablespaces checked in "Check the current path of the data file". In this case, only the old and new paths are used without specifying a file name.
How to check the memory checkpoint image file change path
7. Start the Altibase server as a service stage
Execute while connected to the iSQL with sysdba privilege.
Error messages that may occur during the operation
These are error messages that may occur while changing the data file path, and this section describes how to prevent these errors.
The data file does not exist
This can happen if the change statement was performed without physically moving the data file.
After moving the data file to the location where you want to change the data file, execute the rename statement that changes the location of the data file in the DB.
The data file 'XXXXXX' has an invalid header
This can happen if the data file copy phase is not physically performed normally. When starting the database in the service stage, the startup fails.
Redo the operation of the physical data file
Unable to invoke the create() function on [XXXXXX/dwfile0.dwf]
This can happen if the double write file does not exist. The double write file is a file required for restart recovery when the database is abnormally terminated. The default path is $ALTIBASE_HOME/dbs.If all files in the $ALTIBASE_HOME/dbs path are moved, an error may occur. The error message may differ depending on the Altibase server version.
dwfile0.dwf and dwfile1.dwf files can be created after creating them with the touch command.
Or change $ALTIBASE_HOME/conf/altibase.properties to USE_DW_BUFFER = 0 (add it if it doesn't exist) and start the Altibase server. When the Altibase server is started, change it to USE_DW_BUFFER = 1 or delete the USE_DW_BUFFER setting from altibase.properties.
After changing the default path of the double write file, the Altibase server can be started.
CANNOT IDENTIFY DATAFILE
When starting the Altibase server as a service phase, it happens that the physical data file cannot be found in the path of the data file stored in the meta table. This can happen if an incorrect data file path was entered in the control stage.
The control stage executes the DDL statement by specifying the correct path.