oracle一致性備份(冷備份)概述

來源:互聯網
上載者:User

1、編寫產生備份指令碼的指令碼

#cold backcup

remark set sql*plus variable to manipulate output         //注釋

set feedback off heading off verify  off trimspool off  echo off time off

set pagesize 0  linesize 200

remark set sql*plus user variable used  in this script                //注釋

define bakdir='/disk1/backup/anny/cold_bak'                             //備份檔案的存放位置

define bakscp='/disk1/backup/anny/cold_bak/cold_cmd.sql'               //執行備份的指令碼,自動產生

prompt *** Spooling to &bakscp                        //輸出提示

remark  create a command file with  file backup commands

spool &bakscp

select 'host cp '|| name ||' &bakdir ' from v$datafile order by 1;

select 'host cp '|| name ||' &bakdir ' from v$controlfile order by 1;

spool off;

remark   shutdown the database cleanly

shutdown immediate; ——冷備份需要關庫執行

remark run the copy file commands form the operating system

@&bakscp

remark start the database again

startup;

本文URL地址:http://www.bianceng.cn/database/Oracle/201410/45405.htm

2、執行該指令碼產生了一個指令碼cold_cmd.sql,並執行該指令碼進行冷備份

SQL> conn /as sysdba

Connected.

SQL> @/export/home/oracle/sqlplus/anny_cold_bak

SP2-0734: unknown command beginning "cold backc..." - rest of line ignored.

*** Spooling to /disk1/backup/anny/cold_bak/cold_cmd.sql        ——一下是指令碼內容

host cp /u01/app/oracle/oradata/anny/index01.dbf /disk1/backup/anny/cold_bak

host cp /u01/app/oracle/oradata/anny/lx01.dbf /disk1/backup/anny/cold_bak

host cp /u01/app/oracle/oradata/anny/lx02.dbf /disk1/backup/anny/cold_bak

host cp /u01/app/oracle/oradata/anny/lx03.dbf /disk1/backup/anny/cold_bak

host cp /u01/app/oracle/oradata/anny/lx04.dbf /disk1/backup/anny/cold_bak

host cp /u01/app/oracle/oradata/anny/sysaux01.dbf /disk1/backup/anny/cold_bak

host cp /u01/app/oracle/oradata/anny/system01.dbf /disk1/backup/anny/cold_bak

host cp /u01/app/oracle/oradata/anny/text01.dbf /disk1/backup/anny/cold_bak

host cp /u01/app/oracle/oradata/anny/undotbs01.dbf /disk1/backup/anny/cold_bak

host cp /u01/app/oracle/oradata/anny/user01.dbf /disk1/backup/anny/cold_bak

host cp /disk1/oradata/anny/control02.ctl /disk1/backup/anny/cold_bak

host cp /disk2/oradata/anny/control03.ctl /disk1/backup/anny/cold_bak

host cp /u01/app/oracle/oradata/anny/control01.ctl /disk1/backup/anny/cold_bak

Database closed.

Database dismounted.

ORACLE instance shut down.

ORACLE instance started.

Total System Global Area  314572800 bytes

Fixed Size                  1279964 bytes

Variable Size              58722340 bytes

Database Buffers          251658240 bytes

Redo Buffers                2912256 bytes

Database mounted.

Database opened.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.