Monday 8 May 2017

Step by step to install XDB in Oracle 11gr2

Step1: First check that XML Database already installed or not

SQL> select comp_name from dba_registry;

COMP_NAME
----------------------------------------
OWB
Oracle Application Express
Oracle Enterprise Manager
OLAP Catalog
Spatial
Oracle Multimedia
Oracle Text
Oracle Expression Filter
Oracle Rules Manager
Oracle Workspace Manager
Oracle Database Catalog Views
Oracle Database Packages and Types
JServer JAVA Virtual Machine
Oracle XDK
Oracle Database Java Packages
OLAP Analytic Workspace
Oracle OLAP API

17 rows selected.


Step2: Install XML Database 

XDB Installation

The catqm.sql script requires the following parameters be passed to it when run:

A. XDB user password
B. XDB user default tablespace
      (Any tablespace other than SYSTEM, UNDO and TEMP can be specified.
       The specified tablespace must already exist prior to running the script.)
C. XDB user temporary tablespace
D. SecureFiles = YES or NO
      (If YES is specified, the XDB repository will use SecureFile storage.
       If NO is specified, LOBS will be used.
       To use SecureFiles, compatibility must be set to 11.2.
       The tablespace specified for the XDB repository must be using
       Automatic Segment Space Management (ASSM) for SecureFiles to be used.)

Therefore the syntax to run catqm.sql is the following:
SQL> catqm.sql A B C D

For Example:
SQL> @?/rdbms/admin/catqm.sql XDB XDB TEMP YES

## IMPORTANT: You must shutdown and restart the database between removal and reinstall ##

SQL> spool xdb_install.log
SQL> set echo on;
SQL> connect / as sysdba
SQL> shutdown immediate;
SQL> startup;
SQL> @?/rdbms/admin/catqm.sql
SQL> @?/rdbms/admin/utlrp.sql
SQL> spool off



Step3: Now check that XML Database successfully installed or not

SQL> select comp_name , status from dba_registry;

COMP_NAME                                STATUS
---------------------------------------- --------------------------------------------
Oracle XML Database                      VALID
OWB                                      VALID
Oracle Application Express               VALID
Oracle Enterprise Manager                VALID
OLAP Catalog                             VALID
Spatial                                  VALID
Oracle Multimedia                        VALID
Oracle Text                              VALID
Oracle Expression Filter                 VALID
Oracle Rules Manager                     VALID
Oracle Workspace Manager                 VALID
Oracle Database Catalog Views            VALID
Oracle Database Packages and Types       VALID
JServer JAVA Virtual Machine             VALID
Oracle XDK                               VALID
Oracle Database Java Packages            VALID
OLAP Analytic Workspace                  VALID
Oracle OLAP API                          VALID

18 rows selected.

SQL>


Ref: Oracle Doc ID 1292089.1

Sunday 7 May 2017

ORA-31693: Table data object "SCHEMA"."TABLE" failed to load/unload and is being skipped due to error:

Error:

ORA-31693: Table data object ""."" failed to load/unload and is being skipped due to error:


Reason: 

The error is showing due to the backup dump file is not accessible from the the second node in the RAC


Solution:

Following example will help to resolve the issue.

expdp username/passwd tables=schema.table dumpfile=backup.dmp logfile=backup.log cluster=N

or

Shutdown Database on second node and execute the following command


expdp username/passwd tables=schema.table dumpfile=backup.dmp logfile=backup.lo

Sunday 30 April 2017

ORA-28000 "the account is locked" in the standby database


Scenario:

The user attempts to logon and gets an error ORA-28000 "the account is locked" in the primary database which is configure with Dataguard.
The database administrator unlock this user's account in the primary database.  Still, the user cannot connect to the standby, getting the same error ORA-28000 for the particular user, But the account status shows open in the standby.

In Standby :


SYS@ORCL > conn BNSUSER/sbl123
ERROR:
ORA-28000: the account is locked

Warning: You are no longer connected to ORACLE.

SYS@ORCL > select username,account_status from dba_users where username='BNSUSER';

USERNAME    ACCOUNT_STATUS
--------------------------
BNSUSER    OPEN


Reason :


 This is because the standby database is open read-only and cannot update any tables.  When a user's account has to be locked on the standby database, it is locked only in memory there.

Solution:

A privileged user (sysdba, the database administrator) must logon to the standby and unlock the account there.  A message ORA-28015 "Account unlocked, but the database is open for read-only access" confirms that the account is now unlocked in the standby database.  From then on, the user can logon to the standby database without getting any error.

SYS@ORCL > ALTER USER BNSUSER ACCOUNT UNLOCK;
ALTER USER BNSUSER ACCOUNT UNLOCK
*
ERROR at line 1:
ORA-28015: Account unlocked, but the database is open for read-only access

SYS@ORCL > conn BNSUSER/SBL123
Connected.