ifx_grid_copy() procedure

The ifx_grid_copy() procedure copies non-database, external files from a grid database server to other nodes in the same grid.

Syntax


1  EXECUTE PROCEDURE ifx_grid_copy ( ' grid_name ' , ' source_path_and_filename '?  , ' target_path_and_filename '  ) ;
Element Purpose Restriction
grid_name The name of the database server's grid.
source_path_and_filename The file path, relative to the value of the GRIDCOPY_DIR configuration parameter on the source database server, and name of the file you want to send to the other nodes of the grid. The file must be located relative to the directory specified by the GRIDCOPY_DIR configuration parameter on the source server. By default, the GRIDCOPY_DIR configuration parameter is set to $ONEDB_HOME.
target_path_and_filename The file path, relative to values of the GRIDCOPY_DIR configuration parameter on each other node of a grid, and the name each file will have on the other nodes of the grid. If you do not specify target_path_and_filename, the file is copied to source_path_and_filename on each node, relative to the GRIDCOPY_DIR configuration parameter value on that node.

Usage

The ifx_grid_copy() procedure copies a file, along with the file's permissions, group, and owner values, from a directory on a grid server to specified destinations on each other node that is currently part of the grid. Group and owner values, rather than group ID and user ID values, are copied because group IDs and user IDs can have different values on different servers. If the file's group or owner values have not been defined on a node receiving a copied file, the copy fails on that node.

You can run this procedure only on an authorized database server and as an authorized user, as specified by the cdr grid enable command.

Only nodes that are members of a grid at the time the ifx_grid_copy() is run receive the copied file. Grid nodes added after ifx_grid_copy() procedures complete are not updated with files previously copied to other nodes.

Nonexistent directories that are specified by the source_path_and_filename or target_path_and_filename values of the ifx_grid_copy() command are created during the ifx_grid_copy() procedure.

Wildcard characters in file names are not supported.

Example 1: Copying a file to the same location on database servers of a grid

The GRIDCOPY_DIR configuration parameter is set to $ONEDB_HOME/tmp on all database servers of a grid named grid1. The following command copies the file script1.exe from $ONEDB_HOME/tmp/bin on the source database server to $ONEDB_HOME/tmp/bin on all other nodes of grid1.

EXECUTE PROCEDURE ifx_grid_copy ("grid1", "bin/script1.exe");

Example 2: Copying a file to the same relative locations on other database servers of a grid

The GRIDCOPY_DIR configuration parameter is set to $ONEDB_HOME/tmp on the source database server and $ONEDB_HOME/copies on each other node of a grid named grid2. The following command copies the file script2.exe from $ONEDB_HOME/tmp/bin on the source database server to $ONEDB_HOME/copies/bin on all other nodes of grid2.

EXECUTE PROCEDURE ifx_grid_copy ("grid2", "bin/script2.exe");

Example 3: Copying a file to different relative locations on the other database servers of a grid

The GRIDCOPY_DIR configuration parameter is set to $ONEDB_HOME/tmp on all database servers of a grid named grid3. The following command copies the file script3.exe from $ONEDB_HOME/tmp/bin on the source server to $ONEDB_HOME/tmp/copies on all other nodes of grid3.

EXECUTE PROCEDURE ifx_grid_copy ("grid3", "bin/script3.exe", "copies/script3.exe");

Example 4: Changing the name of file copied throughout a grid

The GRIDCOPY_DIR configuration parameter is set to $ONEDB_HOME/tmp on all database servers of a grid named grid4. The following command copies the file script4.exe in $ONEDB_HOME/tmp on the source server to $ONEDB_HOME/tmp on all other nodes of grid4. The copied file is named script4_copy.exe on the other nodes of grid4.

EXECUTE PROCEDURE ifx_grid_copy ("grid4", "script4.exe", "script4_copy.exe");