Monday, October 22, 2018

how-to-add-target-in-em-13c

How to add target in ORACLE OEM13C
-------------------------------------------------

Best article
------------
Follow step by step process.

ADD TARGET IN 13C



How to remove target from OEM 13c?
To remove a database target, follow these steps:
  1. Select Targets from the Enterprise menu.
  2. Select Databases from the drop-down list of Targets.
  3. Select the database from the listed databases under the Databases screen. ...
  4. Select Targets Setup from the Oracle Database drop-down list. ...
  5. Click on Yes to remove the target.

Saturday, October 13, 2018

ACTIVATE FLASHBACK IN THE STANDBY DATABASE

ACTIVATE FLASHBACK IN THE STANDBY DATABASE

STANDBY CONVERSION --

Enable flashback on the standby
Create a restore point on standby
Put the  standby DB in active mode
Cancel / defer the log shipping on primary
Once the tasks are done using the standby database revert to standby database using flashback

SQL>  select name,db_unique_name,database_role,switchover_status from v$database;

NAME      DB_UNIQUE_NAME                 DATABASE_ROLE    SWITCHOVER_STATUS
--------- ------------------------------ ---------------- --------------------
TESTDB   TESTDB                        PHYSICAL STANDBY NOT ALLOWED

SQL> select flashback_on from v$database;

FLASHBACK_ON
------------------
NO

SQL> show parameter reco

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     92
db_recovery_file_dest                string      /u01/app/flash
db_recovery_file_dest_size           big integer 250G
db_unrecoverable_scn_tracking        boolean     TRUE
recovery_parallelism                 integer     0
SQL>
SQL>
SQL> show parameter db_flashback

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
db_flashback_retention_target        integer     2800
SQL>

SQL> SELECT open_mode FROM V$DATABASE;

select banner from v$version;
OPEN_MODE
--------------------
MOUNTED

select instance_name from gv$instance;
set linesize 125
set pages 9999
select INSTANCE_NUMBER,INSTANCE_NAME,HOST_NAME from gv$instance;

Check MRP
--------

select instance_name from gv$instance;
set linesize 125
set pages 9999
select INSTANCE_NUMBER,INSTANCE_NAME,HOST_NAME from gv$instance;


SQL> SELECT PROCESS, DELAY_MINS FROM V$MANAGED_STANDBY WHERE PROCESS like 'MRP%';

PROCESS   DELAY_MINS
--------- ----------
MRP0               0

SQL> alter database recover managed standby database cancel;

Database altered.

SQL> alter database flashback on;

Database altered.

SQL> select flashback_on from v$database;


FLASHBACK_ON
------------------
YES

HOW TO OPEN THE PHYSICAL STANDBY FOR READ/WRITE TESTING AND FLASHBACK

SHUTDOWN IMMEDIATE
STARTUP MOUNT
SQL> create restore point save_point_export guarantee flashback database;

Restore point created.

SQL>
SQL>
SQL> select name from v$restore_point;

NAME
--------------------------------------------------------------------------------
SAVE_POINT_EXPORT


SQL> select db_unique_name,database_role,flashback_on from v$database;

DB_UNIQUE_NAME                 DATABASE_ROLE    FLASHBACK_ON
------------------------------ ---------------- ------------------
TESTDB                      PHYSICAL STANDBY YES

SQL>  alter database activate standby database;

Database altered.

SQL> select db_unique_name,database_role,flashback_on from v$database;

DB_UNIQUE_NAME                 DATABASE_ROLE    FLASHBACK_ON
------------------------------ ---------------- ------------------
TESTDB                        PRIMARY          YES

SQL> select name,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
TESTDB     MOUNTED              PRIMARY

SQL> alter database open;

Database altered.

SQL> select name,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
TESTDB READ WRITE           PRIMARY


HOW TO REVERT TO THE PHYSICAL STANDBY AFTER READ/WRITE TESTING
  • Resume      standby apply
SWITCH BACK TO STANDBY
-----------------------------------------


