Oracle教程:基於使用者管理的備份與恢複-備份其它檔案

來源:互聯網
上載者:User

備份歸檔日誌

--查看第一個歸檔位置過去一天以來產生的歸檔日誌,dest_id代表歸檔日誌存放位置,對應到v$archive_dest中1~10的destination欄位值,0代表不可用

SQL> select name from v$archived_log where dest_id=1 and first_time>=sysdate-1;

NAME
------------------------------------------------------------------------------------------------------------------------
/Oracle/10g/oracle/log/archive_log/archive_1_23_757801926.arclog
/oracle/10g/oracle/log/archive_log/archive_1_24_757801926.arclog

SQL> select name from v$archived_log where dest_id=10 and first_time>=sysdate-1;

NAME
------------------------------------------------------------------------------------------------------------------------
/oracle/10g/oracle/product/10.2.0/db_1/flash_recovery_area/ORALIFE/archivelog/2011_08_01/o1_mf_1_23_73fljh3f_.arc
/oracle/10g/oracle/product/10.2.0/db_1/flash_recovery_area/ORALIFE/archivelog/2011_08_02/o1_mf_1_24_73hwlry6_.arc

SQL> select destination from v$archive_dest;

DESTINATION
------------------------------------------------------------------------------------------------------------------------
/oracle/10g/oracle/log/archive_log
/oracle/10g/oracle/log/archive_log2

USE_DB_RECOVERY_FILE_DEST

10 rows selected.
--拷貝歸檔日誌到指定的備份目錄
cp

備份參數檔案
1)如果使用文本參數檔案(pfile),使用OS命令拷貝到備份目錄
2)如果使用spfile,使用create pfile 進行備份
3)如果使用pfile,使用create spfile進行備份
SQL> show parameter spfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /oracle/10g/oracle/product/10.
                                                 2.0/db_1/dbs/spfileoralife.ora
--建立pfile,相當於備份spfile為pfile
SQL> create pfile = '/oracle/10g/oracle/bakup/database/pfileoralife.ora'
  2  from spfile;

File created.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
--使用pfile啟動資料庫到nomount狀態,也可以直接startup pfile='pfile全路徑名'
SQL> startup nomount pfile='/oracle/10g/oracle/bakup/database/pfileoralife.ora';
ORACLE instance started.

Total System Global Area  528482304 bytes
Fixed Size                  1220360 bytes
Variable Size             146800888 bytes
Database Buffers          373293056 bytes
Redo Buffers                7168000 bytes
SQL> show parameter pfile;--當用pfile啟動資料庫時,spfile參數為空白

NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
spfile                               string
SQL> show parameter spfile;

NAME                                 TYPE                   VALUE
------------------------------------ ---------------------- ------------------------------
spfile                               string

SQL> alter database mount;

Database altered.

SQL> alter database open;

Database altered.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
  • 1
  • 2
  • 下一頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.