Thursday, 10 September 2020

Oracle: Clone/Duplicate database from physical standby database

Basic steps:

1.Cancel MRP on Standby database/shutdown/startup(default opens in readonly mode).

2. Include target tns in source tnsnames.ora

3. Prepare target.

  • Listener.ora
  • source and target tns in tnsnames.ora
  • passwd file from source in $ORACLE_HOME/dbs
  • start instance in nomount. (New setup: need to cook init.ora either from source or any other way
  • Verify paths like controlfile/datafile/logfile etc exist.
4. Fire the duplicate command.
-----------------------------------SYNTAX and MISC information------------------------------------------

 Procedure is same as copying from Primary database with minor difference, put physical standby on RO mode.

RO-Read only.

Steps:

1. Configure Listener(to listen for connection) & copy orapwd.

Sample:

LISTENER = 

  (ADDRESS_LIST =

        (ADDRESS=

          (PROTOCOL=IPC)

          (KEY= CloneDB.world)

        )

        (ADDRESS =

          (PROTOCOL = TCP)

         (Host =<CloneDB Host>)

          (Port = <PORT>)

        )

  )

SID_LIST_LISTENER =

  (SID_LIST =

    (SID_DESC =

      (SID_NAME = <CloneDB>)

      (ORACLE_HOME = <Valid Home Path>)

    )

  )

2. Prepare TNS: Both source(Physical Standby) and Destination and init.ora(copy from source and adjust for DB & LOG convert parameters)

Sample:(Format :'Source path','Target Path', ........for each path in source)

*.db_file_name_convert='/u02/ORACLE/dbs','/u001/oradata/db,'/u03/ORACLE/dbs','/u002/oradata/db'

*.log_file_name_convert='/u02/ORACLE/redo','/u003/oradata/db','/u03/ORACLE/redo','/u004/oradata/db'

3. Open Physical standby in RO mode:

a. Cancel recovery.: alter database recover managed standby database cancel;

b. Shutdown immediate.

c. startup (This will open physical standby in RO mode automatically) 

Note : TNS connection entries needed  in tnsnames.ora both side(source/target)

Fireup RMAN:

rman target sys/pwd@<physicalstandby tns>  auxiliary sys/pwd@<DuplicateDB tns>

run

{

allocate channel T1 type disk;

allocate channel T2 type disk;

allocate channel T3 type disk;

allocate channel T4 type disk;

allocate auxiliary channel A1 type disk;

allocate auxiliary channel A2 type disk;

allocate auxiliary channel A3 type disk;

allocate auxiliary channel A4 type disk;

DUPLICATE TARGET DATABASE TO 'sblut1db' FROM ACTIVE DATABASE NOFILENAMECHECK;

Number of channels may help to speedup the duplication process, be aware of load on the system(IO/CPU).

Additional info:

a. if duplicate fails fix the problem, normally would be 'missed' path creation.

b. UNDO tablespace parameter should either same or commented altogether, if different duplication would fail.

 

Tuesday, 21 April 2020

Oracle : RMAN-04014: startup failed: ORA-00600: internal error code, arguments: [kck_rls_check must use (11,0,0,0,0) or lower], [kdt.c], [9576

Error was encountered while duplicating database using backup from source.
RMAN-04014: startup failed: ORA-00600: internal error code, arguments: [kck_rls_check must use (11,0,0,0,0) or lower], [kdt.c], [9576], [11.2.0.2.0]
Solution:
_compression_compatibility='11.2.0.0.0'


Monday, 20 April 2020

Windows10 : Apps missing after reinstall or reset

Tries a ton of thing. Following worked to get store back:

Click xbox->setting or fix option the first screen. click all check boxes



Above bring back store.

Wednesday, 8 April 2020

Oracle: TNS for Primary and Standby Failover & basic tns

TNS for Primary and Standby:: (failover)

PRDmydb =
 (DESCRIPTION =
  (ADDRESS_LIST =
   (FAILOVER=ON)(LOAD_BALANCE=ON)(CONNECT_TIMEOUT=10)(RETRY_COUNT=3)
    (ADDRESS=(PROTOCOL=TCP)(HOST=mydbwldbprd001.int.bellmts.ca)(PORT=6123))
    (ADDRESS=(PROTOCOL=TCP)(HOST=mydbwldbprd002.int.bellmts.ca)(PORT=6123))
   )
    (CONNECT_DATA =(SERVICE_NAME  = prdmydb)(FAILOVER_MODE = (TYPE=SELECT)(METHOD=BASIC))
   )
)


Basic TNS:
dbalias=
(DESCRIPTION=(ADDRESS = (PROTOCOL = TCP)(HOST = uimwldbprd001.int.bellmts.ca)(PORT = 1521))
         (LOAD_BALANCE = on)(CONNECT_DATA =(SERVER = DEDICATED) (SERVICE_NAME = dbservice)))

Tuesday, 28 January 2020

Clone or Recreate DB link or Duplicate with different name


set long 100000 line 100
col DBMS_METADATA.GET_DDL('DB_LINK',DB.DB_LINK,DB.OWNER) for a100
SELECT DBMS_METADATA.GET_DDL('DB_LINK',db.db_link,db.owner) from dba_db_links db;

use with where clause to avoid erroneous pickup.

Monday, 13 January 2020

RMAN-06059: expected archived log not found, loss of archived log compromises recoverability

Fix::

change archivelog all crosscheck;
delete expired archivelog all;


I faced on standby database, newly created