FirebirdSQL/問答篇/批次檔執行備份修復
出自VFP Wiki
FirebirdSQL/問答篇/批次檔執行備份修復
的原始碼
跳轉到:
導航
,
搜尋
根據以下的原因,您並無權限去做編輯這個頁面:
你所請求執行的操作被禁止。
你可以檢視並複製本頁面的原始碼。
=== Firebird自動化設定 === <code> rem @echo off rem Batch file for safe shutting down and restarting IB55 rem This Batch will run on Win-NT, not on Win-9x C: CD "\Program Files\Interbase Corp\Interbase\Bin" SET BATLOGFILE=%1 IF "%BATLOGFILE%" == "" SET BATLOGFILE=d:\newua\jobs\nightly.LOG echo ------------------------------------------------- >> %BATLOGFILE% Date /T >> %BATLOGFILE% Time /T >> %BATLOGFILE% rem ========= Step 1: shutdown database ========= echo Try Shutdown Database... >> %BATLOGFILE% gfix -shut -attach 30 d:\newua\ua.gdb -user SYSDBA -pass masterkey 2> errout.tmp echo 1> nul 2> empty.tmp echo N 1> N_CR.tmp comp errout.tmp empty.tmp 1> nul 2> nul < N_CR.tmp if errorlevel 1 GOTO NOT_SHUT echo Shutdown ua ok >> %BATLOGFILE% gfix -shut -attach 30 d:\newua\train.gdb -user SYSDBA -pass masterkey 2> errout.tmp echo 1> nul 2> empty.tmp echo N 1> N_CR.tmp comp errout.tmp empty.tmp 1> nul 2> nul < N_CR.tmp if errorlevel 1 GOTO NOT_SHUT_TRAIN echo Shutdown train ok >> %BATLOGFILE% rem ========= Step 2: stop InterbaseServer ========= echo Try stop InterbaseServer... >> %BATLOGFILE% NET STOP InterbaseServer 1> nul 2>> %BATLOGFILE% IF errorlevel 1 GOTO NOT_STOPPED echo stop InterbaseServer ok >> %BATLOGFILE% rem ========= Step 3: (re)start InterbaseGuardian ========= echo Try start InterbaseGuardian... >> %BATLOGFILE% NET START InterbaseGuardian 1> nul 2>> %BATLOGFILE% IF errorlevel 1 GOTO NOT_STARTED echo start InterbaseGuardian ok >> %BATLOGFILE% rem ========= Step 4: backup database ========= echo backup Database... >> %BATLOGFILE% gbak -B -t -user SYSDBA -pass masterkey d:\newua\ua.gdb d:\newua\ua.bkp 2> errout.tmp echo 1> nul 2> empty.tmp echo N 1> N_CR.tmp comp errout.tmp empty.tmp 1> nul 2> nul < N_CR.tmp if errorlevel 1 GOTO NOT_BACKEDUP echo backup ua ok >> %BATLOGFILE% rem ========= Step 5: restore database ========= echo restore Database... >> %BATLOGFILE% gbak -R -user SYSDBA -pass masterkey -c -p 8192 d:\newua\ua.bkp d:\newua\ua.gdb 2> errout.tmp echo 1> nul 2> empty.tmp echo N 1> N_CR.tmp comp errout.tmp empty.tmp 1> nul 2> nul < N_CR.tmp if errorlevel 1 GOTO NOT_RESTORED echo restore train ok >> %BATLOGFILE% rem ========= Step 6: bring database online ========= echo Try bring database online... >> %BATLOGFILE% gfix -online d:\newua\ua.gdb -user SYSDBA -pass masterkey 2> errout.tmp echo 1> nul 2> empty.tmp echo N 1> N_CR.tmp comp errout.tmp empty.tmp 1> nul 2> nul < N_CR.tmp if errorlevel 1 GOTO NOT_ONLINE echo Online ua again. Finished. >> %BATLOGFILE% gfix -online d:\newua\train.gdb -user SYSDBA -pass masterkey 2> errout.tmp echo 1> nul 2> empty.tmp echo N 1> N_CR.tmp comp errout.tmp empty.tmp 1> nul 2> nul < N_CR.tmp if errorlevel 1 GOTO NOT_ONLINE_TRAIN echo Online train again. Finished. >> %BATLOGFILE% GOTO END_BATCH :NOT_SHUT type errout.tmp >> %BATLOGFILE% echo Shutdown ua failed! >> %BATLOGFILE% GOTO END_BATCH :NOT_SHUT_TRAIN type errout.tmp >> %BATLOGFILE% echo Shutdown train failed! >> %BATLOGFILE% GOTO END_BATCH :NOT_STOPPED echo Stop InterbaseServer failed! >> %BATLOGFILE% GOTO END_BATCH :NOT_STARTED echo Start InterbaseGuardian failed! >> %BATLOGFILE% GOTO END_BATCH :NOT_BACKEDUP type errout.tmp >> %BATLOGFILE% echo Backup failed! >> %BATLOGFILE% GOTO END_BATCH :NOT_RESTORED echo restore failed! >> %BATLOGFILE% GOTO END_BATCH :NOT_ONLINE type errout.tmp >> %BATLOGFILE% echo Bringing ua database online failed! >> %BATLOGFILE% GOTO END_BATCH :NOT_ONLINE_TRAIN type errout.tmp >> %BATLOGFILE% echo Bringing train database online failed! >> %BATLOGFILE% GOTO END_BATCH :END_BATCH del *.tmp </code> [http://www.hg-fix.com/ 数据恢复] [http://www.hg-fix.com/ 硬盘数据恢复] [http://www.hg-fix.com/ 磁带数据恢复] [http://www.hg-fix.com/ raid数据恢复] [http://www.hg-fix.com/ 磁盘阵列数据恢复] [http://www.hg-fix.com/diskrecover.htm 数据恢复] [http://www.hg-fix.com/taperecover.htm 数据恢复] [http://www.hg-fix.com/raidrecover.htm 数据恢复] [http://www.hg-fix.com/ 数据修复] [http://www.hg-fix.com/ 硬盘数据修复] [http://www.hg-fix.com/ 磁带数据修复] [http://www.hg-fix.com/ raid数据修复] [http://www.hg-fix.com/diskrecover.htm 数据修复] [http://www.hg-fix.com/raidrecover.htm 数据修复] [http://www.hg-fix.com/taperecover.htm 数据修复] [http://www.hg-fix.com/ 磁盘阵列数据修复]
返回到
FirebirdSQL/問答篇/批次檔執行備份修復
。
檢視
頁面
討論
原始碼
歷史
個人工具
登入/建立新帳號 選單
導航
首頁
社群入口
現時事件
近期變動
隨機頁面
使用說明
搜尋
工具箱
鏈入頁面
相關頁面修訂記錄
所有特殊頁面