您好,登錄后才能下訂單哦!
小編給大家分享一下Oracle+ASM單機環境下如何開啟歸檔,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!
在ASM單機環境下,開啟歸檔的最簡單的方法。
環境:oracle11g 11.2.0.4
登陸sqlplus
[oracle@udevasm ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Thu Jun 8 18:20:41 2017
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to an idle instance.
要把Oracle數據庫給啟動到Open狀態
SQL> startup
ORACLE instance started.
Total System Global Area 1068937216 bytes
Fixed Size 2260088 bytes
Variable Size 331350920 bytes
Database Buffers 729808896 bytes
Redo Buffers 5517312 bytes
Database mounted.
Database opened.
查看ASM空間使用率
SQL> select group_number,name,total_mb,free_mb from v$asm_diskgroup;
GROUP_NUMBER NAME TOTAL_MB FREE_MB
------------ ------------------------------ ---------- ----------
1 DGDATA01 22520 260
2 DGDATA02 20472 14132
3 DGRECOVERY 21500 21420
4 DGSYSTEM 20472 20392
5 GRID1 10232 10144
查看歸檔狀態
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /oracle/app/oracle/product/11.2.0/dbs/arch
Oldest online log sequence 9
Current log sequence 14
SQL> show user
USER is "SYS"
關庫,或使用命令:shutdown immediate來關閉
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
啟庫到mount
SQL> startup mount;
ORACLE instance started.
Total System Global Area 1068937216 bytes
Fixed Size 2260088 bytes
Variable Size 331350920 bytes
Database Buffers 729808896 bytes
Redo Buffers 5517312 bytes
Database mounted.
查看當前節點的狀態
SQL> select status from gv$instance;
STATUS
------------
MOUNTED
為節點開啟歸檔,開啟歸檔
SQL> alter database archivelog;
Database altered.
查看歸檔狀態,發現歸檔日志路徑不對,并不是默認的路徑在ASM中的路徑
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /oracle/app/oracle/product/11.2.0/dbs/arch
Oldest online log sequence 9
Next log sequence to archive 14
Current log sequence 14
修改歸檔路徑
SQL> ALTER SYSTEM SET LOG_ARCHIVE_DEST_1='LOCATION=+DGRECOVERY/' SCOPE=SPFILE SID='udevasm';
查看當前修改后路徑
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination +DGRECOVERY/arc
Oldest online log sequence 9
Next log sequence to archive 14
Current log sequence 14
節點啟庫
SQL> alter database open;
Database altered.
SQL> select status from v$instance;
STATUS
------------
OPEN
來看一下,歸檔路徑的信息,默認是直接指向了ASM中的路徑
SQL> show parameter log_archive_dest;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
log_archive_dest string
log_archive_dest_1 string LOCATION=+DGRECOVERY/ARC
log_archive_dest_10 string
log_archive_dest_11 string
log_archive_dest_12 string
log_archive_dest_13 string
log_archive_dest_14 string
log_archive_dest_15 string
log_archive_dest_16 string
log_archive_dest_17 string
log_archive_dest_18 string
到ASM下看一下歸檔文件
ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 4194304 22520 260 0 260 0 N DGDATA01/
MOUNTED EXTERN N 512 4096 4194304 20472 14132 0 14132 0 N DGDATA02/
MOUNTED EXTERN N 512 4096 4194304 21500 21420 0 21420 0 N DGRECOVERY/
MOUNTED EXTERN N 512 4096 4194304 20472 20392 0 20392 0 N DGSYSTEM/
MOUNTED EXTERN N 512 4096 4194304 10232 10144 0 10144 0 N GRID1/
SMCMD> cd 2017_06_08/
ASMCMD> l
thread_1_seq_14.256.946154499
thread_1_seq_15.257.946154499
thread_1_seq_16.258.946154499
thread_1_seq_17.259.946154499
thread_1_seq_18.260.946154501
thread_1_seq_19.261.946154523
thread_1_seq_20.262.946154571
看完了這篇文章,相信你對“Oracle+ASM單機環境下如何開啟歸檔”有了一定的了解,如果想了解更多相關知識,歡迎關注億速云行業資訊頻道,感謝各位的閱讀!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。