偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

Oracle基于用戶管理的備份與恢復之歸檔日志和參數文件

數據庫 Oracle
Oracle數據庫基于用戶管理的備份與恢復系列文章,我們曾經介紹了備份控制文件和恢復重做日志,今天我們介紹一下基于用戶管理的歸檔日志和參數文件的備份與恢復,希望能夠對您有所幫助。

繼上次介紹了:Oracle數據庫基于用戶管理的備份與恢復之恢復重做日志之后,我們今天接著介紹基于用戶管理的備份與恢復之其他文件的備份,包括歸檔日志的備份以及參數文件的備份與恢復等。接下來就讓我們來一起了解一下這一過程吧。

備份歸檔日志

--查看***個歸檔位置過去一天以來生成的歸檔日志,dest_id代表歸檔日志存放位置,對應到v$archive_dest中1~10的destination字段值,0代表不可用。

  1. SQL> select name from v$archived_log where dest_id=1 and first_time>=sysdate-1;  
  2.  
  3. NAME  
  4.  
  5. ------------------------------------------------------------------------------------------------------------------------  
  6.  
  7. /oracle/10g/oracle/log/archive_log/archive_1_23_757801926.arclog  
  8.  
  9. /oracle/10g/oracle/log/archive_log/archive_1_24_757801926.arclog  
  10.  
  11. SQL> select name from v$archived_log where dest_id=10 and first_time>=sysdate-1;  
  12.  
  13. NAME  
  14.  
  15. ------------------------------------------------------------------------------------------------------------------------  
  16.  
  17. /oracle/10g/oracle/product/10.2.0/db_1/flash_recovery_area/ORALIFE/archivelog/2011_08_01/o1_mf_1_23_73fljh3f_.arc  
  18.  
  19. /oracle/10g/oracle/product/10.2.0/db_1/flash_recovery_area/ORALIFE/archivelog/2011_08_02/o1_mf_1_24_73hwlry6_.arc  
  20.  
  21. SQL> select destination from v$archive_dest;   
  22.  
  23. DESTINATION  
  24.  
  25. ------------------------------------------------------------------------------------------------------------------------  
  26.  
  27. /oracle/10g/oracle/log/archive_log  
  28.  
  29. /oracle/10g/oracle/log/archive_log2  
  30.  
  31. USE_DB_RECOVERY_FILE_DEST  
  32.  
  33. 10 rows selected. 

備份參數文件

1)如果使用文本參數文件(pfile),使用OS命令拷貝到備份目錄。

2)如果使用spfile,使用create pfile 進行備份。

3)如果使用pfile,使用create spfile進行備份。

  1. SQL> show parameter spfile  
  2.  
  3. NAME                                 TYPE        VALUE  
  4.  
  5. ------------------------------------ ----------- ------------------------------  
  6.  
  7. spfile                               string      /oracle/10g/oracle/product/10.  
  8.  
  9.                                                  2.0/db_1/dbs/spfileoralife.ora 

創(chuàng)建pfile,相當于備份spfile為pfile

  1. SQL> create pfile = '/oracle/10g/oracle/bakup/database/pfileoralife.ora' 
  2.  
  3. 2  from spfile;  
  4.  
  5. File created.  
  6.  
  7. SQL> shutdown immediate  
  8.  
  9. Database closed.  
  10.  
  11. Database dismounted.  
  12.  
  13. ORACLE instance shut down. 

使用pfile啟動數據庫到nomount狀態(tài),也可以直接startup pfile='pfile全路徑名'

  1. SQL> startup nomount pfile='/oracle/10g/oracle/bakup/database/pfileoralife.ora';  
  2.  
  3. ORACLE instance started.  
  4.  
  5. Total System Global Area  528482304 bytes  
  6.  
  7. Fixed Size                  1220360 bytes  
  8.  
  9. Variable Size             146800888 bytes  
  10.  
  11. Database Buffers          373293056 bytes  
  12.  
  13. Redo Buffers                7168000 bytes  
  14.  
  15. SQL> show parameter pfile;--當用pfile啟動數據庫時,spfile參數為空  
  16.  
  17. NAME                                 TYPE                   VALUE  
  18.  
  19. ------------------------------------ ---------------------- ------------------------------  
  20.  
  21. spfile                               string  
  22.  
  23. SQL> show parameter spfile;  
  24.  
  25. NAME                                 TYPE                   VALUE  
  26.  
  27. ------------------------------------ ---------------------- ------------------------------  
  28.  
  29. spfile                               string  
  30.  
  31. SQL> alter database mount;  
  32.  
  33. Database altered.  
  34.  
  35. SQL> alter database open;  
  36.  
  37. Database altered.  
  38.  
  39. SQL> shutdown immediate  
  40.  
  41. Database closed.  
  42.  
  43. Database dismounted.  
  44.  
  45. ORACLE instance shut down. 

