oracle 10g rac 啟用歸檔模式

guyeh發表於2009-07-14

RAC環境,雙節點,之前沒有啟用歸檔,現在因上備份軟體要啟用歸檔。

本次處理方案是將歸檔日誌存放到雙節點的本地磁碟,

[@more@]

首先選取作業系統中空閒多的分割槽作為歸檔日誌存放的位置。

如下,我選用/opt分割槽

# df -g
Filesystem GB blocks Free %Used Iused %Iused Mounted on
/dev/hd4 20.00 18.78 7% 10184 1% /
/dev/hd2 10.00 8.17 19% 41599 3% /usr
/dev/hd9var 10.00 9.83 2% 1096 1% /var
/dev/hd3 4.00 3.90 3% 677 1% /tmp
/dev/hd1 25.00 10.00 60% 37970 2% /home
/dev/hd11admin 0.25 0.25 1% 5 1% /admin
/proc - - - - - /proc
/dev/hd10opt 60.00 58.52 3% 4763 1% /opt

每個節點分別執行
# cd /opt
# ls
IBM RPM_inst_root eclipse2 nbu_software
IBMinvscout Tivoli freeware pconsole
LicenseUseManagement cam hsc perfwb
ORCLcluster csm ibm perl
ORCLfmap diagnostics lost+found
# mkdir ora_archive
# ls
IBM RPM_inst_root eclipse2 nbu_software
IBMinvscout Tivoli freeware ora_archive
LicenseUseManagement cam hsc pconsole
ORCLcluster csm ibm perfwb
ORCLfmap diagnostics lost+found perl
# chown -R oracle:oinstall ora_archive
設定本地歸檔日誌存放目錄

SQL> alter system set log_archive_dest='/opt/ora_archive' sid='keyan1';

System altered.

SQL> alter system set log_archive_dest='/opt/ora_archive' sid='keyan2';

System altered.

關閉叢集所有節點例項 $ srvctl stop database -d keyan

在每個節點分別執行
$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.4.0 - Production on Tue Jul 14 11:46:12 2009

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.

Connected to an idle instance.

SQL> startup mount
ORACLE instance started.

Total System Global Area 1610612736 bytes
Fixed Size 2084400 bytes
Variable Size 939524560 bytes
Database Buffers 654311424 bytes
Redo Buffers 14692352 bytes
Database mounted.
SQL> alter database archivelog;

Database altered.

SQL> alter database open;

Database altered.

SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /opt/ora_archive
Oldest online log sequence 141
Next log sequence to archive 142
Current log sequence 142
SQL>

重新啟動叢集所有節點例項 $ srvctl start database -d keyan

強制切換歸檔檢視結果
$ date
Tue Jul 14 12:22:23 CDT 2009
$ sqlplus "/as sysdba"

SQL*Plus: Release 10.2.0.4.0 - Production on Tue Jul 14 12:22:33 2009

Copyright (c) 1982, 2007, Oracle. All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options

SQL> alter system switch logfile;

System altered.

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP, Data Mining
and Real Application Testing options
$ ls -al
total 114944
drwxr-xr-x 2 oracle oinstall 256 Jul 14 12:22 .
drwxr-xr-x 23 root system 4096 Jul 14 11:37 ..
-rw-rw---- 1 oracle oinstall 17235968 Jul 14 12:22 1_142_682350777.dbf
-rw-r----- 1 oracle oinstall 41601536 Jul 14 11:47 2_53_682350777.dbf


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/570433/viewspace-1024122/,如需轉載,請註明出處,否則將追究法律責任。

相關文章