SQL> select name,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
TESTDB   READ WRITE           PRIMARY

SQL> select name from v$restore_point;

NAME
--------------------------------------------------------------------------------
SAVE_POINT_EXPORT09OCT18

SQL>
SQL>
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area 1.0737E+10 bytes
Fixed Size                  4498208 bytes
Variable Size            4529855712 bytes
Database Buffers         6174015488 bytes
Redo Buffers               29048832 bytes
Database mounted.
SQL> select name from v$restore_point;

NAME
--------------------------------------------------------------------------------
SAVE_POINT_EXPORT09OCT18

SQL>
SQL>
SQL> flashback database to restore point SAVE_POINT_EXPORT09OCT18;


Flashback complete.

 SQL> select name from v$restore_point;

NAME
--------------------------------------------------------------------------------
SAVE_POINT_EXPORT09OCT18

SQL> select name,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
TESTDB   MOUNTED              PRIMARY

SQL> select controlfile_type from v$database;

CONTROL
-------
BACKUP

SQL> alter database convert to physical standby;

Database altered.

SQL>  select name,open_mode,database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
TESTDB   MOUNTED              PHYSICAL STANDBY

SQL>  select db_unique_name,database_role,flashback_on from v$database;

DB_UNIQUE_NAME                 DATABASE_ROLE    FLASHBACK_ON
------------------------------ ---------------- ------------------
TESTDB                        PHYSICAL STANDBY YES

SQL>
SQL>
SQL> alter database flashback off;

Database altered.

SQL> select db_unique_name,database_role,flashback_on from v$database;

DB_UNIQUE_NAME                 DATABASE_ROLE    FLASHBACK_ON
------------------------------ ---------------- ------------------
TESTDB                        PHYSICAL STANDBY RESTORE POINT ONLY

SQL> shutdown immediate
ORA-01109: database not open


Database dismounted.
ORACLE instance shut down.
SQL>
SQL>
SQL> startup nomount
ORA-32004: obsolete or deprecated parameter(s) specified for RDBMS instance
ORACLE instance started.

Total System Global Area 1.0737E+10 bytes
Fixed Size                  4498208 bytes
Variable Size            4529855712 bytes
Database Buffers         6174015488 bytes
Redo Buffers               29048832 bytes
SQL> alter database mount standby database;

Database altered.

SQL> alter database recover managed standby database disconnect from session;

Database altered.

SQL>  select db_unique_name,database_role,flashback_on from v$database;

DB_UNIQUE_NAME                 DATABASE_ROLE    FLASHBACK_ON
------------------------------ ---------------- ------------------
TESTDB                        PHYSICAL STANDBY RESTORE POINT ONLY

SQL> drop restore point SAVE_POINT_EXPORT;

Restore point dropped.

SQL>   select db_unique_name,database_role,flashback_on from v$database;

DB_UNIQUE_NAME                 DATABASE_ROLE    FLASHBACK_ON
------------------------------ ---------------- ------------------
TESTDB                        PHYSICAL STANDBY NO



Friday, October 12, 2018

How to resolve PLS-00201: identifier 'DBMS_SYSTEM.SET_BOOL_PARAM_IN_SESSION'



SQL> alter package apps.ad_parallel_updates_pkg compile body;

Warning: Package Body altered with compilation errors.

SQL> show errors
Errors for PACKAGE BODY APPS.AD_PARALLEL_UPDATES_PKG:

LINE/COL ERROR
-------- -----------------------------------------------------------------
338/8    PL/SQL: Statement ignored
338/8    PLS-00201: identifier 'DBMS_SYSTEM.SET_BOOL_PARAM_IN_SESSION'
         must be declared


STEPS TO RESOLVE 



SQL> create public synonym dbms_system for dbms_system;

Synonym created.

SQL> grant execute on dbms_system to apps;

Grant succeeded.

SQL> alter package apps.ad_parallel_updates_pkg compile body;

Package body altered.

SQL>

Thursday, October 11, 2018

