Oracle歸檔開啓和更改

運用 Xshell  客戶端工具連接所在的  oracle  服務器sql

1.先進入數據庫裏面去shell

[root@DBSTANDBY ~]# su - oracle數據庫

[oracle@DBSTANDBY ~]$ sqlplus / as sysdba服務器

SQL*Plus: Release 11.2.0.4.0 Production on 星期二 8月 28 09:30:05 2018oracle

Copyright (c) 1982, 2013, Oracle.  All rights reserved.工具

Connected to:ui

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production日誌

With the Partitioning, OLAP, Data Mining and Real Application Testing optionsit

 

2.查看oracle 歸檔的狀態io

SQL> archive log list;

數據庫日誌模式 非存檔模式 //目前不是歸檔模式

自動存檔 禁用

存檔終點 USE_DB_RECOVERY_FILE_DEST

最先的聯機日誌序列 27711

當前日誌序列 27713

 

3.xshell 新開一個終端 創建新的歸檔日誌存放點。

[root@DBSTANDBY ~]# mkdir -p /u02/oracle/archive/

[root@DBSTANDBY ~]# chown -R oracle:oinstall /u02/*

 

4.修改歸檔日誌位置

SQL> alter system set log_archive_dest_1='location=/u02/oracle/archive/';

System altered.

SQL> commit;

Commit complete.

 

5.關閉數據庫

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

 

6.啓動數據庫至mount 狀態下

SQL> startup mount;

ORACLE instance started.

Total System Global Area 1586708480 bytes

Fixed Size                   2253624 bytes

Variable Size                           973081800 bytes

Database Buffers       603979776 bytes

Redo Buffers                             7393280 bytes

Database mounted.

 

7.啓用歸檔模式

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        /u02/oracle/archive/

Oldest online log sequence     7

Next log sequence to archive   9

Current log sequence                 9

 

SQL> alter system switch logfile;           --更改生效

System altered.

 

SQL> commit;                                                                     --提交

Commit complete.

 

SQL> quit

相關文章
相關標籤/搜索