Monday, April 17, 2017

ORA-06502: PL/SQL: numeric or value

Sometimes you will see this error while doing duplicate database 

Oracle instance shut down
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 04/18/2017 13:10:23
RMAN-05501: aborting duplication of target database
RMAN-06136: ORACLE error from auxiliary database: ORA-06502: PL/SQL: numeric or value error

Recovery Manager complete.

Then connect to the source database and its catalog database. now unregister the unique name which you are going to re-use. In my scenario, I tried to duplicate the database as Testt13 and it's already exists.

rman target /
connect catalog rman/password@Rmancatalog

Recovery Manager: Release 11.2.0.4.0 - Production on Tue Apr 18 13:35:43 2017

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: TESTPG (DBID=1734399999)
connected to recovery catalog database

RMAN> list db_unique_name of database;


List of Databases
DB Key  DB Name  DB ID            Database Role    Db_unique_name
------- ------- ----------------- ---------------  ------------------
5548648 TESTPG  1734399999       PRIMARY          TESTPG_DG1
5548648 TESTPG  1734399999       STANDBY          TESTT10
5548648 TESTPG  1734399999       STANDBY          TESTT13
5548648 TESTPG  1734399999       STANDBY          TESTPG
5548648 TESTPG  1734399999       STANDBY          TESTSG
5548648 TESTPG  1734399999       STANDBY          TESTPG_DG2

RMAN> resync catalog;

starting full resync of recovery catalog
full resync complete



removing the unwanted unique names


RMAN> unregister db_unique_name 'TESTT13';

database db_unique_name is "TESTT13", db_name is "TESTPG" and DBID is 1734399999

Want to unregister the database with target db_unique_name (enter YES or NO)? YES
database with db_unique_name TESTT13 unregistered from the recovery catalog

RMAN> unregister db_unique_name 'TESTT10';

database db_unique_name is "TESTT10", db_name is "TESTPG" and DBID is 1734399999

Want to unregister the database with target db_unique_name (enter YES or NO)? YES
database with db_unique_name TESTT10 unregistered from the recovery catalog

RMAN> resync catalog;

starting full resync of recovery catalog
full resync complete

RMAN> list db_unique_name of database;


List of Databases
DB Key  DB Name  DB ID            Database Role    Db_unique_name
------- ------- ----------------- ---------------  ------------------
5548648 TESTPG  1734399999       PRIMARY          TESTPG_DG1
5548648 TESTPG  1734399999       STANDBY          TESTPG
5548648 TESTPG  1734399999       STANDBY          TESTSG
5548648 TESTPG  1734399999       STANDBY          TESTPG_DG2

RMAN> exit



Now retry the duplicate it will work

Wednesday, March 29, 2017

Dropping redo log memmbers - oracle 11gR2



SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/appl/oradata/xdb01/CprodD/CprodD_redo03a.rdo
/appl/oradata/xdb02/CprodD/CprodD_redo03b.rdo
/appl/oradata/xdb01/CprodD/CprodD_redo02a.rdo
/appl/oradata/xdb02/CprodD/CprodD_redo02b.rdo
/appl/oradata/xdb01/CprodD/CprodD_redo01a.rdo
/appl/oradata/xdb02/CprodD/CprodD_redo01b.rdo

6 rows selected.

SQL> alter database drop logfile member '/appl/oradata/xdb02/CprodD/CprodD_redo03b.rdo';
alter database drop logfile member '/appl/oradata/xdb02/CprodD/CprodD_redo03b.rdo'
*
ERROR at line 1:
ORA-01609: log 3 is the current log for thread 1 - cannot drop members
ORA-00312: online log 3 thread 1:
'/appl/oradata/xdb01/CprodD/CprodD_redo03a.rdo'
ORA-00312: online log 3 thread 1:
'/appl/oradata/xdb02/CprodD/CprodD_redo03b.rdo'


The above can be deleted after switching the current log file.



SQL>  alter database drop logfile member '/appl/oradata/xdb02/CprodD/CprodD_redo02b.rdo';

Database altered.

SQL> alter database drop logfile member '/appl/oradata/xdb02/CprodD/CprodD_redo01b.rdo';

Database altered.

SQL> alter system checkpoint;

System altered.

SQL> alter system switch logfile;

System altered.

SQL>  alter database drop logfile member '/appl/oradata/xdb02/CprodD/CprodD_redo03b.rdo';

Database altered.

SQL> select member from v$logfile;

MEMBER
--------------------------------------------------------------------------------
/appl/oradata/xdb01/CprodD/CprodD_redo03a.rdo
/appl/oradata/xdb01/CprodD/CprodD_redo02a.rdo
/appl/oradata/xdb01/CprodD/CprodD_redo01a.rdo

