Professional Documents
Culture Documents
Gavin Soorma
An HA Wish List .
Recover Faster from media failure reduce unplanned downtime Reduce the cost of inevitable human error Reduce storage and network bandwidth associated with backups Reduce the risk and cost associated with change Perform as many tasks as possible online without planned outages
Snapshot Standby
Updateable standby database created from Physical Standby
Physical Standby >> Snapshot Standby >> Test >>Physical Standby Snapshot Standby is open in read-write mode
Snapshot Standby
DGMGRL> show configuration Configuration Name: gavin Enabled: YES Protection Mode: MaxAvailability Databases: apex - Primary database apexdg - Physical standby database Fast-Start Failover: DISABLED Current status for "gavin": SUCCESS
Snapshot Standby
DGMGRL> convert database 'apexdg' to snapshot standby; Converting database "apexdg" to a Snapshot Standby database, please wait... Database "apexdg" converted successfully
DGMGRL> show configuration
Configuration Name: gavin Enabled: YES Protection Mode: MaxAvailability Databases: apex - Primary database apexdg - Snapshot standby database
Fast-Start Failover: DISABLED Current status for "gavin": SUCCESS
Snapshot Standby
apexdg:/u01/oracle/scripts> export ORACLE_SID=apex apex:/u01/oracle/scripts> sqlplus sh/SH SQL*Plus: Release 11.1.0.6.0 - Production on Fri Sep 19 09:40:55 2008 Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> create table test_redo_apply 2 as select * from all_objects; Table created. SQL> select count(*) from test_redo_apply; COUNT(*) ---------56467
Snapshot Standby
apex:/u01/oracle/scripts> export ORACLE_SID=apexdg apexdg:/u01/oracle/scripts> sqlplus sh/SH SQL*Plus: Release 11.1.0.6.0 - Production on Fri Sep 19 09:33:29 2008 Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> create table test_snapshot 2 as select * from all_objects; Table created. SQL> select count(*) from test_snapshot; COUNT(*) ---------56467
Snapshot Standby
DGMGRL>
Converting database "apexdg" to a Physical Standby database, please wait... Operation requires shutdown of instance "apexdg" on database "apexdg" Shutting down instance "apexdg"... Database closed. Database dismounted. ORACLE instance shut down. Operation requires startup of instance "apexdg" on database "apexdg" Starting instance "apexdg"... ORACLE instance started. Database mounted. Continuing to convert database "apexdg" ... Operation requires shutdown of instance "apexdg" on database "apexdg" Shutting down instance "apexdg"... ORA-01109: database not open Database dismounted. ORACLE instance shut down. Operation requires startup of instance "apexdg" on database "apexdg" Starting instance "apexdg"... ORACLE instance started. Database mounted. Database "apexdg" converted successfully DGMGRL>
Snapshot Standby
apex:/u01/oracle/scripts> sqlplus sh/SH@apex SQL*Plus: Release 11.1.0.6.0 - Production on Fri Sep 19 09:46:17 2008
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> select count(*) from test_snapshot; select count(*) from test_snapshot * ERROR at line 1: ORA-00942: table or view does not exist
Snapshot Standby
apexdg:/u01/oracle/scripts> dgmgrl DGMGRL for IBM/AIX RISC System/6000: Version 11.1.0.6.0 - 64bit Production Copyright (c) 2000, 2005, Oracle. All rights reserved. Welcome to DGMGRL, type "help" for information. DGMGRL> connect sys/oracle Connected. DGMGRL> edit database 'apexdg' set state='apply-off'; Succeeded. DGMGRL> exit
Snapshot Standby
apexdg:/u01/oracle/scripts> sqlplus / as sysdba SQL*Plus: Release 11.1.0.6.0 - Production on Fri Sep 19 09:48:38 2008
Copyright (c) 1982, 2007, Oracle. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL> alter database open read only; Database altered. SQL> conn sh/SH@apexdg Connected. SQL> select count(*) from test_redo_apply; COUNT(*) ---------56467
Part of the 11g Support Workbench and can be run in reactive as well as manual mode
SQL*Plus: Release 11.1.0.6.0 - Production on Fri Sep 19 10:03:34 2008 Copyright (c) 1982, 2007, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select count(*) from test_redo_apply; select count(*) from test_redo_apply * ERROR at line 1: ORA-01116: error in opening database file 6 ORA-01110: data file 6: '/u02/oradata/apex/example01.dbf' ORA-27041: unable to open file IBM AIX RISC System/6000 Error: 2: No such file or directory Additional information: 3
ADVISE FAILURE;
List of Database Failures ========================= Failure ID Priority Status Time Detected Summary ---------- -------- --------- ------------- ------162 HIGH OPEN 19-SEP-08 One or more non-system datafiles are missing analyzing automatic repair options; this may take some time allocated channel: ORA_SBT_TAPE_1 channel ORA_SBT_TAPE_1: SID=107 device type=SBT_TAPE Mandatory Manual Actions ======================== no manual actions available Optional Manual Actions ======================= 1. If file /u02/oradata/apex/example01.dbf was unintentionally renamed or moved, restore it Automated Repair Options ======================== Option Repair Description ------ -----------------1 Restore and recover datafile 6 Strategy: The repair includes complete media recovery with no data loss Repair script: /u01/oracle/diag/rdbms/apex/apex/hm/reco_1541621723.hm
Strategy: The repair includes complete media recovery with no data loss Repair script: /u01/oracle/diag/rdbms/apex/apex/hm/reco_1541621723.hm ... ... sql statement: alter database datafile 6 offline Starting restore at 19-SEP-08 using channel ORA_SBT_TAPE_1 using channel ORA_DISK_1 channel ORA_SBT_TAPE_1: starting datafile backup set restore channel ORA_SBT_TAPE_1: specifying datafile(s) to restore from backup set channel ORA_SBT_TAPE_1: restoring datafile 00006 to /u02/oradata/apex/example01.dbf channel ORA_SBT_TAPE_1: reading from backup piece 76jqvhr1_1_1 channel ORA_SBT_TAPE_1: piece handle=76jqvhr1_1_1 tag=TAG20080919T090744 channel ORA_SBT_TAPE_1: restored backup piece 1 channel ORA_SBT_TAPE_1: restore complete, elapsed time: 00:01:05 Finished restore at 19-SEP-08 Starting recover at 19-SEP-08 using channel ORA_SBT_TAPE_1 using channel ORA_DISK_1
NAME -------------------------------TIME_DETECTED --------------------------------------------------------------------------DESCRIPTION -------------------------------------------------------------------------------DAMAGE_DESCRIPTION -------------------------------------------------------------------------------Missing datafile 19-SEP-08 10.10.14.474095 AM Datafile 6: '/u02/oradata/apex/example01.dbf' is missing Some objects in tablespace EXAMPLE might be unavailable
RMAN Enhancements
Network-enabled Database Duplication A clone database on a remote site can now be easily created directly over the network with the enhanced DUPLICATE command without existing backups. Reduces DBA time and effort and eliminates the storage capacity required at the remote site for the copy. Optimized Undo backup
Reduced overall backup time and storage by not backing up undo that applies to transactions that have already been committed.
RMAN Enhancements
Creation and Recovery of Long-Term Backups Improved Long-term backups created with the KEEP option only back up the archive logs needed to make the backup consistent. No further archive log backups are retained. Multisection Backups - Parallel Backup and Restore for Very Large Files Improves the performance of backups and restores of very large data files by parallelizing the workload for each file by dividing the data file into sub sections.
Adding new columns with DEFAULT values and NOT NULL constraint no longer requires the default value to be stored in all existing records.
Enables a schema modification in sub-seconds and independent of the existing data volume, it also consumes no space
1 row created.
description
); 2
VARCHAR2(50)
3 ALTER TABLE lock_tab ADD ( * ERROR at line 1: ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
COUNT(*) ---------101580
SQL>
SQL> 2
set timing on alter table myobjects add (new_column varchar2(3) default 'YES' not null);
Table altered.
Elapsed: 00:00:31.68
sql
SQL*Plus: Release 11.1.0.6.0 - Production on Thu Oct 2 10:14:09 2008 Copyright (c) 1982, 2007, Oracle. All rights reserved. Connected to: Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options SQL>
set timing on alter table myobjects add (new_column varchar2(3) default 'YES' not null);
00:00:00.93
SQL> create table test_dependency 2 (col_a varchar2(10), col_b varchar2(10)); Table created. SQL> create view test_dependency_vw 2 as select col_a from test_dependency; View created. SQL> alter table test_dependency add (col_c varchar2(10)); Table altered. SQL> select status from user_objects where object_name='TEST_DEPENDENCY_VW'; STATUS ------INVALID
Flashback Enhancements
Block Recovery can now be performed from the Flashback Logs on disk.
Reduces recovery time by potentially eliminating time consuming restores from tape to repair a few corrupt blocks. Information Life Cycle management using Flashback Data Archives Guaranteed retention of historical and archived data No need to rely on UNDO tablespace data retention policies Flashback Data archive stored in a tablespace and contains transactional changes to every record in a table Flashback Transaction can easily back out a transaction and its dependent transactions. DBMS_FLASHBACK.TRANSACTION_BACKOUT() procedure rolls back a transaction and its dependent transactions while the database remains online.
6 rows selected.
SQL> BEGIN DBMS_FLASHBACK.transaction_backout (numtxns xids options END; / 2 3 4 5 6 BEGIN * ERROR at line 1: ORA-55504: Transaction conflicts in NOCASCADE ORA-06512: at "SYS.DBMS_FLASHBACK", line 37 ORA-06512: at "SYS.DBMS_FLASHBACK", line 70 ORA-06512: at line 2
mode
Pre 11g, temporary transient failures (cable disconnect) will cause disk to be dropped from disk group straight away.
ASM would rebalance the disk group after dropping the disk rebalance again after adding disk once problem is rectified Rebalancing operations increases I/O significantly. ASM attribute disk_repair_time now provides a window for repair disk is dropped if this window expires default 3.6 hours After disk is online, only extents that have been marked as modified need to be rebalanced after failed disk joins disk group.
Once the disk is available, only the changed extents are written to resynchronize the disk, rather than overwriting the contents of the entire disk
Parses ASM fixed tables and views to get information on disk and failure group configuration, templates and alias directory structure
ASMCMD> md_backup b asm_metadata g data ASMCMD> md_restore b asm_metadata t full g data
Miscellaneous
Online Patching ASM Rolling Upgrade from 10g R2 to 11g
SQL Repair Advisor repair SQL statements causing ORA-600s by providing a customised SQL patch after recompiling and reexecuting SQL statement
QUESTIONS ANSWERS