Error: Views\Synonyms required for XA transaction support are missing in this Database 12c

To resolve the above issue, follow below steps:-

As SYS user, enable Oracle database for XA by performing the following steps:

sqlplus / as sysdba

SQL>@$ORACLE_HOME/javavm/install/initxa.sql 
PL/SQL procedure successfully completed.
Execute $ORACLE_HOME/rdbms/admin/xaview.sql

SQL> @xaview.sql
DROP VIEW v$xatrans$
*
ERROR at line 1:
ORA-00942: table or view does not exist
DROP VIEW v$pending_xatrans$
*
ERROR at line 1:
ORA-00942: table or view does not exist
View created.
View created.
SQL>

RCU-6083:Failed - Check prerequisites requirement for selected component:OIM

Error: XDB is installed on the database with some errors. Objects in XDB schema are in unusable \ invalid state

1) Check for Invalid objects of XDB Schema

Login to Oracle Database as sysdba

SQL> select * from dba_objects where status='INVALID' and owner='XDB';

It will return Invalid Objects

Then we need to compile those invalid objects

SQL> exec dbms_utility.compile_schema(schema=>'XDB');

Again check for Invalid Objects

SQL> select * from dba_objects where status='INVALID' and owner='XDB';

If there is no Data return by this Select Statement then all Invalid objects are compiled

Error: Oracle TEXT is installed on the database with some errors. Objects in CTXSYS schema are in unusable\invalid state.

1) Check for Invalid objects of CTXSYS Schema

Login to Oracle Database as sysdba

SQL> select * from dba_objects where status='INVALID' and owner='CTXSYS';

It will return Invalid Objects

Then we need to compile those invalid objects

SQL> exec dbms_utility.compile_schema(schema=>'CTXSYS');

Again check for Invalid Objects

SQL> select * from dba_objects where status='INVALID' and owner='CTXSYS';

If there is no Data return by this Select Statement then all Invalid objects are compiled

Uninstall JAVA / JDK in Linux

Login as "root" user

Check the JAVA version

java -version

Query JDK / Java

rpm -qa | grep jdk

or 

rpm -qa | grep java

Uninstall / remove JDK / JAVA

yum -y remove jdk*

or

yum -y remove java<version name>

ORA-00119: invalid specification for system parameter LOCAL_LISTENER

I’ve recently installed an Oracle 12c Release 2 database on Linux and when I bounce the database (using the Shutdown and Startup commands), the database is unable to start

SQL> startup
ORA-00119: invalid specification for system parameter LOCAL_LISTENER
ORA-00132: syntax error or unresolved network name 'LISTENER_LAB11'

This is due to the lack of a LOCAL_LISTENER, that must be defined in the TNSNAMES.ORA, according to the Oracle Database Reference 12cR2:

LOCAL_LISTENER specifies a network name that resolves to an address or address list of Oracle Net local listeners
(that is, listeners that are running on the same machine as this instance)

The address or address list is specified in the TNSNAMES.ORA file or other address repository as configured for your system.

So, in your TNSNAMES.ORA (not in LISTENER.ORA) you must define this entry for the local listener:

LISTENER_LAB11.WORLD =
 (ADDRESS = (PROTOCOL = TCP)(HOST = toralin1)(PORT = 1521))

And now you can startup the database. Be sure to set the .WORLD if you have the parameter NAMES.DEFAULT_DOMAIN set at SQLNET.ORA

You can learn more about the LOCAL_LISTENER in this excellent post of Ed Stevens: Exploring the LOCAL_LISTENER parameter

ORA - 39087 Directory Name is invalid

This error occurs because of Directory permissions in Oracle Data Pump during Export / Import

Resolution

SQL> grant read, write on directory <Directory_Name> to <Schema_Name>;

Move Datafile from Location to Another

Prior to Oracle 12c, moving datafiles has always been an offline task

Oracle 12c includes an enhancement to ALTER DATABASE command to allow datafiles to be moved online

Connect as SYSDBA

SQL>SELECT file_id, file_name FROM dba_data_files ORDER BY file_id;

SQL> ALTER DATABASE MOVE DATAFILE '/u01/app/oracle/oradata/cdb1/system01.dbf'
TO '/tmp/system01.dbf';

Database altered.

SQL> SELECT file_id, file_name FROM dba_data_files WHERE file_id = 1;

