MANAGE ARCHIVED REDOLOGS

1. objective:

 

      copy online redologs to offline desitination

      database recovery

      update standby database

     

2.change redolog mode(archive log mode)

      in oracle 10g    startup mount

                              alter database  archivelog/noarchivelog

      in oracle 9i        startup mount

                               alter database  archivelog/noarchivelog

                               alter system archive log start/stop;

      in oracle 10g, if enable archive log,automatic archving log start also. oracle 9i is not.

  

3.start/stop  automantic archive  at instance startup

    (oracle 9i)

     alter system set log_archive_start=false;

     alter system set log_archive_max_process=5;(maximum 10)

     alter system archive log stop/start

   (ORACLE 10g)

       alter database archivelog manual;

 

4.log archive destination

      log_archive_dest_n(n>=1and n<=10) (oracle 10g)

      log_archive_dumplex_dest=(oracle 9i)

      log_archive_dest=(9i)

 

5.archived log format

     log_archive_format %S%s%T%t

 

6.get archive log information

      archive log list

      v$archived_log;

      v$archive_dest;

      v$log_history;

      select archiver from v$instance;

      select log_mode from v$database;

 

7.archive  dest state

 

   LOG_ARCHIVE_DEST_STATE_n

 ENABLE indicates that the database can use the destination.

DEFER indicates that the location is temporarily disabled.

     ALTERNATE indicates that the destination is an alternate.

 

8.the Mode of Log Transmission

   Normal:In normal transmission mode, the archiving destination is another disk drive of the database server.

   Standby:In standby transmission mode, the archiving destination is either a local or remote standby database.keep your standby database synchronized with your source database by automatically applying transmitted archive logs.

           To transmit files successfully to a standby database, either ARCn or a server process must do the following:

  • Recognize a remote location

  • Transmit the archived logs in conjunction with a remote file server (RFS) process that resides on the remote server

Each ARCn process has a corresponding RFS for each standby destination. For example, if three ARCn processes are archiving to two standby databases, then Oracle Database establishes six RFS connections.

You transmit archived logs through a network to a remote location by using Oracle Net Services. Indicate a remote archival by specifying a Oracle Net service name as an attribute of the destination. Oracle Database then translates the service name, through the tnsnames.ora file, to a connect descriptor. The descriptor contains the information necessary for connecting to the remote database. The service name must have an associated database SID, so that the database correctly updates the log history of the control file for the standby database.

The RFS process, which runs on the destination node, acts as a network server to the ARCn client. Essentially, ARCn pushes information to RFS, which transmits it to the standby database.

The RFS process, which is required when archiving to a remote destination, is responsible for the following tasks:

  • Consuming network I/O from the ARCn process

  • Creating file names on the standby database by using the STANDBY_ARCHIVE_DEST parameter

  • Populating the log files at the remote site

  • Updating the standby database control file (which Recovery Manager can then use for recovery)

  

  

 

9:  in oracle 10g, 

       automatic archive start when change archived log mode

       default archive dest flashrecovery(db_recovery_file_deset) rechive when change archived log mode

       change default archive  alter system set log_archive_dest_1='location=' scope=spfile;

       SQL> alter system set log_archive_dest_1='/oracle/product/9.2.0/arch' scope= spfile;
       alter system set log_archive_dest_1='/oracle/product/9.2.0/arch' scope= spfile
*     第 1 行出现错误:
       ORA-32017: failure in updating SPFILE
       ORA-16179: incremental changes to "log_archive_dest_1" not allowed with SPFILE

       reason: there is no LOCATION or SERVICE key word

       SQL> alter system set log_archive_dest_1='location=/oracle/product/9.2.0/arch' scope=spfile;

            

 

implications of noarchivelog and archivelog

1.in noarchivelog

   if tablespace unaviable,database can not be used immediate.

   we must full database backup(cold backup) in shutdown immediate,for asy.

2. in archivelog

   we must have enough space to hold archived log files.

   we can backup database when it online.

   we can restore database when it open.

    if tablespace unaviable,database can be continuely used.

 

select log_mode from v$database;

 

  • NOARCHIVELOG

  • ARCHIVELOG

  • MANUAL

  

which processes complete archiving logfiles

 

    1.in automatic archive: arcn process

    2.in manual archive: server process 

 

 

你可能感兴趣的:(hive)