Skip to main content

Snapshot db 10g

Testing A Physical Standby Database In Oracle 10g

If you don’t want to deal with missteps, I recommend that you test your standby database to facilitate the failover or switchover process.

This procedure is very useful when you have physical standby databases for testing and other purposes that require read-write access to the standby database. Also, it improves your checklist in the event of an error or disaster.

By using Snapshot standby databases, redo data is not applied until you convert the snapshot standby database back into a physical standby database, and after all local updates to the snapshot standby database are discarded.

Requirements

The following requirements need to be met in order to create a snapshot standby.

The Data Guard environment (a primary and a physical standby) needs to be Oracle 10.2.0.1 version or higher.The Primary and Standby databases need to be in archivelog mode (this is a default requirement for Data Guard).Force logging should be set to TRUE (to avoid no-logging operations).Flash Recovery Area (FRA) is required on the standby database to implement a Flashback database.The Primary and standby are in sync at the time of the test, or the gap between primary and physical standby is nominal.

Activation Of The Standby

On The Standby Database

Stop dataguard brokers on standby:
SQL> alter system set dg_broker_start=FALSE
Get the SCN
SQL> select current_scn from v$database;Cancel the managed recovery
:SQL> alter database recover managed standby database cancel;
Create the restore point.A restore point can be specified such that it guarantees the database can be recovered to a particular point-in-time and eliminates the need to manually record an SCN or timestamp to use with the Flashback database and Flashback table operations:SQL> create restore point TEST_NEW_FEATURE guarantee flashback database;Now confirm the scn from restore point:
SQL> col name form a40;
SQL> select scn, time, name from v$restore_point where name = 'TEST_NEW_FEATURE';

Prepare The Primary

Archive logsWhen using the standby redo logs, this step is essential to ensure that the database can be properly flashed back to the restore point.
SQL> alter system archive log current;
SQL> alter system switch logfile;
SQL> alter system switch logfile;Stop shipment of logs
SQL> alter system set log_archive_dest_state_2=DEFER

Activate The Physical Standby

Activation of the standby:
SQL> alter database activate standby database; SQL> startup mount force;
SQL> alter database set standby database to maximize performance; (This is used in case you have not set it before)
SQL> alter database open;disable log_archive_dest_2 (this will prevent archive logs being sent to primary):SQL> alter system set log_archive_dest_state_2=DISABLE;

Time For Testing

Once the standby database has been activated, it is a full-blown production system. You may run reports, test new code, or create objects. Remember that any results stored in the activated database will be lost when the database is flashed back to before activation time.. If you need to save the results, they must be copied or exported out of the activated database before flashing it back.

Revert The Snapshot Database To Physical Standby

After testing is completed, you need to resynchronize the activated database with the primary database.

Flashback to the restore point:
SQL> STARTUP MOUNT FORCE;
SQL> FLASHBACK DATABASE TO RESTORE POINT TEST_NEW_FEATURE;
SQL> ALTER DATABASE CONVERT TO PHYSICAL STANDBY;
SQL> ALTER SYSTEM SET DG_BROKER_START=TRUE;
SQL> STARTUP MOUNT FORCE;Re-enable log shipping on the primaryEnable shipment:
SQL> alter system set log_archive_dest_state_2=ENABLETo re-enable log shipping on the standby, enable this parameter:
SQL> alter system set log_archive_dest_state_2=ENABLECheck dgmgrl configurationDGMGRL> show configuration verbose;
Current status for “xxx”:
SUCCESS
DGMGRL> enable configuration (if not success)

A status of data guard configuration successful indicates the success of the procedures.

On Oracle Database 11g, you can use the Data Guard command-line interface (DGMGRL), Oracle Active Data Guard, and the OEM interface. In my next blog I’ll describe the equivalent procedures on 11g.

Comments

Popular posts from this blog

Hard dependency with ip address Oracle RAC Cluster.

Command error out due to hard dependency with ip address [-Node1]/app/grid/oracle/product/11.2.0/grid/bin>./crsctl relocate resource RDBMS_DB -n Node2 CRS-2527: Unable to start 'RDBMS_DB' because it has a 'hard' dependency on 'sDB' CRS-2525: All instances of the resource 'sDB' are already running; relocate is not allowed because the force option was not specified CRS-4000: Command Relocate failed, or completed with errors. [-Node1]/app/grid/oracle/product/11.2.0/grid/bin>./crsctl relocate resource sDB  -n Node2 CRS-2529: Unable to act on 'DB' because that would require stopping or relocating 'LISTENER_DB', but the force option was not specified CRS-4000: Command Relocate failed, or completed with errors. [-Node1]/app/grid/oracle/product/11.2.0/grid/bin>./crsctl relocate resource LISTENER_DB  -n Node2 CRS-2527: Unable to start 'LISTENER_DB' because it has a 'hard' dependency on 'sD...

19C NID ( Rename Database)

 [oracle@localhost ~]$ nid DBNEWID: Release 19.0.0.0.0 - Production on Thu Dec 23 00:05:36 2021 Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved. Keyword     Description                    (Default) ---------------------------------------------------- TARGET      Username/Password              (NONE) DBNAME      New database name              (NONE) LOGFILE     Output Log                     (NONE) REVERT      Revert failed change           NO SETNAME     Set a new database name only   NO APPEND      Append to output log           NO HELP        Displays these messages    ...

ORA-01017/ORA-28000 with AUDIT_TRAIL

With default profile in Oracle 11g, accounts are automatically locked 1 day ( PASSWORD_LOCK_TIME ) after 10 failed login attempt ( FAILED_LOGIN_ATTEMPTS ): SQL > SET lines 200 SQL > SET pages 200 SQL > SELECT * FROM dba_profiles WHERE PROFILE = 'DEFAULT' ORDER BY resource_name; PROFILE                         RESOURCE_NAME                      RESOURCE LIMIT ------------------------------ -------------------------------- -------- ---------------------------------------- DEFAULT                         COMPOSITE_LIMIT                 ...