PLS - 00201 Identifier 'dbms_reputil' must be declared

Solution:

sqlplus / as sysdba

SQL>grant execute on dbms_reputil to public;

SQL>exit

PRVG - 1561 Setting ORA_CRS_HOME variable is not supported

Resolution:

unset ORA_CRS_HOME

INS - 30507 Empty ASM diskgroup

Resolution:

Check permission for "sd* in /dev

PRVF - 0002 - Could not retrieve Local Node name

Resolution:

Edit /etc/hosts

Add IP Address and Host name

INS - 40922 Invalid SCAN - unresolveable to an IP Address

Cause:

SCAN provided does not resolve to an IP Address

Resolution:

Check SCAN name, during installation of GRID Infrastructure

ORA - 1653 Unable to Save Records in a table OR Unable to Extend Tablespace

Unable to Save Records in a table OR Unable to Extend Tablespace

Solution:

Check Oracle's Alert.log file for the problem

Reason may be tablespace for that table may be full

So you need to extend the tablespace OR

Create another datafile for that tablespace

Configure MS Outlook Mail for Oracle 12c Database

First install Oracle Packages to Configure Outlook Mail

[host@oracle]$sqlplus / as sysdba

SQL> @$ORACLE_HOME/rdbms/admin\utlmail.sql

SQL> @$ORACLE_HOME/rdbms/admin\utlsmtp.sql

SQL> @$ORACLE_HOME/rdbms/admin\prvtmail.plb

SQL> GRANT EXECUTE ON utl_mail TO PUBLIC;

SQL> GRANT EXECUTE ON utl_smtp TO PUBLIC;

SQL> alter system set smtp_out_server='mail.server.com or IP of Mail Server' scope=both;

ACL: Access Control List

Check for current existing ACL’s
Let’s check out all currently present Access Control Lists in the database;

SQL> SELECT host, lower_port, upper_port, acl FROM dba_network_acls;
no rows selected

SQL>

All right none present – let’s create a new Network Access List using

DBMS_NETWORK_ACL_ADMIN — privilege

Use ‘connect’ for UTL_TCP, UTL_SMTP, UTL_MAIL and UTL_HTTP access.
Use ‘resolve’ for UTL_INADDR name/IP resolution.
The text for the privilege is case sensitive.
A list of all available network access privileges is in the
DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE reference

Create ACL and Privileges

Now first create an ACL as SYS
(or any other user with DBMS_NETWORK_ACL_ADMIN execute granted)
This will hold the privileges.
You can add as many privileges as you like to this file, but I would recommend to split
privileges in the ACL to specific tasks or users.
You must create an ACL with at least one privilege, so lets start with the ‘connect’
privilege for user SCOTT (also a role can be added as principal)

