solidDB Help : Configuring and administering : Configuring and administering HotStandby : HotStandby administration tasks : Copying a primary database to a secondary database over the network
  
Copying a primary database to a secondary database over the network
There are two main situations in which you might want to create a copy of the primary database on the secondary server:
You want to create a database for a new secondary server that does not have the database. This method is also used to copy a database to a diskless secondary server as, after a failure a diskless server loses its entire database and must be treated as a new secondary server.
You want to replace an existing secondary database. For example, if the database is corrupted.
Note To use data compression during the netcopy operation, set the HotStandby.NetcopyRpcCompress parameter to yes.
Procedure
1 Ensure that you have configured the solid.ini file so that it is valid for the HotStandby configuration and includes the connect string that is used to connect to the secondary server from the primary server.
For more information about the HotStandby.Connect parameter, which defines the connect string, see Defining HotStandby configuration on primary and secondary servers.
2 Make sure that the primary server is in PRIMARY ALONE state. If not, run the following command on the primary server:
ADMIN COMMAND 'hotstandby set primary alone'
3 If the secondary server does not have a database, start the secondary server in netcopy listening mode by executing the following command:
solid -x backupserver
Normally, when you start a solidDB server, you are prompted to create a new database if a database does not already exist. However, if the server is a secondary server, the server must use a copy of the primary database rather than create a new database. Therefore, when you start a secondary server that does not have an existing database, you start the server with a command-line parameter to tell it to wait to receive a copy of the database from the primary server.
The server is set to netcopy listening mode (also called backup listening mode). In netcopy listening mode, the only possible operation for the secondary server is to receive a database copy from the primary server. The secondary server does not accept connection requests or respond to any other command.
4 If the secondary server does already have a database, make sure the secondary server is in SECONDARY ALONE state. If not, run the following command on the secondary server:
ADMIN COMMAND 'hotstandby set secondary alone'
5 To start the netcopy operation, run the following command:
ADMIN COMMAND 'hotstandby netcopy';
When you execute the netcopy command, the following actions take place:
The primary server connects to the secondary server.
A database checkpoint is created on the primary server.
The primary server continues accepting transactions and connections during the netcopy operation, however, any administration command (ADMIN COMMAND) that changes the server state is rejected.
The secondary server does not continue accepting transactions and connections. If the secondary server has any open connections or transactions when the netcopy operation starts, the server rolls back the open transactions and disconnects from any clients, before the copy of the database is received. While the secondary server is receiving the database copy, the secondary server communicates only with the primary server.
6 To check the status of the netcopy operation, run the following command on the primary server:
ADMIN COMMAND 'hotstandby status copy';
The netcopy command runs asynchronously in the background. The servers do not display a message when the database copy completes or fails; instead, you must monitor the status of the netcopy operation.
The command displays a status message that indicates whether the netcopy command was successful, is still in progress, or has failed.
Before you can resume full hot standby operations, you must connect the primary and secondary servers. Connecting the servers sets the primary server to PRIMARY ACTIVE state, and the secondary server to SECONDARY ACTIVE state. For information about connecting the servers, see Connecting HotStandby servers.
Replacing the database by using HAC
If a High Availability Controller (HAC) is used, the procedure to get the primary server database copied to the secondary server is as follows:
1 Ensure that the servers have the correct HotStandy.Connect parameters.
2 Ensure that the HAC in the primary server has the PreferredPrimary parameter set to Yes in solidhac.ini, and that the HAC in the secondary server does not. For further information about configuring HACs see Configuring HA Controller and HA Manager.
3 Start the HAC instances, or optionally set the HACs to the AUTOMATIC mode.
See
Copying a database file from the primary server to a specified directory
Go up to
HotStandby administration tasks