Create an archive directory manually and adjust the Oracle startup mode. Set Oracle to archive Mode Manually create an archive directory on the master server $ CD $ oracle_base # The Directory pointed to by $ oracle_base is/opt/Oracle/. For details, see the specific settings of Oracle user environment variables. $ Mkdir-P oradata/szdb/archive # specify the szdb directory name based on the database Sid. In fact, this directory can be specified arbitrarily. $ Mkdir-P oradata/szdb/standbyarchive # This directory is created if the master server may act as a backup server [Oracle @ cqcncdb szdb] $ sqlplus/nolog SQL> Conn/As sysdba; Connected. SQL> startup Mount; SQL> alter database archivelog; SQL> archive log start; SQL> archive log list; SQL> alter database open; SQL> alter system set log_archive_dest_1 = 'location =/Oracle/oradata/szdb/archive '; #/Oracle/oradata/szdb/archive must be the same path as the previous mkdir-P oradata/szdb/archive operation. SQL> alter system set log_archive_format = '% T _ % S. dbf' scope = spfile; SQL> alter system set log_archive_start = true scope = spfile; Restart the database to make the modification take effect. SQL> shutdown immediate; View archiving Mode SQL> startup SQL> archive log list; Database Log mode archive Mode Automatic Archival Enabled Archive destination/Oracle/oradata/szdb/archive Oldest online log sequence 565 Next log sequence to archive 567 Current Log sequence 567 The preceding alter system set operation adds the following parameters to the spfile@sid.ora and init@sid.ora files of the database: *. Log_archive_dest_1 = 'location =/Oracle/oradata/szdb/archive' *. Log_archive_format = '% T _ % S. dbf' *. Log_archive_start = true Note: The folder defined by *. log_archive_dest_1 must exist and the Oracle user has the write permission. Note: @ Sid indicates the actual SID number of the database. For example, in this actual operation, the two file names are spfileszdb. ora and initszdb. ora. If you need to stop the archive mode, use: Alter database noarchivelog command. SQL> shutdown immediate; SQL> startup Mount; SQL> alter database noarchivelog; SQL> alter database open; SQL> archive log list;
|