自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Oracle 數(shù)據(jù)庫如何設(shè)置歸檔模式與非歸檔模式

數(shù)據(jù)庫 Oracle
本文主要介紹了Oracle數(shù)據(jù)庫中設(shè)置歸檔模式與非歸檔模式的方法,希望能夠?qū)δ兴鶐椭?/div>

Oracle 數(shù)據(jù)庫操作中,數(shù)據(jù)庫可以設(shè)置為歸檔模式非歸檔模式。歸檔模式保存所有的事務(wù)日志,包括redolog、archivelog等,而非歸檔模式只記錄redolog。我們常常會(huì)根據(jù)工作的需要將其設(shè)置為歸檔模式和非歸檔模式,本文我們就介紹它們的設(shè)置過程,接下來就讓我們一起來了解一下吧。

-、查看oracle歸檔模式

 

  1. SQL> conn evan/evan  (dba)  
  2.  
  3. Connected.  
  4.  
  5. SQL> archive log list  
  6.  
  7. ORA-01031: insufficient privileges  
  8.  
  9. SQL> conn / as sysdba --archive log list需要以sysdba執(zhí)行  
  10.  
  11. Connected.  
  12.  
  13. SQL> archive log list  
  14.  
  15. Database log mode              No Archive Mode  
  16.  
  17. Automatic archival             Disabled  
  18.  
  19. Archive destination            USE_DB_RECOVERY_FILE_DEST  
  20.  
  21. Oldest online log sequence     2  
  22.  
  23. Current log sequence           4  
  24.  
  25. 查詢v$database  
  26.  
  27. SQL> select name,log_mode from v$database;  
  28.  
  29. NAME      LOG_MODE  
  30.  
  31. --------- ------------  
  32.  
  33. ORALIFE   NOARCHIVELOG 

 

二、修改歸檔模式

歸檔日志位置,Oracle 10g可以生成多份一樣的日志,保存多個(gè)位置,以防不測(cè)。

 

  1. SQL> alter system set log_archive_dest_1='location=/oracle/10g/oracle/log/archive_log';  
  2.  
  3. System altered.  
  4.  
  5. SQL> alter system set log_archive_dest_2='location=/oracle/10g/oracle/log/archive_log2';  
  6.  
  7. System altered.  
  8.  
  9. SQL> shutdown immediate  
  10.  
  11. ORA-01031: insufficient privileges  
  12.  
  13. SQL> conn / as sysdba  
  14.  
  15. Connected.  
  16.  
  17. SQL> shutdown immediate  
  18.  
  19. Database closed.  
  20.  
  21. Database dismounted.  
  22.  
  23. ORACLE instance shut down.  
  24.  
  25. SQL> startup mount  
  26.  
  27. ORACLE instance started.  
  28.  
  29. Total System Global Area  528482304 bytes  
  30.  
  31. Fixed Size                  1220360 bytes  
  32.  
  33. Variable Size             163578104 bytes  
  34.  
  35. Database Buffers          356515840 bytes  
  36.  
  37. Redo Buffers                7168000 bytes  
  38.  
  39. Database mounted.  
  40.  
  41. SQL> alter database archivelog; --設(shè)置歸檔模式  
  42.  
  43. Database altered.  
  44.  
  45. SQL> alter database open;  
  46.  
  47. Database altered. 

 

配置歸檔文件格式(從oracle 10g 開始,必須帶有%s,%t,%r)

 

  1. SQL> alter system set log_archive_format="archive_%t_%s_%r.arclog" scope=spfile;  
  2.  
  3. System altered.  
  4.  
  5. SQL> shutdown immediate  
  6.  
  7. Database closed.  
  8.  
  9. Database dismounted.  
  10.  
  11. ORACLE instance shut down.  
  12.  
  13. SQL> startup mount  
  14.  
  15. ORACLE instance started.  
  16.  
  17. Total System Global Area  528482304 bytes  
  18.  
  19. Fixed Size                  1220360 bytes  
  20.  
  21. Variable Size             163578104 bytes  
  22.  
  23. Database Buffers          356515840 bytes  
  24.  
  25. Redo Buffers                7168000 bytes  
  26.  
  27. Database mounted.  
  28.  
  29. SQL> archive log list  --查看是否歸檔  
  30.  
  31. Database log mode              Archive Mode  
  32.  
  33. Automatic archival             Enabled          --已開啟自動(dòng)歸檔  
  34.  
  35. Archive destination            /oracle/10g/oracle/log/archive_log2  
  36.  
  37. Oldest online log sequence     2  
  38.  
  39. Next log sequence to archive   4  
  40.  
  41. Current log sequence           4  
  42.  
  43. SQL> select destination from v$archive_dest;  --查看歸檔日志位置  
  44.  
  45. DESTINATION  
  46.  
  47. --------------------------------------------------------------------------------  
  48.  
  49. /oracle/10g/oracle/log/archive_log  
  50.  
  51. /oracle/10g/oracle/log/archive_log2  
  52.  
  53. 10 rows selected. 

 