SQL>BEGIN
  DBMS_NETWORK_ACL_ADMIN.create_acl (
    acl          => 'acl_test_for_scott.xml',
    description  => 'A test of the ACL functionality',
    principal    => 'SCOTT', */ schema (user) name/*
    is_grant     => TRUE,
    privilege    => 'connect',
    start_date   => SYSTIMESTAMP,
    end_date     => NULL);
  COMMIT;
END;
/

Add Privilege

Great, now that the ACL is created
You can add more privileges like the ‘resolve’ privilege:

SQL>begin
  dbms_network_acl_admin.add_privilege (
  acl       => 'utl_mail.xml',
  principal => 'SCOTT', */ schema (user) name/*
  is_grant  => TRUE,
  privilege => 'resolve'
  );
  commit;
end;

Assign Access Control List (ACL)

Cool, you granted SCOTT to connect and resolve
But you have not defined to which resources/port he is allowed to connect

== ADD PORT 80

SQL>begin
  dbms_network_acl_admin.assign_acl (
    acl => 'acl_test_for_scott.xml',
    host => 'mail.<domain>.nl',
    lower_port => 80,
    upper_port => NULL);
END;
/

== ADD PORT 25

SQL>begin
  dbms_network_acl_admin.assign_acl (
    acl => 'acl_test_for_scott.xml',
    host => 'mail.********.nl',
    lower_port => 25,
    upper_port => NULL);
  COMMIT;

SQL> select * from dba_network_acls

HOST       LOWER_PORT UPPER_PORT ACL
---------- ---------- ---------- ------------------------------
mail.**.nl         80         80 /sys/acls/acl_test_for_scott.xml
mail.**.nl         25         25 /sys/acls/acl_test_for_scott.xml
SQL>

Add another Database User (SCHEMA) to ACL list

SQL>BEGIN
  DBMS_NETWORK_ACL_ADMIN.ADD_PRIVILEGE(
    acl => 'acl_test_for_scott.xml',
    principal => 'PANNENKOEK', */ schema (user) name/*
    is_grant => TRUE,
    privilege => 'connect');
END;
/

SQL> SELECT acl,
          principal,
           privilege,
           is_grant,
           TO_CHAR(start_date, 'DD-MON-YYYY') AS start_date,
          TO_CHAR(end_date, 'DD-MON-YYYY') AS end_date
  FROM   dba_network_acl_privileges;
SQL> /

ACL                                 PRINCIPAL  PRIVILE IS_GR START_DATE  END_DATE
------------------------------      ---------- ------- ----- ----------- -----------
/sys/acls/acl_test_for_scott.xml    SCOTT      connect true  30-JAN-2013
/sys/acls/acl_test_for_scott.xml    PANNENKOEK connect true  30-JAN-2013

SQLNet.Allowed_Logon_Version is deprecated

Resolution

In Oracle Database 12c parameter Allowed_Logon_Version is deprecated in SQLNet.ora

This parameter is been replaced by 2 new parameters

SQLNET.Allowed_Logon_Version_Server
SQLNET.Allowed_Logon_Version_Client

Basic Configuration for Installing Oracle Forms 11g and Reports on Windows O/s

Download Oracle Weblogic Server 10.3.6 for Oracle Forms 11g and Reports from Oracle Website

Basic/Initial Configuration for installation on Windows O/s

Set up TEMP Directory for installation

In Windows Environmental Variables

Set Variable TEMP ==> C:\Windows\TEMP
Set Variable TMP ==>    C:\Windows\TEMP

Install latest JDK
Ensure that there is no White Space in the Folder where Java is to be installed

Example: C:\Oracle\Java

Also set the same in Windows Environmental Variables

JAVA_HOME    => C:\Oracle\Java

After completion of these Steps, start installing
1) Weblogic Server
2) Oracle Forms and Reports 11g

ORA - 01653: Unable to extend table ABC by X in tablespace

PROBLEM:

User gets an error message -2147217900 - ORA-01653: unable to extend table ABC by X in tablespace OPSMASTERSTORAGE where ABC is a name of the current table X is the number of bytes the table needs to be extended by

CAUSE:

Typically occurs when writing a new record to oracle database, but there is not enough space to write it.
The data file in oracle tablespace called OPSMASTERSTORAGE should be set to AUTOEXTEND
If it is not, Oracle will not auto-increase the size of the datafile and will raise the above error.

SOLUTION:

WARNING: This procedure should be performed by your ORACLE Database Administrator.
The SYSTEM user should have required privledges to perform this task.  

Enable Autoextend on the OPSMASTERSTORAGE tablespace by executing the following Oracle PL/SQL command:

ALTER DATABASE DATAFILE 'C:\ORACLE\ORADATA\ORA817\OPSMASTERSTORAGE.ORA' AUTOEXTEND ON NEXT 1024K

ORA - 01658 Unable to create initial extents in tablespace

Solution:  Can be resolved either by using one of the methods 
Add new datafile to tablespace
Extend the tablespace or resize the datafile
Move datafile to mount point having enough space

OUI - 10136 - Oracle home with name jdk1 already exists

This is because, there is an Entry during the installation

Solution:

Remove line MIDDLEWARE\JDK from file INVENTORY.XML which is located in

C:\PROGRAM FILES\ORACLE\INVENTORY\CONTEXTSXML\INVENTORY.XML

Save the file and restart installation of OEM 12c

ORA - 01665

Solution

On Primary Database
C:\Windows\system32>sqlplus sys/<password> as sysdba

SQL*Plus: Release 10.2.0.4.0 - Production on Tue May 14 12:31:15 2013
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> alter database create standby controlfile as 'D:\oracle\oradata\sjcstnd\controlfile\stanctl.ctl';
Database altered.

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64 bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

On Standby Database
C:\Windows\system32>set oracle_sid=sjcstnd
C:\Windows\system32>sqlplus sys/<password> as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Tue May 14 12:31:59 2013
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64 bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

C:\Windows\system32>d:
D:\>cd oracle
D:\oracle>cd oradata
D:\oracle\oradata>dir
 Volume in drive D is Secondary
 Volume Serial Number is 0ABF-0E1D

 Directory of D:\oracle\oradata
21/04/2013  13:06    <DIR>          .
21/04/2013  13:06    <DIR>          ..
21/04/2013  12:50    <DIR>          archive
09/05/2013  09:48    <DIR>          sjcstnd
07/05/2013  14:20    <DIR>          sjctest
               0 File(s)              0 bytes
               5 Dir(s)  433,725,743,104 bytes free

D:\oracle\oradata>cd sjcstnd\controlfile
D:\oracle\oradata\sjcstnd\controlfile>dir
 Volume in drive D is Secondary
 Volume Serial Number is 0ABF-0E1D

 Directory of D:\oracle\oradata\sjcstnd\controlfile
14/05/2013  12:33    <DIR>          .
14/05/2013  12:33    <DIR>          ..
14/05/2013  12:32         7,094,272 control01OLD.ctl
14/05/2013  12:32         7,094,272 control02OLD.ctl
14/05/2013  12:32         7,094,272 control03OLD.ctl
14/05/2013  12:31         7,159,808 STANCTL.CTL
               4 File(s)     28,442,624 bytes
               2 Dir(s)  433,725,743,104 bytes free

D:\oracle\oradata\sjcstnd\controlfile>move STANCTL.CTL CONTROL01.CTL
        1 file(s) moved.

D:\oracle\oradata\sjcstnd\controlfile>COPY CONTROL01.CTL CONTROL02.CTL
        1 file(s) copied.

D:\oracle\oradata\sjcstnd\controlfile>COPY CONTROL02.CTL CONTROL03.CTL
        1 file(s) copied.

D:\oracle\oradata\sjcstnd\controlfile>set oracle_sid=sjcstnd
D:\oracle\oradata\sjcstnd\controlfile>sqlplus sys/<password> as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Tue May 14 12:36:15 2013
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
Connected to an idle instance.
SQL> startup nomount pfile='C:\oracle\product\10.2.0\db_1\database\INITsjcstnd.ora';
ORACLE instance started.

Total System Global Area 1610612736 bytes
Fixed Size                  2066080 bytes
Variable Size             385878368 bytes
Database Buffers         1207959552 bytes
Redo Buffers               14708736 bytes

SQL>  create spfile from pfile='C:\oracle\product\10.2.0\db_1\database\INITsjcstnd.ora';
File created.

SQL> shutdown immediate;
ORA-01507: database not mounted

ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.

Total System Global Area 1610612736 bytes
Fixed Size                  2066080 bytes
Variable Size             385878368 bytes
Database Buffers         1207959552 bytes
Redo Buffers               14708736 bytes
Database mounted.

SQL> alter database recover managed standby database disconnect from session;
Database altered.

SQL>

ORA - 01196

Solution

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.

C:\Windows\system32>set oracle_sid=sjcstnd
C:\Windows\system32>dgmgrl
DGMGRL for 64-bit Windows: Version 10.2.0.4.0 - 64bit Production

Copyright (c) 2000, 2005, Oracle. All rights reserved.
Welcome to DGMGRL, type "help" for information.
DGMGRL> connect sys/<password>
Connected.
Error:
ORA-01034: ORACLE not available

DGMGRL> connect sys/<password>@sjcstnd
Connected.
Error:
ORA-01034: ORACLE not available

DGMGRL> connect sys/<password>@sjctest
Connected.
DGMGRL> show configuration

Configuration
  Name:                dgtest
  Enabled:             YES
  Protection Mode:     MaxPerformance
  Fast-Start Failover: DISABLED
  Databases:
    sjctest - Primary database
    sjcstnd - Physical standby database

Current status for "dgtest":
Warning: ORA-16607: one or more databases have failed

DGMGRL> exit
C:\Windows\system32>set oracle_sid=sjcstnd
C:\Windows\system32>sqlplus sys/<password> as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Tue May 14 10:00:11 2013
Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
Connected to an idle instance.
SQL> startup
ORACLE instance started.

Total System Global Area 1610612736 bytes
Fixed Size                  2066080 bytes
Variable Size             385878368 bytes
Database Buffers         1207959552 bytes
Redo Buffers               14708736 bytes
Database mounted.
ORA-16004: backup database requires recovery
ORA-01196: file 1 is inconsistent due to a failed media recovery session
ORA-01110: data file 1: 'D:\ORACLE\ORADATA\SJCSTND\SYSTEM01.DBF'

SQL> shutdown immediate;
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.

SQL> startup
ORACLE instance started.

Total System Global Area 1610612736 bytes
Fixed Size                  2066080 bytes
Variable Size             385878368 bytes
Database Buffers         1207959552 bytes
Redo Buffers               14708736 bytes
Database mounted.
ORA-16004: backup database requires recovery
ORA-01196: file 1 is inconsistent due to a failed media recovery session
ORA-01110: data file 1: 'D:\ORACLE\ORADATA\SJCSTND\SYSTEM01.DBF'

SQL> shutdown immediate;
ORA-01109: database not open

Database dismounted.
ORACLE instance shut down.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 1610612736 bytes
Fixed Size                  2066080 bytes
Variable Size             385878368 bytes
Database Buffers         1207959552 bytes
Redo Buffers               14708736 bytes

SQL> ALTER DATABASE MOUNT STANDBY DATABASE;
Database altered.

SQL> alter database activate standby database;
alter database activate standby database
*
ERROR at line 1:
ORA-01196: file 1 is inconsistent due to a failed media recovery session
ORA-01110: data file 1: 'D:\ORACLE\ORADATA\SJCSTND\SYSTEM01.DBF'

SQL> recover managed standby database cancel;
Media recovery complete.

SQL> recover automatic standby database;
ORA-00279: change 1201121 generated at 05/14/2013 10:04:49 needed for thread 1
ORA-00289: suggestion :

D:\ORACLE\FLASH_RECOVERY_AREA\SJCSTND\ARCHIVELOG\ARC00055_0814701730.001
ORA-00280: change 1201121 for thread 1 is in sequence
#55 ORA-00278: log file'D:\ORACLE\FLASH_RECOVERY_AREA\SJCSTND\ARCHIVELOG\ARC00055_0814701730.001' nolonger needed for this recovery
ORA-16145: archival for thread# 1 sequence# 55 in progress

Specify log: {<RET>=suggested | filename | AUTO | CANCEL}
CANCEL
Media recovery cancelled.

SQL> alter database activate standby database;
Database altered.

SQL> select CONTROLFILE_TYPE from v$database;
CONTROL
-------
CURRENT

SQL> ALTER DATABASE SET STANDBY DATABASE TO MAXIMIZE PERFORMANCE;
Database altered.

SQL> ALTER DATABASE OPEN;
Database altered.

SQL> select name,open_mode from gv$database;
NAME      OPEN_MODE
--------- ----------
SJCTEST   READ WRITE

SQL> exit
Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

C:\Windows\system32>set oracle_sid=sjcstnd
C:\Windows\system32>sqlplus sys/<password> as sysdba
SQL*Plus: Release 10.2.0.4.0 - Production on Tue May 14 10:11:51 2013
Copyright (c) 1982, 2007, Oracle.  All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> ALTER DATABASE OPEN;
ALTER DATABASE OPEN
*
ERROR at line 1:
ORA-01531: a database already open by the instance

SQL> select name,open_mode from gv$database;
NAME      OPEN_MODE
--------- ----------
SJCTEST   READ WRITE

SQL> select controlfile_type from gv$database;
CONTROL
-------
CURRENT

SQL> desc dba_users
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------

 USERNAME                                  NOT NULL VARCHAR2(30)
 USER_ID                                   NOT NULL NUMBER
 PASSWORD                                           VARCHAR2(30)
 ACCOUNT_STATUS                            NOT NULL VARCHAR2(32)
 LOCK_DATE                                          DATE
 EXPIRY_DATE                                        DATE
 DEFAULT_TABLESPACE                        NOT NULL VARCHAR2(30)
 TEMPORARY_TABLESPACE                      NOT NULL VARCHAR2(30)
 CREATED                                   NOT NULL DATE
 PROFILE                                   NOT NULL VARCHAR2(30)
 INITIAL_RSRC_CONSUMER_GROUP                        VARCHAR2(30)
 EXTERNAL_NAME                                      VARCHAR2(4000)

SQL>

How to fix: ERROR 1045 (28000): Access denied for user ‘root’@’localhost’ (using password: YES)

Open your terminal and type mysql -u root -p Enter your password. Hopefully your MySQL is logged in now.