SQL>

Wednesday, March 1, 2017

ORACLE error from auxiliary database: ORA-06502: PL/SQL: numeric or value error

RMAN duplicate db fails with ORA-06502

Oracle instance shut down
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 03/02/2017 10:02:21
RMAN-05501: aborting duplication of target database
RMAN-06136: ORACLE error from auxiliary database: ORA-06502: PL/SQL: numeric or value error

RMAN> exit

solution


1. remove db_unique_name parameter from init.ora

    and retry the duplicate. you can set the db_unique_name later once the duplicate complets fine. 

2. cleanup the catalog if required.
    remove the dbunique name related to duplicate work

oracle@oravm1[TestPG]:/var/applogs/oracle/rmanback
> rman target / catalog rman/passs@Rmancatalog

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Mar 2 10:01:55 2017

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: TestPG (DBID=1734336466)
connected to recovery catalog database
re
RMAN> sync catalog;

starting full resync of recovery catalog
full resync complete

RMAN> list incarnation of database;


List of Database Incarnations
DB Key  Inc Key DB Name  DB ID            STATUS  Reset SCN  Reset Time
------- ------- -------- ---------------- --- ---------- ----------
5548648 5548649 TestPG  1734336466       CURRENT 1          31-JAN-14
5548648 42491323 TestPG  1734336466       ORPHAN  11928117675339 12-MAY-16

RMAN> exit


Recovery Manager complete.
oracle@oravm1[TestPG]:/var/applogs/oracle/rmanback
> sqlplus rman@Rmancatalog

SQL*Plus: Release 11.2.0.4.0 Production on Thu Mar 2 10:04:11 2017

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

Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning option

SQL> select site_key,db_key,database_role,cf_create_time,db_unique_name from rc_site where db_key=5548648;

  SITE_KEY     DB_KEY DATABAS CF_CREAT
---------- ---------- ------- --------
DB_UNIQUE_NAME
--------------------------------------------------------------------------------
   5548650    5548648 PRIMARY 31/01/14
TestPG_DG1

   5560736    5548648 STANDBY 09/03/15
TestPG_DG2


  42491321    5548648 STANDBY 12/05/16
TestPG_DG3


  SITE_KEY     DB_KEY DATABAS CF_CREAT
---------- ---------- ------- --------
DB_UNIQUE_NAME
--------------------------------------------------------------------------------
  40708303    5548648 STANDBY
TESTSG

  46494327    5548648 STANDBY
TESTSG1

  46265758    5548648 STANDBY
TESTSG_DG1_MDR


  SITE_KEY     DB_KEY DATABAS CF_CREAT
---------- ---------- ------- --------
DB_UNIQUE_NAME
--------------------------------------------------------------------------------
  42469535    5548648 STANDBY
TESTT4

  35485732    5548648 STANDBY
TESTT9


8 rows selected.

SQL> set linesize 200
SQL> 1
  1* select site_key,db_key,database_role,cf_create_time,db_unique_name from rc_site where db_key=5548648
SQL> /

  SITE_KEY     DB_KEY DATABAS CF_CREAT DB_UNIQUE_NAME
---------- ---------- ------- -------- ------------------------------------------------------------------------------------------------------------------------
  40708303    5548648 STANDBY          TESTSG
  46494327    5548648 STANDBY          TESTSG1
  35485732    5548648 STANDBY          TESTT9
  46265758    5548648 STANDBY          TESTSG_DG1
  42491321    5548648 STANDBY 12/05/16 TestPG_DG3
   5560736    5548648 STANDBY 09/03/15 TestPG_DG2
  42469535    5548648 STANDBY          TESTT4
   5548650    5548648 PRIMARY 31/01/14 TestPG_DG1

8 rows selected.

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning option
oracle@oravm1[TestPG]:/var/applogs/oracle/rmanback





Remove the db unique names which is not related to source database. These entries are created whenever we duplicate the database and it got failed.

 
> rman target / catalog rman/passs@Rmancatalog

Recovery Manager: Release 11.2.0.4.0 - Production on Thu Mar 2 10:05:18 2017

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

connected to target database: TestPG (DBID=1734336466)
connected to recovery catalog database

RMAN> unregister db_unique_name TESTT4;

database db_unique_name is "TESTT4", db_name is "TestPG" and DBID is 1734336466

Want to unregister the database with target db_unique_name (enter YES or NO)? YES
database with db_unique_name TESTT4 unregistered from the recovery catalog

RMAN> unregister db_unique_name TESTSG;