創(chuàng)建spfile到指定位置

  1. SQL> create spfile='/oracle/10g/oracle/product/10.2.0/db_1/dbs/spfileoralife_test.ora' from   
  2.  
  3. 2  pfile='/oracle/10g/oracle/bakup/database/pfileoralife.ora';  
  4.  
  5. File created.  
  6.  
  7. SQL> shutdown immediate  
  8.  
  9. ORA-01507: database not mounted  
  10.  
  11. ORACLE instance shut down. 

數據庫啟動時不能指定spfile文件位置,但可以在pfile文件中引用spfile

  1. SQL> startup nomount spfile='/oracle/10g/oracle/product/10.2.0/db_1/dbs/spfileoralife_test.ora' 
  2.  
  3. SP2-0714: invalid combination of STARTUP options  
  4.  
  5. SQL> startup  spfile='/oracle/10g/oracle/product/10.2.0/db_1/dbs/spfileoralife_test.ora' 
  6.  
  7. SP2-0714: invalid combination of STARTUP options 

在pfileoralife.ora中添加:*.spfile='/oracle/10g/oracle/product/10.2.0/db_1/dbs/spfileoralife_test.ora'使用pfile啟動數據庫:

  1. SQL> startup nomount pfile='/oracle/10g/oracle/bakup/database/pfileoralife.ora';  
  2.  
  3. ORACLE instance started.  
  4.  
  5. Total System Global Area  528482304 bytes  
  6.  
  7. Fixed Size                  1220360 bytes  
  8.  
  9. Variable Size             146800888 bytes  
  10.  
  11. Database Buffers          373293056 bytes  
  12.  
  13. Redo Buffers                7168000 bytes  
  14.  
  15. SQL> show parameter spfile;  
  16.  
  17. NAME                                 TYPE                   VALUE  
  18.  
  19. ------------------------------------ ---------------------- ------------------------------  
  20.  
  21. spfile                               string                 /oracle/10g/oracle/product/10.  
  22.  
  23.                                                             2.0/db_1/dbs/spfileoralife_tes  
  24.  
  25.                                                             t.ora 

可以看出,已經使用了spfileoralife_test.ora。

關于Oracle數據庫基于用戶管理的備份歸檔日志和參數文件的知識就介紹到這里,如果您感興趣還可以看一下:Oracle數據庫基于用戶管理的控制文件的備份與恢復,希望本次的介紹能夠對您有所收獲!

【編輯推薦】

  1. Oracle數據庫中序列(SEQUENCE)的用法詳解
  2. 虛擬機安裝Oracle錯誤ORA-12514的解決方案
  3. SQL Server數據庫實現全文檢索的一個完整的例子
  4. Oracle提示“資源正忙,需指定nowait”的解決方案
  5. Oracle數據庫的物理存儲結構之數據庫控制文件詳解
責任編輯:趙鵬 來源: CSDN博客
相關推薦

2011-08-03 18:42:21

Oracle數據庫重做日志

2011-08-01 12:44:25

Oracle基于用戶管理備份與恢復

2011-08-02 08:59:52

Oracle控制文件

2010-10-29 15:07:33

oracle日志

2015-10-21 14:07:17

Oracle備份Oracle恢復

2010-10-29 14:44:35

ORACLE歸檔日志

2010-11-19 13:28:13

2009-03-17 16:00:47

Oracle數據庫備份

2011-05-20 09:35:24

Oracle數據庫恢復備份

2018-04-17 08:24:58

2010-04-01 11:21:51

Oracle備份

2010-11-19 13:19:26

Oracle歸檔日志

2010-11-19 13:14:21

Oracle刪除歸檔日

2010-04-12 10:40:49

Oracle數據庫

2010-04-14 17:11:13

Oracle管理

2010-04-14 16:09:51

Oracle 10g歸

2009-04-03 10:54:49

Oracle備份恢復

2020-04-03 10:54:38

多云歸檔備份

2010-11-19 13:01:31

Oracle日志文件

2011-08-30 10:02:18

OracleRMAN不完全恢復基于日志序列號恢復
點贊
收藏

51CTO技術棧公眾號