The below set of steps outlines a full restore (catalog/IQ store) from a backup/dump file.
# Step 1) Start an empty server:
start_asiq -n testsrv -gu all
# Step 2) Add the server information in the interfaces file and the server name must be utility_db, below snapshot from the interfaces file:
[utility_db]
master=TCP,montana,2638
query=TCP,montana,2638
# (Note: montana is the Linux/UNIX host name)
# Step 3) Connect using isql and use utility_db as the server name:
isql -Udba -Psql -Sutility_db
OR
dbisql -nogui -c "uid=DBA;pwd=sql;eng=util;dbn=utility_db;links=tcpip{host=montana;port=2638}"
# ** note if you restoring the MPX database you need to start the utility server with override switch "-iqmpx_ov 1").
# Step 4) In the utility_db, Issue the command to stop the IQ server. (for example, it is HELENA)
STOP DATABASE HELENA ON HELENA UNCONDITIONALLY ;
# Step 5) For a FULL RESTORE, also need to delete .db and .log files
mkdir SAVE
mv -i IQ*.db IQ*.log SAVE
# Step 6) In the utility_db, issue the restore command:
restore database 'HELENA'
from '/data/db_dumps/backup_HELENA_20130504.dmp' ;
# Step 7) In the utility_db, issue the command to start the IQ server.
START DATABASE /opt/sybaseiq/HELENA/HELENA.db AS HELENA ON HELENA ;
The database should be restored now.
# Errata ..
# If loading from a server with another name, you'll need to rename the message file
restore database 'HELENA'
from '/data/db_dumps/backup_HELENA_20130504.dmp'
rename IQ_SYSTEM_MSG to 'HELENA.iqmsg' ;
# Then, you may need to rename the transaction log as well
cd /opt/sybaseiq
# Stop the IQ server
stop_asiq
dblog -t ./HELENA.log HELENA.db
# Start the IQ server
nohup asiqsrv12 -n HELENA @HELENA.cfg HELENA.db > HELENA.$$.log 2>&1 &
|
|