database db_unique_name is "TESTSG", db_name is "TestPG" and DBID is 1734336466

Want to unregister the database with target db_unique_name (enter YES or NO)? YES
database with db_unique_name TESTSG unregistered from the recovery catalog

RMAN> unregister db_unique_name TESTSG1
2> ;

database db_unique_name is "TESTSG1", db_name is "TestPG" and DBID is 1734336466

Want to unregister the database with target db_unique_name (enter YES or NO)? YES
database with db_unique_name TESTSG1 unregistered from the recovery catalog

RMAN> unregister db_unique_name TESTT9;

database db_unique_name is "TESTT9", db_name is "TestPG" and DBID is 1734336466

Want to unregister the database with target db_unique_name (enter YES or NO)? YES
database with db_unique_name TESTT9 unregistered from the recovery catalog

RMAN> exit


Recovery Manager complete.
oracle@oravm1[TestPG]:/var/applogs/oracle/rmanback
> sqlplus rman@Rmancatalog

SQL*Plus: Release 11.2.0.4.0 Production on Thu Mar 2 10:07:42 2017

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

Enter password:

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning option

SQL>  select site_key,db_key,database_role,cf_create_time,db_unique_name from rc_site where db_key=5548648
  2  /

  SITE_KEY     DB_KEY DATABAS CF_CREAT
---------- ---------- ------- --------
DB_UNIQUE_NAME
--------------------------------------------------------------------------------
   5548650    5548648 PRIMARY 31/01/14
TestPG_DG1_MDR

   5560736    5548648 STANDBY 09/03/15
TestPG_DG2_HTC

  42491321    5548648 STANDBY 12/05/16
TestPG_DG3_MDR


  SITE_KEY     DB_KEY DATABAS CF_CREAT
---------- ---------- ------- --------
DB_UNIQUE_NAME
--------------------------------------------------------------------------------
  46265758    5548648 STANDBY
TESTSG_DG1_MDR


SQL> set linesize 200
SQL> 1
  1*  select site_key,db_key,database_role,cf_create_time,db_unique_name from rc_site where db_key=5548648
SQL> /

  SITE_KEY     DB_KEY DATABAS CF_CREAT DB_UNIQUE_NAME
---------- ---------- ------- -------- ------------------------------------------------------------------------------------------------------------------------
   5548650    5548648 PRIMARY 31/01/14 TestPG_DG1
   5560736    5548648 STANDBY 09/03/15 TestPG_DG2
  42491321    5548648 STANDBY 12/05/16 TestPG_DG3
  46265758    5548648 STANDBY          TESTSG_DG1

SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning option
oracle@oravm1[TestPG]:/


Activating physical standby database to primary /normal database

Activating the physical standby database to primary database. 

# recover process is running

SQL> !ps -ef|grep mrp
oracle   28937     1  0 Feb24 ?        00:00:38 ora_mrp0_TestSG
oracle   49454 49444  0 09:02 pts/0    00:00:00 /bin/ksh -c ps -ef|grep mrp
oracle   49456 49454  0 09:02 pts/0    00:00:00 grep mrp
# cancelling the recover process
SQL> alter database recover managed standby database cancel;

Database altered.

#checking database status


SQL> select name,database_role from v$database;

NAME      DATABASE_ROLE
--------- ----------------
TESTSG   PHYSICAL STANDBY

# completing the recovery

SQL> alter database recover managed standby database finish;

Database altered.

#checking the database role and activating the database


SQL> select name,database_role from v$database;

NAME      DATABASE_ROLE
--------- ----------------
TESTSG   PHYSICAL STANDBY

SQL> alter database activate physical standby database;

Database altered.

SQL> select name,database_role from v$database;

NAME      DATABASE_ROLE
--------- ----------------
TESTSG   PRIMARY

SQL> alter database open ;

Database altered.

#checking the database mode


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

NAME      DATABASE_ROLE    OPEN_MODE
--------- ---------------- --------------------
TESTSG   PRIMARY          READ WRITE

Wednesday, December 7, 2016

oracle nls_setting inside pl/sql procedure.

In some procedures or functions we may need to set the NLS parameter. we can do this like alter session statement.

The package  dbms_session can be used to achieve that.

Syntax :

 dbms_session.set_nls('nls_date_format','''your foramt here''');

Example

  1  declare
  2  str varchar2(4000);
  3  begin
  4   dbms_session.set_nls('nls_date_format','''dd/mm/yyyy HH24:mi:ss''');
  5  select sysdate into str from dual;
  6  dbms_output.put_line(str);
  7* end;
SQL> /
08/12/2016 12:33:02

Tuesday, July 14, 2015