還可以配置歸檔進(jìn)程個(gè)數(shù)

 

  1. alter system set log_archive_max_processes=n 

 

三、修改為非歸檔模式

 

  1. SQL> startup mount  
  2.  
  3. ORACLE instance started.  
  4.  
  5. Total System Global Area  528482304 bytes  
  6.  
  7. Fixed Size                  1220360 bytes  
  8.  
  9. Variable Size             167772408 bytes  
  10.  
  11. Database Buffers          352321536 bytes  
  12.  
  13. Redo Buffers                7168000 bytes  
  14.  
  15. Database mounted.  
  16.  
  17. SQL> alter database noarchivelog;  
  18.  
  19. Database altered.  
  20.  
  21. SQL> alter system set log_archive_dest_1='';  
  22.  
  23. System altered.  
  24.  
  25. SQL> alter system set log_archive_dest_2='';  
  26.  
  27. System altered.  
  28.  
  29. SQL>  alter system set log_archive_dest_10='location=USE_DB_RECOVERY_FILE_DEST'; --恢復(fù)為原來  
  30.  
  31. System altered.  
  32.  
  33. SQL> archive log list  
  34.  
  35. Database log mode              No Archive Mode  
  36.  
  37. Automatic archival             Disabled  
  38.  
  39. Archive destination            USE_DB_RECOVERY_FILE_DEST  
  40.  
  41. Oldest online log sequence     6  
  42.  
  43. Current log sequence           8  
  44.  
  45. SQL> shutdown immediate  
  46.  
  47. ORA-01109: database not open  
  48.  
  49. Database dismounted.  
  50.  
  51. ORACLE instance shut down.  
  52.  
  53. SQL> startup mount  
  54.  
  55. ORACLE instance started.  
  56.  
  57. Total System Global Area  528482304 bytes  
  58.  
  59. Fixed Size                  1220360 bytes  
  60.  
  61. Variable Size             167772408 bytes  
  62.  
  63. Database Buffers          352321536 bytes  
  64.  
  65. Redo Buffers                7168000 bytes  
  66.  
  67. Database mounted.  
  68.  
  69. SQL> archive log list  
  70.  
  71. Database log mode              No Archive Mode  
  72.  
  73. Automatic archival             Disabled  
  74.  
  75. Archive destination            USE_DB_RECOVERY_FILE_DEST  
  76.  
  77. Oldest online log sequence     6  
  78.  
  79. Current log sequence           8 

 

關(guān)于Oracle 數(shù)據(jù)庫歸檔模式與非歸檔模式的設(shè)置就介紹這么多,如果您想了解更多關(guān)于Oracle數(shù)據(jù)庫的知識(shí),可以看一下這里的文章:http://database.51cto.com/oracle/,相信一定可以帶給您收獲的!

【編輯推薦】

  1. Oracle數(shù)據(jù)庫基于用戶管理的備份與恢復(fù)
  2. SQL Server 2008的BI組件SSAS使用詳解
  3. Oracle數(shù)據(jù)庫如何增加scott用戶與相關(guān)的表
  4. Oracle數(shù)據(jù)庫排序ORDER BY子句的使用總結(jié)篇
  5. SQL Server數(shù)據(jù)同步Merge的一個(gè)BUG及解決方法
責(zé)任編輯:趙鵬 來源: CSDN博客
相關(guān)推薦

2010-04-30 16:34:43

Oracle數(shù)據(jù)庫

2010-10-29 15:14:36

Oracle自動(dòng)歸檔

2011-08-24 17:08:28

Oracle數(shù)據(jù)庫歸檔模式

2017-06-06 08:10:00

Oracle

2010-05-10 09:59:47

Oracle手動(dòng)歸檔模

2010-10-29 15:07:33

oracle日志

2010-10-29 14:57:12

Oracle歸檔模式

2010-05-07 16:01:21

Oracle歸檔模式

2010-05-07 16:13:07

Oracle歸檔模式

2011-03-28 15:44:45

惠普數(shù)據(jù)庫Oracle數(shù)據(jù)庫

2011-08-02 11:16:08

Oracle數(shù)據(jù)庫歸檔日志

2010-04-30 16:42:08

Oracle歸檔模式

2010-04-09 16:40:01

Oracle數(shù)據(jù)庫

2010-11-19 13:28:13

2010-04-02 15:25:40

云歸檔

2011-03-23 09:31:26

歸檔日志文件數(shù)據(jù)庫恢復(fù)

2021-05-20 08:23:13

Oracle數(shù)據(jù)庫rac啟用

2010-10-29 13:30:33

Oracle歸檔日志

2010-10-29 14:44:35

ORACLE歸檔日志

2010-04-14 16:09:51

Oracle 10g歸
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)