Monday, July 31, 2017

How to copy Oracle Home from one host to other

Topic:

How to copy Oracle Home from one host to other.  


Source oracle home:

Tar source oracle home by using below:
tar -cvf home_11g.tar <ORACLE_HOME>
Move tar file to target database server.

Target Home:
Untar copied tar file using below.
tar -xvf home_11g.tar -C <ORACLE_HOME>

Once untar completes invoke runInstaller as mentioned below.

$ORACLE_HOME/oui/bin/runInstaller -clone ORACLE_BASE="/11g/app/ormsm6p1/oracle/" ORACLE_HOME="/11g/app/ormsm6p1/oracle/product/11.2.0.3" ORACLE_HOME_NAME="ormsm6p1_home"

Note : ORACLE_HOME and ORACLE_BASE are for the new database server.

How to troubleshoot OEM agent software unavailability

Topic :

Below document provides steps to update software in OEM(Oracle Enterprise Manager) OMS(Oracle Managed Services) repository .




Steps:

Goto OMS Location in OMS server ( Host : xxxxxxxxxxx.com).


env   (get OMS location from this command)

cd /app/oracle/em12cOMS/oms
cd bin

Login as sys user like sysman.


./emcli login -username=sysman
./emcli login -username=naresh


Sample Output:


[oracle@nh1grp01 bin]$ ./emcli login -username=naresh
Enter password

Login successful

Check if agent software is missing any binaries by running below command.


./emcli verify_updates


[oracle@xxxxxx bin]$ ./emcli verify_updates

Verifying updates, starting validation ...


-----
Type       : Agent Software
Description: Agent Software (12.1.0.1.0) for HP-UX PA-RISC (64-bit)
Attributes
        Version: 12.1.0.1.0
        OS Platform: HP-UX PA-RISC (64-bit)

Archives are missing from the software library and can be downloaded from the following URL:
https://updates.oracle.com/Orion/Services/download/p14169493_112000_Generic.zip?aru=15238828&patch_file=p14169493_112000_Generic.zip
-----

-----
Type       : Agent Software
Description: Agent Software (12.1.0.2.0) for HP-UX PA-RISC (64-bit)
Attributes
        Version: 12.1.0.2.0
        OS Platform: HP-UX PA-RISC (64-bit)

Archives are missing from the software library and can be downloaded from the following URL:
https://updates.oracle.com/Orion/Services/download/p14570372_112000_Generic.zip?aru=15465143&patch_file=p14570372_112000_Generic.zip
-----

-----
Type       : Plug-in
Description: Oracle Database plugin provides comprehensive management for Oracle Database and related targets such as Real Application Clusters, Automatic Storage Management (ASM) etc.
Attributes
        Version: 12.1.0.3.0
        Revision: 0
        OS Platform: Generic Platform
        Plug-in Name: Oracle Database

Archives are missing from the software library and can be downloaded from the following URL:
https://updates.oracle.com/Orion/Services/download/p16282741_112000_Generic.zip?aru=15965857&patch_file=p16282741_112000_Generic.zip
-----

-----
Type       : Plug-in
Description: Oracle Database plugin provides comprehensive management for Oracle Database and related targets such as Real Application Clusters, Automatic Storage Management (ASM) etc.
Attributes
        Version: 12.1.0.3.0
        Revision: 20130402
        OS Platform: Generic Platform
        Plug-in Name: Oracle Database

Archives are missing from the software library and can be downloaded from the following URL:
https://updates.oracle.com/Orion/Services/download/p16986037_112000_Generic.zip?aru=16490107&patch_file=p16986037_112000_Generic.zip
-----

For each update with missing archives, emcli import_update can be used with a -force option to re-upload the archives to software library.

Import missing binaries reported by above command by using below commands..


./emcli import_update -file=/app/oracle/em12cOMS/oms/bin/p14169493_112000_Generic.zip -force -omslocal
./emcli import_update -file=/app/oracle/em12cOMS/oms/bin/p14570372_112000_Generic.zip -force -omslocal
./emcli import_update -file=/app/oracle/em12cOMS/oms/bin/p16282741_112000_Generic.zip -force -omslocal
./emcli import_update -file=/app/oracle/em12cOMS/oms/bin/p16986037_112000_Generic.zip -force -omslocal

Sample Output :

[oracle@xxxxxxx bin]$ ./emcli import_update -file=/app/oracle/em12cOMS/oms/bin/p14169493_112000_Generic.zip -force
Error: If omslocal flag is not specified, host and all necessarily credential options must be specified.

[oracle@xxxxxxx bin]$ ./emcli import_update -file=/app/oracle/em12cOMS/oms/bin/p14169493_112000_Generic.zip -force -omslocal
Processing update: Agent Software - Agent Software (12.1.0.1.0) for HP-UX PA-RISC (64-bit)
Operation completed successfully. Update has been uploaded to Enterprise Manager. Please use the Self Update Home to manage this update.

[oracle@xxxxxxx bin]$ ./emcli import_update -file=/app/oracle/em12cOMS/oms/bin/p14570372_112000_Generic.zip -force -omslocal
Processing update: Agent Software - Agent Software (12.1.0.2.0) for HP-UX PA-RISC (64-bit)
Operation completed successfully. Update has been uploaded to Enterprise Manager. Please use the Self Update Home to manage this update.


