日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時間:8:30-17:00
你可能遇到了下面的問題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
Oracle數(shù)據(jù)庫如何設(shè)置歸檔模式與非歸檔模式

Oracle 數(shù)據(jù)庫操作中,數(shù)據(jù)庫可以設(shè)置為歸檔模式非歸檔模式。歸檔模式保存所有的事務(wù)日志,包括redolog、archivelog等,而非歸檔模式只記錄redolog。我們常常會根據(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可以生成多份一樣的日志,保存多個位置,以防不測。

 
 
 
  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          --已開啟自動歸檔  
  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. 

還可以配置歸檔進程個數(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ù)庫的知識,可以看一下這里的文章:http://database./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的一個BUG及解決方法

分享題目:Oracle數(shù)據(jù)庫如何設(shè)置歸檔模式與非歸檔模式
分享網(wǎng)址:http://www.5511xx.com/article/dhohcde.html