Re-create Grants And Synonyms For APPS Schema Fails With ORA-00942 For SYSTEM.AD_DDL (Doc ID 438194.1)


APPLIES TO:

Oracle Applications DBA - Version 11.5.10.2 to 11.5.10.2 [Release 11.5.10]
Information in this document applies to any platform.

SYMPTOMS

Using adadmin to Re-generate Grants and Synonyms but get errors. This occured after doing upgrade to Database 10gR2:
sqlplus -s APPS/***** @/$AD_TOP/patch/115/sql/adgrnctx4.sql &systempwd &un_fnd
CTXSYS &un_fnd FND

ERROR at line 1:
ORA-00942: table or view does not exist
ORA-06512: at "SYSTEM.AD_DDL", line 160
ORA-06512: at line 26

CAUSE

Some objects are missing. This SQL should provide the following result:
select owner, object_type, status from dba_objects where upper(object_name)=upper('ad_ctx_ddl');

OWNER                                 OBJECT_TYPE         STATUS
------------------------------  -------------------       -------
CTXSYS                                 PACKAGE                VALID
CTXSYS                                 PACKAGE BODY    VALID
APPS                                       SYNONYM              VALID
ICX                                         SYNONYM               VALID
APPLSYS                               SYNONYM               VALID
AMV                                       SYNONYM               VALID
JTF                                          SYNONYM               VALID
CS                                           SYNONYM               VALID
AR                                           SYNONYM               VALID
EGO                                        SYNONYM               VALID
PA                                           SYNONYM               VALID
OKC                                       SYNONYM               VALID
In this situation the AD_CTX_DDL package and package body for CTXSYS were missing.

SOLUTION

To implement the solution, please execute the following steps:

1. cd $AD_TOP/patch/115/sql
2. Run sqlplus as system user
3. run script adctxpkg.sql:
   @adctxpkg.sql <SYSTEM password> <INTERMEDIA username> <apps username>
   eg:  @adctxpkg.sql manager CTXSYS apps

Monday, October 8, 2018

How to open Standby DB when Primary is lost

Case: The primary is lost, we need to open the standby database.


sqlplus / as sysdba

STARTUP MOUNT

-- Check the status of DB
SELECT DB_UNIQUE_NAME, OPEN_MODE, PROTECTION_MODE, DATABASE_ROLE FROM V$DATABASE;

RECOVER STANDBY DATABASE;

==> CANCEL

ALTER DATABASE RECOVER MANAGED STANDBY DATABASE FINISH;
ALTER DATABASE ACTIVATE PHYSICAL STANDBY DATABASE;
ALTER DATABASE OPEN;

-- Check the status of DB
SELECT DB_UNIQUE_NAME, OPEN_MODE, PROTECTION_MODE, DATABASE_ROLE FROM V$DATABASE;

Saturday, October 6, 2018

Errors while applying 12.2.7 RUP Patch (24690690)



Errors on ADOP at APPLY phase 


Error:

1) All workers are failed with the Java error..
2) Invalid objects count is increased to 56k.

Troubleshooting:

1) Cleared the invalid objects by using utlrp.sql
2) Run the auto config on DB node
3) Start the patching activity again.

In step (3) while running auto config in database node exists with the below error.

ORA-01400: cannot insert NULL into ("APPLSYS"."FND_NODES"."NODE_NAME")

Adop error message: 

ERRORMSG: Cannot identify any valid application tier nodes in ADOP_VALID_NODES table. Ensure AutoConfig has been run on all nodes.

To resolve this error need to follow the below steps:

Step 1:
drop synonym apps.fnd_nodes;
create synonym apps.fnd_nodes for applsys.fnd_nodes;
drop synonym apps.fnd_oam_context_files;
create synonym apps.fnd_oam_context_files for applsys.fnd_oam_context_files;

Step 2:
Change the worker status to restart using adcrtl utility.

Step 3:
Run auto config again in database node. (Auto config completed without any errors)

Step 4:
Restart the patching activity.

adop phase=apply apply_mode=downtime patches=24690690 abandon=no restart=yes workers=16