Check if still any binaries missing.

./emcli verify_updates

Sample Output:

[oracle@nh1grp01 bin]$ ./emcli verify_updates

Verifying updates, starting validation ...


-----
Type       : Plug-in
Description: Oracle Database plugin provides comprehensive management for Oracle Database and related targets such as Real Application Clusters, Automatic Storage Management (ASM) etc.
Attributes
        Version: 12.1.0.3.0
        Revision: 0
        OS Platform: Generic Platform
        Plug-in Name: Oracle Database

Archives are missing from the software library and can be downloaded from the following URL:
https://updates.oracle.com/Orion/Services/download/p16282741_112000_Generic.zip?aru=15965857&patch_file=p16282741_112000_Generic.zip
-----

-----
Type       : Plug-in
Description: Oracle Database plugin provides comprehensive management for Oracle Database and related targets such as Real Application Clusters, Automatic Storage Management (ASM) etc.
Attributes
        Version: 12.1.0.3.0
        Revision: 20130402
        OS Platform: Generic Platform
        Plug-in Name: Oracle Database

Archives are missing from the software library and can be downloaded from the following URL:
https://updates.oracle.com/Orion/Services/download/p16986037_112000_Generic.zip?aru=16490107&patch_file=p16986037_112000_Generic.zip
-----

For each update with missing archives, emcli import_update can be used with a -force option to re-upload the archives to software library.


Check installed agent software supported versions.

./emcli get_supported_platforms

Sample Output:

[oracle@xxxxxxx bin]$ ./emcli get_supported_platforms
Getting list of platforms ...
Check the logs at /app/oracle/em12cOMS/gc_inst/em/EMGC_OMS1/sysman/emcli/setup/.emcli/agent.log
About to access self-update code path to retrieve the platforms list..
Getting Platforms list  ...
-----------------------------------------------
Version = 12.1.0.2.0
 Platform = Linux x86-64
-----------------------------------------------
Version = 12.1.0.2.0
 Platform = HP-UX Itanium
-----------------------------------------------
Version = 12.1.0.1.0
 Platform = HP-UX PA-RISC (64-bit)
-----------------------------------------------
Version = 12.1.0.2.0
 Platform = HP-UX PA-RISC (64-bit)
-----------------------------------------------
Platforms list displayed successfully.



Wednesday, July 26, 2017

Physical Standby database re-build with incremental backup approach

Issue :

Physical standby database was out of sync with production either by missing archive logs in primary database or with some other reason. We need catch up the standby with primary database. We can restart the MRP process which will eventually apply all the archives but if archives gap is huge or archives was not available because of retention policy, you may not process with MRP process.
We can use Incremental backup approach for this kind of situation, which is less time consuming activity comparing with MRP process. Below are the steps to perform.


Steps:


On Standby:

– check current scn# of standby

SBY>select to_char(current_scn) from v$database;

CURRENT_SCN
-----------
XXXXXXXX

On Primary:

– Create a standby control file:
ALTER DATABASE CREATE STANDBY CONTROLFILE AS '<backup-location>/standby_control.ctl';

– Take incremental backup on primary starting from scn# of standby database
RMAN uses the selected SCN as the basis for this incremental backup. For all files being backed up, RMAN includes all data blocks that were changed at SCNs greater than or equal to the FROM SCN in the incremental backup.
Note:
• RMAN does not consider the incremental backup as part of a backup strategy at the source database. The backup is not suitable for use in a normal RECOVER DATABASE operation at the source database.

run
{
Backup AS compressed backupset incremental from SCN XXXXXXXX database tag='FOR_STANDBY' format '<backup-location>/%d_%t_%s_%p';
}

***********Once backup is done start working from below*************

– copy the standby control file to standby host

- Copy the backup files to standby site

On Standby:

– Find out names of current control files
col value for a50
col name for a15
select name, value   from v$parameter where upper(name)= 'CONTROL_FILES';

- Shutdown the standby database and rename the original control file of the standby database:
 Shutdown immediate;

- Backup all the control files

– Restore the standby control file just copied from the primary


– Startup the Standby database with the new controlfile:

SQL> startup mount;

RMAN> restore controlfile from '<controlfile_location>';

– Catalog the Incremental Backup Files at the Standby Database
RMAN>  catalog start with   '<Location>';

– Apply the Incremental Backup to the Standby Database
Use the RMAN RECOVER command with the NOREDO option to apply the incremental backup to the standby database. All changed blocks captured in the incremental backup are updated at the standby database, bringing it up to date with the primary database.

SBY> recover managed standby database cancel;


RMAN> RECOVER DATABASE from tag <backup_tab_name> NOREDO;

Start the Managed Recovery process on the standby DB:
SBY>recover managed standby database disconnect from session;


You can now resume managed recovery at the standby. Any redo logs required at the standby with changes since those contained in the incremental are automatically requested from the primary and applied.

— check that SCN# of the standby database has advanced.

SBY>select current_scn from v$database;


RMAN-06457

Issue : Rman active duplicate failed with below error. RMAN-00571: =========================================================== RMAN-...