Oracle:归档模式
Log:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
[oracle@ora12c ~]$ env | grep SID ORACLE_SID=atlas [oracle@ora12c ~]$ ps -ef | grep ora_ oracle 47194 46048 0 22:53 pts/1 00:00:00 grep ora_ [oracle@ora12c ~]$ [oracle@ora12c ~]$ sqlplus / as sysdba SQL*Plus: Release 12.1.0.2.0 Production on Thu Nov 13 22:53:25 2014 Copyright (c) 1982, 2014, Oracle. All rights reserved. Connected to an idle instance. SQL> startup mount; ORACLE instance started. Total System Global Area 1140850688 bytes Fixed Size 2923584 bytes Variable Size 771752896 bytes Database Buffers 352321536 bytes Redo Buffers 13852672 bytes Database mounted. SQL> SQL> archive log list; Database log mode No Archive Mode Automatic archival Disabled Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 235 Current log sequence 238 SQL> SQL> alter database archivelog; Database altered. SQL> archive log list; Database log mode Archive Mode Automatic archival Enabled Archive destination USE_DB_RECOVERY_FILE_DEST Oldest online log sequence 235 Next log sequence to archive 238 Current log sequence 238 SQL> SQL> alter database open; Database altered. SQL> show parameter db_recovery_file_dest NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_recovery_file_dest string /oradata/fast_recovery_area db_recovery_file_dest_size big integer 4815M SQL> SQL> col member for a68 SQL> set linesize 400 SQL> SQL> run 1* select a.group#,a.member,b.status,b.archived,sum(b.bytes)/1024/1024 mbytes from v$logfile a,v$log b where a.group#=b.group# group by a.group#,a.member,b.status,b.archived order by 1,2 GROUP# MEMBER STATUS ARC MBYTES ---------- -------------------------------------------------------------------- ---------------- --- ---------- 1 /oradata/ATLAS/onlinelog/o1_mf_1_b5cyjr0s_.log CURRENT NO 50 1 /oradata/fast_recovery_area/ATLAS/onlinelog/o1_mf_1_b5cyjrgf_.log CURRENT NO 50 2 /oradata/ATLAS/onlinelog/o1_mf_2_b5cyjs6t_.log INACTIVE YES 50 2 /oradata/fast_recovery_area/ATLAS/onlinelog/o1_mf_2_b5cyjsoj_.log INACTIVE YES 50 3 /oradata/ATLAS/onlinelog/o1_mf_3_b5cyjt8v_.log ACTIVE YES 50 3 /oradata/fast_recovery_area/ATLAS/onlinelog/o1_mf_3_b5cyjvkg_.log ACTIVE YES 50 4 /oradata/ATLAS/onlinelog/redo04b.log ACTIVE YES 50 4 /oradata/fast_recovery_area/ATLAS/onlinelog/redo04a.log ACTIVE YES 50 8 rows selected. SQL> alter system switch logfile; System altered. SQL> select a.group#,a.member,b.status,b.archived,sum(b.bytes)/1024/1024 mbytes from v$logfile a,v$log b where a.group#=b.group# group by a.group#,a.member,b.status,b.archived order by 1,2; GROUP# MEMBER STATUS ARC MBYTES ---------- -------------------------------------------------------------------- ---------------- --- ---------- 1 /oradata/ATLAS/onlinelog/o1_mf_1_b5cyjr0s_.log ACTIVE YES 50 1 /oradata/fast_recovery_area/ATLAS/onlinelog/o1_mf_1_b5cyjrgf_.log ACTIVE YES 50 2 /oradata/ATLAS/onlinelog/o1_mf_2_b5cyjs6t_.log ACTIVE YES 50 2 /oradata/fast_recovery_area/ATLAS/onlinelog/o1_mf_2_b5cyjsoj_.log ACTIVE YES 50 3 /oradata/ATLAS/onlinelog/o1_mf_3_b5cyjt8v_.log CURRENT NO 50 3 /oradata/fast_recovery_area/ATLAS/onlinelog/o1_mf_3_b5cyjvkg_.log CURRENT NO 50 4 /oradata/ATLAS/onlinelog/redo04b.log ACTIVE YES 50 4 /oradata/fast_recovery_area/ATLAS/onlinelog/redo04a.log ACTIVE YES 50 8 rows selected. SQL> SQL> show parameter log_archive_dest_1 NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ log_archive_dest_1 string log_archive_dest_10 string log_archive_dest_11 string log_archive_dest_12 string log_archive_dest_13 string log_archive_dest_14 string log_archive_dest_15 string log_archive_dest_16 string log_archive_dest_17 string log_archive_dest_18 string log_archive_dest_19 string SQL> SQL> alter system set log_archive_dest_1='location=/oradata/archive_data' scope=both; System altered. SQL> show parameter log_archive_dest_1 NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ log_archive_dest_1 string location=/oradata/archive_data log_archive_dest_10 string log_archive_dest_11 string log_archive_dest_12 string log_archive_dest_13 string log_archive_dest_14 string log_archive_dest_15 string log_archive_dest_16 string log_archive_dest_17 string log_archive_dest_18 string log_archive_dest_19 string SQL> SQL> show parameter log_archive_dest_state_1 NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ log_archive_dest_state_1 string enable log_archive_dest_state_10 string enable log_archive_dest_state_11 string enable log_archive_dest_state_12 string enable log_archive_dest_state_13 string enable log_archive_dest_state_14 string enable log_archive_dest_state_15 string enable log_archive_dest_state_16 string enable log_archive_dest_state_17 string enable log_archive_dest_state_18 string enable log_archive_dest_state_19 string enable SQL> SQL> alter system switch logfile; System altered. SQL> |
查看文件系统中的状态:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
[root@ora12c ~]# ls -altr /oradata/fast_recovery_area/ATLAS/archivelog/2014_11_13/ total 1120 drwxr-x--- 6 oracle oinstall 4096 Nov 13 22:27 .. -rw-r----- 1 oracle oinstall 988160 Nov 13 22:55 o1_mf_1_238_b69kl5ds_.arc -rw-r----- 1 oracle oinstall 14848 Nov 13 22:55 o1_mf_1_239_b69kmycn_.arc -rw-r----- 1 oracle oinstall 122880 Nov 13 22:56 o1_mf_1_240_b69kotg7_.arc drwxr-x--- 2 oracle oinstall 4096 Nov 13 22:56 . [root@ora12c ~]# [root@ora12c ~]# ls -altr /oradata/fast_recovery_area/ATLAS/archivelog/2014_11_13/ total 1124 drwxr-x--- 6 oracle oinstall 4096 Nov 13 22:27 .. -rw-r----- 1 oracle oinstall 988160 Nov 13 22:55 o1_mf_1_238_b69kl5ds_.arc -rw-r----- 1 oracle oinstall 14848 Nov 13 22:55 o1_mf_1_239_b69kmycn_.arc -rw-r----- 1 oracle oinstall 122880 Nov 13 22:56 o1_mf_1_240_b69kotg7_.arc -rw-r----- 1 oracle oinstall 4096 Nov 13 22:57 o1_mf_1_241_b69kphd5_.arc drwxr-x--- 2 oracle oinstall 4096 Nov 13 22:57 . [root@ora12c ~]# [oracle@ora12c archive_data]$ pwd /oradata/archive_data [oracle@ora12c archive_data]$ ls -altr total 8 drwxr-xr-x 5 oracle oinstall 4096 Nov 13 22:49 .. drwxr-xr-x 2 oracle oinstall 4096 Nov 13 22:49 . [oracle@ora12c archive_data]$ ls -altr total 16 drwxr-xr-x 5 oracle oinstall 4096 Nov 13 22:49 .. -rw-r----- 1 oracle oinstall 7680 Nov 13 23:08 1_250_862594328.dbf drwxr-xr-x 2 oracle oinstall 4096 Nov 13 23:08 . [oracle@ora12c archive_data]$ |
——————————————————————
Ending。
不小心进来看看,楼主网站速度嗷嗷的~~