ARCHIVELOG or NOARCHIVELOG

(To be or not to be) http://www.data-glob.com/samples/ArchivelogNoArchivelog.htm

 

 

Table of Contents

ARCHIVELOG or NOARCHIVELOG.. 1

NOARCHIVELOG U ARCHIVELOG.. 1

Dodati lokaciju arhive (Alter System ili  pfile) 1

Promeniti mod rada baze. 1

Napraviti jedan arhivski log. 2

Gde se nalazi log?. 4

Promena destinacije arhivskih logova. 4

ARCHIVELOG U NOARCHIVELOG.. 5

Obrisati lokaciju arhive (Alter System ili  pfile) 5

Promeniti mod rada baze. 5

 

 

NOARCHIVELOG U ARCHIVELOG

Dodati lokaciju arhive (Alter System ili  pfile)

 

create pfile='c:\external\pfile1.txt' from spfile;

 

Dodati u pfile npr:

*.log_archive_dest_1='location=C:\external\arch\ mandatory'

ili

SQL> alter system set  LOG_ARCHIVE_DEST_1 = "LOCATION=USE_DB_RECOVERY_FILE_DEST" –-direktna promena parametra

SQL> show parameter LOG_ARCHIVE_DEST_1

 

NAME                                 TYPE        VALUE

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

log_archive_dest_1                   string      LOCATION=USE_DB_RECOVERY_FILE_DEST

Promeniti mod rada baze

 

SQL> shutdown immediate;

SQL> startup pfile='c:\external\pfile1.txt' mount

ili

SQL> startup mount

ORACLE instance started.

 

Total System Global Area 1369579520 bytes

Fixed Size                  2439352 bytes

Variable Size             671090504 bytes

Database Buffers          687865856 bytes

Redo Buffers                8183808 bytes

Database mounted.

SQL> alter database archivelog;

 

Database altered.

 

SQL> alter database open;

SQL> create spfile from pfile='c:\external\pfile1.txt'; --ukoliko je potrebno

 

Database altered.

 

SQL> select  LOG_MODE from v$database;

 

LOG_MODE

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

ARCHIVELOG

 

Napraviti jedan arhivski log

 

SQL> alter system switch logfile;

 

 

--alert log prikaz komandi

Completed: ALTER DATABASE   MOUNT

Wed Jan 06 16:24:44 2016

alter database archivelog

Completed: alter database archivelog

alter database open

Starting background process TMON

Wed Jan 06 16:24:53 2016

TMON started with pid=22, OS id=96920

Wed Jan 06 16:24:53 2016

LGWR: STARTING ARCH PROCESSES

Starting background process ARC0

Wed Jan 06 16:24:54 2016

ARC0 started with pid=24, OS id=92196

ARC0: Archival started

LGWR: STARTING ARCH PROCESSES COMPLETE

Wed Jan 06 16:24:56 2016

Thread 1 opened at log sequence 318

  Current log# 2 seq# 318 mem# 0: D:\APP\DARKOJ\ORADATA\ORCLD\REDO02.LOG

Successful open of redo thread 1

Wed Jan 06 16:24:56 2016

MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set

Wed Jan 06 16:24:55 2016

ARC0: STARTING ARCH PROCESSES

Starting background process ARC1

Wed Jan 06 16:24:56 2016

ARC1 started with pid=26, OS id=69464

Wed Jan 06 16:24:56 2016

SMON: enabling cache recovery

Starting background process ARC2

Wed Jan 06 16:24:57 2016

ARC2 started with pid=27, OS id=81092

Wed Jan 06 16:24:57 2016

[96436] Successfully onlined Undo Tablespace 2.

Undo initialization finished serial:0 start:1055546273 end:1055547006 diff:733 ms (0.7 seconds)

Verifying file header compatibility for 11g tablespace encryption..

Verifying 11g file header compatibility for tablespace encryption completed

Wed Jan 06 16:24:57 2016

SMON: enabling tx recovery

Wed Jan 06 16:24:57 2016

Database Characterset is AL32UTF8

No Resource Manager plan active

Starting background process ARC3

Wed Jan 06 16:24:58 2016

ARC3 started with pid=28, OS id=95056

Wed Jan 06 16:24:59 2016

replication_dependency_tracking turned off (no async multimaster replication found)

Wed Jan 06 16:24:58 2016

ARC1: Archival started

Wed Jan 06 16:24:59 2016

ARC2: Archival started

Wed Jan 06 16:24:59 2016

ARC2: Becoming the 'no FAL' ARCH

ARC2: Becoming the 'no SRL' ARCH

Wed Jan 06 16:24:59 2016

ARC1: Becoming the heartbeat ARCH

Starting background process SMCO

Wed Jan 06 16:25:00 2016

SMCO started with pid=29, OS id=87328

Wed Jan 06 16:25:00 2016

ARC3: Archival started

ARC0: STARTING ARCH PROCESSES COMPLETE

Starting background process AQPC

Wed Jan 06 16:25:01 2016

AQPC started with pid=30, OS id=10896

Wed Jan 06 16:25:19 2016

Opening pdb PDB$SEED (2) with no Resource Manager plan active

Wed Jan 06 16:25:22 2016

db_recovery_file_dest_size of 11264 MB is 74.18% used. This is a

user-specified limit on the amount of space that will be used by this

database for recovery-related files, and does not reflect the amount of

space available in the underlying filesystem or ASM diskgroup.

Starting background process CJQ0

Wed Jan 06 16:25:29 2016

CJQ0 started with pid=36, OS id=88976

Completed: alter database open

Wed Jan 06 16:29:43 2016