Renaming schema in oracle database

Oracle : Rename schema

In oracle there is no straight way to rename a schema, but it can be done by using transport tablespaces.

The following is the brief overview of the steps using transport tablespaces. Normally we will use transport tablespaces to migrate the database. In our scenario, the source and target database will be same to achieve schema rename.

Source schema : The schema name which is going to be renamed
Target schema : The new schema name
TT= transport tablespaces

  • Check whether tablespace can be used for TT 
  • Take a note on source schema objects. 
  • Create target schema in db with the previlages same as source schema
  • Export the source schema metadata excluding tables and indexes
  • Export all the tablespace metadata which are going to be TT
  • Put the tablespace in read only  which is involved in TT activity.
  • Shutdown the database
  • Rename all the transport tablespace datafiles 
  • Start the database in mount.
  • Since we renamed, database will complain that it cant identify the datafiles. So put all the transport tablespace datafiles to offline. 
  • Drop the source schema tables - > This is required if you have partition tables spanned to different tablespaces or tables have referential tables in other tablespaces.
  • Drop the tablespaces with keep datafile option which are marked for TT
  • Rename the datafiles back to original name. 
  • Import the metadata of the TT with remap_schema option (source_schema:target_schema). This will migrate all the tables and index but not the procedures,packages etc.
  • Import the metadata of the source schema to target schema.
  • Verify the objects counts, recompile the invalid objects.
  • Drop the source schema.
  • You may have to recompile any public synonyms created for this source schema. 

so renaming schema is done :)

---------------------------------------------------------------------------------------------------------

Example
Pre-check-
SQL*Plus: Release 12.1.0.2.0 Production on Mon Jul 13 11:24:34 2015

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning option

SQL> execute dbms_tts.transport_set_check('user_data,pay_data',TRUE,TRUE);

PL/SQL procedure successfully completed.

SQL> SELECT * FROM transport_set_violations;

no rows selected


-- export meta data
> cat transport_expdp.par
transport_tablespaces=user_data,pay_data
directory=test_exp
dumpfile=trans_expdp.dmp
logfile=trans_expdp.log
userid=system 


SQL> @create_target_user.sql --create target user with same previlages as source schema (sys_privs and roles )

SQL> alter tablespace user_data read only;

Tablespace altered.

SQL> alter tablespace pay_data read only;

Tablespace altered.

SQL> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning option


>  expdp parfile=transport_expdp.par

