Convertir una instancia de Oracle primaria a standby

Categorías:

Para convertir una instancia de oracle primaria a standby usamos los siguientes comandos…

Verificamos el estado de la instancia

[oracle@correo: glpi2 [~]  14:21:11 $ sq

SQL*Plus: Release 11.2.0.4.0 Production on Sat May 8 14:23:05 2021

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> SELECT database_role FROM v$database;

DATABASE_ROLE
----------------
PRIMARY

SQL>

Procedemos a bajar la instancia

SQL> shutdown immediate; 
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>

Arrancamos la instancia de la siguiente manera

SQL> STARTUP MOUNT
ORACLE instance started.

Total System Global Area 1870647296 bytes
Fixed Size		    2254304 bytes
Variable Size		  503319072 bytes
Database Buffers	 1358954496 bytes
Redo Buffers		    6119424 bytes
Database mounted.
SQL>

La siguiente sentencia le indica a oracle que cambie el rol de la instancia

SQL> ALTER DATABASE CONVERT TO PHYSICAL STANDBY;

Database altered.

SQL>

Bajamos la instancia

SQL> shutdown immediate; 
ORA-01507: database not mounted


ORACLE instance shut down.
SQL>

De nuevo , iniciamos la instancia

SQL> startup 
ORACLE instance started.

Total System Global Area 1870647296 bytes
Fixed Size		    2254304 bytes
Variable Size		  503319072 bytes
Database Buffers	 1358954496 bytes
Redo Buffers		    6119424 bytes
Database mounted.
Database opened.
SQL>

Y verificamos que el rol se haya cambiado…

SQL> SELECT database_role FROM v$database;

DATABASE_ROLE
----------------
PHYSICAL STANDBY

SQL>

Esto es todo…..