Enormous acount of archive log produced for inserts
Hi there,
This is my first post on a forum ever. I have set up a test database that we will be installing on a customer site soon. One table is going to be very large (about 520 million rows). It is partitioned by range (on date) 53 ways (one for every week of the year + 1). I have written a PL/SQL script to load the table with about 1 million rows but I am baffled by the amount of archive log produced. Here is the PL/SQL script :
declare
TYPE hash_a IS TABLE OF VARCHAR2(15) INDEX BY VARCHAR(15);
TYPE array_a IS TABLE OF VARCHAR2(15) INDEX BY PLS_INTEGER;
min_to_meid hash_a;
min_array array_a;
temp VARCHAR2(20);
begin_time TIMESTAMP(0);
end_time TIMESTAMP(0);
begin
-- Initialise
FOR i IN 1..3000 LOOP
temp := TO_CHAR(6162500000 + i);
min_array(i) := temp;
-- Convert to hex char :
SELECT TO_CHAR(130791510000+i, 'xxxxxxxxx') INTO min_to_meid(temp) FROM DUAL;
END LOOP;
SELECT SYSTIMESTAMP INTO begin_time FROM DUAL;
begin_time := begin_time - interval '1' year;
end_time := begin_time + interval '1' minute;
FOR i IN 1..365 LOOP
FOR j IN 1..3000 LOOP
INSERT INTO SESSIONTAB (ms_msid, session_type, start_time, finish_time, call_type, error_type, cm_instance, term_state)
VALUES (min_array(j), 21, begin_time, end_time, 'OTAPA', 0, 1, 'ok');
END LOOP;
begin_time := begin_time + interval '1' day;
end_time := end_time + interval '1' day;
END LOOP;
end;
Essentially it is putting 3000 entries for each day into the table. Each partition increases in size by about 2,5MB -- ie 130MB in total. Yet the amount of archive log produced is crazy -- about 1GB (and that is multiplexed two ways meaning 2GB appear on disk!). All tablespaces for the table and its indexes are LOGGING. Surely this amount is excessive though? Any ideas what is going on??
Thanks for getting back so quickly.
Here are the index creation statements :
rem #--
rem # Indexes for sessiontab
rem #--
CREATE INDEX session_ms_msid_index ON sessiontab(ms_msid) LOCAL;
CREATE INDEX session_device_id_index ON sessiontab(device_id) LOCAL;
CREATE INDEX session_new_ms_msid_index ON sessiontab(new_ms_msid) LOCAL;
CREATE INDEX session_new_mdn_index ON sessiontab(new_mdn) LOCAL;
And here is the table creation. Note that the partition there is a hack. The real partitions are created later in this sql script. As you can see there are quite a few indexes, and as they are local they reside in each partitions tablespace. The only index that resides in its own tablespace is the primary key index. As I understand it, changing the tablespace to NOLOGGING wouldn't make a difference anyway because insert statements always cause redo logs to be written to.
rem #---
rem # Session Table
rem #---
CREATE TABLE sessiontab (
record_id number(38),
ms_msid VARCHAR2(15) NOT NULL,
session_type NUMBER(3) NOT NULL,
start_time TIMESTAMP(0) NOT NULL,
finish_time TIMESTAMP(0) NOT NULL,
call_type CHAR(5) NOT NULL,
error_type NUMBER(3) NULL,
error_data NUMBER(3) NULL,
sms_acc_den_reason NUMBER(2) NULL,
otaf_id VARCHAR2(32) NULL,
cm_instance NUMBER(2) NULL,
term_state VARCHAR2(64) NOT NULL,
trn CHAR(8) NULL,
activation_ms_msid VARCHAR2(15) NULL,
csc_id VARCHAR2(64) NULL,
msc_addr VARCHAR2(12) NULL,
mdn VARCHAR2(15) NULL,
device_id VARCHAR2(15) NULL,
msc_id NUMBER(8) NULL,
job_id NUMBER(10) NULL,
nam_download CHAR(1) NULL,
succ_name CHAR(1) NULL,
new_ms_msid VARCHAR2(15) NULL,
new_mdn VARCHAR2(15) NULL,
home_sid_changed CHAR(1) NULL,
old_home_sid NUMBER(5) NULL,
new_home_sid NUMBER(5) NULL,
sspr_download CHAR(1) NULL,
old_prl_id NUMBER(5) NULL,
new_prl_id NUMBER(5) NULL,
sspr_p_rev NUMBER(5) NULL,
unlocked_phone CHAR(1) NULL,
old_spc CHAR(6) NULL,
changed_spc CHAR(1) NULL,
new_spc CHAR(6) NULL,
generated_akey CHAR(1) NULL,
ssd_updated CHAR(1) NULL,
re_auth CHAR(1) NULL,
succ_ms_commit CHAR(1) NULL,
succ_akey_commited CHAR(1) NULL,
succ_spasm CHAR(1) NULL,
succ_spasm_init CHAR(1) NULL,
succ_welcom_msg CHAR(1) NULL,
extra0 VARCHAR2(64) NULL,
extra1 VARCHAR2(64) NULL,
extra2 VARCHAR2(64) NULL,
CONSTRAINT sessiontab_pk PRIMARY KEY (record_id) USING INDEX TABLESPACE sessiontab_indexes
PARTITION BY RANGE (start_time)(
PARTITION DEFAULT_PART VALUES LESS THAN (TO_DATE('31/12/2000','DD/MM/YYYY'))
);
Similar Messages
-
Are archived logs useful for crashed instance?
when the machine powers off,and start it again,the database will experience instance recover,will this kind of recover use archived log£¿I see if the database worked under unarchive mod before,then instance recover will not use archived log(no archived log).
surpose that oracle makes a commit,and the commited
data are already written into log file,but are not
written back to datafile,and if the log file is
archived,at this time OS crash.when oracle startup again
it will user the online redo,and some of the latest
archvied log to recover the committed data.and if the
archvied log accidentally lost,how can oracle recovery.
Or oracle will not reuse the online redo log until
its data are written back to the datafile under archived
log mod? -
Two copies archive logs with only one defined
Hi,
On a 11g database, I have only got flash_recovery_area defined. When switched into archive log mode, I have expected only one copy of archive logs produced in the defined USE_DB_RECOVERY_FILE_DEST location, but there is another copy generated as well under $ORACLE_HOME/dbs directory. How to explain that? and how to DISABLE the second copy to be produced?
Thanks for any help
Zhuang Li
PS: more info
In spfile:
orcl.__java_pool_size=50331648
orcl.__large_pool_size=16777216
orcl.__oracle_base='/usr/oracle11g'#ORACLE_BASE set from environment
orcl.__pga_aggregate_target=1828716544
orcl.__sga_target=1056964608
orcl.__shared_io_pool_size=0
orcl.__shared_pool_size=654311424
orcl.__streams_pool_size=0
*.audit_file_dest='/usr/oracle11g/admin/orcl/adump'
*.audit_trail='db'
*.compatible='11.1.0.0.0'
*.control_file_record_keep_time=30
*.control_files='/db/orcl1/control0^@^@C^AC"^@^@^@^@^@^C^@^@^@^@^@^@^A^D{^S^@^@1.ctl','/db/orcl1/control02.ctl',
'/db/orcl1/control03.ctl'
*.db_block_size=8192
*.db_domain=''
*.db_name='orcl'
*.db_recovery_file_dest='/usr/oracle11g/flash_recovery_area'
*.db_recovery_file_dest_size=6442450944
*.diagnostic_dest='/usr/oracle11g'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclXDB)'
*.job_queue_processes=5
*.open_cursors=300
*.pga_aggregate_target=1824522240
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_max_size=1258291200#internally adjusted
*.sga_target^@^@C^AC"^@^@^@^@^@^D^@^@^@^@^@^@^A^DCS^@^@=1056964608
*.undo_tablespace='UNDOTBS1'
==============================
SQL> select destination from V$ARCHIVE_DEST;
DESTINATION
/usr/oracle11g/R1/dbs/arch
USE_DB_RECOVERY_FILE_DEST
10 rows selected.
SQL> SQL> archive log lis
SP2-0718: illegal ARCHIVE LOG option
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Oldest online log sequence 2549
Next log sequence to archive 2551
Current log sequence 2551
SQL>
===================
SQL> show parameter archive
NAME TYPE VALUE
archive_lag_target integer 0
log_archive_config string
log_archive_dest string
log_archive_dest_1 string
log_archive_dest_10 string
log_archive_dest_2 string
log_archive_dest_3 string
log_archive_dest_4 string
log_archive_dest_5 string
log_archive_dest_6 string
log_archive_dest_7 string
log_archive_dest_8 string
log_archive_dest_9 string
log_archive_dest_state_1 string enable
log_archive_dest_state_10 string enable
log_archive_dest_state_2 string enable
log_archive_dest_state_3 string enable
log_archive_dest_state_4 string enable
log_archive_dest_state_5 string enable
log_archive_dest_state_6 string enable
log_archive_dest_state_7 string enable
log_archive_dest_state_8 string enable
log_archive_dest_state_9 string enable
log_archive_duplex_dest string
log_archive_format string %t_%s_%r.dbf
log_archive_local_first boolean TRUE
log_archive_max_processes integer 4
log_archive_min_succeed_dest integer 1
log_archive_start boolean FALSE
log_archive_trace integer 0
standby_archive_dest string ?/dbs/archThis is the way 11g install sets up the archive destination intially after creating the database using DBA.
What you can do is to go to the Recovery Settings in Enterprise Manager. You would notice that Archive Log Destination number 1 is set to usr/oracle11g/R1/dbs/arch while number 10 is set to USE_DB_RECOVERY_FILE_DEST
Remove the entry for Number 1 (leave it blank). Apply the settings. This will force Oracle to only log to flash_recovery_area.
<br>
Oracle Database FAQs
</br> -
Question about Archive Log Deletion policy
I've a problem to understand the Archive Log Deletion policy, and I I'd like to this problem explain with the following example.
Messages of the database are in German, but I guess you'll understand them.
SQL> startup
ORACLE-Instance hochgefahren.
Total System Global Area 5344731136 bytes
Fixed Size 2129240 bytes
Variable Size 2684355240 bytes
Database Buffers 2617245696 bytes
Redo Buffers 41000960 bytes
Datenbank mounted.
Datenbank geöffnet.
SQL> archive log list
Datenbank-Log-Modus Archive-Modus
Automatische Archivierung Aktiviert
Archivierungsziel E:\oracle\thetis_iv\arch
Älteste Online-Log-Sequenz 17917
Nächste zu archivierende Log-Sequenz 17919
Aktuelle Log-Sequenz 17919
SQL> alter system switch logfile;
System wurde geändert.I created a brand new archive log.
SQL> exit
Verbindung zu Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options beendet
D:\OracleDB\product\11.1.0\db_1\BIN>dir E:\oracle\thetis_iv\arch
Datenträger in Laufwerk E: ist Volume
Volumeseriennummer: 3EBD-77E5
Verzeichnis von E:\oracle\thetis_iv\arch
06.04.2011 15:04 <DIR> .
06.04.2011 15:04 <DIR> ..
06.04.2011 15:04 17.137.152 ARC17919_0721667907.001
1 Datei(en), 17.137.152 Bytes
2 Verzeichnis(se), 41.073.258.496 Bytes freiand this is the only archive log in the directory. Now I start rman:
D:\OracleDB\product\11.1.0\db_1\BIN>rman target / catalog rmanrepo@rmanrepo
Recovery Manager: Release 11.1.0.7.0 - Production on Mi Apr 6 15:05:35 2011
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Mit Ziel-Datenbank verbunden: ENTWIV (DBID=21045568)
Kennwort für Recovery-Katalog-Datenbank:
Verbindung mit Datenbank des Recovery-Katalogs
RMAN> show all;
RMAN-Konfigurationsparameter für Datenbank mit db_unique_name ENTWIV sind:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 1 DAYS;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEFAULT DEVICE TYPE TO 'SBT_TAPE';
CONFIGURE CONTROLFILE AUTOBACKUP OFF;
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE DISK TO 'E:\oracle\thetis_iv\backup\CF_%F_ENTWIV.ORA';
CONFIGURE CONTROLFILE AUTOBACKUP FORMAT FOR DEVICE TYPE SBT_TAPE TO '%F'; # default
CONFIGURE DEVICE TYPE SBT_TAPE PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
CONFIGURE DATAFILE BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE SBT_TAPE TO 1; # default
CONFIGURE ARCHIVELOG BACKUP COPIES FOR DEVICE TYPE DISK TO 1; # default
CONFIGURE CHANNEL DEVICE TYPE 'SBT_TAPE' PARMS 'ENV=(TPDO_OPTFILE=D:\Services\Tivoli\TSM\AgentOBA64\tpdo.opt)';
CONFIGURE MAXSETSIZE TO UNLIMITED; # default
CONFIGURE ENCRYPTION FOR DATABASE OFF; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES128'; # default
CONFIGURE COMPRESSION ALGORITHM 'BZIP2'; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 2 TIMES TO 'SBT_TAPE';
CONFIGURE SNAPSHOT CONTROLFILE NAME TO 'D:\ORACLEDB\PRODUCT\11.1.0\DB_1\DATABASE\SNCFENTWIV.ORA'; # defaultThe archive log deletion policy says the the logfiles have to be backed up for two times before they get deleted.
Now I backup all archive logs, that havn't been backed up for at least two times.
RMAN> run { backup archivelog all not backed up 2 times
2> format '%d_AR_%Y%M%D_%s_%t'
3> tag 'ARCHIVE LOGS'
4> DELETE ALL INPUT;
5> }
Starten backup um 06.04.2011 15:08:01
Aktuelles Log archiviert
Zugewiesener Kanal: ORA_SBT_TAPE_1
Kanal ORA_SBT_TAPE_1: SID=253 Device-Typ=SBT_TAPE
Kanal ORA_SBT_TAPE_1: Data Protection for Oracle: version 5.5.1.0
Kanal ORA_SBT_TAPE_1: Backup Set für Archive Log wird begonnen
Kanal ORA_SBT_TAPE_1: Archive Logs in Backup Set werden angegeben
Eingabe-Archive-Log-Thread=1 Sequence=17919 RECID=147 STAMP=747759899
Eingabe-Archive-Log-Thread=1 Sequence=17920 RECID=148 STAMP=747760081
Kanal ORA_SBT_TAPE_1: Piece 1 wird auf 06.04.2011 15:08:02 begonnen
Kanal ORA_SBT_TAPE_1: Piece 1 auf 06.04.2011 15:08:09 beendet
Piece Handle=ENTWIV_AR_20110406_23_747760082 Tag=ARCHIVE LOGS Kommentar=API Version 2.0,MMS Version 5.5.1.0
Kanal ORA_SBT_TAPE_1: Backup Set vollstõndig, abgelaufene Zeit: 00:00:08
Kanal ORA_SBT_TAPE_1: Archive Logs werden gel÷scht
Archive Log-Dateiname=E:\ORACLE\THETIS_IV\ARCH\ARC17919_0721667907.001 RECID=147 STAMP=747759899
Archive Log-Dateiname=E:\ORACLE\THETIS_IV\ARCH\ARC17920_0721667907.001 RECID=148 STAMP=747760081
Beendet backup um 06.04.2011 15:08:10
RMAN> exit
Recovery Manager abgeschlossen.
D:\OracleDB\product\11.1.0\db_1\BIN> dir E:\oracle\thetis_iv\arch
Datenträger in Laufwerk E: ist Volume
Volumeseriennummer: 3EBD-77E5
Verzeichnis von E:\oracle\thetis_iv\arch
06.04.2011 15:08 <DIR> .
06.04.2011 15:08 <DIR> ..
0 Datei(en), 0 Bytes
2 Verzeichnis(se), 41.090.396.160 Bytes freirman deleted all archive logs, even I they are on tape only once by now.
Thats not what I expected. Where is my mistake?Hi,
I do new tests it's very strange.
BACKUP ARCHIVELOG command is not obeying the policy of archivelog.
You can open a SR on MOS. (to check bugs)
I reproduce the same test and the result was the same, it seems that this is a bug.
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 2 TIMES TO DISK;
RMAN> backup archivelog all not backed up 2 times delete all input;
Starting backup at 06-APR-11
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=15 RECID=16 STAMP=747753711
input archived log thread=2 sequence=20 RECID=17 STAMP=747753714
input archived log thread=1 sequence=16 RECID=19 STAMP=747753729
input archived log thread=2 sequence=21 RECID=18 STAMP=747753729
channel ORA_DISK_1: starting piece 1 at 06-APR-11
channel ORA_DISK_1: finished piece 1 at 06-APR-11
piece handle=+DATA/orcl/backupset/2011_04_06/annnf0_tag20110406t132210_0.304.747753731 tag=TAG20110406T132210 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
archived log file name=+DATA/orcl/archivelog/2011_04_06/thread_1_seq_15.293.747753711 RECID=16 STAMP=747753711
archived log file name=+DATA/orcl/archivelog/2011_04_06/thread_2_seq_20.295.747753715 RECID=17 STAMP=747753714
archived log file name=+DATA/orcl/archivelog/2011_04_06/thread_1_seq_16.294.747753729 RECID=19 STAMP=747753729
archived log file name=+DATA/orcl/archivelog/2011_04_06/thread_2_seq_21.298.747753729 RECID=18 STAMP=747753729
Finished backup at 06-APR-11
RMAN> list archivelog all;
specification does not match any archived log in the repositoryOracle Docs Says:
The BACKUP ARCHIVELOG ... DELETE INPUT command deletes archived log files after they are backed up.
This command eliminates the separate step of manually deleting archived redo logs.
With DELETE INPUT, RMAN deletes only the specific copy of the archived log chosen for the backup set.
With DELETE ALL INPUT, RMAN deletes each backed-up archived redo log file from all log archiving destinations.
As explained in "Configuring an Archived Redo Log Deletion Policy",
the BACKUP ... DELETE INPUT and DELETE ARCHIVELOG commands obey the archived redo log deletion policy
for logs in all archiving locations. For example, if you specify that logs should only be deleted when backed
up at least twice to tape, then BACKUP ... DELETE honors this policy.http://download.oracle.com/docs/cd/E11882_01/backup.112/e10642/rcmbckba.htm#BRADV89524
But in ours case it's not honors this policy.
Only with the FORCE command should this happen. But it is not our case.
Oracle Docs:
If FORCE is not specified on the deletion commands,
then these deletion commands obey the archived log deletion policy.
If FORCE is specified, then the deletion commands ignore the archived log deletion policy.http://download.oracle.com/docs/cd/E11882_01/backup.112/e10643/rcmsynta010.htm#RCMRF113
Alternatively you can do the following:
Set the commands separately.
Check this:
RMAN> run {
2> backup archivelog all not backed up 2 times ;
3> delete archivelog all backed up 2 times to disk;
4> }
Starting backup at 06-APR-11
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=2 sequence=22 RECID=21 STAMP=747755128
input archived log thread=1 sequence=17 RECID=20 STAMP=747755127
channel ORA_DISK_1: starting piece 1 at 06-APR-11
channel ORA_DISK_1: finished piece 1 at 06-APR-11
piece handle=+DATA/orcl/backupset/2011_04_06/annnf0_tag20110406t134528_0.295.747755129 tag=TAG20110406T134528 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 06-APR-11
released channel: ORA_DISK_1
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=78 instance=orcl1 device type=DISK
RMAN-08138: WARNING: archived log not deleted - must create more backups
archived log file name=+DATA/orcl/archivelog/2011_04_06/thread_1_seq_17.298.747755127 thread=1 sequence=17
RMAN-08138: WARNING: archived log not deleted - must create more backups
archived log file name=+DATA/orcl/archivelog/2011_04_06/thread_2_seq_22.294.747755129 thread=2 sequence=22
RMAN>Edited by: Levi Pereira on Apr 6, 2011 1:35 PM -
I am sort of new to RMAN, I've been playing with it for a while but that's about as far as I've taken it. My question is does RMAN automatically backup any archive logs needed for recovery when I run "backup database" command or do I have to issue "backup database plus archive log" in order to insure recovery.
Backup database also backups archivelogs.No,it does not. From documentation:
backup database;
Creates a backup set (AS BACKUPSET) or group of image copies (AS COPY) for all datafiles in the database. If generating a backup set, then RMAN can include only datafiles and control files: it cannot include archived redo logs.
Werner -
Hi All,
We have 10g R2 database running on RHEL 4 OS. In order to set the archive log mode for the database, if we set only log_archive_dest_n parameter is only enough or we have to set db_recovery_file_dest_size and db_recovery_file_dest also? i know that these 2 parameters are required to configure the flash_recovery_area. my doubt is whether, do we need to set flash_recovery_area parameters and log_archive_dest_n parameters to take backup of databases or set only the log_archive_dest_n parameter and enable archive log mode and take backup using RMAN?
Thanks,
Praveen.Hi,
To use RMAN to take a hot backup you need only set LOG_ARCHIVE_DEST_n and place the database in archive log mode. RMAN can be used to backup changed data even after a nologging operation, and you can move away from archivelog mode.
http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10726/configbp.htm
There is also the new "block change tracking" B&R that does not need archivelog mode:
http://www.dba-oracle.com/t_block_change_tracking.htm -
Data Warehouse Archive logging questions
Hi all,
I'd like some opinions/advice on archive logging and OWB 10.2 with a 10.2 database.
Do you use archive logging on your non-production OWB instances? I have a development system that only has "on demand" backups done and the archive logs fill frequently. In this scenario, should I disable archive logging? I realize that this limits my recovery options to cold backups but on a development environment, this seems sufficient for me. Would I be messing up any OWB features by turning off archive logging?
For production instances, how large do you make your archive log (as a percentage of your total DW size perhaps)?
How do you manage them? With Flash recovery areas? Manually? RMAN or other tools?
Thanks in Advance,
MikeUsualy, I don't set any DW tables to log. Since it's a data warehouse, I believe it's better to make cold backups. In some cases, ETL Mappings may work like backup procedures themselves.
In OWB, select the object you need (table or index) to create. Right-click it, select Configuration -> Performance Parameters -> Logging Mode -> NOLOGGING
Flash RecoveryDon't think it's going to help you, since most of your data manipulation is based on batch jobs.
RMANIf you want to make hot backups, this is something that can really help you manage backup procedures.
ManuallyMaybe... Why not?
I don't take hot backups from DW databases. I prefer to take cold backups. In a recovery scenario, you restore the cold backup and if it's 3 days late, I execute the ETL mappings for the last 3 days.
Regards,
Marcos -
How does one name an Archive Log file in ARC%S_%R.%T format
Hallo!I have been trying to enable Archive Log mode for the Oracle 10g database.
In OEM,I went via the links Maintenance->Recovery Settings->Media Recovery
There,a text box by the name Log Archive Filename Format requires one to name the Archive Log file in ARC%S_%R.%T format.
I have tried several times to name the Archive log e.g ARC001_001.001 but when I shutdown and restart the database instance,the error below appears
ORA-19905: log_archive_format must contain %s, %t and %r.
This error has proved impossible to rectify and I am forced to uninstall then re-install Oracle 10g.
I would like to have back-ups in archive log mode.Please give me the best way to name the Archive Log file i.e with an example name so that I can have online back-ups.
Thanks.Hi,
If you try to change the LOG_ARCHIVE_FORMAT to something other than the default %s,%t,%r, it will fail
Perform as the below steps in order to enable archive log mode
SQL>create pfile from spfile
SQL>create pfile='c:\temp\init.ora' from spfile;
SQL>created;
SQL>shutdown immediate;
edit the init.ora file by adding the following information
*.LOG_ARCHIVE_DEST_1='LOCATION=C:\db\archive1'
*.LOG_ARCHIVE_FORMAT='%t_%s_%r.dbf'
Start the DB with modified pfile.
- Pavan Kumar N
Edited by: Pavan Kumar on May 2, 2010 2:17 PM -
Import performance and archive logs
Well we are working on Oracle 10 R2 on Solaris.
During import (impdp) its generating huge volume of archive logs.
Our database size is in terabytes.
How to stop the archive log generation during import or atleast minimize the generation ??Hello,
If you can restart your database then you may set your database in NOARCHIVELOG mode.
Then, after the import is finished, you'll have to set back your database in ARCHIVELOG mode (you'll need to restart again the database).
Afterwards, you'll have to Backup your database.
Else, without changing the Archive mode of the database, you can Backup and compress your archived "logs".
For instance, with RMAN:
connect target /
backup
as compressed backupset
device type disk
tag 'BKP_ARCHIVE'
archivelog all not backed up
delete all input;
exit;By that way you'll save space on disk.
Hope this help.
Best regards,
Jean-Valentin -
Change the location of Archive Logs on standby Server
Can somebody tell me the process how to change the archive logs location for the standby by server. e.g. Its going now to location C:\stby\archives and I want to send it to E:\stby\archives
ThxHi,
Change the STANDBY SPFILE/PFILE Value of <b>standby_archive_dest=E:\stby\archives</b>
see this
http://download.oracle.com/docs/cd/B10501_01/server.920/a96653/init_params.htm#84366
HTH
Regards! -
Archive log / nologging/ direct path insert
Could you please confirm if following are true or correct me if my understanding is wrong:
1 ) Archive log mode and LOGGING is needed to deal with media recovery; it was not needed for instance recovery.
2) IF insert is in NO APPEND mode , redo is generated even if table is in nologging mode and database is in noachive log mode. This redo is needed for instance recovery.
3) Direct path insert skips undo generation and may skip redo generation if the object is in nologging mode.
Thanks.
In case if it is relevant , I am using Oracle 11.2.0.3.1) Yes, Archive logs are needed for media recovery.
2 and 3) Even if the table is in nologging mode , it generates little bit of redo for index maintenance and dictionary data. Upon a restart from a failure - Oracle will read the online redo logs and replay any transaction it finds in there. That is the "roll forward" bit. The binary redo information is used to replay everything that did not get written to the datafiles. This replay included regenerating the UNDO information (UNDO is protected by redo).
After the redo has been applied, the database is typically available for use now - and the rollback phase begins. For any transaction that was being processed when the instance failed - we need to undo its changes, roll it back. We do that by processing the undo for all uncommitted transactions.
The database is now fully recovered.
Also read he following link
http://docs.oracle.com/cd/B19306_01/server.102/b14220/startup.htm
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5280714813869 -
Shell script for archive log transfer
hi
I dont want to reinvent the wheel.
I am looking for shell script for log shipping to provide standby db.
What I want to do is, get the last applied archived log number from alert.log
Copy the files from archive destination according to this value.
CheersIf you don't want to re-invent the wheel you use Dataguard, no scripts.
And your script should use the dictionary, instead of some bs method to read the alert.
v$archived_log has all information!
Also as far as I know, the documentation describes manual standby.
So apparently you not only don't want to reinvent the wheel, but you want the script on a silver plate on your doorstep!
Typical attitude of most DBAs here. Use OTN for a permanent vacation.
Sybrand Bakker
Senior Oracle DBA -
Two entries for each archive log in v$archived_log
Hi,
I have noticied that there are two entries for each archive log. Why this is so...?
I have fired following command.
==================
set pages 300
set lines 120
ALTER SESSION SET nls_date_format='DD-MON-YYYY HH24:MI:SS';
SELECT sequence#, first_time, next_time
FROM v$archived_log
ORDER BY sequence#;
==================
output is as follows.
==================
1436 24-FEB-2012 00:04:09 24-FEB-2012 08:24:21
1436 24-FEB-2012 00:04:09 24-FEB-2012 08:24:21
1437 24-FEB-2012 08:24:21 24-FEB-2012 15:45:01
1437 24-FEB-2012 08:24:21 24-FEB-2012 15:45:01
1438 24-FEB-2012 15:45:01 24-FEB-2012 15:45:04
1438 24-FEB-2012 15:45:01 24-FEB-2012 15:45:04
1439 24-FEB-2012 15:45:04 24-FEB-2012 15:45:57
1439 24-FEB-2012 15:45:04 24-FEB-2012 15:45:57
1440 24-FEB-2012 15:45:57 24-FEB-2012 17:26:41
1440 24-FEB-2012 15:45:57 24-FEB-2012 17:26:41
1441 24-FEB-2012 17:26:41 24-FEB-2012 18:40:07
1441 24-FEB-2012 17:26:41 24-FEB-2012 18:40:07
1442 24-FEB-2012 18:40:07 24-FEB-2012 19:36:17
1442 24-FEB-2012 18:40:07 24-FEB-2012 19:36:17
1443 24-FEB-2012 19:36:17 24-FEB-2012 19:36:18
1443 24-FEB-2012 19:36:17 24-FEB-2012 19:36:18
==================
Regards
DBA.I have noticied that there are two entries for each archive log. Why this is so...?Mseberg already mentioned.. little in detail as below
Check for the name column in v$archived_log,
One location refers to Local destination LOG_ARCHIVE_DEST_1
Other location refers to your standby/DR location, But it will shows you only service name instead of full archive name.
select dest_id,name from v$archived_log where name is not null and completion_time like '%24%FEB%'
DEST_ID NAME
1 +ORAARCHIVE/prod1/archivelogs/arch_0001_0671689302_0000240097.arc
2 (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=sldb1srv)(POR
T=9101)))(CONNECT_DATA=(SERVICE_NAME=prod_sldb1srv_XPT)(INSTANCE_N
AME=prod1)(SERVER=dedicated)))Edited by: CKPT on Feb 24, 2012 8:26 PM -
Oracle recommended location for archive logs in oracle 10g rac
Hello All,
We would like to know the oracle recommended location for the archive logs in oracle10g RAC .we are using ASM.
Thanks...user4487322 wrote:
thanks. Is it the recommended setting ,if we go for a DR setup?I mean archive logs in ASM.If you can use dataguard, the archivelog copy to the standby system would be handled by Oracle and it supports ASM.
Just remember, what ever your strategy, the archivelogs must be in a SHARED location (where all nodes can read/write to this location.) -
"recover database until cancel" asks for archive log file that do not exist
Hello,
Oracle Release : Oracle 10.2.0.2.0
Last week we performed, a restore and then an Oracle recovery using the recover database until cancel command. (we didn't use backup control files) .It worked fine and we able to restart the SAP instances. However, I still have questions about Oracle behaviour using this command.
First we restored, an online backup.
We tried to restart the database, but got ORA-01113,ORA-01110 errors :
sr3usr.data1 needed media recovery.
Then we performed the recovery :
According Oracel documentation, "recover database until cancel recovery" proceeds by prompting you with the suggested filenames of archived redo log files.
The probleme is it prompts for archive log file that do not exist.
As you can see below, it asked for SMAarch1_10420_610186861.dbf that has never been created. Therefore, I cancelled manually the recovery, and restarted the database. We never got the message "media recovery complete"
ORA-279 signalled during: ALTER DATABASE RECOVER LOGFILE '/oracle/SMA/oraarch/SMAarch1_10417_61018686
Fri Sep 7 14:09:45 2007
ALTER DATABASE RECOVER LOGFILE '/oracle/SMA/oraarch/SMAarch1_10418_610186861.dbf'
Fri Sep 7 14:09:45 2007
Media Recovery Log /oracle/SMA/oraarch/SMAarch1_10418_610186861.dbf
ORA-279 signalled during: ALTER DATABASE RECOVER LOGFILE '/oracle/SMA/oraarch/SMAarch1_10418_61018686
Fri Sep 7 14:10:03 2007
ALTER DATABASE RECOVER LOGFILE '/oracle/SMA/oraarch/SMAarch1_10419_610186861.dbf'
Fri Sep 7 14:10:03 2007
Media Recovery Log /oracle/SMA/oraarch/SMAarch1_10419_610186861.dbf
ORA-279 signalled during: ALTER DATABASE RECOVER LOGFILE '/oracle/SMA/oraarch/SMAarch1_10419_61018686
Fri Sep 7 14:10:13 2007
ALTER DATABASE RECOVER LOGFILE '/oracle/SMA/oraarch/SMAarch1_10420_610186861.dbf'
Fri Sep 7 14:10:13 2007
Media Recovery Log /oracle/SMA/oraarch/SMAarch1_10420_610186861.dbf
Errors with log /oracle/SMA/oraarch/SMAarch1_10420_610186861.dbf
ORA-308 signalled during: ALTER DATABASE RECOVER LOGFILE '/oracle/SMA/oraarch/SMAarch1_10420_61018686
Fri Sep 7 14:15:19 2007
ALTER DATABASE RECOVER CANCEL
Fri Sep 7 14:15:20 2007
ORA-1013 signalled during: ALTER DATABASE RECOVER CANCEL ...
Fri Sep 7 14:15:40 2007
Shutting down instance: further logons disabled
When restaring the database we could see that, a recovery of online redo log has been performed automatically, is it the normal behaviour of a recovery using "recover database until cancel" command ?
Started redo application at
Thread 1: logseq 10416, block 482
Fri Sep 7 14:24:55 2007
Recovery of Online Redo Log: Thread 1 Group 4 Seq 10416 Reading mem 0
Mem# 0 errs 0: /oracle/SMA/origlogB/log_g14m1.dbf
Mem# 1 errs 0: /oracle/SMA/mirrlogB/log_g14m2.dbf
Fri Sep 7 14:24:55 2007
Completed redo application
Fri Sep 7 14:24:55 2007
Completed crash recovery at
Thread 1: logseq 10416, block 525, scn 105140074
0 data blocks read, 0 data blocks written, 43 redo blocks read
Thank you very much for your help.
Frod.Hi,
Let me answer your query.
=======================
Your question: While performing the recovery, is it possible to locate which online redolog is needed, and then to apply the changes in these logs
1. When you have current controlfile and need complete data (no data loss),
then do not go for until cancel recovery.
2. Oracle will apply all the redologs (including current redolog) while recovery
process is on.
3. During the recovery you need to have all the redologs which are listed in the view V$RECOVERY_LOG and all the unarchived and current redolog. By querying V$RECOVERY_LOG you can find out about the redologs required.
4. If the required sequence is not there in the archive destination, and if recovery process asks for that sequence you can query V$LOG to see whether requested sequence is part of the online redologs. If yes you can mention the path of the online redolog to complete the recovery.
Hope this information helps.
Regards,
Madhukar
Maybe you are looking for
-
My company had a 3rd party develop a flash mini site that has had some issues with loading external swf files. When asked about it they said there is an issue with a flash movie loading any file with a capital letter in the name such as "BikeTire.swf
-
Cannot ssh, Permission Denied
Very odd. Cannot SSH into a Mac Pro (10.6.7) on my network Can ping the box at it's IP Also cannot see this Mac in ARD I have Remote Login and Remote Management enabled for All Users I thought it may be "Firewall" being on (which in the past will blo
-
ChaRM security control on action
Hi, In the correction process, we have Developer to set a correction into 'in development' status & have Change Manager to set this correction into 'to be tested' status. There are two actions between status 'in development' & to be tested'. They ar
-
WMS - check capacity = 2
Hello all: on configuration of WMS > master data> storage type : check capacity =2? how the system work?
-
I have an iPhone 3Gs, 16Gb that for the past couple months won't complete a backup. Backing up, the phone prepares for backup for about 1-2 minutes then backup begins. It reaches about, maybe 10% progress in about 5 minutes then essentially freezes.