Monday, April 11, 2016

ADOP Concepts on R12.2 and above

Oracle Application 12.2 ADOP concepts





ADOP stands for AD Online Patching. From Release 12.2+ patching can only be performed by using adop.
You have to use adop instead of adpatch unlike previous release of EBS.

From 12.2+ onward each application node of apps will contain two file systems.

RUN file system: This is the actual file system where all the live applications run.

PATCH file system: Here is the actual concept of online patching coming in to picture with this file system.

Oracle recommend to download all application patches to PATCH_TOP ($APPL_TOP_NE/../patch) before you proceed with the actual patching activity.

adop is designed to support online patching activity with minimal downtime. To support that it is been divided into multiple phases. You can pass following phase with adop.

adop phase=prepare/apply/finalize/cutover/cleanup/actualize_all/abort

Prepare - This phase is used to sync run and patch file systems.

Usage: adop phase=prepare

Steps it will do - 1. Prepare the patch file system to ready for the patching
                          2. Create Patch Edition
                          3. Submit ADZDPATCH concurrent request to stop any conflict requests to submit from                                 patch edition.
                          4. Create session ID in ad_adop _sessions table with prepare_status as 'Y' at the end of                                     prepare.
Apply - Actual patching activity

Usage: adop phase=apply

Steps it will do - 1. Apply the specified patch to Patch File system.
                          2. Update the session ID created by prepare with apply_status as 'P' at the end of apply.
                          3. Insert entry in ad_adop_session_patches table with bug_number as the patch number.
Finalize - To prepare DB and APPS for cutover

Usage: adop phase=finalize

Cutover - This is where you need actual minimal down time where application services get stooped from RUN file system and start it from patch file system.

Usage: adop phase=cutover

Steps it will do - 1. Change the file system from PATCH to RUN
                          2. Change the Edition from PATCH to current
                          3. Do finalize if not run explicitly
                          4. Stop the ADZDPATCH concurrent request submitted during prepare
                          5. This will have the following status for cutover_status in ad_adop_sessions
                              'N' - 'NOT STARTED',
                               'R' - 'RUNNING',
                      'F' - 'FAILED',
                      'C' - 'COMPLETED',
                      'P' - 'ACTIVE',
                      'Y' - 'COMPLETED',
                      'X' - 'NOT APPLICABLE',
                      '0' - 'FORCE_SHUTDOWN_BEGIN',
                      '1' - 'FORCE_SHUTDOWN_COMPLETED_DB_CUTOVER_BEGIN',
                      '3' - 'DB_CUTOVER_COMPLETED_FLIP_SNAPSHOTS_BEGIN',
                      'D' - 'FLIP_SNAPSHOTS_COMPLETED_FS_CUTOVER_BEGIN',
                      '4' - 'FS_CUTOVER_COMPLETED_ADMIN_STARTUP_BEGIN',
                      '5' - 'ADMIN_STARTUP_COMPLETED_FORCE_STARTUP_BEGIN',
                      '6' - 'FORCE_STARTUP_COMPLETED'

Cleanup - Cleanup of the online patching stale objects that are created to support.

Usage: adop phase=cleanup

Actualize_all - Actualize all the uncovered objects (non active editioned objects).

Usage: adop phase=actualize_all

Abort - Delete the Patch Edition created in Prepare Phase

Usage: adop phase=abort


Tuesday, March 29, 2016

startup ORA-01012: not logged on

ORA-01012: not logged on:

sqlplus "/as sysdba"


SQL>
SQL> startup
ORA-01012: not logged on
SQL> exit
Disconnected

[oemora@lnxdbtst > /apps/oemora/oracle/njvcoid/orabin/11.2.0/rdbms/lib]$ sysresv

IPC Resources for ORACLE_SID "OIDREP" :
Shared Memory:
ID              KEY
387350529       0x00000000
387383298       0x00000000
387416067       0xbd6e4ec0
Semaphores:
ID              KEY
No semaphore resources used
Oracle Instance not alive for sid "OIDREP"

[oemora@lnxdbtst > /apps/oemora/oracle/njvcoid/orabin/11.2.0/rdbms/lib]$ ipcrm -m 387350529
ipcrm -m 387383298
ipcrm -m 387416067
sqlplus "/as sysdba"



SQL> startup
ORACLE instance started.

Total System Global Area 2137886720 bytes
Fixed Size                  2230072 bytes
Variable Size            1828718792 bytes
Database Buffers          301989888 bytes
Redo Buffers                4947968 bytes
Database mounted.
Database opened.
SQL>

Thursday, March 24, 2016

ORA 20001 request could not be procees provision_comapnay



Create the new workspace as below as normal.


The Admin password is Passw0rd$123.

The provided password for the schema to be created didn't meet the required complexity rules. Therefore you  received this error.so please provide the password for ADMIN as required by complexity rules.


SYSDBA grant to any User in Oracle 12c

Common Users & SYSDBA with #Oracle 12c:


SQL>  select name,open_mode,con_id from v$pdbs;

