Believe + Attitude=What you achieve


The title does look like a math formula. It is the summary of Carol Dweck's book - Mindset: The new psychology of success in simple words. This book was published in 2006. It was recommended by one of the nerds I admire.

According to the book, the entire world fall into - fixed mindset or growth mindset.

In a fixed mindset, you have a talent in something and that cannot be changed. Growth mindset believes that anyone can be intelligent, smart and achieve anything by effort and attitude. The book depicts the roadblocks hit by a fixed mindset and how it becomes fatal in their life.  The book touches different areas like sports,  work & business, relationship and parenting. The book ends with a workshop to encourage the reader to get into growth mindset. 

Analyzing my own life, I feel like there are somethings I do with fixed mindset while rest being in growth mindset. I would definitely recommend this as a must read.

Drop an Oracle Database using SQLPlus - Drop Database

DBCA is one of the most popular method of dropping an Oracle database. I personally use SQLPlus method. It is simple, fast and removes the files from the storage as well. SQLPlus also doesn't verify the inventory information for the drop.

Please set the environment variables like $ORACLE_SID, $ORACLE_HOME, $PATH. If the database is already up and running, issue a shutdown first. Following are the order of commands:

$ sqlplus / as sysdba
SQL> shutdown immediate;
SQL> startup mount exclusive restrict;
SQL> drop database;
SQL> exit
Please wait for few minutes and you can see the database files are removed.

OPatch Error after copying Oracle Home : Inventory load failed... OPatch cannot load inventory for the given Oracle Home.

In order to save time, I copied Oracle Database Home from one server to another including the inventory. When I tried to do a 'lsinventory' I got the following error:

$opatch lsinventory -invPtrLoc /r01/app/oracle/oradb/oraInventory/oraInst.loc

Oracle Interim Patch Installer version 12.1.0.1.6
Copyright (c) 2015, Oracle Corporation.  All rights reserved.


Oracle Home       : /r01/app/oracle/oradb/12.1.0
Central Inventory : /r01/app/oracle/oradb/oraInventory
   from           : /r01/app/oracle/oradb/oraInventory/oraInst.loc
OPatch version    : 12.1.0.1.6
OUI version       : 12.1.0.2.0
Log file location : /r01/app/oracle/oradb/12.1.0/cfgtoollogs/opatch/opatch2015-06-02_10-31-39AM_1.log

List of Homes on this system:

  Home name= OraDB12Home1, Location= "/u01/app/oracle/oradb/12.1.0"
Inventory load failed... OPatch cannot load inventory for the given Oracle Home.
Possible causes are:
   Oracle Home dir. path does not exist in Central Inventory
   Oracle Home is a symbolic link
   Oracle Home inventory is corrupted
LsInventorySession failed: OracleHomeInventory gets null oracleHomeInfo

OPatch failed with error code 73

Solution:

Go to the Inventory location (in my case /r01/app/oracle/oradb/oraInventory/ContentsXML) and search for inventory.xml. Replace

HOME NAME="OraDB12Home1" LOC="/u01/app/oracle/oradb/12.1.0" TYPE="O" IDX="1"
with
HOME NAME="OraDB12Home1" LOC="/r01/app/oracle/oradb/12.1.0" TYPE="O" IDX="1" 

in the inventory.xml and save it.

Oracle WebCenter Content RCU with 12c database - ORA-01950: no privileges on tablespace

While creating schema for WebCenter Content (11.1.1.8.0) using the RCU ofm_rcu_win_11.1.1.8.0_64_disk1_1of1.zip against a 12c database caused the following error:

JDBC SQLException - ErrorCode: 1950SQLState:42000 Message: ORA-01950: no privileges on tablespace 'WCC_ORAIRM'

Error encountered executing SQL statement  FileName: 'Z:AAAA\Desktop\ofm_rcu_win_11.1.1.8.0_64_disk1_1of1\rcuHome\\rcu\integration\\irm\sql\oracle\create_irm_tables.sql' LineNumber: '64'
SQL Statement: [INSERT INTO SEQUENCE(SEQ_NAME, SEQ_COUNT) values ('SEQ_GEN_TABLE', 0)]
java.sql.SQLSyntaxErrorException: ORA-01950: no privileges on tablespace 'WCC_ORAIRM'

Cause :

This is due to changes in the 12c database compared to 11g: UNLIMITED TABLESPACE is no longer included in RESOURCE role. Quota must be explicitly set by ALTER USER.

Solution:
Go to the RCU location:

Z:AAAA\Desktop\ofm_rcu_win_11.1.1.8.0_64_disk1_1of1\rcuHome\rcu\integration\irm\sql\oracle

alter user &irm_user quota unlimited on &def_tablespace;
or
alter user &&1 quota unlimited on &&3; 

Repeat the following for contentserver11, contentserver11search, capture, ipm, urm.

Oracle System Change Number (SCN) : How to find the current SCN, SCN and Archive Log

Oracle SCN (System Change Number) is a mechanism to maintain data consistency in Oracle database. A stamp that defines a committed version of a database at a point in time. Oracle assigns every committed transaction a unique SCN.

Checkpoint (CKPT) occurs when all modified database buffers in the Oracle SGA are written out to datafiles by the database writer (DBWn) process. It is a data structure that defines an SCN in the redo thread of a database. Checkpoints are recorded in the control file and each datafile header, and are a crucial element of recovery.

How to find current SCN in the database

Method-I
column current_scn format 99999999999999999999;
select current_scn from v$database; 

Method-II
select to_char(dbms_flashback.get_system_change_number) from dual;

Archive Log and SCN:

col first_change# for 999999999999999999
col next_change# for 999999999999999999
select name, thread#, sequence#, status, first_time, next_time 
from v$archived_log 
where &scn between FIRST_CHANGE# and NEXT_CHANGE#;

SCN and Timestamp:
SQL>select scn_to_timestamp(281840233193) as timestamp from dual;

TIMESTAMP
---------------------------------------------------------------------------
04-MAY-15 10.01.49.000000000 AM
SQL>col scn for 99999999999999999999;
SQL>select timestamp_to_scn(to_timestamp('05/04/2015 10:25:01','MM/DD/YYYY HH24:MI:SS')) as scn from dual;

                  SCN
---------------------
         281842111354
SQL>select timestamp_to_scn(to_timestamp('05042015102501','MMDDYYYYHH24MISS')) scn from dual; 
 SCN
---------------------
         281842111354

Other options are to query smon_scn_time and v$log_history. smon_scn_time is owned by SYS and have data worth of 5 days.