11g rac ASM下最簡單歸檔開啟/關閉方法
本次先來介紹一下在rac環境下,開啟歸檔的最簡單的方法。
環境:oracle11g RAC 11.2.0.4
登陸sqlplus
Last login: Wed Jul 29 09:25:43 2015 from 10.112.16.22
[root@hyldb1 ~]# su - oracle
[oracle@hyldb1 ~]$ sqlplus / as sysdba
SQL*Plus: Release 11.2.0.4.0 Production on Wed Jul 29 09:29:44 2015
Copyright (c) 1982, 2013, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
檢視ASM空間使用率
SQL> select group_number,name,total_mb,free_mb from v$asm_diskgroup;
GROUP_NUMBER NAME TOTAL_MB FREE_MB
------------ ------------------------------ ---------- ----------
1 OCR_ARCH 2048000 2042322
2 OCR_DATA 26112000 23640108
3 OCR_VOTE 61440 60514
檢視歸檔狀態
SQL> archive log list;
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 29061
Current log sequence 29065
SQL> show user
USER is "SYS"
節點1、2,分別關庫,或使用命令:srvctl stop instance -d hyl來關閉所有例項。
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
節點1,啟庫到mount
SQL> startup mount;
ORACLE instance started.
Total System Global Area 3.9284E+10 bytes
Fixed Size 2261608 bytes
Variable Size 7516196248 bytes
Database Buffers 3.1675E+10 bytes
Redo Buffers 89997312 bytes
Database mounted.
檢視節點1的狀態
SQL> select status from gv$instance;
STATUS
------------
MOUNTED
為節點1開啟歸檔
開啟歸檔
SQL> alter database archivelog;
Database altered.
檢視歸檔狀態,可以看到預設歸檔路徑為USE_DB_RECOVERY_FILE_DEST
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 29061
Next log sequence to archive 29065
Current log sequence 29065
節點1啟庫
SQL> alter database open;
Database altered.
SQL> select status,instance_name from gv$instance;
STATUS INSTANCE_NAME
------------ ----------------
OPEN hyl1
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 29061
Next log sequence to archive 29065
Current log sequence 29065
來看一下,歸檔路徑的資訊,預設是直接指向了ASM中的路徑
SQL> show parameter recover
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string +OCR_ARCH
db_recovery_file_dest_size big integer 4407M
db_unrecoverable_scn_tracking boolean TRUE
recovery_parallelism integer 0
節點2啟庫:
SQL> startup;
ORACLE instance started.
Total System Global Area 3.9284E+10 bytes
Fixed Size 2261608 bytes
Variable Size 6710889880 bytes
Database Buffers 3.2481E+10 bytes
Redo Buffers 89997312 bytes
Database mounted.
Database opened.
檢視叢集例項啟動狀態
SQL> select status,instance_name from gv$instance;
STATUS INSTANCE_NAME
------------ ----------------
OPEN hyl2
OPEN hyl1
檢視節點2的歸檔狀態
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 48485
Next log sequence to archive 48489
Current log sequence 48489
檢視db_recovery_file_dest資訊
SQL> show parameter recover
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string +OCR_ARCH
db_recovery_file_dest_size big integer 4407M
db_unrecoverable_scn_tracking boolean TRUE
recovery_parallelism integer 0
到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 1048576 2048000 2042300 0 2042300 0 N OCR_ARCH/
MOUNTED EXTERN N 512 4096 1048576 26112000 23640108 0 23640108 0 N OCR_DATA/
MOUNTED NORMAL N 512 4096 1048576 61440 60514 20480 20017 0 Y OCR_VOTE/
ASMCMD> cd +OCR_ARCH/hyl/ARCHIVELOG/2015_07_29
ASMCMD> ls -s
Block_Size Blocks Bytes Space Name
512 43974 22514688 23068672 thread_2_seq_48488.268.886327155
節點1上切一下歸檔
SQL> alter system switch logfile;
System altered.
在看一下歸檔檔案的資訊
ASMCMD> ls -ls
Type Redund Striped Time Sys Block_Size Blocks Bytes Space Name
ARCHIVELOG UNPROT COARSE JUL 29 10:00:00 Y 512 378883 193988096 196083712 thread_1_seq_29065.269.886328273
ARCHIVELOG UNPROT COARSE JUL 29 09:00:00 Y 512 43974 22514688 23068672 thread_2_seq_48488.268.886327155
可以看到執行緒1,即節點1的歸檔檔案已經成功生成了。
這種設定歸檔路徑使用的db_recovery_file_dest,但是要注意db_recovery_file_dest的大小設定,預設設定往往比較小,對於生成環境顯然是不夠的,需要調整。
如果預設設定過小,使用這種方式,開啟歸檔後常常遇到如下錯誤:
ORA-00257: archiver error. Connect internal only, until freed
如指令:
SQL> alter system set db_recovery_file_dest_size=200G;
————————————————————————————————
關閉RAC歸檔 由開>到關
-- 關閉資料庫
[oracle@hyldb1 ~]$ srvctl stop database -d jcdydb
-- 一個節點操作:
[oracle@hyldb1 ~]$ sqlplus / as sysdba
SQL> startup mount
SQL> alter system set cluster_database=false scope=spfile sid='*';
SQL> alter database noarchivelog;
SQL> alter database open;
SQL> alter system set cluster_database=true scope=spfile sid='*';
-- 另外一個開啟資料庫
[oracle@hyldb2 ~]$ srvctl stop database -d jcdydb
-- 刪除歸檔檔案
[oracle@hyldb1 ~]$ rman target /
RMAN> delete archivelog all;
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31383567/viewspace-2129839/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- rac下啟動關閉與更改歸檔模式模式
- rac下啟動關閉與更改歸檔模式(zt)模式
- ORACLE 歸檔日誌開啟關閉方法Oracle
- oracle 開啟、關閉歸檔Oracle
- 【rac】實驗一:啟動關閉歸檔
- Oracle 11g RAC的啟動、關閉及修改歸檔總結Oracle
- 10g , 11g RAC 環境下開啟歸檔模式的方法模式
- oracle 10g rac下啟動關閉與更改歸檔模式Oracle 10g模式
- oracle 歸檔日誌開啟,關閉Oracle
- 關閉和開啟歸檔日誌
- 開啟與關閉oracle的歸檔Oracle
- rac下啟動關閉與更改歸檔模式 時CLUSTER_DATABASE 作用模式Database
- oracle入門之1 rac下啟動關閉與更改歸檔模式Oracle模式
- oracle入門之1 rac下啟動關閉與更改歸檔模式 (zt)Oracle模式
- oracle rac及單例項開啟歸檔Oracle單例
- RAC--歸檔日誌的開啟方法
- RMAN在歸檔/非歸檔,庫關閉/mounted/開啟狀態下的備份
- RAC 11G ASM下修改spfile檔案ASM
- RAC(ASM)歸檔模式修改ASM模式
- oracle RAC開啟歸檔模式Oracle模式
- RAC 開啟歸檔日誌
- archive log 歸檔模式 啟動關閉Hive模式
- RAC開啟資料庫歸檔資料庫
- 【RAC】啟動/關閉CRS, OHAS, ASM & RDBMS 的步驟ASM
- RAC下啟動日誌歸檔模式模式
- Oracle單例項+ASM啟動與關閉Oracle單例ASM
- Oracle資料庫歸檔模式的開啟和關閉Oracle資料庫模式
- Oracle10g RAC (ASM) 資料庫及服務開啟關閉OracleASM資料庫
- Oracle11g RAC (ASM) 及Active Dataguard開啟與關閉 [final]OracleASM
- Oracle 11g關閉開啟AWROracle
- RAC常用開啟關閉命令 – SRVCTL用法
- ORACLE RAC 啟用歸檔Oracle
- Oracle 11G RAC OS開啟後叢集元件開啟但DB依然是關閉Oracle元件
- 10g關閉歸檔/啟用閃回恢復區歸檔
- oracle 11g開啟歸檔模式及修改歸檔目錄Oracle模式
- Oracle RAC 11gR2開啟歸檔Oracle
- Oracle10g RAC下啟用歸檔模式Oracle模式
- oracle之 RAC 11G ASM下控制檔案多路複用OracleASM