NAME                           OPEN_MODE      CON_ID
------------------------------ ---------- ----------
PDB$SEED                       READ ONLY           2
PDBORCL                        READ WRITE          3
APEXPDB                        READ WRITE          4

SQL> select * from v$pwfile_users;

USERNAME                       SYSDB SYSOP SYSAS SYSBA SYSDG SYSKM     CON_ID
------------------------------ ----- ----- ----- ----- ----- ----- ----------
SYS                            TRUE  TRUE  FALSE FALSE FALSE FALSE          0


SQL> create user c##_sys identified by oracle container=all;

User created.

SQL> grant sysdba to c##_sys container=all;

Grant succeeded.

SQL> select * from v$pwfile_users;

USERNAME                       SYSDB SYSOP SYSAS SYSBA SYSDG SYSKM     CON_ID
------------------------------ ----- ----- ----- ----- ----- ----- ----------
SYS                            TRUE  TRUE  FALSE FALSE FALSE FALSE          0
C##_SYS                        TRUE  FALSE FALSE FALSE FALSE FALSE          0

C##_SYS can now do anything to any PDB

Wednesday, March 23, 2016

How to create Table Spaces in PDB$SEED

How to create Table Spaces in PDB$SEED 

SQL> alter session set "_oracle_script"=TRUE;

Session altered.

SQL> alter pluggable database pdb$seed OPEN READ WRITE;
alter pluggable database pdb$seed OPEN READ WRITE
*
ERROR at line 1:
ORA-65019: pluggable database PDB$SEED already open


SQL> alter pluggable database pdb$seed close immediate instances=all;

Pluggable database altered.

SQL> select open_mode from v$database;

OPEN_MODE
--------------------
MOUNTED

SQL>  alter pluggable database pdb$seed OPEN READ WRITE;

Pluggable database altered.

SQL> show con_name;

CON_NAME
------------------------------
PDB$SEED
SQL> select open_mode from v$database;

OPEN_MODE
--------------------
READ WRITE

SQL> create tablespace APEXFILE datafile '/apps/apexora/app/apexora/oradata/APEXORA/pdbseed/APEXFILE.dbf'
  2  size                                  100M
  3  autoextend on maxsize                2000M
  4  extent management local uniform size  64K;

Tablespace created.

SQL> create tablespace APEXUSER datafile '/apps/apexora/app/apexora/oradata/APEXORA/pdbseed/APEXUSER.dbf'
  2  size                                  100M
  3  autoextend on maxsize                2000M
  4  extent management local uniform size  64K;

Tablespace created.

SQL> reate tablespace APEXEBS datafile '/apps/apexora/app/apexora/oradata/APEXORA/pdbseed/APEXEBS.dbf'
SP2-0734: unknown command beginning "reate tabl..." - rest of line ignored.
SQL> create tablespace APEXEBS datafile '/apps/apexora/app/apexora/oradata/APEXORA/pdbseed/APEXEBS.dbf'
  2  size                                  100M
  3  autoextend on maxsize                2000M
  4  extent management local uniform size  64K;

Tablespace created.

SQL> alter system set db_securefile=NEVER  scope=both;

System altered.

SQL> commit;

Commit complete.

SQL> alter pluggable database pdb$seed close immediate instances=all;

Pluggable database altered.

SQL> alter pluggable database pdb$seed OPEN READ ONLY;

Pluggable database altered.

SQL> how con_name;
SP2-0734: unknown command beginning "how con_na..." - rest of line ignored.
SQL> show con_name;

CON_NAME
------------------------------
PDB$SEED
SQL>  select open_mode from v$database;

OPEN_MODE
--------------------
READ ONLY

SQL> alter session set "_oracle_script"=FALSE;

Session altered.

SQL> commit;

Commit complete.

Tuesday, March 22, 2016

ORA-60019: Creating initial extent of size 14 in tablespace of extent size 8


The minimum extent size of the tablespace must be 1M when db_securefile is set to always. If the extent size is less than 1M the error ORA-60019 is reported.

1.precreate the tablespaces with a uniform extent size of 1M

SQL> CREATE TABLESPACE TEST DATAFILE '/oracle/oradata/test.dbf' SIZE 500M EXTENT MANAGEMENT LOCAL UNIFORM SIZE 1030K SEGMENT SPACE MANAGEMENT AUTO ;

or


2. Create the tablespace with default local extent management:
     SQL> CREATE TABLESPACE TEST DATAFILE '/oracle/oradata/test.dbf' SIZE 500M EXTENT MANAGEMENT LOCAL SEGMENT SPACE MANAGEMENT AUTO ;

the above solution for Version 10.2.0.1 to 11.2.0.3 

In 12c :

alter system set db_securefile=NEVER  scope=both;   


Thursday, March 17, 2016

ORA-28014: cannot drop administrative users on Oracle 12C

SQL> drop user APEX_050000 ;
drop user APEX_050000
*
ERROR at line 1:
ORA-28014: cannot drop administrative users


SQL> alter session set "_oracle_script"=true;

Session altered.

SQL> drop user APEX_050000 cascade;

User dropped.