archiveloglistSP2-0734: unknown command beginning archivelog... - rest of line ig..."/>
溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊(cè)×
其他方式登錄
點(diǎn)擊 登錄注冊(cè) 即表示同意《億速云用戶服務(wù)條款》

oracle 11g rac開啟歸檔日志和閃回

發(fā)布時(shí)間:2020-07-01 06:21:14 來(lái)源:網(wǎng)絡(luò) 閱讀:2225 作者:z597011036 欄目:數(shù)據(jù)庫(kù)

1.查看數(shù)據(jù)庫(kù)是否開啟歸檔(查看兩個(gè)節(jié)點(diǎn)rac1和rac2是否開歸檔日志)

SQL> archiveloglist

SP2-0734: unknown command beginning "archivelog..." - rest of line ignored.

SQL> archive log list

Database log mode              No Archive Mode

Automatic archival             Disabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     7

Current log sequence           8

SQL> 


2.在節(jié)點(diǎn)1(rac1)中設(shè)置只修改節(jié)點(diǎn)1的參數(shù),不影響節(jié)點(diǎn)2.

SQL> alter system set cluster_database=false scope=spfile sid='racdb1';

System altered.

SQL> 


3.在節(jié)點(diǎn)1(rac1)用srvctl命令關(guān)閉數(shù)據(jù)庫(kù)

[oracle@rac1 ~]$ srvctl stop database -d racdb


4.掛載數(shù)據(jù)庫(kù),日志修改為歸檔

SQL> startup mount

SQL> alter database archivelog;

SQL> alter system set cluster_database=true scope=spfile sid='racdb1';

SQL> shutdown immediate


5.啟動(dòng)數(shù)據(jù)庫(kù)

[oracle@rac1 ~]$ srvctl start database -d racdb


6.檢查修改后的歸檔信息

SQL> archive log list

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            USE_DB_RECOVERY_FILE_DEST

Oldest online log sequence     9

Next log sequence to archive   10

Current log sequence           10

SQL>


7.查看數(shù)據(jù)庫(kù)是否啟用閃回功能

節(jié)點(diǎn)1(rac1):

SQL> select flashback_on from v$database;   --必須先開啟歸檔

FLASHBACK_ON

------------------

NO

SQL>


8.設(shè)置閃回的路徑和大小

SQL> alter system set cluster_database=false scope=spfile sid='racdb1';

SQL> alter system set db_recovery_file_dest='+FALSE' scope=spfile;

SQL> alter system set db_recovery_file_dest_size=5G scope=spfile;


9.關(guān)閉數(shù)據(jù)庫(kù)

[oracle@rac1 ~]$ srvctl stop database -d racdb


10.啟用閃回

SQL> startup mount

SQL> alter database flashback on;

SQL> alter system set cluster_database=true scope=spfile sid='racdb1';

SQL> shutdown immediate


11.啟動(dòng)數(shù)據(jù)庫(kù)

[oracle@rac1 ~]$ srvctl start database -d racdb


12.查看閃回功能

SQL> select flashback_on from v$database;

FLASHBACK_ON

------------------

YES

SQL>


13.也可啟用表空間閃回

SQL> alter tablespace abc flashback on;    --開啟表空間閃回

SQL> alter tablespace abc flashback off;    --關(guān)閉表空間閃回


向AI問(wèn)一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI