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.

Reverting to Release 4.2 in a CDB

To revert to a previous Oracle Application Express release 4.2 in a CDB:

Make sure All PDB's Open at this stage.
alter pluggble database all open;
  1. If you altered your images directory, you must point the text alias /i/ back to images directory for the release you want to revert to. See "Copying the Images Directory."
  2. Change your working directory to apex/core in the 4.2 source.
  3. Cd $OH_HOME/apex/core create below sqls.This your apex5 directory under OH_HOME
  4. Create a new text file in that directory named apx42dgrd1.sql consisting of the following:
    alter session set current_schema = SYS;
     
    @core_sys_views.sql
     
    grant select on sys.wwv_flow_gv$session to APEX_040200;
     
    @wwv_flow_val.sql
    @wwv_flow_val.plb
    @wwv_dbms_sql.sql
    @wwv_dbms_sql.plb
     
    begin
        dbms_utility.compile_schema('APEX_040200');
    end;
    /
    
  5. Create a second new text file in that directory named apx42dgrd.sql consisting of the following:
    set define '^'
     
    whenever sqlerror exit
     
    column :xe_home new_value OH_HOME NOPRINT
    variable xe_home varchar2(255)
     
    set serverout on
    begin
    -- get oracle_home
        sys.dbms_system.get_env('ORACLE_HOME',:xe_home);
        if length(:xe_home) = 0 then
            sys.dbms_output.put_line(lpad('-',80,'-'));
            raise_application_error (
                -20001,
                'Oracle Home environment variable not set' );
        end if;
    end;
    /
    whenever sqlerror continue
     
    set termout off
    select :xe_home from sys.dual;
    set termout on
     
    host ^OH_HOME/perl/bin/perl -I ^OH_HOME/rdbms/admin ^OH_HOME/rdbms/admin/catcon.pl -b apx42dgrd apx42dgrd1.sql
    
  6. Start SQL*Plus and connect to CDB$ROOT of the database where Oracle Application Express is installed as SYS specifying the SYSDBA role:
    On UNIX and Linux:
    $ sqlplus /nolog
    SQL> SQL> CONNECT SYS as SYSDBA
    Enter password: SYS_password
    
  7. Execute the following commands:
    @apx42dgrd.sql
    
  8. Once this is completed successful goto the next step.
  9. Change your working directory to apex in the 4.2 source.
  10. cd $OH_HOME
  11. mv apex apex_5_old
  12. mv apex_old  apex this your old apex4.2 directory and create below sqls under apex4.2 .
  13. Create a new text file in that directory name apx42dgrd1.sql with the following contents:
    set define '^'
     
    ALTER SESSION SET CURRENT_SCHEMA = SYS;
     
    @apexvalidate x x APEX_040200
     
    ALTER SESSION SET CURRENT_SCHEMA = APEX_040200;
    exec apex_040200.wwv_flow_upgrade.switch_schemas('APEX_050000','APEX_040200');
    ALTER SESSION SET CURRENT_SCHEMA = SYS;
    declare
        l_apex_version varchar2(30);
    begin
        l_apex_version := apex_040200.wwv_flows_release;
        dbms_registry.downgrading('APEX','Oracle Application Express','validate_apex','APEX_040200');
        dbms_registry.downgraded('APEX',l_apex_version);
        validate_apex;
    end;
    /
    
  14. Create a second new text file in that directory named apx42dgrd.sql consisting of the following:
    set define '^'
     
    whenever sqlerror exit
     
    column :xe_home new_value OH_HOME NOPRINT
    variable xe_home varchar2(255)
     
    set serverout on
    begin
    -- get oracle_home
        sys.dbms_system.get_env('ORACLE_HOME',:xe_home);
        if length(:xe_home) = 0 then
            sys.dbms_output.put_line(lpad('-',80,'-'));
            raise_application_error (
                -20001,
                'Oracle Home environment variable not set' );
        end if;
    end;
    /
    whenever sqlerror continue
     
    set termout off
    select :xe_home from sys.dual;
    set termout on
     
    host ^OH_HOME/perl/bin/perl -I ^OH_HOME/rdbms/admin ^OH_HOME/rdbms/admin/catcon.pl -b apx42dgrd apx42dgrd1.sql
    
  15. Start SQL*Plus and connect to CDB$ROOT of the database where Oracle Application Express is installed as SYS specifying the SYSDBA role:
    On UNIX and Linux:
    $ sqlplus /nolog
    SQL> SQL> CONNECT SYS as SYSDBA
    Enter password: SYS_password
    
  16. Execute the following:
    @apx42dgrd.sql
  17. SQL> @apx42dgrd.sql
    
    PL/SQL procedure successfully completed.
    
    catcon: ALL catcon-related output will be written to apx42dgrd_catcon_17261.lst
    catcon: See apx42dgrd*.log files for output generated by scripts
    catcon: See apx42dgrd_*.lst files for spool files, if any
    catcon.pl: completed successfully
    
    SQL> commit;
    
    Commit complete.
    
    SQL> select version from sys.dba_registry where comp_id = 'APEX';
    
    VERSION
    ------------------------------
    4.2.5.00.08
    
    SQL> show con_name
    
    CON_NAME
    ------------------------------
    CDB$ROOT
  18. Now you are done with reverting.