Thread 1 advanced to log sequence 319 (LGWR switch)

  Current log# 3 seq# 319 mem# 0: D:\APP\DARKOJ\ORADATA\ORCLD\REDO03.LOG

Wed Jan 06 16:29:45 2016

Archived Log entry 276 added for thread 1 sequence 318 ID 0xbe2c43c1 dest 1:

 

Gde se nalazi log?

 

U direktorijumu:

d:\app\darkoj\fast_recovery_area\orcld\ARCHIVELOG\2016_01_06 (primer pretrzivanja sa komandne linije)

 

d:\app\darkoj>dir  "*.ARC" /S   

 Volume in drive D is New Volume

 Volume Serial Number is 1372-99FB

 

 Directory of d:\app\darkoj\fast_recovery_area\orcld\ARCHIVELOG\2016_01_06

 

06-Jan-16  16:29        40,729,088 O1_MF_1_318_C8TDQ7V2_.ARC

               1 File(s)     40,729,088 bytes

 

     Total Files Listed:

               1 File(s)     40,729,088 bytes

 

Promena destinacije arhivskih logova

 

 

SQL> alter system set log_archive_dest_1= "LOCATION=D:\app\darkoj\fast_recovery_area\orcld\ARCHIVELOG mandatory";

 

SQL> show parameter log_archive_dest_1

 

NAME                                 TYPE        VALUE

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

log_archive_dest_1                   string      location= D:\app\darkoj\fast_recovery_area\orcld\ARCHIVELOG mandatory

log_archive_dest_10                  string

 

Uraditi još jedan archlog

 

SQL> alter system switch logfile;

 

Proveriti da li arhiva postoji:

SQL> !dir D:\app\darkoj\fast_recovery_area\orcld\ARCHIVELOG

Directory of D:\app\darkoj\fast_recovery_area\orcld\ARCHIVELOG

 

06-Jan-16  16:49    <DIR>          .

06-Jan-16  16:49    <DIR>          ..

06-Jan-16  16:42    <DIR>          2016_01_06

06-Jan-16  16:49            61,952 ARC0000000320_0828916422.0001

 

 

ARCHIVELOG U NOARCHIVELOG

 

 

Obrisati lokaciju arhive (Alter System ili  pfile)

 

create pfile='c:\external\pfile1.txt' from spfile;

 

Obrisati iz pfile navdenu liniju (ako postoji, npr):

*.log_archive_dest_1='location=C:\external\arch\ mandatory'

 

ili

 

SQL> alter system set  LOG_ARCHIVE_DEST_1 = ''; –-direktna promena parametra

 

Promeniti mod rada baze

 

 

SQL> shutdown immediate

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> startup mount

ORACLE instance started.

 

Total System Global Area 1369579520 bytes

Fixed Size                  2439352 bytes

Variable Size             671090504 bytes

Database Buffers          687865856 bytes

Redo Buffers                8183808 bytes

Database mounted.

SQL> alter database noarchivelog;

 

Database altered.

 

SQL> alter database open;

 

Database altered.

 

SQL> select LOG_MODE from v$database;

 

LOG_MODE

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

NOARCHIVELOG

 

SQL> create spfile from pfile='c:\external\pfile1.txt';   --ako ste menjali pfile

 

 

--alert log

Wed Jan 06 15:50:24 2016

ALTER DATABASE   MOUNT

Wed Jan 06 15:50:28 2016

Successful mount of redo thread 1, with mount id 3262068544

Wed Jan 06 15:50:28 2016

Database mounted in Exclusive Mode

Lost write protection disabled

Ping without log force is disabled.

Completed: ALTER DATABASE   MOUNT

Wed Jan 06 15:51:57 2016

alter database noarchivelog

Completed: alter database noarchivelog

alter database open

Starting background process TMON

Wed Jan 06 15:52:07 2016

TMON started with pid=22, OS id=96672

Wed Jan 06 15:52:07 2016

Thread 1 opened at log sequence 318

  Current log# 2 seq# 318 mem# 0: D:\APP\DARKOJ\ORADATA\ORCLD\REDO02.LOG

Successful open of redo thread 1

Wed Jan 06 15:52:07 2016

MTTR advisory is disabled because FAST_START_MTTR_TARGET is not set

Wed Jan 06 15:52:07 2016

SMON: enabling cache recovery

Wed Jan 06 15:52:08 2016

[97600] Successfully onlined Undo Tablespace 2.

Undo initialization finished serial:0 start:1053576869 end:1053577353 diff:484 ms (0.5 seconds)

Verifying file header compatibility for 11g tablespace encryption..

Verifying 11g file header compatibility for tablespace encryption completed

Wed Jan 06 15:52:08 2016

SMON: enabling tx recovery

Starting background process SMCO

Wed Jan 06 15:52:08 2016

SMCO started with pid=25, OS id=97384

Wed Jan 06 15:52:08 2016

Database Characterset is AL32UTF8

No Resource Manager plan active

replication_dependency_tracking turned off (no async multimaster replication found)

Starting background process AQPC

Wed Jan 06 15:52:11 2016

AQPC started with pid=27, OS id=97872

Wed Jan 06 15:52:27 2016

Opening pdb PDB$SEED (2) with no Resource Manager plan active

Wed Jan 06 15:52:32 2016

db_recovery_file_dest_size of 11264 MB is 74.18% used. This is a

user-specified limit on the amount of space that will be used by this

database for recovery-related files, and does not reflect the amount of

space available in the underlying filesystem or ASM diskgroup.

Starting background process CJQ0

Wed Jan 06 15:52:35 2016

CJQ0 started with pid=32, OS id=97508

Completed: alter database open