Check Log Mode
SQL>
select dbid,name from v$database;
select log_mode ,
OPEN_MODE , DATABASE_ROLE
from v$database;
--DataGuard
select
SWITCHOVER_STATUS , PROTECTION_MODE , PROTECTION_LEVEL
from v$database;
DBID NAME
---------- ---------
1438520397 ORCL
SQL> 2
LOG_MODE OPEN_MODE DATABASE_ROLE
------------ --------------------
----------------
NOARCHIVELOG MOUNTED PRIMARY
SQL> SQL> 2
SWITCHOVER_STATUS PROTECTION_MODE PROTECTION_LEVEL
--------------------
-------------------- --------------------
NOT ALLOWED MAXIMUM
PERFORMANCE UNPROTECTED
---------- ---------
1438520397 ORCL
SQL> 2
LOG_MODE OPEN_MODE DATABASE_ROLE
------------ --------------------
----------------
NOARCHIVELOG MOUNTED PRIMARY
SQL> SQL> 2
SWITCHOVER_STATUS PROTECTION_MODE PROTECTION_LEVEL
--------------------
-------------------- --------------------
NOT ALLOWED MAXIMUM
PERFORMANCE UNPROTECTED
How to change an Oracle database to noarchivelog mode
================================================
SQL> alter
database mount;
Database altered.
SQL> alter database
noarchivelog;
Database altered.
SQL> alter database open;
Database altered.
================================================
How to change an Oracle database to noarchivelog mode
================================================
SQL> alter
database mount;
Database altered.
SQL> alter database
noarchivelog;
Database altered.
SQL> alter database open;
Database altered.
================================================
SQL> alter
database mount;
Database altered.
SQL> alter database
noarchivelog;
Database altered.
SQL> alter database open;
Database altered.
================================================
How to change an Oracle database to archivelog mode
SQL> SELECT LOG_MODE FROM V$DATABASE;
LOG_MODE
------------
NOARCHIVELOG
SQL>
select force_logging from v$database;
FOR
---
NO
1 開啟Archive log mode
1.設定archive log
destination
SQL> alter system set
log_archive_dest_1='LOCATION=/oradata/archivelog'
scope=both;
System altered.
SQL>
2.重啟資料庫於mount
SQL> startup force mount ;
ORACLE instance started.
Total System Global Area 409194496 bytes
Fixed Size 2213856 bytes
Variable Size 272631840 bytes
Database
Buffers 130023424 bytes
Redo Buffers 4325376 bytes
Database mounted.
SQL>
3.開啟archive log mode
SQL> alter
database archivelog;
Database altered.
4.確認資料庫歸檔模式
SQL> archive log list
Database log
mode Archive Mode
Automatic archival Enabled
Archive destination
/oradata/archivelog
Oldest online log sequence 8
Next log sequence to
archive 10
Current log sequence 10
SQL> SELECT
LOG_MODE FROM V$DATABASE;
LOG_MODE
------------
ARCHIVELOG
logging
SQL>
select force_logging from v$database;
FOR
---
NO
SQL>
alter
database force logging;
Database altered.
SQL>
select
force_logging from v$database;
FOR
---
YES
SQL>
沒有留言:
張貼留言