Export: Release 12.1.0.2.0 - Production on Mon Jul 13 11:08:30 2015

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.
Password:

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning option
Starting "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01":  system/******** parfile=transport_expdp.par
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type TRANSPORTABLE_EXPORT/INDEX/INDEX
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/INDEX_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/COMMENT
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/REF_CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/STATISTICS/MARKER
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Master table "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_TRANSPORTABLE_01 is:
  /usr/work/trans_expdp.dmp
******************************************************************************
Datafiles required for transportable tablespace USER_DATA:
  /usr/data/Testdb/user_data_01.dbf
Datafiles required for transportable tablespace PAY_DATA: 
  /usr/data/Testdb/pay_data_01.dbf
Job "SYSTEM"."SYS_EXPORT_TRANSPORTABLE_01" successfully completed at Mon Jul 13 1:09:10 2015 elapsed 0 00:00:35


Rename the files

SQL>shutdown immediate

mv  /usr/data/Testdb/user_data_01.dbf /usr/data/Testdb/temp_user_data_01.dbf
mv 
/usr/data/Testdb/pay_data_01.dbf /usr/data/Testdb/temp_pay_data_01.dbf



Drop the tablespaces 
 
SQL> startup mount;
SQL> alter database datafile '/usr/data/Testdb/user_data_01.dbf' offline;
SQL>alter database datafile '/usr/data/Testdb/pay_data_01.dbf' offline;
SQL> alter database open;
SQL> @drop_source_schema_tables.sql

-- the above step is required if the table has partitions span over different tablespaces. That's why we are putting the datafiles offline and dropping the tables. otherwise you may face the following errors.

SQL> drop tablespace user_data including contents keep datafiles;
drop tablespace user_data including contents keep datafiles
*
ERROR at line 1:
ORA-14404: partitioned table contains partitions in a different tablespace

SQL> drop tablespace pay_data including contents keep datafiles;
drop tablespace pay_data including contents keep datafiles
*
ERROR at line 1:
ORA-14404: partitioned table contains partitions in a different tablespace
 


or 

constraint errors which has referential in different partition.


SQL> drop tablespace user_data including contents keep datafiles;

Tablespace dropped.

SQL> drop tablespace pay_data including contents keep datafiles;

Tablespace dropped.

SQL> shutdown immediate;




Rename the files back to original name    
 
 

mv /usr/data/Testdb/temp_user_data_01.dbf /usr/data/Testdb/user_data_01.dbf
mv/usr/data/Testdb/temp_pay_data_01.dbf /usr/data/Testdb/pay_data_01.dbf

Start the db and import the metadata  

SQL> startup 

> cat trans_impdp.par
remap_schema=TESTUSER:NEW_TESTU
directory=test_exp
dumpfile=trans_expdp.dmp
logfile=trans_test_imp.log
transport_datafiles=/usr/data/Testdb/user_data_01.dbf,
  /usr/data/Testdb/pay_data_01.dbf

 
> impdp parfile=trans_impdp.par userid=system

Import: Release 12.1.0.2.0 - Production on Mon Jul 13 11:16:51 2015

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.
Password:

Connected to: Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning option
Master table "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully loaded/unloaded
Starting "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01":  parfile=trans_impdp.par userid=system/********
Processing object type TRANSPORTABLE_EXPORT/PLUGTS_BLK
Processing object type TRANSPORTABLE_EXPORT/TABLE
Processing object type TRANSPORTABLE_EXPORT/GRANT/OWNER_GRANT/OBJECT_GRANT
Processing object type TRANSPORTABLE_EXPORT/INDEX/INDEX
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/INDEX_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/COMMENT
Processing object type TRANSPORTABLE_EXPORT/CONSTRAINT/REF_CONSTRAINT
Processing object type TRANSPORTABLE_EXPORT/TABLE_STATISTICS
Processing object type TRANSPORTABLE_EXPORT/STATISTICS/MARKER
Processing object type TRANSPORTABLE_EXPORT/POST_INSTANCE/PLUGTS_BLK
Job "SYSTEM"."SYS_IMPORT_TRANSPORTABLE_01" successfully completed at Mon Jul 13 11:17:21 2015 elapsed 0 00:00:13




SQL> select count(object_type),object_type from dba_objects where owner='TESTUSER' group by object_type;

COUNT(OBJECT_TYPE) OBJECT_TYPE
------------------ -----------------------
                 1 SEQUENCE
                 2 PROCEDURE
                25 VIEW
                 5 FUNCTION

SQL>  select count(object_type),object_type from dba_objects where owner='NEW_TESTU' group by object_type;

COUNT(OBJECT_TYPE) OBJECT_TYPE
------------------ -----------------------
                 1 LOB
                54 INDEX
                74 TABLE
 

Import the metadata of source schema excluding table and index

Import the metadata and then check the object count again.

impdp remap_schema=TESTUSER:NEW_TESTU directory=test_exp dumpfile=TEST_metadata.dmp logfile=import_test.log userid=system


SQL> select count(object_type),object_type from dba_objects where owner='TESTUSER' group by object_type;

COUNT(OBJECT_TYPE) OBJECT_TYPE
------------------ -----------------------
                 1 SEQUENCE
                 2 PROCEDURE
                25 VIEW
                 5 FUNCTION

SQL>   select count(object_type),object_type from dba_objects where owner='NEW_TESTU' group by object_type;

COUNT(OBJECT_TYPE) OBJECT_TYPE
------------------ -----------------------
                 1 SEQUENCE
                 2 PROCEDURE
                 1 LOB
                54 INDEX
                74 TABLE
                25 VIEW
                 5 FUNCTION

7 rows selected.


Saturday, July 27, 2013

EM - Express 12c

EM Express – 12c Edition

Oracle Enterprise Manager Database Express, also referred to as EM Express, is a web-based tool for managing Oracle Database 12c



About license: This tool is free tool with oracle 12c standard or 12c Enterprise edition

To access EM express you need local listener configuration and this will get installed by default when u use DBCA to create database.


In my case I don't have listener so I am creating it from scratch

I registered my database with the newly created listener as follows

in sqlplus
 alter system register;


to know the port of your em please run the following query

 select dbms_xdb.getHttpPort() from dual;

DBMS_XDB.GETHTTPPORT()
----------------------
    0

SQL> select dbms_xdb_config.getHttpsPort() from dual;

DBMS_XDB_CONFIG.GETHTTPSPORT()
------------------------------
 5500

okay to invoke the em express the following is the formart

in web browser  https://hostname:portnumber://em/

in my case the following is the example

Note: This em plugin requires flash player. I tried more tough to update my firefox to install flash player.

finally I managed to install through following command

yum install flash-plugin nspluginwrapper.x86_64 nspluginwrapper.i686 

here you go first screen





























==================================================================================
please post your questions