Oracle資料庫開啟關閉歸檔

2021-09-10 07:29:28 字數 3235 閱讀 3693

資料庫開啟歸檔模式

步驟如下:

[oracle@10g admin]$sqlplus / as sysdba

sql>alter user sys identified by sys; 忘記密碼修改密碼,

database altered

sql> conn sys/sys as sysdba

connected.

sql> show user

user is 「sys」

1、檢視資料庫是否開啟歸檔

sql> select name,log_mode from v$database;

name log_mode

orcl noarchivelog

sql> archive log list

database log mode no archive mode

automatic archival disabled

archive destination use_db_recovery_file_dest

oldest online log sequence 29

current log sequence 31

2、#修改系統的日誌儲存方式為歸檔模式:

sql> alter system set log_archive_start=true scope=spfile;

system altered.

sql> archive log list;

database log mode no archive mode

automatic archival disabled

archive destination use_db_recovery_file_dest

oldest online log sequence 29

current log sequence 31

關閉資料庫;

sql> shutdown immediate;

database closed.

database dismounted.

oracle instance shut down.

3、oracle資料庫開啟歸檔,需要在mount模式下。

sql> startup mount;

ora-32004: obsolete and/or deprecated parameter(s) specified

oracle instance started.

total system global area 599785472 bytes

fixed size 2022600 bytes

variable size 260047672 bytes

database buffers 331350016 bytes

redo buffers 6365184 bytes

database mounted.

4、使資料庫置於歸檔模式。

sql> alter database archivelog;

database altered.

sql> archve log list;

sp2-0734: unknown command beginning 「archve log…」 - rest of line ignored.

sql> archive log list;

database log mode archive mode

automatic archival enabled

archive destination use_db_recovery_file_dest

oldest online log sequence 29

next log sequence to archive 31

current log sequence 31

開啟資料庫

sql> alter database open;

database altered.

sql> select instance_name,status from v$instance;

instance_name status

orcl open

關閉資料庫的歸檔:

sql> shutdown immediate;

sdatabase closed.

database dismounted.

oracle instance shut down.

sql> startup mount;

ora-32004: obsolete and/or deprecated parameter(s) specified

oracle instance started.

total system global area 599785472 bytes

fixed size 2022600 bytes

variable size 260047672 bytes

database buffers 331350016 bytes

redo buffers 6365184 bytes

database mounted.

sql> archive log list;

database log mode archive mode

automatic archival enabled

archive destination use_db_recovery_file_dest

oldest online log sequence 29

next log sequence to archive 31

current log sequence 31

sql> alter database noarchivelog;

database altered.

sql> archive log list;

database log mode no archive mode

automatic archival disabled

archive destination use_db_recovery_file_dest

oldest online log sequence 29

current log sequence 31

sql> alter database open;

database altered.

sql> select status from v$instance;

open

完畢

如何開啟 關閉資料庫歸檔

1 單機模式下 如果開啟歸檔,請保證 log archive start true 開啟自動歸檔,否則只能手工歸檔,如果是關閉了歸檔,則設定該引數為false。10g之後廢除該引數,不需要設定。log archive dest 注意 如果是ops rac環境,需要先把parallel server ...

Oracle資料庫關閉歸檔功能及刪除歸檔日誌方法

注意 資料庫歸檔功能的開啟和關閉需重啟例項。一 查詢資料 庫歸檔是否開啟 返回值是archivelog則開啟了歸檔模式 noarchivelog是未開啟。conn sys sys orcl as sysdba select log mode from v database 二 歸檔日誌日 空間使用 ...

Oracle開啟關閉歸檔日誌

shutdown immediate 關閉資料庫 startup mount 開啟資料庫 alter database archivelog 開啟歸檔日誌 alter database open 開啟資料庫 archive log list 檢視歸檔日誌是否開啟 shutdown immediate...