Monday, March 14, 2016

Oracle12c DB CDB and PDB Auto start

Determining Whether a Database Is a CDB or Not:

SQL> SELECT NAME, CDB, CON_ID FROM V$DATABASE;

NAME          CDB     CON_ID
--------- --- -----------------------

APEXORA    YES          0

Creation of a PDB:


Creation of a PDB from Seed

You can use the CREATE PLUGGABLE DATABASE statement to create a PDB by copying the files from PDB$SEED, which is a template for creating PDBs. The following figure illustrates creation from the seed.
Creating a PDB Using the STORAGE, DEFAULT TABLESPACE, PATH_PREFIX, and FILE_NAME_CONVERT Clauses

CREATE PLUGGABLE DATABASE apexpdb ADMIN USER apexdb IDENTIFIED BY welcome123  STORAGE (MAXSIZE 5G MAX_SHARED_TEMP_SIZE 100M)  DEFAULT TABLESPACE sales     DATAFILE '/apps/apexora/app/apexora/oradata/APEXORA/apexpdb/apexpdb01.dbf' SIZE 250M AUTOEXTEND ON   PATH_PREFIX = '/apps/apexora/app/apexora/oradata/APEXORA/apexpdb/' FILE_NAME_CONVERT = ('/apps/apexora/app/apexora/oradata/APEXORA/pdbseed', '/apps/apexora/app/apexora/oradata/APEXORA/apexpdb');
Pluggable database created.
How to start the Pluggable DB:
SQL> select instance_name, version, status, con_id from v$instance;
INSTANCE_NAME    VERSION           STATUS           CON_ID
---------------- ----------------- ------------ ----------
APEXORA          12.1.0.2.0        OPEN                  0

Thursday, March 10, 2016

APEX 5 upgrade/Install on 12c Oracle DB (12.1.0.2.0)


1. Apex 5 downloaded from otn.oracle.com
2. Patch #20618595 (For a 12.1.0.2.0 database)

Down the DB and listener.

Run the "CheckConflictAgainstOHWithDetail"
Once above check is Passed apply the patch:
export PATH=$PATH:$HOME:$ORACLE_HOME/OPatch:/bin
Go to the PATCH Directory and opatch apply.
Now need  to upgrade all PDBs with the new patch we applied. This is done with a utility called datapatch. 
datapatch
Create 3 tablespace for APEX:

create tablespace APEXFILE datafile '/apps/apexora/app/apexora/oradata/APEXORA/APEXFILE.dbf'size                                  100Mautoextend on maxsize                2000Mextent management local uniform size  64K;
create tablespace APEXUSER datafile '/apps/apexora/app/apexora/oradata/APEXORA/APEXUSER.dbf'size                                  100Mautoextend on maxsize                2000Mextent management local uniform size  64K;

create tablespace APEXEBS datafile '/apps/apexora/app/apexora/oradata/APEXORA/APEXEBS.dbf'size                                  100Mautoextend on maxsize                2000Mextent management local uniform size  64K;

Now rename the apex 4.2 home to apex_old
mv apex apex_old 

unzip apex_5.0_en.zip in any location and mv apex to $ORACLE_HOME.

cd $ORACLE_HOME/apex
start up sqlplus as sys
sqlplus / as sysdba
@apexins.sql APEXEBS APEXFILE TEMP /i/ 

Once upgrade finish check the APEX version:

SQL> select version from sys.dba_registry where comp_id = 'APEX';.



next i ran rest-config sql 

SQL> @apex_rest_config_cdb.sql this is also completed with out any issue. 

@reset_image_prefix_con.sql this is also completed with out any issue. 


These two are key sql for APEX5 on 12c CDB installation.

SQL> select version from sys.dba_registry where comp_id = 'APEX'; 

VERSION 
------------------------------ 
5.0.3.00.03 

Thursday, March 3, 2016

OAM login page Error

After Integration OAM with EBS and Accessgate.I got some starange Error as below:

while login to EBs Page it is not redirect to OAM Page throwing error

7777/ebsauth_test/dossologin not found

After research I found that I missed the configuration in ebs_oam.conf file as below

cd $RREG_HOME/bin/ebs.oam.conf
protected_uris ########################### /ebsauth_{instance} /index.html

I added the instance name on ebs.oam.conf file thena fter I re ran "./bin/oamreg.sh inband inout/EBS_OAM11gRequest_short.html" script to update .

And copy the ObAccessClient.xml ,cwallet.sso files from cd $RREG_HOME/output/agent_name/ to

cd /apps/oemora/Oracle/Middleware/Oracle_WT1/instances/instance1/config/OHS/ohs1/webgate/config/.

Once files are copied then you ahve to bounce the ./opmnctl .

Go to cd /apps/oemora/Oracle/Middleware/Oracle_WT1/instances/instance1/bin/
./opmnctl stopall
and
./opmnctl startall

Then after check your eag_domaiin admin and managed server status those should Up and running.
 try to login with your EBS login Page it is redirect to OAM Console Page and login with orcladmin it is redirect to sysadmin/password enter the credentials your into EBS Home page.

OAM Integration is completed.