Skip navigation.

Michael Dinh

Syndicate content Thinking Out Loud
Michael T. Dinh, Oracle DBA
Updated: 7 hours 55 sec ago

Using DBMS_STREAMS_ADM To Cleanup GoldenGate

Mon, 2016-05-23 23:33

This is really messed up. I chose GoldenGate because I did not want to mess around with streams.

When using Integrated Capture or Delivery, then knowing streams is a prerequisites.

Apologies as the format is not pretty.

The QUEUE table was indeed missing and this is what I get for monkeying around.

To resolve the issue –  exec DBMS_STREAMS_ADM.REMOVE_STREAMS_CONFIGURATION();

GGSCI (arrow.localdomain as ggs_admin@hawk) 3> unREGISTER EXTRACT e_hawk DATABASE

2016-05-23 19:16:32  ERROR   OGG-08221  Cannot register or unregister EXTRACT E_HAWK because of the following SQL error: 
OCI Error ORA-24010: QUEUE "GGS_ADMIN"."OGG$Q_E_HAWK" does not exist
ORA-06512: at "SYS.DBMS_APPLY_ADM_INTERNAL", line 468
ORA-06512: at "SYS.DBMS_APPLY_ADM", line 724
ORA-06512: at line 1 (status = 24010).

GGSCI (arrow.localdomain as ggs_admin@hawk) 4> exit


ARROW:(SYS@hawk):PRIMARY> select * from dba_capture;

CAPTURE_NAME                   QUEUE_NAME                     QUEUE_OWNER
------------------------------ ------------------------------ ------------------------------
RULE_SET_NAME                  RULE_SET_OWNER                 CAPTURE_USER
------------------------------ ------------------------------ ------------------------------
 START_SCN STATUS   CAPTURED_SCN APPLIED_SCN USE  FIRST_SCN
---------- -------- ------------ ----------- --- ----------
SOURCE_DATABASE
----------------------------------------------------------------------------------------------------
SOURCE_DBID SOURCE_RESETLOGS_SCN SOURCE_RESETLOGS_TIME LOGMINER_ID NEGATIVE_RULE_SET_NAME
----------- -------------------- --------------------- ----------- ------------------------------
NEGATIVE_RULE_SET_OWNER        MAX_CHECKPOINT_SCN REQUIRED_CHECKPOINT_SCN LOGFILE_ STATUS_CH
------------------------------ ------------------ ----------------------- -------- ---------
ERROR_NUMBER
------------
ERROR_MESSAGE
----------------------------------------------------------------------------------------------------
VERSION                                                          CAPTURE_TY LAST_ENQUEUED_SCN
---------------------------------------------------------------- ---------- -----------------
CHECKPOINT_RETENTION_TIME
-------------------------
START_TIME                                                                  PURPOSE
--------------------------------------------------------------------------- -------------------
CLIENT_NAME
----------------------------------------------------------------------------------------------------
CLIENT_S OLDEST_SCN FILTERED_SCN
-------- ---------- ------------
OGG$CAP_E_HAWK                 OGG$Q_E_HAWK                   GGS_ADMIN
                                                              GGS_ADMIN
    256229 DISABLED       346591      346586 NO      256229
HAWK
 3171223736                    1             912525304           3
                                           346420                  346586 IMPLICIT 23-MAY-16


11.2.0.4.0                                                       LOCAL
                        0
22-MAY-16 04.21.31.000000 PM                                                GoldenGate Capture
E_HAWK
DISABLED     346586       255600


ARROW:(SYS@hawk):PRIMARY> exec DBMS_CAPTURE_ADM.STOP_CAPTURE('OGG$CAP_E_HAWK');

PL/SQL procedure successfully completed.

ARROW:(SYS@hawk):PRIMARY> select * from dba_capture;

CAPTURE_NAME                   QUEUE_NAME                     QUEUE_OWNER
------------------------------ ------------------------------ ------------------------------
RULE_SET_NAME                  RULE_SET_OWNER                 CAPTURE_USER
------------------------------ ------------------------------ ------------------------------
 START_SCN STATUS   CAPTURED_SCN APPLIED_SCN USE  FIRST_SCN
---------- -------- ------------ ----------- --- ----------
SOURCE_DATABASE
----------------------------------------------------------------------------------------------------
SOURCE_DBID SOURCE_RESETLOGS_SCN SOURCE_RESETLOGS_TIME LOGMINER_ID NEGATIVE_RULE_SET_NAME
----------- -------------------- --------------------- ----------- ------------------------------
NEGATIVE_RULE_SET_OWNER        MAX_CHECKPOINT_SCN REQUIRED_CHECKPOINT_SCN LOGFILE_ STATUS_CH
------------------------------ ------------------ ----------------------- -------- ---------
ERROR_NUMBER
------------
ERROR_MESSAGE
----------------------------------------------------------------------------------------------------
VERSION                                                          CAPTURE_TY LAST_ENQUEUED_SCN
---------------------------------------------------------------- ---------- -----------------
CHECKPOINT_RETENTION_TIME
-------------------------
START_TIME                                                                  PURPOSE
--------------------------------------------------------------------------- -------------------
CLIENT_NAME
----------------------------------------------------------------------------------------------------
CLIENT_S OLDEST_SCN FILTERED_SCN
-------- ---------- ------------
OGG$CAP_E_HAWK                 OGG$Q_E_HAWK                   GGS_ADMIN
                                                              GGS_ADMIN
    256229 DISABLED       346591      346586 NO      256229
HAWK
 3171223736                    1             912525304           3
                                           346420                  346586 IMPLICIT 23-MAY-16


11.2.0.4.0                                                       LOCAL
                        0
22-MAY-16 04.21.31.000000 PM                                                GoldenGate Capture
E_HAWK
DISABLED     346586       255600


ARROW:(SYS@hawk):PRIMARY>


ARROW:(SYS@hawk):PRIMARY> exec DBMS_STREAMS_ADM.REMOVE_STREAMS_CONFIGURATION();

PL/SQL procedure successfully completed.

ARROW:(SYS@hawk):PRIMARY> select * from dba_capture;

no rows selected

ARROW:(SYS@hawk):PRIMARY>

GoldenGate 12.2 Patch 17030189 required Integrated trail format RELEASE 12.2 or later

Sun, 2016-05-22 14:26
EXTRACT Abending With OGG-02912 (Doc ID 2091679.1)

Alternate script prvtlmpg.plb (included in the Oracle GoldenGate installation directory) to the mining database to work around this limitation.

oracle@arrow:hawk:/u01/app/12.2.0.1/ggs01
$ ll prv*
-rw-r-----. 1 oracle oinstall 1272 Dec 28  2010 prvtclkm.plb
-rw-r-----. 1 oracle oinstall 9487 May 27  2015 prvtlmpg.plb
-rw-r-----. 1 oracle oinstall 3263 May 27  2015 prvtlmpg_uninstall.sql
oracle@arrow:hawk:/u01/app/12.2.0.1/ggs01
$

The other option in this case would be to request a backport since patch is not available for all database 11g releases.

Implementing work around.

oracle@arrow:hawk:/u01/app/12.2.0.1/ggs01
$ sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Sun May 22 15:23:27 2016

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


Connected to:
Oracle Database 11g Release 11.2.0.4.0 - 64bit Production

ARROW:(SYS@hawk):PRIMARY> @prvtlmpg.plb

Oracle GoldenGate Workaround prvtlmpg

This script provides a temporary workaround for bug 17030189.
It is strongly recommended that you apply the official Oracle
Patch for bug 17030189 from My Oracle Support instead of using
this workaround.

This script must be executed in the mining database of Integrated
Capture. You will be prompted for the username of the mining user.
Use a double quoted identifier if the username is case sensitive
or contains special characters. In a CDB environment, this script
must be executed from the CDB$ROOT container and the mining user
must be a common user.

===========================  WARNING  ==========================
You MUST stop all Integrated Captures that belong to this mining
user before proceeding!
================================================================

Enter Integrated Capture mining user: ggs_admin

Installing workaround...
No errors.
No errors.
No errors.
Installation completed.
ARROW:(SYS@hawk):PRIMARY> exit
Disconnected from Oracle Database 11g Release 11.2.0.4.0 - 64bit Production
oracle@arrow:hawk:/u01/app/12.2.0.1/ggs01
$

oracle@arrow:hawk:/u01/app/oracle/product/11.2.0/se_1/dbs
$ opatch lsinventory
Oracle Interim Patch Installer version 11.2.0.3.4
Copyright (c) 2012, Oracle Corporation.  All rights reserved.

Oracle Home       : /u01/app/oracle/product/11.2.0/se_1
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/11.2.0/se_1/oraInst.loc
OPatch version    : 11.2.0.3.4
OUI version       : 11.2.0.4.0
Log file location : /u01/app/oracle/product/11.2.0/se_1/cfgtoollogs/opatch/opatch2016-05-22_15-26-10PM_1.log

Lsinventory Output file location : /u01/app/oracle/product/11.2.0/se_1/cfgtoollogs/opatch/lsinv/lsinventory2016-05-22_15-26-10PM.txt

--------------------------------------------------------------------------------
Installed Top-level Products (1):

Oracle Database 11g                                                  11.2.0.4.0
There are 1 products installed in this Oracle Home.


There are no Interim patches installed in this Oracle Home.


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

OPatch succeeded.
oracle@arrow:hawk:/u01/app/oracle/product/11.2.0/se_1/dbs
$

Create GoldenGate 12.2 Manager

Sun, 2016-05-22 14:14

I typically don’t like to see WARNING if I can help it.

Goldengate 12c has some security features to allow/prevent unauthorized access.

Be careful. Incorrect IPADDR or PROG is used will prevent Pump Extract delivery to target server.

oracle@arrow:hawk:/u01/app/12.2.0.1/ggs01
$ tail -100 ggserr.log
2016-05-22 12:25:07  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): start mgr.
2016-05-22 12:25:07  WARNING OGG-01877  Oracle GoldenGate Manager for Oracle, mgr.prm:  Missing explicit accessrule for server collector.
2016-05-22 12:25:07  INFO    OGG-00960  Oracle GoldenGate Manager for Oracle, mgr.prm:  Access granted (rule #7).
2016-05-22 12:25:07  INFO    OGG-00983  Oracle GoldenGate Manager for Oracle, mgr.prm:  Manager started (port 7901).
2016-05-22 12:25:09  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): info all.
2016-05-22 12:25:46  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): info all.
2016-05-22 12:25:51  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): stop mgr.
2016-05-22 12:25:51  INFO    OGG-00963  Oracle GoldenGate Manager for Oracle, mgr.prm:  Command received from GGSCI on host [127.0.0.1]:39551 (STOP).
2016-05-22 12:25:51  INFO    OGG-00960  Oracle GoldenGate Manager for Oracle, mgr.prm:  Access granted (rule #7).
2016-05-22 12:25:51  WARNING OGG-00938  Oracle GoldenGate Manager for Oracle, mgr.prm:  Manager is stopping at user request.
2016-05-22 12:26:00  INFO    OGG-00987  Oracle GoldenGate Command Interpreter for Oracle:  GGSCI command (oracle): start mgr.
2016-05-22 12:26:00  INFO    OGG-00960  Oracle GoldenGate Manager for Oracle, mgr.prm:  Access granted (rule #2).
2016-05-22 12:26:00  INFO    OGG-00983  Oracle GoldenGate Manager for Oracle, mgr.prm:  Manager started (port 7901).

oracle@arrow:hawk:/u01/app/12.2.0.1/ggs01
$ cat dirprm/mgr.prm
PORT 7901
DYNAMICPORTLIST 15100-15120
ACCESSRULE, PROG server, IPADDR *, ALLOW
ACCESSRULE, PROG *, IPADDR *, ALLOW
USERIDALIAS ggs_admin
PURGEOLDEXTRACTS ./dirdat/*, USECHECKPOINTS, MINKEEPDAYS 3
-- AUTOSTART ER *
-- AUTORESTART ER *, RETRIES 5, WAITMINUTES 2, RESETMINUTES 60
CHECKMINUTES 5
LAGCRITICALMINUTES 15
oracle@arrow:hawk:/u01/app/12.2.0.1/ggs01
$

Create GoldenGate 12.2 Wallet

Sun, 2016-05-22 13:44

So what’s different from this post versus other posts? I share my mistakes with you.

Did you know there was a DEFAULT domain? If you didn’t, neither did I and only found out by using

info credentialstore

alter credentialstore add user ggs_admin alias ggs_admin domain admin
USERIDALIAS ggs_admin DOMAIN admin

alter credentialstore add user ggs_admin alias ggs_admin
USERIDALIAS ggs_admin

oracle@arrow:thor:/u01/app/12.2.0.1/ggs02
$ ./ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 12.2.0.1.1 OGGCORE_12.2.0.1.0_PLATFORMS_151211.1401_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Dec 12 2015 00:54:38
Operating system character set identified as UTF-8.

Copyright (C) 1995, 2015, Oracle and/or its affiliates. All rights reserved.

GGSCI (arrow.localdomain) 1> create wallet

Created wallet at location 'dirwlt'.

Opened wallet at location 'dirwlt'.

GGSCI (arrow.localdomain) 2> add credentialstore

Credential store created in ./dircrd/.

GGSCI (arrow.localdomain) 3> alter credentialstore add user ggs_admin alias ggs_admin domain admin
Password:

Credential store in ./dircrd/ altered.

GGSCI (arrow.localdomain) 4> info credentialstore

Reading from ./dircrd/:

No information found in default domain OracleGoldenGate.

Other domains:

admin

To view other domains, use INFO CREDENTIALSTORE DOMAIN <domain>

GGSCI (arrow.localdomain) 5> info credentialstore domain admin

Reading from ./dircrd/:

Domain: admin

Alias: ggs_admin
Userid: ggs_admin

GGSCI (arrow.localdomain) 6> exit


oracle@arrow:hawk:/u01/app/12.2.0.1/ggs01
$ ./ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 12.2.0.1.1 OGGCORE_12.2.0.1.0_PLATFORMS_151211.1401_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Dec 12 2015 00:54:38
Operating system character set identified as UTF-8.

Copyright (C) 1995, 2015, Oracle and/or its affiliates. All rights reserved.



GGSCI (arrow.localdomain) 1> alter credentialstore add user ggs_admin alias ggs_admin
Password:

Credential store in ./dircrd/ altered.

GGSCI (arrow.localdomain) 2> info credentialstore

Reading from ./dircrd/:

Default domain: OracleGoldenGate

  Alias: ggs_admin
  Userid: ggs_admin

Other domains:

  admin

To view other domains, use INFO CREDENTIALSTORE DOMAIN 

GGSCI (arrow.localdomain) 3> exit
oracle@arrow:hawk:/u01/app/12.2.0.1/ggs01
$

 


Automating DG Broker

Sat, 2016-05-14 20:11

I have been applying PSU lately and what’s so hard out it?

Four+ databases running on Primary with DG Broker for standby.

There are no conventions, as some standby databases have dr appended to primary name while others have 2 appended to primary name.

I wanted to view the DG configuration for currently active instances and show_dg_config.sh will show me this.

Next, I want a faster way to shutdown DG by having syntax generated and  gen_dg_cmd.sh does this.

Guess I could have taken it further by creating a shell script to create shell scripts to shutdown DG.

One day when I am really bore, I might OR may be you are so nice to complete my mission.

Tested on AIX 7.1

Note: the ps -ef syntax is for AIX and will not work with Linux.

See below for the Linux alternative.

$ ps -ef -o args|grep ora_smon|grep -v grep|awk -F"_smon_" '{print $2}'
Warning: bad syntax, perhaps a bogus '-'? See /usr/share/doc/procps-3.2.8/FAQ

$ ps -eo args|grep ora_smon|grep -v grep|awk -F"_smon_" '{print $2}'
thor
hulk

show_dg_config.sh

#!/bin/sh -e
ps -ef -o args|grep ora_smon|grep -v grep|awk -F"_smon_" '{print $2}'
export ORAENV_ASK=NO
for SID in ps -ef -o args|grep ora_smon|grep -v grep|awk -F"_smon_" '{print $2}'`
do
export ORACLE_SID=$SID
. /usr/local/bin/oraenv
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
echo "+++: " $ORACLE_SID $ORACLE_HOME
sysresv
dgmgrl -echo << END
connect /
show configuration
exit
END
done
exit

gen_dg_cmd.sh

#!/bin/sh -e
for XB in `egrep 'Primary|Physical' /tmp/dg.log |sort |awk -F" " '{print $3 $1}'`
do
#echo $XB
#echo $XB|awk '{print substr($1,1,7)}'
if [ "`echo $XB|awk '{print substr($1,1,7)}'`" == "Primary" ]
then
PRI=`echo $XB|awk '{print substr($1,8)}'`
echo "edit database $PRI set state='LOG-TRANSPORT-OFF';"
echo "show database $PRI"
echo "edit database $PRI set state='ONLINE';"
echo "show database $PRI"
fi
if [ "`echo $XB|awk '{print substr($1,1,8)}'`" == "Physical" ]
then
SBY=`echo $XB|awk '{print substr($1,9)}'`
echo "edit database $SBY set state='APPLY-OFF';"
echo "show database $SBY"
echo "edit database $SBY set state='APPLY-ON';"
echo "show database $SBY"
fi
done
exit

./show_dg_config.sh > /tmp/dg.log

egrep ‘Primary|Physical’ /tmp/dg.log |sort |awk -F” ” ‘{print $3 $1}’

Primarydb02
Physicaldb02dr
Primarydb01
Physicaldb01dr
Primarystageqa
Physicalstageqa2
Primarytest
Physicaltestdr

./gen_dg_cmd.sh

edit database db01 set state='LOG-TRANSPORT-OFF';
show database db01
edit database db01 set state='ONLINE';
show database db01
edit database db01dr set state='APPLY-OFF';
show database db01dr
edit database db01dr set state='APPLY-ON';
show database db01dr
edit database db02 set state='LOG-TRANSPORT-OFF';
show database db02
edit database db02 set state='ONLINE';
show database db02
edit database db02dr set state='APPLY-OFF';
show database db02dr
edit database db02dr set state='APPLY-ON';
show database db02dr
edit database stageqa set state='LOG-TRANSPORT-OFF';
show database stageqa
edit database stageqa set state='ONLINE';
show database stageqa
edit database stageqa2 set state='APPLY-OFF';
show database stageqa2
edit database stageqa2 set state='APPLY-ON';
show database stageqa2
edit database test set state='LOG-TRANSPORT-OFF';
show database test
edit database test set state='ONLINE';
show database test
edit database testdr set state='APPLY-OFF';
show database testdr
edit database testdr set state='APPLY-ON';
show database testdr
oracle:/home/oracle/working/dinh$

Create GoldenGate 12.2 Database User

Sat, 2016-04-09 08:33

Oracle GoldenGate for Windows and UNIX 12c (12.2.0.1)

First, I am disappointed that Oracle does not go above and beyond to provide SQL scripts to create GoldenGate users for the database.

There are different set of privileges depending on the version of the database:

4.1.4.2 Oracle 11.2.0.3 or Earlier Database Privileges
4.1.4.1 Oracle 11.2.0.4 or Later Database Privileges

PDB is not being used and it’s different for PDB.

Depending on whether you want to practice the least principle privileges, ggadmin user can be create with privileges for both extract (capture) and replicat (apply).

Please don’t forget to change the password from the script since it is hard coded to be same as username :=)

cr_ggadmin_12c.sql
-- 4.1.4.1 Oracle 11.2.0.4 or Later Database Privileges
set echo on lines 200 pages 1000 trimspool on tab off
define _username='GGADMIN'
-- grant privileges for capture
create user &_username identified by &_username default tablespace ggdata;
select DEFAULT_TABLESPACE,TEMPORARY_TABLESPACE from dba_users where username='&_username';
grant create session, connect, resource, alter any table, alter system, dba, select any transaction to &_username;
-- grant privileges for replicat
grant create table, lock any table to &_username;
-- grant both capture and apply
exec dbms_goldengate_auth.grant_admin_privilege('&_username')
-- grant capture
-- exec dbms_goldengate_auth.grant_admin_privilege('&_username','capture');
-- grant apply
-- exec dbms_goldengate_auth.grant_admin_privilege('&_username','apply');

Demo:

oracle@arrow:tiger:/media/sf_working/ggs
$ sysdba @cr_ggadmin_12c.sql

SQL*Plus: Release 11.2.0.4.0 Production on Sat Apr 9 07:06:41 2016

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

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

ARROW:(SYS@tiger):PRIMARY> define _username='GGADMIN'
ARROW:(SYS@tiger):PRIMARY> -- grant privileges for capture
ARROW:(SYS@tiger):PRIMARY> create user &_username identified by &_username default tablespace ggdata;

User created.

ARROW:(SYS@tiger):PRIMARY> select DEFAULT_TABLESPACE,TEMPORARY_TABLESPACE from dba_users where username='&_username';

DEFAULT_TABLESPACE             TEMPORARY_TABLESPACE
------------------------------ ------------------------------
GGDATA                         TEMP

ARROW:(SYS@tiger):PRIMARY> grant create session, connect, resource, alter any table, alter system, dba, select any transaction to &_username;

Grant succeeded.

ARROW:(SYS@tiger):PRIMARY> -- grant privileges for replicat
ARROW:(SYS@tiger):PRIMARY> grant create table, lock any table to &_username;

Grant succeeded.

ARROW:(SYS@tiger):PRIMARY> -- grant both capture and apply
ARROW:(SYS@tiger):PRIMARY> exec dbms_goldengate_auth.grant_admin_privilege('&_username')

PL/SQL procedure successfully completed.

ARROW:(SYS@tiger):PRIMARY> -- grant capture
ARROW:(SYS@tiger):PRIMARY> -- exec dbms_goldengate_auth.grant_admin_privilege('&_username','capture');
ARROW:(SYS@tiger):PRIMARY> -- grant apply
ARROW:(SYS@tiger):PRIMARY> -- exec dbms_goldengate_auth.grant_admin_privilege('&_username','apply');
ARROW:(SYS@tiger):PRIMARY> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
oracle@arrow:tiger:/media/sf_working/ggs
$

Clone GoldenGate 12.2

Mon, 2016-04-04 03:16

This is what insomnia does to you.

Since GoldenGate installation is now using runInstaller, I would expect the same functionality as the database; hence, cloning GoldenGate Home.

oracle@arrow:pooh:/home/oracle
$ cd /u01/app/12.2.0.1/ggs01/

oracle@arrow:pooh:/u01/app/12.2.0.1/ggs01
$ ls
bcpfmt.tpl            ddl_ora10.sql             defgen                           extract        libggnnzitp.so      marker_status.sql       role_setup.sql
bcrypt.txt            ddl_ora10upCommon.sql     deinstall                        freeBSD.txt    libggparam.so       mgr                     sequence.sql
cachefiledump         ddl_ora11.sql             demo_more_ora_create.sql         ggcmd          libggperf.so        notices.txt             server
cfgtoollogs           ddl_ora9.sql              demo_more_ora_insert.sql         ggMessage.dat  libggrepo.so        oggerr                  sqlldr.tpl
checkprm              ddl_pin.sql               demo_ora_create.sql              ggparam.dat    libicudata.so.48    OPatch                  srvm
chkpt_ora_create.sql  ddl_remove.sql            demo_ora_insert.sql              ggsci          libicudata.so.48.1  oraInst.loc             tcperrs
convchk               ddl_session1.sql          demo_ora_lob_create.sql          help.txt       libicui18n.so.48    oui                     ucharset.h
convprm               ddl_session.sql           demo_ora_misc.sql                install        libicui18n.so.48.1  params.sql              ulg.sql
db2cntl.tpl           ddl_setup.sql             demo_ora_pk_befores_create.sql   inventory      libicuuc.so.48      prvtclkm.plb            UserExitExamples
ddl_cleartrace.sql    ddl_status.sql            demo_ora_pk_befores_insert.sql   jdk            libicuuc.so.48.1    prvtlmpg.plb            usrdecs.h
ddl_create.sql        ddl_staymetadata_off.sql  demo_ora_pk_befores_updates.sql  keygen         libxerces-c.so.28   prvtlmpg_uninstall.sql  zlib.txt
ddl_ddl2file.sql      ddl_staymetadata_on.sql   diagnostics                      label.sql      libxml2.txt         remove_seq.sql
ddl_disable.sql       ddl_tracelevel.sql        dirout                           libantlr3c.so  logdump             replicat
ddl_enable.sql        ddl_trace_off.sql         dirwww                           libdb-6.1.so   marker_remove.sql   retrace
ddl_filter.sql        ddl_trace_on.sql          emsclnt                          libgglog.so    marker_setup.sql    reverse

oracle@arrow:pooh:/u01/app/12.2.0.1/ggs01
$ nohup tar -cvpf /tmp/ggs12c_${USER}_`hostname -s`_clone.tar . > /tmp/clone_${USER}_`hostname -s`_ggs12c.log 2>&1 &
[1] 10859
oracle@arrow:pooh:/u01/app/12.2.0.1/ggs01
$
[1]+  Done                    nohup tar -cvpf /tmp/ggs12c_${USER}_`hostname -s`_clone.tar . > /tmp/clone_${USER}_`hostname -s`_ggs12c.log 2>&1

oracle@arrow:pooh:/u01/app/12.2.0.1/ggs01
$ cd ..
oracle@arrow:pooh:/u01/app/12.2.0.1
$ mkdir ggs02
oracle@arrow:pooh:/u01/app/12.2.0.1
$ cd ggs02/
oracle@arrow:pooh:/u01/app/12.2.0.1/ggs02
$ ls

oracle@arrow:pooh:/u01/app/12.2.0.1/ggs02
$ nohup tar -xvf /tmp/ggs12c_oracle_arrow_clone.tar > /tmp/untar_${USER}_`hostname -s`_ggs12c.log 2>&1 &
[1] 10897
oracle@arrow:pooh:/u01/app/12.2.0.1/ggs02
$
[1]+  Done                    nohup tar -xvf /tmp/ggs12c_oracle_arrow_clone.tar > /tmp/untar_${USER}_`hostname -s`_ggs12c.log 2>&1

oracle@arrow:pooh:/u01/app/12.2.0.1/ggs02
$ ll /tmp/*ggs*
-rw-r--r--. 1 oracle oinstall     84131 Apr  4 01:36 /tmp/clone_oracle_arrow_ggs12c.log
-rw-r--r--. 1 oracle oinstall 835788800 Apr  4 01:36 /tmp/ggs12c_oracle_arrow_clone.tar
-rw-r--r--. 1 oracle oinstall     84131 Apr  4 01:45 /tmp/untar_oracle_arrow_ggs12c.log

oracle@arrow:pooh:/u01/app/12.2.0.1/ggs02
$ tail /tmp/clone_oracle_arrow_ggs12c.log
./jdk/bin/javadoc
./jdk/bin/jarsigner
./jdk/bin/pack200
./jdk/bin/rmid
./jdk/bin/jrunscript
./jdk/bin/extcheck
./jdk/bin/keytool
./jdk/LICENSE
./jdk/.manifest
./ddl_setup.sql

oracle@arrow:pooh:/u01/app/12.2.0.1/ggs02
$ tail /tmp/untar_oracle_arrow_ggs12c.log
./jdk/bin/javadoc
./jdk/bin/jarsigner
./jdk/bin/pack200
./jdk/bin/rmid
./jdk/bin/jrunscript
./jdk/bin/extcheck
./jdk/bin/keytool
./jdk/LICENSE
./jdk/.manifest
./ddl_setup.sql

oracle@arrow:pooh:/u01/app/12.2.0.1/ggs02
$ ls
bcpfmt.tpl            ddl_ora10.sql             defgen                           extract        libggnnzitp.so      marker_status.sql       role_setup.sql
bcrypt.txt            ddl_ora10upCommon.sql     deinstall                        freeBSD.txt    libggparam.so       mgr                     sequence.sql
cachefiledump         ddl_ora11.sql             demo_more_ora_create.sql         ggcmd          libggperf.so        notices.txt             server
cfgtoollogs           ddl_ora9.sql              demo_more_ora_insert.sql         ggMessage.dat  libggrepo.so        oggerr                  sqlldr.tpl
checkprm              ddl_pin.sql               demo_ora_create.sql              ggparam.dat    libicudata.so.48    OPatch                  srvm
chkpt_ora_create.sql  ddl_remove.sql            demo_ora_insert.sql              ggsci          libicudata.so.48.1  oraInst.loc             tcperrs
convchk               ddl_session1.sql          demo_ora_lob_create.sql          help.txt       libicui18n.so.48    oui                     ucharset.h
convprm               ddl_session.sql           demo_ora_misc.sql                install        libicui18n.so.48.1  params.sql              ulg.sql
db2cntl.tpl           ddl_setup.sql             demo_ora_pk_befores_create.sql   inventory      libicuuc.so.48      prvtclkm.plb            UserExitExamples
ddl_cleartrace.sql    ddl_status.sql            demo_ora_pk_befores_insert.sql   jdk            libicuuc.so.48.1    prvtlmpg.plb            usrdecs.h
ddl_create.sql        ddl_staymetadata_off.sql  demo_ora_pk_befores_updates.sql  keygen         libxerces-c.so.28   prvtlmpg_uninstall.sql  zlib.txt
ddl_ddl2file.sql      ddl_staymetadata_on.sql   diagnostics                      label.sql      libxml2.txt         remove_seq.sql
ddl_disable.sql       ddl_tracelevel.sql        dirout                           libantlr3c.so  logdump             replicat
ddl_enable.sql        ddl_trace_off.sql         dirwww                           libdb-6.1.so   marker_remove.sql   retrace
ddl_filter.sql        ddl_trace_on.sql          emsclnt                          libgglog.so    marker_setup.sql    reverse

oracle@arrow:pooh:/u01/app/12.2.0.1/ggs02
$ cd oui/bin/
oracle@arrow:pooh:/u01/app/12.2.0.1/ggs02/oui/bin
$ ls run*
runConfig.sh  runInstaller  runInstaller.sh  runSSHSetup.sh

oracle@arrow:pooh:/u01/app/12.2.0.1/ggs02/oui/bin
$ ./runInstaller -clone -silent -noconfig -defaultHomeName ORACLE_HOME="/u01/app/12.2.0.1/ggs02"
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 4072 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2016-04-04_01-50-47AM. Please wait ...oracle@arrow:pooh:/u01/app/12.2.0.1/ggs02/oui/bin
$ Oracle Universal Installer, Version 11.2.0.3.0 Production
Copyright (C) 1999, 2011, Oracle. All rights reserved.

You can find the log of this install session at:
 /u01/app/oraInventory/logs/cloneActions2016-04-04_01-50-47AM.log
.................................................................................................... 100% Done.



Installation in progress (Monday, April 4, 2016 1:50:56 AM PDT)
..........................................................................                                                      72% Done.
Install successful

Linking in progress (Monday, April 4, 2016 1:50:59 AM PDT)
Link successful

Setup in progress (Monday, April 4, 2016 1:50:59 AM PDT)
...........                                                     100% Done.
Setup successful

End of install phases.(Monday, April 4, 2016 1:51:20 AM PDT)
The cloning of OraHome3 was successful.
Please check '/u01/app/oraInventory/logs/cloneActions2016-04-04_01-50-47AM.log' for more details.

oracle@arrow:pooh:/u01/app/12.2.0.1/ggs02/oui/bin
$ grep -e '[[:upper:]]: ' /u01/app/oraInventory/logs/cloneActions2016-04-04_01-50-47AM.log|cut -d ":" -f1|sort -u
INFO

oracle@arrow:pooh:/u01/app/12.2.0.1/ggs02/oui/bin
$ cd ../../

oracle@arrow:pooh:/u01/app/12.2.0.1/ggs02
$ ./ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 12.2.0.1.1 OGGCORE_12.2.0.1.0_PLATFORMS_151211.1401_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Dec 12 2015 00:54:38
Operating system character set identified as UTF-8.

Copyright (C) 1995, 2015, Oracle and/or its affiliates. All rights reserved.


GGSCI (arrow.localdomain) 1> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     STOPPED

GGSCI (arrow.localdomain) 2> show

Parameter settings:

SET SUBDIRS    ON
SET DEBUG      OFF

Current directory: /u01/app/12.2.0.1/ggs02

Using subdirectories for all process files

Editor:  vi

Reports (.rpt)                 /u01/app/12.2.0.1/ggs02/dirrpt -- does not yet exist
Parameters (.prm)              /u01/app/12.2.0.1/ggs02/dirprm -- does not yet exist
Replicat Checkpoints (.cpr)    /u01/app/12.2.0.1/ggs02/dirchk -- does not yet exist
Extract Checkpoints (.cpe)     /u01/app/12.2.0.1/ggs02/dirchk -- does not yet exist
Process Status (.pcs)          /u01/app/12.2.0.1/ggs02/dirpcs -- does not yet exist
SQL Scripts (.sql)             /u01/app/12.2.0.1/ggs02/dirsql -- does not yet exist
Database Definitions (.def)    /u01/app/12.2.0.1/ggs02/dirdef -- does not yet exist
Dump files (.dmp)              /u01/app/12.2.0.1/ggs02/dirdmp -- does not yet exist
Masterkey wallet files (.wlt)  /u01/app/12.2.0.1/ggs02/dirwlt -- does not yet exist
Credential store files (.crd)  /u01/app/12.2.0.1/ggs02/dircrd -- does not yet exist


GGSCI (arrow.localdomain) 3> create subdirs

Creating subdirectories under current directory /u01/app/12.2.0.1/ggs02

Parameter files                /u01/app/12.2.0.1/ggs02/dirprm: created
Report files                   /u01/app/12.2.0.1/ggs02/dirrpt: created
Checkpoint files               /u01/app/12.2.0.1/ggs02/dirchk: created
Process status files           /u01/app/12.2.0.1/ggs02/dirpcs: created
SQL script files               /u01/app/12.2.0.1/ggs02/dirsql: created
Database definitions files     /u01/app/12.2.0.1/ggs02/dirdef: created
Extract data files             /u01/app/12.2.0.1/ggs02/dirdat: created
Temporary files                /u01/app/12.2.0.1/ggs02/dirtmp: created
Credential store files         /u01/app/12.2.0.1/ggs02/dircrd: created
Masterkey wallet files         /u01/app/12.2.0.1/ggs02/dirwlt: created
Dump files                     /u01/app/12.2.0.1/ggs02/dirdmp: created


GGSCI (arrow.localdomain) 4> exit
oracle@arrow:pooh:/u01/app/12.2.0.1/ggs02
$

There is no clone.pl for GoldenGate.
oracle@arrow:pooh:/u01/app/12.2.0.1/ggs02
$ locate clone.pl
/u01/app/oracle/product/11.2.0/dbhome_1/clone/bin/clone.pl
/u01/app/oracle/product/11.2.0/dbhome_1/clone/bin/prepare_clone.pl
/u01/app/oracle/product/11.2.0/dbhome_1/sysman/admin/scripts/db/dbclone/db_clone.pl
/u01/app/oracle/product/12.2.0/dbhome_2/clone/bin/clone.pl
/u01/app/oracle/product/12.2.0/dbhome_2/clone/bin/clone.pl.sbs
/u01/app/oracle/product/12.2.0/dbhome_2/clone/bin/clone.pl.sbs.ouibak
/u01/app/oracle/product/12.2.0/dbhome_2/clone/bin/prepare_clone.pl
/u01/app/oracle/product/12.2.0/dbhome_2/inventory/Templates/clone/bin/clone.pl.sbs
oracle@arrow:pooh:/u01/app/12.2.0.1/ggs02
$

oracle@arrow:pooh:/u01/app/12.2.0.1/ggs02
$ cat /u01/app/oraInventory/ContentsXML/inventory.xml
<?xml version=”1.0″ standalone=”yes” ?>
<!– Copyright (c) 1999, 2011, Oracle. All rights reserved. –>
<!– Do not modify the contents of this file by hand. –>
<INVENTORY>
<VERSION_INFO>
<SAVED_WITH>11.2.0.3.0</SAVED_WITH>
<MINIMUM_VER>2.1.0.6.0</MINIMUM_VER>
</VERSION_INFO>
<HOME_LIST>
<HOME NAME=”OraDb11g_home1″ LOC=”/u01/app/oracle/product/11.2.0/dbhome_1″ TYPE=”O” IDX=”1″/>
<HOME NAME=”OraDB12Home1″ LOC=”/u01/app/oracle/product/12.2.0/dbhome_1″ TYPE=”O” IDX=”2″/>
<HOME NAME=”OraHome1″ LOC=”/u01/app/oracle/product/12.2.0/dbhome_2″ TYPE=”O” IDX=”3″/>
<HOME NAME=”OraHome2″ LOC=”/u01/app/12.2.0.1/ggs01″ TYPE=”O” IDX=”4″/>
<HOME NAME=”OraHome3″ LOC=”/u01/app/12.2.0.1/ggs02″ TYPE=”O” IDX=”5″/>
</HOME_LIST>
<COMPOSITEHOME_LIST>
</COMPOSITEHOME_LIST>
</INVENTORY>


Silent Install GoldenGate 12.2

Mon, 2016-04-04 02:31

There are probably many blogs about installation; however, I tend to do things a little different.

oracle@arrow:pooh:/media/sf_working/fbo_ggs_Linux_x64_shiphome/Disk1
$ cat /media/sf_working/oggcore_11gdb.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_ogginstall_response_schema_v12_1_2
INSTALL_OPTION=ORA11g
SOFTWARE_LOCATION=/u01/app/12.2.0.1/ggs01
START_MANAGER=
MANAGER_PORT=
DATABASE_LOCATION=/u01/app/oracle/product/11.2.0/dbhome_1
INVENTORY_LOCATION=/u01/app/oraInventory
UNIX_GROUP_NAME=oinstall

I like to see installation progress.

oracle@arrow:pooh:/media/sf_working/fbo_ggs_Linux_x64_shiphome/Disk1
$ ./runInstaller -silent -showProgress -waitforcompletion -responseFile /media/sf_working/oggcore_11gdb.rsp
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 120 MB.   Actual 28152 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 4073 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2016-04-04_01-04-39AM. Please wait ...You can find the log of this install session at:
 /u01/app/oraInventory/logs/installActions2016-04-04_01-04-39AM.log

Prepare in progress.
..................................................   10% Done.

Prepare successful.

Copy files in progress.
..................................................   61% Done.
..................................................   69% Done.
..................................................   77% Done.
..................................................   82% Done.
..................................................   87% Done.
..................................................   94% Done.
..................................................   95% Done.

Copy files successful.

Link binaries in progress.
..................................................   95% Done.

Link binaries successful.

Setup files in progress.
..................................................   95% Done.
..................................................   96% Done.
..................................................   97% Done.
..................................................   98% Done.
..................................................   99% Done.
..................................................   100% Done.

Setup files successful.
The installation of Oracle GoldenGate Core was successful.
Please check '/u01/app/oraInventory/logs/silentInstall2016-04-04_01-04-39AM.log' for more details.
Successfully Setup Software.


oracle@arrow:pooh:/media/sf_working/fbo_ggs_Linux_x64_shiphome/Disk1
$ cat /u01/app/oraInventory/logs/silentInstall2016-04-04_01-04-39AM.log
silentInstall2016-04-04_01-04-39AM.log
The installation of Oracle GoldenGate Core was successful.

I like to see distinct log type: INFO|WARNING|ERROR.

oracle@arrow:pooh:/media/sf_working/fbo_ggs_Linux_x64_shiphome/Disk1
$ grep -e '[[:upper:]]: ' /u01/app/oraInventory/logs/installActions2016-04-04_01-04-39AM.log|cut -d ":" -f1|sort -u
INFO
WARNING

I like to see what WARNING are all about and to compare with subsequent install.

oracle@arrow:pooh:/media/sf_working/fbo_ggs_Linux_x64_shiphome/Disk1
$ grep -e '[[:upper:]]: ' /u01/app/oraInventory/logs/installActions2016-04-04_01-04-39AM.log|grep "^WARNING: "
WARNING: CVU is not enabled. No CVU based operation will be performed.
WARNING: Unable to find the namespace URI. Reason: Start of root element expected.
WARNING: Unable to find the namespace URI. Reason: Start of root element expected.
WARNING: Unable to get the value for INSTALL_OPTION. Error: null
WARNING: Unable to get the value for INSTALL_OPTION. Error: null
WARNING: Unable to get the value for INSTALL_OPTION. Error: null
WARNING: Validation disabled for the state init
WARNING: Validation disabled for the state summary
WARNING: Validation disabled for the state finish

Is WARNING bogus?

oracle@arrow:pooh:/media/sf_working/fbo_ggs_Linux_x64_shiphome/Disk1
$ grep INSTALL_OPTION /u01/app/oraInventory/logs/installActions2016-04-04_01-04-39AM.log
WARNING: Unable to get the value for INSTALL_OPTION. Error: null
WARNING: Unable to get the value for INSTALL_OPTION. Error: null
WARNING: Unable to get the value for INSTALL_OPTION. Error: null
INFO: Setting value for the property:INSTALL_OPTION in the bean:OGGInstallSettings
 INSTALL_OPTION                                         ORA11g
 INSTALL_OPTION            ORA11g
INFO: adding the variable INSTALL_OPTION to command line args table
oracle@arrow:pooh:/media/sf_working/fbo_ggs_Linux_x64_shiphome/Disk1
$

Deinstall GoldenGate 12.2

Mon, 2016-04-04 01:59

I always like to know how to remove software installation in the event I am not happy with how it was installed.

GoldenGate Home is at /u01/app/oracle/12.2/ggs01

Thinking of may be using the same directory structures as Grid Infrastructure, i.e. /u01/app/12.2.0.1/ggs01 with full release version.

oracle@arrow:pooh:/u01/app/oracle/12.2/ggs01
$ ls -ld deinstall/
drwxr-xr-x. 2 oracle oinstall 4096 Apr  4 00:24 deinstall/

oracle@arrow:pooh:/u01/app/oracle/12.2/ggs01
$ cd deinstall/

oracle@arrow:pooh:/u01/app/oracle/12.2/ggs01/deinstall
$ ls
deinstall.sh

oracle@arrow:pooh:/u01/app/oracle/12.2/ggs01/deinstall
$ ./deinstall.sh

ALERT: Ensure all the processes running from the current Oracle Home are shutdown prior to running this software uninstallation script.

Proceed with removing Oracle GoldenGate home: /u01/app/oracle/12.2/ggs01 (yes/no)? [no]
yes
Starting Oracle Universal Installer...

Checking swap space: must be greater than 500 MB.   Actual 4073 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2016-04-04_12-48-07AM. Please wait ...Oracle Universal Installer, Version 11.2.0.3.0 Production
Copyright (C) 1999, 2011, Oracle. All rights reserved.

Starting deinstall


Deinstall in progress (Monday, April 4, 2016 12:48:12 AM PDT)
............................................................... 100% Done.

Deinstall successful

End of install phases.(Monday, April 4, 2016 12:48:33 AM PDT)
End of deinstallations
Please check '/u01/app/oraInventory/logs/silentInstall2016-04-04_12-48-07AM.log' for more details.

oracle@arrow:pooh:/u01/app/oracle/12.2/ggs01/deinstall
$ cat /u01/app/oraInventory/logs/silentInstall2016-04-04_12-48-07AM.log
silentInstall2016-04-04_12-48-07AM.log
Starting deinstall
This deinstallation was successful
End of deinstallations
oracle@arrow:pooh:/u01/app/oracle/12.2/ggs01/deinstall
$

Easy Way to Create pfile from spfile

Sun, 2016-04-03 10:50

I learned something new today; so excited as this will make automation so much easier.

create pfile=’/tmp/init@.ora’ from spfile;

The @ automatically substitute SID.

oracle@arrow:tiger:/tmp
$ sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Sun Apr 3 09:45:49 2016

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

ARROW:(SYS@tiger):PRIMARY> set time on
09:45:52 ARROW:(SYS@tiger):PRIMARY> !ls -l /tmp/init*
ls: cannot access /tmp/init*: No such file or directory

09:45:59 ARROW:(SYS@tiger):PRIMARY> create pfile='/tmp/init@.ora' from spfile;

File created.

09:46:04 ARROW:(SYS@tiger):PRIMARY> !ls -l /tmp/init*
-rw-r--r--. 1 oracle oinstall 1165 Apr  3 09:46 /tmp/inittiger.ora

09:46:10 ARROW:(SYS@tiger):PRIMARY> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
oracle@arrow:tiger:/tmp
$


Tablespace Free w Fragmentation Info

Thu, 2016-03-24 13:43

I have been conversing with Liron Amitzi on twitter about his tablespace free SQL script.

He accommodate my request to add fragmentation details so I can verify against what I have.

Looks like I did it right.

You can find Liron script at this blog – Tablespaces Free Space and Stuff

oracle@arrow:tiger:/media/sf_working/sql
$ sysdba @ts_free_space.sql

SQL*Plus: Release 11.2.0.4.0 Production on Thu Mar 24 12:35:23 2016

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


TABLESPACE_NAME                   CURR_SIZE     MAX_SIZE    FREE_SIZE    USED_SIZE     PCT_FREE PCT_FREE_TOTAL  FREE_CHUNKS LARGEST_CHUNK
------------------------------ ------------ ------------ ------------ ------------ ------------ -------------- ------------ -------------
USERS                                  1024         1024      1021.38         2.62        99.74          99.74            2       1021.13
UNDOTBS1                                 80        32767        64.75        15.25        80.94          99.95           12            37
SYSAUX                                  400        32767       218.94       181.06        54.73          99.45            1        218.94
SYSTEM                                  500        32767       231.19       268.81        46.24          99.18            3           231

ARROW:(SYS@tiger):PRIMARY> @free.sql
Enter value for 1: *

                                                              Database Freespace Summary

TABLESPACE_NAME                      BLKSZ   DFCT      CT_FRAG MB_FREE_FRAG     MB_FREE     MB_TOTAL PCT_USED MAX_MB_FREE MAX_PCT_USED
----------------------------------- ------ ------ ------------ ------------ ----------- ------------ -------- ----------- ------------
*m s SYSTEM                           8192      1            3          231         231          499    53.71      32,767          .82
*m s UNDOTBS1                         8192      1           12           37          65           79    53.16      32,767          .13
*a s SYSAUX                           8192      1            1          219         219          399    45.13      32,767          .55
*m s USERS                            8192      1            2        1,021       1,021         1023      .18       1,023          .18
                                           ------                           -----------                       -----------
sum                                             4                                 1,536                            99,324

ARROW:(SYS@tiger):PRIMARY>

free.sql

set line 150 echo off verify off
ttitle -
   center  'Database Freespace Summary'  skip 2
break   on report
COMPUTE sum of mb_used on report
COMPUTE sum of mb_free on report
COMPUTE sum of max_mb_free on report
COMPUTE sum of dfct on report
COLUMN mb_used       format 99,999,999
COLUMN mb_free       format 99,999,999
COLUMN max_mb_free   format 99,999,999
COLUMN mb_free_frag  format 99,999,999
COLUMN dfct          format 99999
COLUMN blksz         format 99999
COLUMN pct_used      format 999.99
COLUMN max_pct_used  format 999.99
SELECT
  DECODE(extent_management,'LOCAL','*',' ') ||
  DECODE(segment_space_management,'AUTO','a ','m ') ||
  DECODE(allocation_type,'SYSTEM','s ','u ') ||
  fs.tablespace_name tablespace_name, block_size blksz, dfct,
  fs.nfrag                      ct_frag,
  fs.mxfrag           / 1048576 mb_free_frag,
  fs.free_bytes       / 1048576 mb_free,
  df.avail            / 1048576 mb_total,
  (df.avail-fs.mxfrag)/df.avail*100 pct_used,
  df.max_bytes        / 1048576 max_mb_free,
  (df.avail-fs.mxfrag)/df.max_bytes*100 max_pct_used
FROM dba_tablespaces ts,
  (SELECT tablespace_name, count(*) dfct,
   SUM(decode(maxbytes,0,user_bytes,greatest(maxbytes,user_bytes))) max_bytes,
   SUM(user_bytes) avail
   FROM dba_data_files
   GROUP BY tablespace_name
  ) df,
  (SELECT tablespace_name,  nvl(sum(bytes),0) free_bytes, count(bytes) nfrag, nvl(max(bytes),0) mxfrag
   FROM dba_free_space
   GROUP BY tablespace_name
  ) fs
WHERE fs.tablespace_name = ts.tablespace_name(+)
AND fs.tablespace_name   = df.tablespace_name
AND regexp_like(fs.tablespace_name,'&1','i')
ORDER BY pct_used desc

Don’t Know cron

Sat, 2016-03-19 19:54

Learn something new every day !!!

Did you know the Date and Day from cron is OR condition and not AND?

Wanted to schedule cron to run every 3rd Friday.

This ended up running on the 19th which is Saturday

$ crontab -l|head -1
### Schedule below will run Every Friday OR Date 15-21
41 18 15-21 * 5 /bin/date > /tmp/date.out

$ date
Sat Mar 19 18:40:05 PDT 2016

$ date
Sat Mar 19 18:41:17 PDT 2016

$ ll /tmp/date.out
-rw-r--r--. 1 oracle oinstall 29 Mar 19 18:41 /tmp/date.out

$ cat /tmp/date.out
Sat Mar 19 18:41:01 PDT 2016

OOPS!

++++++++++

Shell script will need to check for day and exit if not the correct day.

$ date
Sat Mar 19 18:43:13 PDT 2016

$ crontab -l|head -1
44 18 15-21 * * /home/oracle/t.sh > /tmp/date.out

++++++++++
$ cat t.sh
#!/bin/sh -ex
# Exit if not Friday
if [[ $(date +%u) -ne 5 ]] ; then
    exit
fi
date
++++++++++

$ date
Sat Mar 19 18:44:26 PDT 2016

$ ll /tmp/date.out
-rw-r--r--. 1 oracle oinstall 0 Mar 19 18:44 /tmp/date.out

$ ./t.sh
++ date +%u
+ [[ 6 -ne 5 ]]
+ exit

Option 2: check day from cron.

$ date
Sun Mar 20 04:44:39 PDT 2016

$ crontab -l|head -1
45 04 15-21 * * [ $(date +\%u) -eq 7 ] && /home/oracle/t2.sh > /tmp/date.out

++++++++++
$ cat t2.sh
date
++++++++++

$ date
Sun Mar 20 04:45:01 PDT 2016

$ ll /tmp/date.out
-rw-r--r--. 1 oracle oinstall 29 Mar 20 04:45 /tmp/date.out

$ cat /tmp/date.out
Sun Mar 20 04:45:01 PDT 2016

Tested on:
oracle@arrow:tiger:/home/oracle
$ uname -an
Linux arrow.localdomain 3.8.13-68.3.2.el6uek.x86_64 #2 SMP Tue Jun 9 17:07:32 PDT 2015 x86_64 x86_64 x86_64 GNU/Linux

oracle@arrow:tiger:/home/oracle
$ cat /etc/oracle-release
Oracle Linux Server release 6.6
oracle@arrow:tiger:/home/oracle
$

++++++++++

Updated: Mar 26, 2016

$ crontab -l|head -1
27 20 15-25 * * /usr/bin/test `date +\%a` = Fri && /home/oracle/t2.sh > /tmp/t2.sh.log 2>&1

Both && and || logic produce identical results for the correct day.

$ date
Fri Mar 25 21:21:26 PDT 2016

$ test `date +\%a` = Fri;echo $?
0

pwd if test = 0

$ test `date +\%a` = Fri && pwd; echo $?
/home/oracle
0

$ test `date +\%a` != Fri;echo $?
1

pwd if test != 0

$ test `date +\%a` != Fri || pwd; echo $?
/home/oracle
0

Noticed the difference in return code as mention in reference: 

http://docstore.mik.ua/orelly/unix3/upt/ch25_02.htm

Using && returns 1 while using || returns 0 for incorrect day.

It’s not Monday; hence, pwd did not return values.

$ test `date +\%a` = Mon && pwd; echo $?
1

$ test `date +\%a` != Mon || pwd; echo $?
0

 

The right side of && (pwd) will only be evaluated if the left side exit status = 0.

$ test `date +\%a` = Mon;echo $?
1

pwd if test = 0

$ test `date +\%a` = Mon && pwd; echo $?
1

The right side of || (pwd) will only be evaluated if the left side exit status is != 0.

$ test `date +\%a` != Mon;echo $?
0

pwd if test != 0

$ test `date +\%a` != Mon || pwd; echo $?
0

 


Migrate to 12c using Export/Import

Thu, 2016-03-17 20:07

If you had success doing this, please share.

This took some troubleshooting and more than one pass.

Still not comfortable to guarantee target is identical to source.

Here are all the references, I have gathered if you want an adventure.

How to Perform a Full Database Export Import During Upgrade, Migrate, Copy or Move of a Database (Doc ID 286775.1)

Information On Installed Database Components and Schemas (Doc ID 472937.1)
Schemas CTXSYS MDSYS ORDSYS Are Not Exported (Doc ID 228482.1)

How to Install/Deinstall Oracle Workspace Manager (Doc ID 263428.1)
How to Determine if Workspace Manager is Being Used? (Doc ID 727765.1)

Data Pump: GRANTs On SYS Owned Objects Are Not Transferred With Data Pump And Are Missing In The Target Database (Doc ID 1911151.1)
After Full Import All Object Privileges Granted By SYS Are Lost (Doc ID 97902.1)

DataPump Export Fails With Error ORA-39095 (Doc ID 1071931.1)

++++++++++
How many components are installed?

*** dba_registry ***

ACTUAL SOURCE:
COMP_ID    COMP_NAME			       VERSION	       STATUS	    NAMESPACE	 SCHEMA
---------- ----------------------------------- --------------- ------------ ------------ ---------------
CATALOG    Oracle Database Catalog Views       10.2.0.4.0      VALID	    SERVER	 SYS
CATPROC    Oracle Database Packages and Types  10.2.0.4.0      VALID	    SERVER	 SYS
EM	   Oracle Enterprise Manager	       10.2.0.4.0      VALID	    SERVER	 SYSMAN
OWM	   Oracle Workspace Manager	       10.2.0.4.3      VALID	    SERVER	 WMSYS

ONE BAD SOURCE:
COMP_ID    COMP_NAME                           VERSION         STATUS       NAMESPACE    SCHEMA
---------- ----------------------------------- --------------- ------------ ------------ ---------------
APS        OLAP Analytic Workspace             11.2.0.4.0      VALID        SERVER       SYS
CATALOG    Oracle Database Catalog Views       11.2.0.4.0      VALID        SERVER       SYS
CATJAVA    Oracle Database Java Packages       11.2.0.4.0      VALID        SERVER       SYS
CATPROC    Oracle Database Packages and Types  11.2.0.4.0      VALID        SERVER       SYS
CONTEXT    Oracle Text                         11.2.0.4.0      VALID        SERVER       CTXSYS
EXF        Oracle Expression Filter            11.2.0.4.0      VALID        SERVER       EXFSYS
JAVAVM     JServer JAVA Virtual Machine        11.2.0.4.0      VALID        SERVER       SYS
ORDIM      Oracle Multimedia                   11.2.0.4.0      VALID        SERVER       ORDSYS
OWB        OWB                                 11.2.0.4.0      VALID        SERVER       OWBSYS
OWM        Oracle Workspace Manager            11.2.0.4.0      VALID        SERVER       WMSYS
RUL        Oracle Rules Manager                11.2.0.4.0      VALID        SERVER       EXFSYS
SDO        Spatial                             11.2.0.4.0      VALID        SERVER       MDSYS
XDB        Oracle XML Database                 11.2.0.4.0      VALID        SERVER       XDB
XML        Oracle XDK                          11.2.0.4.0      VALID        SERVER       SYS
XOQ        Oracle OLAP API                     11.2.0.4.0      VALID        SERVER       SYS

15 rows selected.

++++++++++
Export error using FLASHBACK_TIME

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
ORA-39001: invalid argument value
ORA-39150: bad flashback time
ORA-01841: (full) year must be between -4713 and +9999, and not be 0

Took a some time but finally found a work around other than using FLASHBACK_SCN which is hokie.

expdp_full.par

USERID="/ as sysdba"
directory=DATA_PUMP_DIR
METRICS=Y
PARALLEL=4
FULL=Y
DUMPFILE=full%U.dmp
FLASHBACK_TIME="TO_TIMESTAMP(TO_CHAR(systimestamp,'DD-MM-YYYY HH24:MI:SS'), 'DD-MM-YYYY HH24:MI:SS')"
EXCLUDE=statistics
exclude=schema:"IN ('WMSYS','SYSMAN')"
LOGFILE=exp_full.log

++++++++++
Create 12c non-PDB database.

whenever sqlerror exit sql.sqlcode
whenever oserror exit 1
set echo on
shu abort;
create spfile from pfile;
startup force nomount;
CREATE DATABASE
USER SYS IDENTIFIED BY oracle
USER SYSTEM IDENTIFIED BY oracle
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
CHARACTER SET AL32UTF8
NATIONAL CHARACTER SET AL16UTF16
LOGFILE 
GROUP 1 size 100M,GROUP 2 size 100M,GROUP 3 size 100M
EXTENT MANAGEMENT LOCAL
DATAFILE SIZE 257M AUTOEXTEND ON NEXT 256M MAXSIZE 30721M
SYSAUX DATAFILE SIZE 257M AUTOEXTEND ON NEXT 256M MAXSIZE 30721M
DEFAULT TABLESPACE USERS DATAFILE SIZE 257M AUTOEXTEND ON NEXT 257M MAXSIZE 30721M
DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE SIZE 256M AUTOEXTEND ON NEXT 256M MAXSIZE 30720M
UNDO TABLESPACE UNDOTBS1 DATAFILE SIZE 256M AUTOEXTEND ON NEXT 256M MAXSIZE 30720M
;
set echo off
@?/rdbms/admin/catalog.sql;
@?/rdbms/admin/catproc.sql;
@?/rdbms/admin/catblock.sql;
@?/rdbms/admin/catoctk.sql;
@?/rdbms/admin/catio.sql
@?/rdbms/admin/dbmsiotc.sql
@?/rdbms/admin/dbmspool.sql
@?/rdbms/admin/userlock.sql
@?/rdbms/admin/utlrp.sql
shutdown immediate;
startup mount;
alter database archivelog;
alter database open;
connect system/oracle
@?/sqlplus/admin/pupbld.sql
exit

++++++++++
Check for errors.
grep '^ORA-' create_db_omf.tiger.out |cut -d ":" -f1|sort -u

ORA-00942
ORA-01432
ORA-01434
ORA-01921
ORA-02289
ORA-04043
ORA-29807

oerr ora 1432

01432, 00000, "public synonym to be dropped does not exist"
// *Cause:
// *Action:

grep '^ORA-' create_db_omf.tiger.out |cut -d ":" -f2|grep -v "not exist"|sort -u

 role name 'EXP_FULL_DATABASE' conflicts with another user or role
 role name 'IMP_FULL_DATABASE' conflicts with another user or role

++++++++++
Don’t use FILESIZE – I know, there are presentation showing usage of FILESIZE.

Example:
FILESIZE=8g
ORA-39095: Dump file space has been exhausted: Unable to allocate 8192 bytes

++++++++++
DATAFILE SIZE 2097152000 is larger than MAXSIZE 1048576000.

ORA-39083: Object type TABLESPACE:"USERS" failed to create with error:
ORA-02494: invalid or missing maximum file size in MAXSIZE clause
Failing sql is:
CREATE TABLESPACE "USERS" DATAFILE SIZE 2097152000 AUTOEXTEND ON NEXT 104857600 MAXSIZE 1048576000

Related error:

Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE
ORA-39083: Object type TABLE: failed to create with error:
ORA-01950: no privileges on tablespace 'USERS'

++++++++++
SYS triggers need to be extracted from Source and created at Target.
Remember this one – OJVM?

SQL> CREATE OR REPLACE TRIGGER "SYS"."DBMS_JAVA_DEV_TRG" before create
2 on database
3 begin
4 if (ora_dict_obj_type='JAVA')
5 then
6 raise_application_error(-20031,'Java Development Disabled');
7 end if;
8 end;
9 /
Trigger created.

SQL> ALTER TRIGGER "SYS"."DBMS_JAVA_DEV_TRG" DISABLE;

Trigger altered.
SYS@SQL>

++++++++++
Tablespaces were pre-created since datafile locations changed.  Alternatively, use REMAP_DATAFILE.

set echo off head off verify off feedb off pages 0 long 10000 longchunk 10000 trimspool on lines 2000 timing off term off
exec dbms_metadata.set_transform_param(dbms_metadata.SESSION_TRANSFORM,'SQLTERMINATOR',TRUE);
exec dbms_metadata.set_transform_param(dbms_metadata.SESSION_TRANSFORM,'PRETTY',TRUE);
define _filename=none
COL name NEW_VALUE name
select name from v$database;
define _filename='tbs_&name..sql'
spool &_filename
select dbms_metadata.get_ddl('TABLESPACE',TABLESPACE_NAME) from dba_tablespace
;
spool off
set term on
pro
pro *** Spool Output: &_filename
pro
pro
exit

++++++++++
Import done in 2 passes, impdp_full_user.par and impdp_full.par

impdp_full_user.par

directory=DATA_PUMP_DIR
USERID="/ as sysdba"
METRICS=Y
PARALLEL=4
FULL=Y
DUMPFILE=full%U.dmp
LOGFILE=imp_user.log
INCLUDE=user,role,default_role,tablespace_quota,role_grant,profile,password_verify_function,tablespace

Want to detect as many issues as possible before actual data import.
ORA-39083: Object type TABLESPACE:"USERS" failed to create with error

ORA-39083: Object type TABLE: failed to create with error:
ORA-01950: no privileges on tablespace 'USERS'

++++++++++
grep -v ORA-31684 imp_user.log | grep -A 1 Processing

Processing object type DATABASE_EXPORT/TABLESPACE
     Completed 26 TABLESPACE objects in 1 seconds
Processing object type DATABASE_EXPORT/PASSWORD_VERIFY_FUNCTION
     Completed 1 PASSWORD_VERIFY_FUNCTION objects in 0 seconds
Processing object type DATABASE_EXPORT/PROFILE
     Completed 1 PROFILE objects in 0 seconds
Processing object type DATABASE_EXPORT/SYS_USER/USER
     Completed 1 USER objects in 0 seconds
Processing object type DATABASE_EXPORT/SCHEMA/USER
     Completed 7796 USER objects in 20 seconds
Processing object type DATABASE_EXPORT/ROLE
     Completed 321 ROLE objects in 2 seconds
Processing object type DATABASE_EXPORT/SCHEMA/ROLE_GRANT
     Completed 21442 ROLE_GRANT objects in 129 seconds
Processing object type DATABASE_EXPORT/SCHEMA/DEFAULT_ROLE
     Completed 7796 DEFAULT_ROLE objects in 10 seconds
Processing object type DATABASE_EXPORT/SCHEMA/TABLESPACE_QUOTA
     Completed 7790 TABLESPACE_QUOTA objects in 24 seconds

++++++++++
impdp_full.par

directory=DATA_PUMP_DIR
USERID="/ as sysdba"
METRICS=Y
PARALLEL=4
FULL=Y
DUMPFILE=full%U.dmp
LOGFILE=imp_full.log
EXCLUDE=user,role,default_role,tablespace_quota,role_grant,profile,password_verify_function,tablespace
STREAMS_CONFIGURATION=NO

++++++++++
grep -v ORA-31684 imp_full.log | grep -A 1 Processing

Processing object type DATABASE_EXPORT/GRANT/SYSTEM_GRANT/PROC_SYSTEM_GRANT
     Completed 6 PROC_SYSTEM_GRANT objects in 1 seconds
Processing object type DATABASE_EXPORT/SCHEMA/GRANT/SYSTEM_GRANT
     Completed 145 SYSTEM_GRANT objects in 0 seconds
Processing object type DATABASE_EXPORT/RESOURCE_COST
     Completed 1 RESOURCE_COST objects in 0 seconds
Processing object type DATABASE_EXPORT/TRUSTED_DB_LINK
     Completed 1 TRUSTED_DB_LINK objects in 0 seconds
Processing object type DATABASE_EXPORT/SCHEMA/SEQUENCE/SEQUENCE
     Completed 197 SEQUENCE objects in 0 seconds
Processing object type DATABASE_EXPORT/SCHEMA/SEQUENCE/GRANT/OWNER_GRANT/OBJECT_GRANT
     Completed 205 OBJECT_GRANT objects in 1 seconds
Processing object type DATABASE_EXPORT/DIRECTORY/DIRECTORY
     Completed 7 DIRECTORY objects in 0 seconds
Processing object type DATABASE_EXPORT/DIRECTORY/GRANT/OWNER_GRANT/OBJECT_GRANT
     Completed 12 OBJECT_GRANT objects in 0 seconds
Processing object type DATABASE_EXPORT/CONTEXT
     Completed 7 CONTEXT objects in 0 seconds
Processing object type DATABASE_EXPORT/SCHEMA/PUBLIC_SYNONYM/SYNONYM
     Completed 1139 SYNONYM objects in 2 seconds
Processing object type DATABASE_EXPORT/SCHEMA/SYNONYM
     Completed 1014 SYNONYM objects in 1 seconds
Processing object type DATABASE_EXPORT/SCHEMA/TYPE/TYPE_SPEC
     Completed 180 TYPE objects in 3 seconds
Processing object type DATABASE_EXPORT/SCHEMA/TYPE/GRANT/OWNER_GRANT/OBJECT_GRANT
     Completed 2 OBJECT_GRANT objects in 0 seconds
Processing object type DATABASE_EXPORT/SYSTEM_PROCOBJACT/PRE_SYSTEM_ACTIONS/PROCACT_SYSTEM
ORA-39083: Object type PROCACT_SYSTEM failed to create with error:
--
Processing object type DATABASE_EXPORT/SYSTEM_PROCOBJACT/PROCOBJ
     Completed 3 PROCOBJ objects in 0 seconds
Processing object type DATABASE_EXPORT/SYSTEM_PROCOBJACT/POST_SYSTEM_ACTIONS/PROCACT_SYSTEM
ORA-39083: Object type PROCACT_SYSTEM failed to create with error:
--
Processing object type DATABASE_EXPORT/SCHEMA/PROCACT_SCHEMA
ORA-39083: Object type PROCACT_SCHEMA failed to create with error:
--
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE
     Completed 1302 TABLE objects in 18 seconds
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TABLE_DATA
Startup took 356 seconds
--
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/GRANT/OWNER_GRANT/OBJECT_GRANT
     Completed 68094 OBJECT_GRANT objects in 91 seconds
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/GRANT/CROSS_SCHEMA/OBJECT_GRANT
     Completed 4 OBJECT_GRANT objects in 0 seconds
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/INDEX/INDEX
ORA-39083: Object type INDEX: failed to create with error:
--
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/CONSTRAINT/CONSTRAINT
     Completed 238 CONSTRAINT objects in 86 seconds
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/COMMENT
     Completed 696 COMMENT objects in 0 seconds
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/AUDIT_OBJ
     Completed 1 AUDIT_OBJ objects in 1 seconds
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/RLS_POLICY
     Completed 68 RLS_POLICY objects in 0 seconds
Processing object type DATABASE_EXPORT/SCHEMA/PACKAGE/PACKAGE_SPEC
     Completed 148 PACKAGE objects in 1 seconds
Processing object type DATABASE_EXPORT/SCHEMA/PACKAGE/GRANT/OWNER_GRANT/OBJECT_GRANT
     Completed 195 OBJECT_GRANT objects in 0 seconds
Processing object type DATABASE_EXPORT/SCHEMA/FUNCTION/FUNCTION
     Completed 42 FUNCTION objects in 1 seconds
Processing object type DATABASE_EXPORT/SCHEMA/FUNCTION/GRANT/OWNER_GRANT/OBJECT_GRANT
     Completed 52 OBJECT_GRANT objects in 0 seconds
Processing object type DATABASE_EXPORT/SCHEMA/PROCEDURE/PROCEDURE
     Completed 16 PROCEDURE objects in 1 seconds
Processing object type DATABASE_EXPORT/SCHEMA/PROCEDURE/GRANT/OWNER_GRANT/OBJECT_GRANT
     Completed 2 OBJECT_GRANT objects in 0 seconds
Processing object type DATABASE_EXPORT/SCHEMA/FUNCTION/ALTER_FUNCTION
     Completed 42 ALTER_FUNCTION objects in 0 seconds
Processing object type DATABASE_EXPORT/SCHEMA/PROCEDURE/ALTER_PROCEDURE
     Completed 16 ALTER_PROCEDURE objects in 0 seconds
Processing object type DATABASE_EXPORT/SCHEMA/VIEW/VIEW
     Completed 72 VIEW objects in 1 seconds
Processing object type DATABASE_EXPORT/SCHEMA/VIEW/GRANT/OWNER_GRANT/OBJECT_GRANT
     Completed 155 OBJECT_GRANT objects in 1 seconds
Processing object type DATABASE_EXPORT/SCHEMA/VIEW/COMMENT
     Completed 62 COMMENT objects in 0 seconds
Processing object type DATABASE_EXPORT/SCHEMA/VIEW/RLS_POLICY
     Completed 4 RLS_POLICY objects in 0 seconds
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/CONSTRAINT/REF_CONSTRAINT
ORA-39083: Object type REF_CONSTRAINT: failed to create with error:
--
Processing object type DATABASE_EXPORT/SCHEMA/PACKAGE_BODIES/PACKAGE/PACKAGE_BODY
     Completed 148 PACKAGE_BODY objects in 4 seconds
Processing object type DATABASE_EXPORT/SCHEMA/TYPE/TYPE_BODY
     Completed 16 TYPE_BODY objects in 0 seconds
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/INDEX/FUNCTIONAL_AND_BITMAP/INDEX
ORA-39083: Object type INDEX: failed to create with error:
--
Processing object type DATABASE_EXPORT/SCHEMA/TABLE/TRIGGER
     Completed 68 TRIGGER objects in 1 seconds
Processing object type DATABASE_EXPORT/SCHEMA/VIEW/TRIGGER
     Completed 3 TRIGGER objects in 0 seconds
Processing object type DATABASE_EXPORT/SCHEMA/MATERIALIZED_VIEW
     Completed 1 MATERIALIZED_VIEW objects in 0 seconds
Processing object type DATABASE_EXPORT/SCHEMA/JOB
     Completed 5 JOB objects in 1 seconds
Processing object type DATABASE_EXPORT/SCHEMA/POST_SCHEMA/PROCOBJ
     Completed 3 PROCOBJ objects in 0 seconds
Processing object type DATABASE_EXPORT/SCHEMA/POST_SCHEMA/PROCACT_SCHEMA
ORA-39083: Object type PROCACT_SCHEMA failed to create with error:
--
Processing object type DATABASE_EXPORT/AUDIT
     Completed 5 AUDIT objects in 0 seconds

12c Clone DB_SWONLY Oracle Home

Sun, 2016-03-06 19:42

Just some notes on 12c Oracle Home Cloning.

I am too lazy to put step by step instructions in words, and if you have questions, please ask.

-defaultHomeName
<HOME NAME=”OraHome1” LOC=”/u01/app/oracle/product/12.2.0/dbhome_2″ TYPE=”O” IDX=”3″/>

oracle@arrow:hawlkas:/home/oracle
$ . oraenv <<< db12c
ORACLE_SID = [hawlkas] ? The Oracle base remains unchanged with value /u01/app/oracle
oracle@arrow:db12c:/home/oracle
$ echo $ORACLE_HOME
/u01/app/oracle/product/12.2.0/dbhome_1
oracle@arrow:db12c:/home/oracle
$ cd $ORACLE_HOME
oracle@arrow:db12c:/u01/app/oracle/product/12.2.0/dbhome_1
$ pwd
/u01/app/oracle/product/12.2.0/dbhome_1
oracle@arrow:db12c:/u01/app/oracle/product/12.2.0/dbhome_1
$ nohup tar -cvpf /tmp/db12cHome_${USER}_`hostname -s`_clone.tar . > /tmp/clone_${USER}_`hostname -s`_db12cHome.log 2>&1 &
[1] 13092

++++++++++

oracle@arrow:db12c:/u01/app/oracle/product/12.2.0/dbhome_1
$
[1]+  Done                    nohup tar -cvpf /tmp/db12cHome_${USER}_`hostname -s`_clone.tar . > /tmp/clone_${USER}_`hostname -s`_db12cHome.log 2>&1
oracle@arrow:db12c:/u01/app/oracle/product/12.2.0/dbhome_1
$ ll /tmp/*clone*
-rw-r--r--. 1 oracle oinstall    1381582 Mar  6 16:24 /tmp/clone_oracle_arrow_db12cHome.log
-rw-r--r--. 1 oracle oinstall 6581944320 Mar  6 16:24 /tmp/db12cHome_oracle_arrow_clone.tar
oracle@arrow:db12c:/u01/app/oracle/product/12.2.0/dbhome_1
$ tail /tmp/clone_oracle_arrow_db12cHome.log
./jdk/bin/xjc
./jdk/bin/javadoc
./jdk/bin/jarsigner
./jdk/bin/pack200
./jdk/bin/rmid
./jdk/bin/jrunscript
./jdk/bin/extcheck
./jdk/bin/keytool
./jdk/LICENSE
./jdk/.manifest
oracle@arrow:db12c:/u01/app/oracle/product/12.2.0/dbhome_1
$ du -sh /tmp/db12cHome_oracle_arrow_clone.tar
6.2G    /tmp/db12cHome_oracle_arrow_clone.tar
oracle@arrow:db12c:/u01/app/oracle/product/12.2.0/dbhome_1
$

++++++++++

oracle@arrow:test12c:/home/oracle
$ . oraenv <<< test12c
ORACLE_SID = [test12c] ? The Oracle base remains unchanged with value /u01/app/oracle
oracle@arrow:test12c:/home/oracle
$ cd $ORACLE_HOME
oracle@arrow:test12c:/u01/app/oracle/product/12.2.0/dbhome_2
$ pwd
/u01/app/oracle/product/12.2.0/dbhome_2
oracle@arrow:test12c:/u01/app/oracle/product/12.2.0/dbhome_2
$ ls
oracle@arrow:test12c:/u01/app/oracle/product/12.2.0/dbhome_2
$ nohup tar -xvf /tmp/db12cHome_oracle_arrow_clone.tar > /tmp/untar_${USER}_`hostname -s`_db12cHome.log 2>&1 &
[1] 13182
oracle@arrow:test12c:/u01/app/oracle/product/12.2.0/dbhome_2
$
[1]+  Done                    nohup tar -xvf /tmp/db12cHome_oracle_arrow_clone.tar > /tmp/untar_${USER}_`hostname -s`_db12cHome.log 2>&1
oracle@arrow:test12c:/u01/app/oracle/product/12.2.0/dbhome_2
$ ll /tmp/untar_oracle_arrow_db12cHome.log
-rw-r--r--. 1 oracle oinstall 1381582 Mar  6 16:44 /tmp/untar_oracle_arrow_db12cHome.log
oracle@arrow:test12c:/u01/app/oracle/product/12.2.0/dbhome_2
$ tail /tmp/untar_oracle_arrow_db12cHome.log
./jdk/bin/xjc
./jdk/bin/javadoc
./jdk/bin/jarsigner
./jdk/bin/pack200
./jdk/bin/rmid
./jdk/bin/jrunscript
./jdk/bin/extcheck
./jdk/bin/keytool
./jdk/LICENSE
./jdk/.manifest
oracle@arrow:test12c:/u01/app/oracle/product/12.2.0/dbhome_2
$ ls
addnode     ccr          crs  dbs        diagnostics  hs             javavm  ldap  mgw      odbc    oracore      owm      precomp  rdbms     scheduler     sqlpatch  sysman  wwg
apex        cdata        css  dc_ocm     dmu          install        jdbc    lib   network  olap    oraInst.loc  perl     QOpatch  relnotes  slax          sqlplus   ucp     xdk
assistants  cfgtoollogs  ctx  deinstall  dv           instantclient  jdk     log   nls      OPatch  ord          plsql    R        rest      sqldeveloper  srvm      usm
bin         clone        cv   demo       has          inventory      jlib    md   

++++++++++

$ cd $ORACLE_HOME/clone/bin
oracle@arrow:test12c:/u01/app/oracle/product/12.2.0/dbhome_2/clone/bin
$ perl clone.pl -silent -noconfig -defaultHomeName ORACLE_HOME="/u01/app/oracle/product/12.2.0/dbhome_2" ORACLE_BASE="/u01/app/oracle" OSDBA_GROUP=dba OSOPER_GROUP=dba
./runInstaller -clone -waitForCompletion  -noconfig  -defaultHomeName  "ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_2" 
"ORACLE_BASE=/u01/app/oracle" "oracle_install_OSDBA=dba" "oracle_install_OSOPER=dba" 
-silent -paramFile /u01/app/oracle/product/12.2.0/dbhome_2/clone/clone_oraparam.ini

Starting Oracle Universal Installer...

Checking Temp space: must be greater than 500 MB.   Actual 16049 MB    Passed
Checking swap space: must be greater than 500 MB.   Actual 3994 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2016-03-06_04-58-03PM. 

Please wait ...You can find the log of this install session at:
 /u01/app/oraInventory/logs/cloneActions2016-03-06_04-58-03PM.log
..................................................   5% Done.
..................................................   10% Done.
..................................................   15% Done.
..................................................   20% Done.
..................................................   25% Done.
..................................................   30% Done.
..................................................   35% Done.
..................................................   40% Done.
..................................................   45% Done.
..................................................   50% Done.
..................................................   55% Done.
..................................................   60% Done.
..................................................   65% Done.
..................................................   70% Done.
..................................................   75% Done.
..................................................   80% Done.
..................................................   85% Done.
..........
Copy files in progress.

Copy files successful.

Link binaries in progress.

Link binaries successful.

Setup files in progress.

Setup files successful.

Setup Inventory in progress.

Setup Inventory successful.

Finish Setup successful.
The cloning of OraHome1 was successful.
Please check '/u01/app/oraInventory/logs/cloneActions2016-03-06_04-58-03PM.log' for more details.

Setup Oracle Base in progress.

Setup Oracle Base successful.
..................................................   95% Done.

As a root user, execute the following script(s):
        1. /u01/app/oracle/product/12.2.0/dbhome_2/root.sh

..................................................   100% Done.
oracle@arrow:test12c:/u01/app/oracle/product/12.2.0/dbhome_2/clone/bin
$ su -
Password:
[root@arrow ~]# /u01/app/oracle/product/12.2.0/dbhome_2/root.sh
Check /u01/app/oracle/product/12.2.0/dbhome_2/install/root_arrow.localdomain_2016-03-06_17-03-49.log for the output of root script
[root@arrow ~]# exit
logout

oracle@arrow:test12c:/u01/app/oracle/product/12.2.0/dbhome_2/clone/bin
$ /u01/app/oracle/product/12.2.0/dbhome_2/OPatch/opatch lspatches
22139226;Database PSU 12.1.0.2.160119, Oracle JavaVM Component (Jan2016)
21948354;Database Patch Set Update : 12.1.0.2.160119 (21948354)

OPatch succeeded.
oracle@arrow:test12c:/u01/app/oracle/product/12.2.0/dbhome_2/clone/bin
$ /u01/app/oracle/product/12.2.0/dbhome_2/OPatch/opatch lsinventory
Oracle Interim Patch Installer version 12.1.0.1.10
Copyright (c) 2016, Oracle Corporation.  All rights reserved.


Oracle Home       : /u01/app/oracle/product/12.2.0/dbhome_2
Central Inventory : /u01/app/oraInventory
   from           : /u01/app/oracle/product/12.2.0/dbhome_2/oraInst.loc
OPatch version    : 12.1.0.1.10
OUI version       : 12.1.0.2.0
Log file location : /u01/app/oracle/product/12.2.0/dbhome_2/cfgtoollogs/opatch/opatch2016-03-06_17-29-28PM_1.log

Lsinventory Output file location : /u01/app/oracle/product/12.2.0/dbhome_2/cfgtoollogs/opatch/lsinv/lsinventory2016-03-06_17-29-28PM.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: localhost
ARU platform id: 226
ARU platform description:: Linux x86-64

Installed Top-level Products (1):

Oracle Database 12c                                                  12.1.0.2.0
There are 1 products installed in this Oracle Home.


Interim patches (2) :

Patch  22139226     : applied on Sun Mar 06 15:46:50 PST 2016
Unique Patch ID:  19729684
Patch description:  "Database PSU 12.1.0.2.160119, Oracle JavaVM Component (Jan2016)"
   Created on 4 Jan 2016, 01:41:46 hrs PST8PDT
   Bugs fixed:
     19699946, 19176885, 19623450, 22139226, 19909862, 21811517, 19223010
     21068507, 19895326, 19877336, 22118835, 22118851, 21566993, 19153980
     20408829, 21047766, 19231857, 19895362, 19855285, 20415564, 21555660
     19245191, 21047803, 20408866, 21566944

Patch  21948354     : applied on Sun Mar 06 15:35:02 PST 2016
Unique Patch ID:  19553095
Patch description:  "Database Patch Set Update : 12.1.0.2.160119 (21948354)"
   Created on 20 Dec 2015, 23:39:33 hrs PST8PDT
Sub-patch  21359755; "Database Patch Set Update : 12.1.0.2.5 (21359755)"
Sub-patch  20831110; "Database Patch Set Update : 12.1.0.2.4 (20831110)"
Sub-patch  20299023; "Database Patch Set Update : 12.1.0.2.3 (20299023)"
Sub-patch  19769480; "Database Patch Set Update : 12.1.0.2.2 (19769480)"
   Bugs fixed:
     19189525, 19075256, 19141838, 19865345, 19791273, 19280225, 18845653
     20951038, 19243521, 19248799, 21756699, 18988834, 19238590, 21281532
     20245930, 18921743, 18799063, 19134173, 19571367, 20476175, 20925795
     19018206, 20509482, 20387265, 20588502, 19149990, 18849537, 18886413
     17551063, 19183343, 19703301, 19001390, 18202441, 19189317, 19644859
     19358317, 19390567, 19279273, 19706965, 19068970, 19619732, 20348653
     18607546, 18940497, 19670108, 19649152, 18948177, 19315691, 19676905
     18964978, 19035573, 20165574, 19176326, 20413820, 20558005, 19176223
     19532017, 20134339, 19074147, 18411216, 20361671, 20425790, 18966843
     20294666, 19307662, 19371175, 19195895, 19154375, 19468991, 19174521
     19520602, 19382851, 21875360, 19326908, 19658708, 20093776, 20618595
     21787056, 17835294, 19791377, 19068610, 20048359, 20746251, 19143550
     19185876, 19627012, 20281121, 19577410, 22092979, 19001359, 19518079
     18610915, 19490948, 18674024, 18306996, 19309466, 19081128, 19915271
     20122715, 21188532, 20284155, 18791688, 20890311, 21442094, 18973548
     19303936, 19597439, 20235511, 18964939, 19430401, 19044962, 19409212
     19879746, 20657441, 19684504, 19024808, 18799993, 20877664, 19028800
     19065556, 19723336, 19077215, 19604659, 21421886, 19524384, 19048007
     18288842, 19689979, 20446883, 18952989, 16870214, 19928926, 21526048
     19180770, 19197175, 19902195, 20318889, 19730508, 19012119, 19067244
     20074391, 19512341, 19841800, 14643995, 20331945, 19587324, 19547370
     19065677, 19637186, 21225209, 20397490, 18967382, 19174430, 18674047
     19054077, 19536415, 19708632, 19289642, 20869721, 19335438, 17365043
     18856999, 19869255, 20471920, 19468347, 21620471, 16359751, 18990693
     17890099, 19439759, 19769480, 19272708, 19978542, 20101006, 21300341
     20402832, 19329654, 19873610, 21668627, 21517440, 19304354, 19052488
     20794034, 19291380, 18681056, 19896336, 19076343, 19561643, 18618122
     20440930, 18456643, 19699191, 18909599, 19487147, 18250893, 19016730
     18743542, 20347562, 16619249, 18354830, 19687159, 19174942, 20424899
     19989009, 20688221, 20441797, 19157754, 19032777, 19058490, 19399918
     18885870, 19434529, 19018447, 18417036, 20919320, 19022470, 19284031
     20474192, 20173897, 22062026, 19385656, 19501299, 17274537, 20899461
     19440586, 16887946, 19606174, 18436647, 17655240, 19023822, 19178851
     19124589, 19805359, 19597583, 19155797, 19393542, 19050649



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

OPatch succeeded.
oracle@arrow:test12c:/u01/app/oracle/product/12.2.0/dbhome_2/clone/bin
$
++++++++++
oracle@arrow:tiger:/u01/app/oraInventory/logs
$ ls -alrt|tail
-rw-r-----. 1 oracle oinstall     239 Mar  6 16:54 installActions2016-03-06_04-54-57PM.log
-rw-r-----. 1 oracle oinstall       0 Mar  6 16:56 oraInstall2016-03-06_04-55-18PM.err
-rw-r-----. 1 oracle oinstall     200 Mar  6 16:56 oraInstall2016-03-06_04-55-18PM.out
-rw-r-----. 1 oracle oinstall   11221 Mar  6 16:56 cloneActions2016-03-06_04-55-18PM.log
-rw-r-----. 1 oracle oinstall       0 Mar  6 16:58 oraInstall2016-03-06_04-58-03PM.err
-rw-r-----. 1 oracle oinstall      79 Mar  6 17:01 silentInstall2016-03-06_04-58-03PM.log
-rw-r-----. 1 oracle oinstall    1868 Mar  6 17:01 oraInstall2016-03-06_04-58-03PM.out
drwxrwx---. 6 oracle oinstall    4096 Mar  6 17:01 ..
-rw-r-----. 1 oracle oinstall 7338332 Mar  6 17:01 cloneActions2016-03-06_04-58-03PM.log
drwxrwx---. 3 oracle oinstall    4096 Mar  8 07:51 .

oracle@arrow:tiger:/u01/app/oraInventory/logs
$ grep -e '[[:upper:]]: ' cloneActions2016-03-06_04-58-03PM.log|cut -d ":" -f1|sort -u
INFO
WARNING

oracle@arrow:tiger:/u01/app/oraInventory/logs
$ grep -e '[[:upper:]]: ' cloneActions2016-03-06_04-58-03PM.log |grep "^WARNING: "
WARNING: You have not provided an email address. If you do not want to receive security updates, set 'DECLINE_SECURITY_UPDATES' to 'true'.
oracle@arrow:tiger:/u01/app/oraInventory/logs
$
++++++++++
oracle@arrow:test12c:/u01/app/oraInventory/ContentsXML
$ grep -i "home name" inventory.xml
<HOME NAME="OraDb11g_home1" LOC="/u01/app/oracle/product/11.2.0/dbhome_1" TYPE="O" IDX="1"/>
<HOME NAME="OraDB12Home1" LOC="/u01/app/oracle/product/12.2.0/dbhome_1" TYPE="O" IDX="2"/>
<HOME NAME="OraHome1" LOC="/u01/app/oracle/product/12.2.0/dbhome_2" TYPE="O" IDX="3"/>

RANT PSU Naming

Sun, 2016-03-06 17:12

Do you know what PSU there are?

oracle@arrow:db12c:/media/sf_working/12c/psu
$ ll *.zip
-rwxrwx---. 1 root vboxsf 147028181 Mar  4 20:00 p21948354_121020_Linux-x86-64.zip
-rwxrwx---. 1 root vboxsf 101720296 Mar  4 19:58 p22139226_121020_Linux-x86-64.zip

Let me give you a hint – (12.1.0.1.160119)
Now do you know what they are?

Let me give you another hint.
21948354 (12.1.0.1.160119) – 12.1.0.1 JAN2016 PSU (Database assumed here)
22139226 (12.1.0.2.160119) – OJVM PSU Patches

160119 – what date format is this?

opatch lsinventory

Patch  22139226     : applied on Wed Feb 03 11:07:55 CST 2016
Unique Patch ID:  19729684
Patch description:  "Database PSU 12.1.0.2.160119, Oracle JavaVM Component (Jan2016)"
   Created on 4 Jan 2016, 01:41:46 hrs PST8PDT
   Bugs fixed:
     19699946, 19176885, 19623450, 22139226, 19909862, 21811517, 19223010
     21068507, 19895326, 19877336, 22118835, 22118851, 21566993, 19153980
     20408829, 21047766, 19231857, 19895362, 19855285, 20415564, 21555660
     19245191, 21047803, 20408866, 21566944

Patch  21948354     : applied on Wed Feb 03 11:03:24 CST 2016
Unique Patch ID:  19553095

Looks like the whole numbering system is screwed up now.

Patch description:  "Database Patch Set Update : 12.1.0.2.160119 (21948354)"
   Created on 20 Dec 2015, 23:39:33 hrs PST8PDT
Sub-patch  21359755; "Database Patch Set Update : 12.1.0.2.5 (21359755)"
Sub-patch  20831110; "Database Patch Set Update : 12.1.0.2.4 (20831110)"
Sub-patch  20299023; "Database Patch Set Update : 12.1.0.2.3 (20299023)"
Sub-patch  19769480; "Database Patch Set Update : 12.1.0.2.2 (19769480)"

12c Silent Install software-only BUG

Sun, 2016-03-06 16:35

12.1: Oracle Database Software Only Silent Installation Fails to Create configToolAllCommands (Doc ID 2037923.1)

The BUG is in RED BOLD below.

oracle@arrow:hawklas:/media/sf_working/12c/database/response
$ cat /etc/oraInst.loc
inventory_loc=/u01/app/oraInventory
inst_group=oinstall

++++++++++

oracle@arrow:hawklas:/media/sf_working/12c/database/response
$ cat db_swonly.rsp
oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v12.1.0
oracle.install.option=INSTALL_DB_SWONLY
# Specify the Unix group to be set for the inventory directory.
UNIX_GROUP_NAME=oinstall
INVENTORY_LOCATION=/etc/oraInst.loc
SELECTED_LANGUAGES=en
ORACLE_HOME=/u01/app/oracle/product/12.2.0/dbhome_1
ORACLE_BASE=/u01/app/oracle
oracle.install.db.InstallEdition=EE
oracle.install.db.DBA_GROUP=dba
oracle.install.db.OPER_GROUP=dba
oracle.install.db.BACKUPDBA_GROUP=dba
oracle.install.db.DGDBA_GROUP=dba
oracle.install.db.KMDBA_GROUP=dba
DECLINE_SECURITY_UPDATES=true
oracle.installer.autoupdates.option=SKIP_UPDATES

++++++++++

oracle@arrow:hawklas:/media/sf_working/12c/database
$ ./runInstaller -showProgress -waitforcompletion -silent -noconfig -force -responseFile /media/sf_working/12c/database/response/db_swonly.rsp

Starting Oracle Universal Installer...
Checking Temp space: must be greater than 500 MB.   Actual 29558 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 4080 MB    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2016-03-06_01-53-21PM. 
Please wait ...KiTTY X11 proxy: MIT-MAGIC-COOKIE-1 data did not matchYou can find the log of this install session at:
/u01/app/oraInventory/logs/installActions2016-03-06_01-53-21PM.log

Prepare in progress.
..................................................   8% Done.

Prepare successful.

Copy files in progress.
..................................................   13% Done.
..................................................   18% Done.
..................................................   23% Done.
..................................................   28% Done.
..................................................   33% Done.
..................................................   39% Done.
..................................................   45% Done.
..................................................   50% Done.
..................................................   55% Done.
..................................................   60% Done.
..................................................   65% Done.
..................................................   70% Done.
..................................................   75% Done.

Copy files successful.

Link binaries in progress.

Link binaries successful.

Setup files in progress.
..............................
Setup files successful.
..........
Setup Inventory in progress.

Setup Inventory successful.
..................................................   80% Done.
..........
Finish Setup successful.

The installation of Oracle Database 12c was successful.

Please check '/u01/app/oraInventory/logs/silentInstall2016-03-06_01-53-21PM.log' for more details.

Setup Oracle Base in progress.

Setup Oracle Base successful.
..................................................   95% Done.

As a root user, execute the following script(s):
        1. /u01/app/oracle/product/12.2.0/dbhome_1/root.sh

..................................................   100% Done.

Successfully Setup Software.
As install user, execute the following script to complete the configuration.
        1. /u01/app/oracle/product/12.2.0/dbhome_1/cfgtoollogs/configToolAllCommands RESPONSE_FILE=

        Note:
        1. This script must be run on the same host from where installer was run.
        2. This script needs a small password properties file for configuration assistants that require passwords (refer to install guide documentation).


oracle@arrow:hawklas:/media/sf_working/12c/database
$ su -
Password:
[root@arrow ~]# /u01/app/oracle/product/12.2.0/dbhome_1/root.sh
Check /u01/app/oracle/product/12.2.0/dbhome_1/install/root_arrow.localdomain_2016-03-06_14-09-10.log for the output of root script
[root@arrow ~]# ll /u01/app/oracle/product/12.2.0/dbhome_1/cfgtoollogs/configToolAllCommands
ls: cannot access /u01/app/oracle/product/12.2.0/dbhome_1/cfgtoollogs/configToolAllCommands: No such file or directory
[root@arrow ~]#

A Better Diff

Thu, 2016-03-03 22:25

I have been working on simplifying, perfecting, and comparing RMAN backup scripts.

The typical diff file1 file2 was not useful as I wanted a complete picture.

Look at what I found!

$ diff -iwyB --suppress-common-lines -W 150 rman_bkupinc.sh rman_bkuparc.sh;echo
# RMAN database incremental backup                                        |     # RMAN archivelog backup
# rman_bkupinc.sh                                                         |     # rman_bkuparc.sh
# Shell script calls bkupinc.rman at at SCRIPT_DIR location               |     # Shell script calls bkuparc.rman at at SCRIPT_DIR location
SID=${1:?"---> USAGE: $DN/$BN -ORACLE_SID -LEVEL"}                        |     SID=${1:?"---> USAGE: $DN/$BN -ORACLE_SID"}
LVL=${2:?"---> USAGE: $DN/$BN -ORACLE_SID -LEVEL"}                        <
DAY=`date '+%bW%U'`                                                       |     DAY=`date '+%aH%H'`
RMAN_LOG=$LOG_DIR/`echo $BN|cut -d'.' -f1`.$ORACLE_SID.L$2.$DAY.log       |     RMAN_LOG=$LOG_DIR/`echo $BN|cut -d'.' -f1`.$ORACLE_SID.$DAY.log
rman @${RMAN_SCRIPT} ${LVL} msglog $RMAN_LOG                              |     rman @${RMAN_SCRIPT} msglog $RMAN_LOG

$ diff -iwy -W 150 rman_bkupinc.sh rman_bkuparc.sh;echo
#!/bin/sh -ex                                                                   #!/bin/sh -ex
# Michael Dinh: Mar 03, 2016                                                    # Michael Dinh: Mar 03, 2016
# RMAN database incremental backup                                        |     # RMAN archivelog backup
# rman_bkupinc.sh                                                         |     # rman_bkuparc.sh
# Shell script calls bkupinc.rman at at SCRIPT_DIR location               |     # Shell script calls bkuparc.rman at at SCRIPT_DIR location

DN=`dirname $0`                                                                 DN=`dirname $0`
BN=`basename $0`                                                                BN=`basename $0`
SID=${1:?"---> USAGE: $DN/$BN -ORACLE_SID -LEVEL"}                        |     SID=${1:?"---> USAGE: $DN/$BN -ORACLE_SID"}
LVL=${2:?"---> USAGE: $DN/$BN -ORACLE_SID -LEVEL"}                        <

set -a                                                                          set -a
### Edit for proper location                                                    ### Edit for proper location
SCRIPT_DIR=/media/sf_working/rman                                               SCRIPT_DIR=/media/sf_working/rman
LOG_DIR=/tmp                                                                    LOG_DIR=/tmp
PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin               PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin
LD_LIBRARY_PATH=/lib:/usr/lib                                                   LD_LIBRARY_PATH=/lib:/usr/lib

### Edit resync_catalog.rman                                                    ### Edit resync_catalog.rman
### Uncomment if catalog is being used                                          ### Uncomment if catalog is being used
# RESYNC_CATALOG=$SCRIPT_DIR/resync_catalog.rman                                # RESYNC_CATALOG=$SCRIPT_DIR/resync_catalog.rman

ORACLE_SID=$1                                                                   ORACLE_SID=$1
ORAENV_ASK=NO                                                                   ORAENV_ASK=NO
. oraenv                                                                        . oraenv
NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"                                        NLS_DATE_FORMAT="DD-MON-YYYY HH24:MI:SS"
DAY=`date '+%bW%U'`                                                       |     DAY=`date '+%aH%H'`
RMAN_SCRIPT=$SCRIPT_DIR/`echo $BN|cut -d'.' -f1|cut -c6-`.rman                  RMAN_SCRIPT=$SCRIPT_DIR/`echo $BN|cut -d'.' -f1|cut -c6-`.rman
RMAN_LOG=$LOG_DIR/`echo $BN|cut -d'.' -f1`.$ORACLE_SID.L$2.$DAY.log       |     RMAN_LOG=$LOG_DIR/`echo $BN|cut -d'.' -f1`.$ORACLE_SID.$DAY.log
TMPLOG=/tmp/`echo $BN|cut -d'.' -f1`_$ORACLE_SID.log                            TMPLOG=/tmp/`echo $BN|cut -d'.' -f1`_$ORACLE_SID.log
ERRLOG=/tmp/`echo $BN|cut -d'.' -f1`_$ORACLE_SID.err                            ERRLOG=/tmp/`echo $BN|cut -d'.' -f1`_$ORACLE_SID.err
set +a                                                                          set +a

# Lock file                                                                     # Lock file
exec 200>/tmp/$BN.lck                                                           exec 200>/tmp/$BN.lck
flock -n 200 || exit 1                                                          flock -n 200 || exit 1

# RMAN archivelog backup                                                        # RMAN archivelog backup
rman @${RMAN_SCRIPT} ${LVL} msglog $RMAN_LOG                              |     rman @${RMAN_SCRIPT} msglog $RMAN_LOG

### Uncomment if catalog is being used                                          ### Uncomment if catalog is being used
# rman @${RESYNC_CATALOG} msglog $RMAN_LOG append                               # rman @${RESYNC_CATALOG} msglog $RMAN_LOG append

cp -v $RMAN_LOG $TMPLOG                                                         cp -v $RMAN_LOG $TMPLOG
egrep -i '^rman-|^ora-|error|fail' $RMAN_LOG > $ERRLOG                          egrep -i '^rman-|^ora-|error|fail' $RMAN_LOG > $ERRLOG
exit                                                                            exit


$ ll /tmp/rman*.*
-rw-r--r--. 1 oracle oinstall     0 Mar  3 17:19 /tmp/rman_bkuparc_hawklas.err
-rw-r--r--. 1 oracle oinstall  7910 Mar  3 17:19 /tmp/rman_bkuparc_hawklas.log
-rw-r--r--. 1 oracle oinstall  7910 Mar  3 17:19 /tmp/rman_bkuparc.hawklas.ThuH17.log
-rw-r--r--. 1 oracle oinstall     0 Mar  3 17:19 /tmp/rman_bkuparc.sh.lck
-rw-r--r--. 1 oracle oinstall     0 Mar  3 19:20 /tmp/rman_bkupinc_hawklas.err
-rw-r--r--. 1 oracle oinstall 15315 Mar  3 19:20 /tmp/rman_bkupinc.hawklas.L1.MarW09.log
-rw-r--r--. 1 oracle oinstall 15315 Mar  3 19:20 /tmp/rman_bkupinc_hawklas.log
-rw-r--r--. 1 oracle oinstall     0 Mar  3 19:20 /tmp/rman_bkupinc.sh.lck

Revised RMAN Backup Size

Sat, 2016-02-27 13:25

Long, long ago, I posted https://mdinh.wordpress.com/2013/10/31/whats-rman-backup-size/ and recently discovered  the SQL was incorrect.

Current SQL does not include backup_copy as it got a little complicated to create an all inclusive test case – being sick and lazy.

oracle@arrow:hawklas:/media/sf_working/rman
$ sysdba @bkupinfo.sql
SQL*Plus: Release 11.2.0.4.0 Production on Sat Feb 27 10:51:17 2016

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


COMPLETION_TIME     BS_KEY TYPE        BP_KEY  BP_MB PIECES SET_COUNT PIECE# COM DEVICE_TYPE
------------------- ------ ----------- ------ ------ ------ --------- ------ --- -----------------
HANDLE
----------------------------------------------------------------------------------------------------
2016-02-24 18:43:02   1723 FULL          2058   25.6      1      1800      1 YES DISK
/oradata/backup/HAWK_3130551611_20160224_o8quog1h_1_1_s1800_p1

2016-02-24 18:43:12   1724 FULL          2059  40.88      1      1802      1 YES DISK
/oradata/backup/HAWK_3130551611_20160224_oaquog1p_1_1_s1802_p1

2016-02-24 18:43:22   1725 FULL          2060 109.32      1      1801      1 YES DISK
/oradata/backup/HAWK_3130551611_20160224_o9quog1i_1_1_s1801_p1

2016-02-24 18:43:25   1726 FULL          2061   8.48      1      1804      1 YES DISK
/oradata/backup/HAWK_3130551611_20160224_ocquog2b_1_1_s1804_p1

2016-02-24 18:43:33   1727 FULL          2062  59.28      1      1803      1 YES DISK
/oradata/backup/HAWK_3130551611_20160224_obquog2a_1_1_s1803_p1

2016-02-24 18:43:39   1728 ARCHIVELOG    2063    .02      1      1805      1 YES DISK
/oradata/backup/HAWK_3130551611_20160224_odquog2r_1_1_s1805_p1

2016-02-24 18:43:44   1729 CONTROLFILE   2064  11.23      1      1806      1 NO  DISK
/oradata/backup/HAWK_c-3130551611-20160224-0e

2016-02-27 09:57:49   1730 ARCHIVELOG    2065   3.39      1      1807      1 YES DISK
/oradata/backup/HAWK_3130551611_20160227_ofquvecs_1_1_s1807_p1

2016-02-27 09:57:55   1731 ARCHIVELOG    2066  29.52      1      1808      1 YES DISK
/oradata/backup/HAWK_3130551611_20160227_ogquvecs_1_1_s1808_p1

2016-02-27 09:57:55   1732 ARCHIVELOG    2067  13.55      1      1809      1 YES DISK
/oradata/backup/HAWK_3130551611_20160227_ohquvecv_1_1_s1809_p1

2016-02-27 09:59:03   1733 LEVEL0        2068  25.78      1      1810      1 YES DISK
/oradata/backup/HAWK_3130551611_20160227_oiquved7_1_1_s1810_p1

2016-02-27 09:59:35   1734 LEVEL0        2069  30.08      4      1811      1 YES DISK
/oradata/backup/HAWK_3130551611_20160227_ojquved7_1_1_s1811_p1

2016-02-27 09:59:35   1734 LEVEL0        2070  30.04      4      1811      2 YES DISK
/oradata/backup/HAWK_3130551611_20160227_ojquved7_2_1_s1811_p2

2016-02-27 09:59:35   1734 LEVEL0        2071  30.09      4      1811      3 YES DISK
/oradata/backup/HAWK_3130551611_20160227_ojquved7_3_1_s1811_p3

2016-02-27 09:59:35   1734 LEVEL0        2072  21.52      4      1811      4 YES DISK
/oradata/backup/HAWK_3130551611_20160227_ojquved7_4_1_s1811_p4

2016-02-27 09:59:46   1735 LEVEL0        2073   30.3      2      1812      1 YES DISK
/oradata/backup/HAWK_3130551611_20160227_okquvefb_1_1_s1812_p1

2016-02-27 09:59:46   1735 LEVEL0        2074  11.87      2      1812      2 YES DISK
/oradata/backup/HAWK_3130551611_20160227_okquvefb_2_1_s1812_p2

2016-02-27 09:59:57   1736 LEVEL0        2075   8.51      1      1814      1 YES DISK
/oradata/backup/HAWK_3130551611_20160227_omquvego_1_1_s1814_p1

2016-02-27 10:00:02   1737 LEVEL0        2076  30.44      2      1813      1 YES DISK
/oradata/backup/HAWK_3130551611_20160227_olquveg9_1_1_s1813_p1

2016-02-27 10:00:02   1737 LEVEL0        2077  29.42      2      1813      2 YES DISK
/oradata/backup/HAWK_3130551611_20160227_olquveg9_2_1_s1813_p2

2016-02-27 10:00:09   1738 ARCHIVELOG    2078    .07      1      1815      1 YES DISK
/oradata/backup/HAWK_3130551611_20160227_onquveh9_1_1_s1815_p1

2016-02-27 10:00:14   1739 CONTROLFILE   2079  11.23      1      1816      1 NO  DISK
/oradata/backup/HAWK_c-3130551611-20160227-00

2016-02-27 10:02:49   1740 ARCHIVELOG    2080  11.42      1      1817      1 YES DISK
/oradata/backup/HAWK_3130551611_20160227_opquvem5_1_1_s1817_p1.bus

2016-02-27 10:02:53   1741 ARCHIVELOG    2081   1.77      1      1819      1 YES DISK
/oradata/backup/HAWK_3130551611_20160227_orquvemc_1_1_s1819_p1.bus

2016-02-27 10:02:57   1742 ARCHIVELOG    2082  14.07      3      1818      1 YES DISK
/oradata/backup/HAWK_3130551611_20160227_oqquvem5_1_1_s1818_p1.bus

2016-02-27 10:02:57   1742 ARCHIVELOG    2083  14.07      3      1818      2 YES DISK
/oradata/backup/HAWK_3130551611_20160227_oqquvem5_2_1_s1818_p2.bus

2016-02-27 10:02:57   1742 ARCHIVELOG    2084   5.38      3      1818      3 YES DISK
/oradata/backup/HAWK_3130551611_20160227_oqquvem5_3_1_s1818_p3.bus

2016-02-27 10:04:15   1743 LEVEL0        2085  14.15      2      1820      1 YES DISK
/oradata/backup/HAWK_3130551611_20160227_osquvemj_1_1_s1820_p1.bus

2016-02-27 10:04:15   1743 LEVEL0        2086  12.41      2      1820      2 YES DISK
/oradata/backup/HAWK_3130551611_20160227_osquvemj_2_1_s1820_p2.bus

2016-02-27 10:05:04   1744 LEVEL0        2087  14.17      4      1822      1 YES DISK
/oradata/backup/HAWK_3130551611_20160227_ouquvep1_1_1_s1822_p1.bus

2016-02-27 10:05:04   1744 LEVEL0        2088  14.15      4      1822      2 YES DISK
/oradata/backup/HAWK_3130551611_20160227_ouquvep1_2_1_s1822_p2.bus

2016-02-27 10:05:04   1744 LEVEL0        2089  14.02      4      1822      3 YES DISK
/oradata/backup/HAWK_3130551611_20160227_ouquvep1_3_1_s1822_p3.bus

2016-02-27 10:05:04   1744 LEVEL0        2090    1.7      4      1822      4 YES DISK
/oradata/backup/HAWK_3130551611_20160227_ouquvep1_4_1_s1822_p4.bus

2016-02-27 10:05:07   1745 LEVEL0        2091  14.01      9      1821      1 YES DISK
/oradata/backup/HAWK_3130551611_20160227_otquvemj_1_1_s1821_p1.bus

2016-02-27 10:05:07   1745 LEVEL0        2092  14.05      9      1821      2 YES DISK
/oradata/backup/HAWK_3130551611_20160227_otquvemj_2_1_s1821_p2.bus

2016-02-27 10:05:07   1745 LEVEL0        2093  14.01      9      1821      3 YES DISK
/oradata/backup/HAWK_3130551611_20160227_otquvemj_3_1_s1821_p3.bus

2016-02-27 10:05:07   1745 LEVEL0        2094  14.13      9      1821      4 YES DISK
/oradata/backup/HAWK_3130551611_20160227_otquvemj_4_1_s1821_p4.bus

2016-02-27 10:05:07   1745 LEVEL0        2095  14.11      9      1821      5 YES DISK
/oradata/backup/HAWK_3130551611_20160227_otquvemj_5_1_s1821_p5.bus

2016-02-27 10:05:07   1745 LEVEL0        2096  14.11      9      1821      6 YES DISK
/oradata/backup/HAWK_3130551611_20160227_otquvemj_6_1_s1821_p6.bus

2016-02-27 10:05:07   1745 LEVEL0        2097  14.05      9      1821      7 YES DISK
/oradata/backup/HAWK_3130551611_20160227_otquvemj_7_1_s1821_p7.bus

2016-02-27 10:05:07   1745 LEVEL0        2098  14.02      9      1821      8 YES DISK
/oradata/backup/HAWK_3130551611_20160227_otquvemj_8_1_s1821_p8.bus

2016-02-27 10:05:07   1745 LEVEL0        2099   3.46      9      1821      9 YES DISK
/oradata/backup/HAWK_3130551611_20160227_otquvemj_9_1_s1821_p9.bus

2016-02-27 10:05:20   1746 LEVEL0        2100   8.51      1      1824      1 YES DISK
/oradata/backup/HAWK_3130551611_20160227_p0quveqo_1_1_s1824_p1.bus

2016-02-27 10:05:57   1747 LEVEL0        2101  14.17      5      1823      1 YES DISK
/oradata/backup/HAWK_3130551611_20160227_ovquveqn_1_1_s1823_p1.bus

2016-02-27 10:05:57   1747 LEVEL0        2102   14.2      5      1823      2 YES DISK
/oradata/backup/HAWK_3130551611_20160227_ovquveqn_2_1_s1823_p2.bus

2016-02-27 10:05:57   1747 LEVEL0        2103  14.09      5      1823      3 YES DISK
/oradata/backup/HAWK_3130551611_20160227_ovquveqn_3_1_s1823_p3.bus

2016-02-27 10:05:57   1747 LEVEL0        2104  14.23      5      1823      4 YES DISK
/oradata/backup/HAWK_3130551611_20160227_ovquveqn_4_1_s1823_p4.bus

2016-02-27 10:05:57   1747 LEVEL0        2105    5.6      5      1823      5 YES DISK
/oradata/backup/HAWK_3130551611_20160227_ovquveqn_5_1_s1823_p5.bus

2016-02-27 10:06:07   1748 ARCHIVELOG    2106   5.01      1      1825      1 YES DISK
/oradata/backup/HAWK_3130551611_20160227_p1quvese_1_1_s1825_p1.bus

2016-02-27 10:06:14   1749 CONTROLFILE   2107  11.23      1      1826      1 NO  DISK
/oradata/backup/HAWK_c-3130551611-20160227-01

                                              ------


sum                                           880.92



50 rows selected.

ARROW:(SYS@hawklas):PRIMARY> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Let’t take a look at backupset 1745 and backuppiece 2098 from RMAN.

Note BS Key is not the same as SET_COUNT (which is used to label backuppiece)

BS Key = 1745 while SET_COUNT = s1821

oracle@arrow:hawklas:/media/sf_working/rman
$ rman target /

Recovery Manager: Release 11.2.0.4.0 - Production on Sat Feb 27 10:51:22 2016

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

connected to target database: HAWK (DBID=3130551611)

RMAN> list backup summary;

using target database control file instead of recovery catalog

List of Backups
===============
Key     TY LV S Device Type Completion Time      #Pieces #Copies Compressed Tag
------- -- -- - ----------- -------------------- ------- ------- ---------- ---
1723    B  F  A DISK        2016-FEB-24 18:43:02 1       1       YES        FULL
1724    B  F  A DISK        2016-FEB-24 18:43:12 1       1       YES        FULL
1725    B  F  A DISK        2016-FEB-24 18:43:22 1       1       YES        FULL
1726    B  F  A DISK        2016-FEB-24 18:43:25 1       1       YES        FULL
1727    B  F  A DISK        2016-FEB-24 18:43:33 1       1       YES        FULL
1728    B  A  A DISK        2016-FEB-24 18:43:39 1       1       YES        ARCHIVELOG
1729    B  F  A DISK        2016-FEB-24 18:43:44 1       1       NO         TAG20160224T184341
1730    B  A  A DISK        2016-FEB-27 09:57:49 1       1       YES        ARCHIVELOG
1731    B  A  A DISK        2016-FEB-27 09:57:55 1       1       YES        ARCHIVELOG
1732    B  A  A DISK        2016-FEB-27 09:57:55 1       1       YES        ARCHIVELOG
1733    B  0  A DISK        2016-FEB-27 09:59:03 1       1       YES        LEVEL0
1734    B  0  A DISK        2016-FEB-27 09:59:35 4       1       YES        LEVEL0
1735    B  0  A DISK        2016-FEB-27 09:59:46 2       1       YES        LEVEL0
1736    B  0  A DISK        2016-FEB-27 09:59:57 1       1       YES        LEVEL0
1737    B  0  A DISK        2016-FEB-27 10:00:02 2       1       YES        LEVEL0
1738    B  A  A DISK        2016-FEB-27 10:00:09 1       1       YES        ARCHIVELOG
1739    B  F  A DISK        2016-FEB-27 10:00:14 1       1       NO         TAG20160227T100010
1740    B  A  A DISK        2016-FEB-27 10:02:49 1       1       YES        ARCHIVELOG
1741    B  A  A DISK        2016-FEB-27 10:02:53 1       1       YES        ARCHIVELOG
1742    B  A  A DISK        2016-FEB-27 10:02:57 3       1       YES        ARCHIVELOG
1743    B  0  A DISK        2016-FEB-27 10:04:15 2       1       YES        LEVEL0
1744    B  0  A DISK        2016-FEB-27 10:05:04 4       1       YES        LEVEL0
1745    B  0  A DISK        2016-FEB-27 10:05:07 9       1       YES        LEVEL0
1746    B  0  A DISK        2016-FEB-27 10:05:20 1       1       YES        LEVEL0
1747    B  0  A DISK        2016-FEB-27 10:05:57 5       1       YES        LEVEL0
1748    B  A  A DISK        2016-FEB-27 10:06:07 1       1       YES        ARCHIVELOG
1749    B  F  A DISK        2016-FEB-27 10:06:14 1       1       NO         TAG20160227T100609

RMAN> list backupset 1745;

using target database control file instead of recovery catalog

List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ --------------------
1745    Incr 0  115.94M    DISK        00:02:08     2016-FEB-27 10:05:07
  List of Datafiles in backup set 1745
  File LV Type Ckp SCN    Ckp Time             Name
  ---- -- ---- ---------- -------------------- ----
  2    0  Incr 7405326    2016-FEB-27 10:02:59 /oradata/HAWKLAS/datafile/o1_mf_sysaux_c711xx75_.dbf

  Backup Set Copy #1 of backup set 1745
  Device Type Elapsed Time Completion Time      Compressed Tag
  ----------- ------------ -------------------- ---------- ---
  DISK        00:02:08     2016-FEB-27 10:05:06 YES        LEVEL0

    List of Backup Pieces for backup set 1745 Copy #1
    BP Key  Pc# Status      Piece Name
    ------- --- ----------- ----------
    2091    1   AVAILABLE   /oradata/backup/HAWK_3130551611_20160227_otquvemj_1_1_s1821_p1.bus
    2092    2   AVAILABLE   /oradata/backup/HAWK_3130551611_20160227_otquvemj_2_1_s1821_p2.bus
    2093    3   AVAILABLE   /oradata/backup/HAWK_3130551611_20160227_otquvemj_3_1_s1821_p3.bus
    2094    4   AVAILABLE   /oradata/backup/HAWK_3130551611_20160227_otquvemj_4_1_s1821_p4.bus
    2095    5   AVAILABLE   /oradata/backup/HAWK_3130551611_20160227_otquvemj_5_1_s1821_p5.bus
    2096    6   AVAILABLE   /oradata/backup/HAWK_3130551611_20160227_otquvemj_6_1_s1821_p6.bus
    2097    7   AVAILABLE   /oradata/backup/HAWK_3130551611_20160227_otquvemj_7_1_s1821_p7.bus
    2098    8   AVAILABLE   /oradata/backup/HAWK_3130551611_20160227_otquvemj_8_1_s1821_p8.bus
    2099    9   AVAILABLE   /oradata/backup/HAWK_3130551611_20160227_otquvemj_9_1_s1821_p9.bus

RMAN> list backuppiece 2098;


List of Backup Pieces
BP Key  BS Key  Pc# Cp# Status      Device Type Piece Name
------- ------- --- --- ----------- ----------- ----------
2098    1745    8   1   AVAILABLE   DISK        /oradata/backup/HAWK_3130551611_20160227_otquvemj_8_1_s1821_p8.bus

RMAN> exit


Recovery Manager complete.

Note the size for backup piece is 15MB versus 14.02MB from SQL – good enough.

$ du -m /oradata/backup/HAWK_3130551611_20160227_otquvemj_8_1_s1821_p8.bus

15      /oradata/backup/HAWK_3130551611_20160227_otquvemj_8_1_s1821_p8.bus
$ sysdba @bkupsize.sql
SQL*Plus: Release 11.2.0.4.0 Production on Sat Feb 27 10:52:45 2016

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


COMPLETION_TIME     TYPE                MB        MIN
------------------- ----------- ---------- ----------
2016-02-24 00:00:00 ARCHIVELOG         .02          0
2016-02-24 00:00:00 CONTROLFILE      11.23        .05
2016-02-24 00:00:00 FULL            243.56        .82
2016-02-27 00:00:00 ARCHIVELOG       98.25         .9
2016-02-27 00:00:00 CONTROLFILE      22.46        .13
2016-02-27 00:00:00 LEVEL0           505.4      38.52
                                ----------
sum                                 880.92

6 rows selected.


       GRP TYPE          TOTAL_MB
---------- ----------- ----------
         0 ARCHIVELOG       98.27
         0 CONTROLFILE      33.69
         0 FULL            243.56
         0 LEVEL0           505.4
         1                 880.92

ARROW:(SYS@hawklas):PRIMARY> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

Let’s compare against file system.

oracle@arrow:hawklas:/media/sf_working/rman
$ du -m /oradata/backup/
882     /oradata/backup/

oracle@arrow:hawklas:/media/sf_working/rman
$ ll /oradata/backup/
total 902412
-rw-r-----. 1 oracle oinstall  26853376 Feb 24 18:43 HAWK_3130551611_20160224_o8quog1h_1_1_s1800_p1
-rw-r-----. 1 oracle oinstall 114638848 Feb 24 18:43 HAWK_3130551611_20160224_o9quog1i_1_1_s1801_p1
-rw-r-----. 1 oracle oinstall  42868736 Feb 24 18:43 HAWK_3130551611_20160224_oaquog1p_1_1_s1802_p1
-rw-r-----. 1 oracle oinstall  62169088 Feb 24 18:43 HAWK_3130551611_20160224_obquog2a_1_1_s1803_p1
-rw-r-----. 1 oracle oinstall   8904704 Feb 24 18:43 HAWK_3130551611_20160224_ocquog2b_1_1_s1804_p1
-rw-r-----. 1 oracle oinstall     19968 Feb 24 18:43 HAWK_3130551611_20160224_odquog2r_1_1_s1805_p1
-rw-r-----. 1 oracle oinstall   3551744 Feb 27 09:57 HAWK_3130551611_20160227_ofquvecs_1_1_s1807_p1
-rw-r-----. 1 oracle oinstall  30955520 Feb 27 09:57 HAWK_3130551611_20160227_ogquvecs_1_1_s1808_p1
-rw-r-----. 1 oracle oinstall  14206976 Feb 27 09:57 HAWK_3130551611_20160227_ohquvecv_1_1_s1809_p1
-rw-r-----. 1 oracle oinstall  27041792 Feb 27 09:59 HAWK_3130551611_20160227_oiquved7_1_1_s1810_p1
-rw-r-----. 1 oracle oinstall  31547392 Feb 27 09:58 HAWK_3130551611_20160227_ojquved7_1_1_s1811_p1
-rw-r-----. 1 oracle oinstall  31506432 Feb 27 09:58 HAWK_3130551611_20160227_ojquved7_2_1_s1811_p2
-rw-r-----. 1 oracle oinstall  31563776 Feb 27 09:59 HAWK_3130551611_20160227_ojquved7_3_1_s1811_p3
-rw-r-----. 1 oracle oinstall  22568960 Feb 27 09:59 HAWK_3130551611_20160227_ojquved7_4_1_s1811_p4
-rw-r-----. 1 oracle oinstall  31776768 Feb 27 09:59 HAWK_3130551611_20160227_okquvefb_1_1_s1812_p1
-rw-r-----. 1 oracle oinstall  12451840 Feb 27 09:59 HAWK_3130551611_20160227_okquvefb_2_1_s1812_p2
-rw-r-----. 1 oracle oinstall  31924224 Feb 27 09:59 HAWK_3130551611_20160227_olquveg9_1_1_s1813_p1
-rw-r-----. 1 oracle oinstall  30859264 Feb 27 10:00 HAWK_3130551611_20160227_olquveg9_2_1_s1813_p2
-rw-r-----. 1 oracle oinstall   8929280 Feb 27 09:59 HAWK_3130551611_20160227_omquvego_1_1_s1814_p1
-rw-r-----. 1 oracle oinstall     76288 Feb 27 10:00 HAWK_3130551611_20160227_onquveh9_1_1_s1815_p1
-rw-r-----. 1 oracle oinstall  11970560 Feb 27 10:02 HAWK_3130551611_20160227_opquvem5_1_1_s1817_p1.bus
-rw-r-----. 1 oracle oinstall  14755840 Feb 27 10:02 HAWK_3130551611_20160227_oqquvem5_1_1_s1818_p1.bus
-rw-r-----. 1 oracle oinstall  14749184 Feb 27 10:02 HAWK_3130551611_20160227_oqquvem5_2_1_s1818_p2.bus
-rw-r-----. 1 oracle oinstall   5646848 Feb 27 10:02 HAWK_3130551611_20160227_oqquvem5_3_1_s1818_p3.bus
-rw-r-----. 1 oracle oinstall   1853952 Feb 27 10:02 HAWK_3130551611_20160227_orquvemc_1_1_s1819_p1.bus
-rw-r-----. 1 oracle oinstall  14843904 Feb 27 10:03 HAWK_3130551611_20160227_osquvemj_1_1_s1820_p1.bus
-rw-r-----. 1 oracle oinstall  13025280 Feb 27 10:04 HAWK_3130551611_20160227_osquvemj_2_1_s1820_p2.bus
-rw-r-----. 1 oracle oinstall  14696448 Feb 27 10:03 HAWK_3130551611_20160227_otquvemj_1_1_s1821_p1.bus
-rw-r-----. 1 oracle oinstall  14737408 Feb 27 10:03 HAWK_3130551611_20160227_otquvemj_2_1_s1821_p2.bus
-rw-r-----. 1 oracle oinstall  14696448 Feb 27 10:03 HAWK_3130551611_20160227_otquvemj_3_1_s1821_p3.bus
-rw-r-----. 1 oracle oinstall  14827520 Feb 27 10:03 HAWK_3130551611_20160227_otquvemj_4_1_s1821_p4.bus
-rw-r-----. 1 oracle oinstall  14802944 Feb 27 10:04 HAWK_3130551611_20160227_otquvemj_5_1_s1821_p5.bus
-rw-r-----. 1 oracle oinstall  14802944 Feb 27 10:04 HAWK_3130551611_20160227_otquvemj_6_1_s1821_p6.bus
-rw-r-----. 1 oracle oinstall  14737408 Feb 27 10:04 HAWK_3130551611_20160227_otquvemj_7_1_s1821_p7.bus
-rw-r-----. 1 oracle oinstall  14704640 Feb 27 10:04 HAWK_3130551611_20160227_otquvemj_8_1_s1821_p8.bus
-rw-r-----. 1 oracle oinstall   3637248 Feb 27 10:05 HAWK_3130551611_20160227_otquvemj_9_1_s1821_p9.bus
-rw-r-----. 1 oracle oinstall  14868480 Feb 27 10:04 HAWK_3130551611_20160227_ouquvep1_1_1_s1822_p1.bus
-rw-r-----. 1 oracle oinstall  14843904 Feb 27 10:04 HAWK_3130551611_20160227_ouquvep1_2_1_s1822_p2.bus
-rw-r-----. 1 oracle oinstall  14712832 Feb 27 10:04 HAWK_3130551611_20160227_ouquvep1_3_1_s1822_p3.bus
-rw-r-----. 1 oracle oinstall   1785856 Feb 27 10:05 HAWK_3130551611_20160227_ouquvep1_4_1_s1822_p4.bus
-rw-r-----. 1 oracle oinstall  14868480 Feb 27 10:05 HAWK_3130551611_20160227_ovquveqn_1_1_s1823_p1.bus
-rw-r-----. 1 oracle oinstall  14893056 Feb 27 10:05 HAWK_3130551611_20160227_ovquveqn_2_1_s1823_p2.bus
-rw-r-----. 1 oracle oinstall  14786560 Feb 27 10:05 HAWK_3130551611_20160227_ovquveqn_3_1_s1823_p3.bus
-rw-r-----. 1 oracle oinstall  14925824 Feb 27 10:05 HAWK_3130551611_20160227_ovquveqn_4_1_s1823_p4.bus
-rw-r-----. 1 oracle oinstall   5881856 Feb 27 10:05 HAWK_3130551611_20160227_ovquveqn_5_1_s1823_p5.bus
-rw-r-----. 1 oracle oinstall   8929280 Feb 27 10:05 HAWK_3130551611_20160227_p0quveqo_1_1_s1824_p1.bus
-rw-r-----. 1 oracle oinstall   5254144 Feb 27 10:06 HAWK_3130551611_20160227_p1quvese_1_1_s1825_p1.bus
-rw-r-----. 1 oracle oinstall  11796480 Feb 24 18:43 HAWK_c-3130551611-20160224-0e
-rw-r-----. 1 oracle oinstall  11796480 Feb 27 10:00 HAWK_c-3130551611-20160227-00
-rw-r-----. 1 oracle oinstall  11796480 Feb 27 10:06 HAWK_c-3130551611-20160227-01
oracle@arrow:hawklas:/media/sf_working/rman
$
bkupinfo.sql


col BP_MB for 9,999,999.99
break on report
COMPUTE sum of BP_MB on report
set numw 6 lines 120
col handle for a100
SELECT
s.completion_time,
s.recid BS_KEY,
CASE
WHEN s.backup_type='L' THEN 'ARCHIVELOG'
WHEN s.controlfile_included='YES' THEN 'CONTROLFILE'
WHEN s.backup_type='D' AND s.incremental_level=0 THEN 'LEVEL0'
WHEN s.backup_type='I' AND s.incremental_level=1 THEN 'LEVEL1'
WHEN s.backup_type='D' AND s.incremental_level IS NULL THEN 'FULL'
END type,
p.recid BP_KEY,
round(p.bytes/1048576,2) BP_MB,
s.pieces,
s.set_count,
p.piece#,
p.compressed,
p.device_type,
p.handle
FROM v$backup_piece p, v$backup_set s
WHERE p.status='A'
AND s.set_stamp (+) = p.set_stamp
AND s.set_count (+) = p.set_count
order by s.recid, p.piece#
;

bkupsize.sql


col MB for 9,999,999.99
col min for 9,999,999.99
col TOTAL_MB for 9,999,999.99
break on report
COMPUTE sum of MB on report
SELECT TRUNC(completion_time) completion_time, type, round(sum(MB),2) MB, round(sum(elapsed_seconds)/60,2) min
FROM (
SELECT
CASE
WHEN s.backup_type='L' THEN 'ARCHIVELOG'
WHEN s.controlfile_included='YES' THEN 'CONTROLFILE'
WHEN s.backup_type='D' AND s.incremental_level=0 THEN 'LEVEL0'
WHEN s.backup_type='I' AND s.incremental_level=1 THEN 'LEVEL1'
WHEN s.backup_type='D' AND s.incremental_level IS NULL THEN 'FULL'
END type,
TRUNC(s.completion_time) completion_time,
round(p.bytes/1048576,2) MB,
s.elapsed_seconds
FROM v$backup_piece p, v$backup_set s
WHERE p.status='A'
AND s.set_stamp = p.set_stamp
AND s.set_count = p.set_count
-- UNION ALL
-- SELECT 'DATAFILECOPY' type, TRUNC(completion_time), output_bytes, 0 elapsed_seconds FROM v$backup_copy_details
)
GROUP BY TRUNC(completion_time), type
ORDER BY 1 asc,2,3
;
SELECT grouping(type) grp, type, round(sum(MB),2) TOTAL_MB
FROM (
SELECT
CASE
WHEN s.backup_type='L' THEN 'ARCHIVELOG'
WHEN s.controlfile_included='YES' THEN 'CONTROLFILE'
WHEN s.backup_type='D' AND s.incremental_level=0 THEN 'LEVEL0'
WHEN s.backup_type='I' AND s.incremental_level=1 THEN 'LEVEL1'
WHEN s.backup_type='D' AND s.incremental_level IS NULL THEN 'FULL'
END type,
TRUNC(s.completion_time) completion_time,
round(p.bytes/1048576,2) MB,
s.elapsed_seconds
FROM v$backup_piece p, v$backup_set s
WHERE p.status='A'
AND s.set_stamp = p.set_stamp
AND s.set_count = p.set_count
-- UNION ALL
-- SELECT 'DATAFILECOPY' type, TRUNC(completion_time), output_bytes, 0 elapsed_seconds FROM v$backup_copy_details
)
GROUP BY ROLLUP(type)
ORDER BY 1 asc,2,3
;


CVE-2015-7547 for Oracle Database

Mon, 2016-02-22 19:20

I am sure by now you have heard about the bug.

Reboot Required!

Need to update to release el6_7.7 if you are on OEL 6

glibc-2.12-1.166.el6_7.7.x86_64.rpm
glibc-common-2.12-1.166.el6_7.7.x86_64.rpm
glibc-devel-2.12-1.166.el6_7.7.i686.rpm
glibc-devel-2.12-1.166.el6_7.7.x86_64.rpm
glibc-headers-2.12-1.166.el6_7.7.x86_64.rpm
nscd-2.12-1.166.el6_7.7.x86_64.rpm
glibc-devel-2.12-1.166.el6_7.7.i686.rpm
glibc-2.12-1.166.el6_7.7.i686.rpm

http://linux.oracle.com/errata/ELSA-2016-0175.html

You can also use the following commands to verify RPMs for CVE_2015_7547

There are two dashes (- -) for cve.

$ yum list –cve=2015_7547|egrep ‘^glibc|^nscd’|sort

Skipping security plugin, other command
glibc-common.x86_64                  2.12-1.166.el6_7.7       @public_ol6_latest
glibc-devel.i686                     2.12-1.166.el6_7.7       @public_ol6_latest
glibc-devel.x86_64                   2.12-1.166.el6_7.7       @public_ol6_latest
glibc-headers.x86_64                 2.12-1.166.el6_7.7       @public_ol6_latest
glibc.i686                           2.12-1.166.el6_7.7       @public_ol6_latest
glibc-static.i686                    2.12-1.166.el6_7.7       public_ol6_latest
glibc-static.x86_64                  2.12-1.166.el6_7.7       public_ol6_latest
glibc-utils.x86_64                   2.12-1.166.el6_7.7       public_ol6_latest
glibc.x86_64                         2.12-1.166.el6_7.7       @public_ol6_latest
nscd.x86_64                          2.12-1.166.el6_7.7       public_ol6_latest

Note that it is not necessary to relink any binaries after this update.

Reference: glibc vulnerability (CVE-2015-7547) patch availability for Oracle Exadata Database Machine (Doc ID 2108582.1)

Assumption being made if relink is not required for Exadata, then it is not required for Non-Exadata as well.

Be safe and verify with Oracle support and let me know too please.

$ cat /etc/oracle-release

Oracle Linux Server release 6.6

$ rpm -qa –queryformat=”%{name}-%{version}-%{release}.%{arch}\n” | egrep ‘glibc|nscd’

glibc-devel-2.12-1.149.el6_6.9.i686
glibc-common-2.12-1.149.el6_6.9.x86_64
glibc-2.12-1.149.el6_6.9.i686
glibc-headers-2.12-1.149.el6_6.9.x86_64
glibc-devel-2.12-1.149.el6_6.9.x86_64
glibc-2.12-1.149.el6_6.9.x86_64

[root@arrow ~]# yum update glibc

Loaded plugins: refresh-packagekit, security
Setting up Update Process
public_ol6_UEKR3_latest                                                                                                               | 1.2 kB     00:00
public_ol6_UEKR3_latest/primary                                                                                                       |  22 MB     00:10
public_ol6_UEKR3_latest                                                                                                                              559/559
public_ol6_latest                                                                                                                     | 1.4 kB     00:00
public_ol6_latest/primary                                                                                                             |  55 MB     00:24
public_ol6_latest                                                                                                                                33290/33290
Resolving Dependencies
--> Running transaction check
---> Package glibc.i686 0:2.12-1.149.el6_6.9 will be updated
--> Processing Dependency: glibc = 2.12-1.149.el6_6.9 for package: glibc-common-2.12-1.149.el6_6.9.x86_64
--> Processing Dependency: glibc = 2.12-1.149.el6_6.9 for package: glibc-devel-2.12-1.149.el6_6.9.i686
--> Processing Dependency: glibc = 2.12-1.149.el6_6.9 for package: glibc-headers-2.12-1.149.el6_6.9.x86_64
--> Processing Dependency: glibc = 2.12-1.149.el6_6.9 for package: glibc-devel-2.12-1.149.el6_6.9.x86_64
---> Package glibc.x86_64 0:2.12-1.149.el6_6.9 will be updated
---> Package glibc.i686 0:2.12-1.166.el6_7.7 will be an update
---> Package glibc.x86_64 0:2.12-1.166.el6_7.7 will be an update
--> Running transaction check
---> Package glibc-common.x86_64 0:2.12-1.149.el6_6.9 will be updated
---> Package glibc-common.x86_64 0:2.12-1.166.el6_7.7 will be an update
---> Package glibc-devel.i686 0:2.12-1.149.el6_6.9 will be updated
---> Package glibc-devel.x86_64 0:2.12-1.149.el6_6.9 will be updated
---> Package glibc-devel.i686 0:2.12-1.166.el6_7.7 will be an update
---> Package glibc-devel.x86_64 0:2.12-1.166.el6_7.7 will be an update
---> Package glibc-headers.x86_64 0:2.12-1.149.el6_6.9 will be updated
---> Package glibc-headers.x86_64 0:2.12-1.166.el6_7.7 will be an update
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================
 Package                              Arch                          Version                                   Repository                                Size
=============================================================================================================================================================
Updating:
 glibc                                i686                          2.12-1.166.el6_7.7                        public_ol6_latest                        4.3 M
 glibc                                x86_64                        2.12-1.166.el6_7.7                        public_ol6_latest                        3.8 M
Updating for dependencies:
 glibc-common                         x86_64                        2.12-1.166.el6_7.7                        public_ol6_latest                         14 M
 glibc-devel                          i686                          2.12-1.166.el6_7.7                        public_ol6_latest                        986 k
 glibc-devel                          x86_64                        2.12-1.166.el6_7.7                        public_ol6_latest                        986 k
 glibc-headers                        x86_64                        2.12-1.166.el6_7.7                        public_ol6_latest                        615 k

Transaction Summary
=============================================================================================================================================================
Upgrade       6 Package(s)

Total download size: 25 M
Is this ok [y/N]: y
Downloading Packages:
(1/6): glibc-2.12-1.166.el6_7.7.i686.rpm                                                                                              | 4.3 MB     00:02
(2/6): glibc-2.12-1.166.el6_7.7.x86_64.rpm                                                                                            | 3.8 MB     00:02
(3/6): glibc-common-2.12-1.166.el6_7.7.x86_64.rpm                                                                                     |  14 MB     00:05
(4/6): glibc-devel-2.12-1.166.el6_7.7.i686.rpm                                                                                        | 986 kB     00:00
(5/6): glibc-devel-2.12-1.166.el6_7.7.x86_64.rpm                                                                                      | 986 kB     00:00
(6/6): glibc-headers-2.12-1.166.el6_7.7.x86_64.rpm                                                                                    | 615 kB     00:00
-------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                        1.8 MB/s |  25 MB     00:13
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Updating   : glibc-common-2.12-1.166.el6_7.7.x86_64                                                                                                   1/12
  Updating   : glibc-2.12-1.166.el6_7.7.x86_64                                                                                                          2/12
  Updating   : glibc-headers-2.12-1.166.el6_7.7.x86_64                                                                                                  3/12
  Updating   : glibc-2.12-1.166.el6_7.7.i686                                                                                                            4/12
  Updating   : glibc-devel-2.12-1.166.el6_7.7.i686                                                                                                      5/12
  Updating   : glibc-devel-2.12-1.166.el6_7.7.x86_64                                                                                                    6/12
  Cleanup    : glibc-devel-2.12-1.149.el6_6.9                                                                                                           7/12
  Cleanup    : glibc-devel-2.12-1.149.el6_6.9                                                                                                           8/12
  Cleanup    : glibc-2.12-1.149.el6_6.9                                                                                                                 9/12
  Cleanup    : glibc-headers-2.12-1.149.el6_6.9.x86_64                                                                                                 10/12
  Cleanup    : glibc-2.12-1.149.el6_6.9                                                                                                                11/12
  Cleanup    : glibc-common-2.12-1.149.el6_6.9.x86_64                                                                                                  12/12
  Verifying  : glibc-2.12-1.166.el6_7.7.i686                                                                                                            1/12
  Verifying  : glibc-devel-2.12-1.166.el6_7.7.i686                                                                                                      2/12
  Verifying  : glibc-headers-2.12-1.166.el6_7.7.x86_64                                                                                                  3/12
  Verifying  : glibc-devel-2.12-1.166.el6_7.7.x86_64                                                                                                    4/12
  Verifying  : glibc-2.12-1.166.el6_7.7.x86_64                                                                                                          5/12
  Verifying  : glibc-common-2.12-1.166.el6_7.7.x86_64                                                                                                   6/12
  Verifying  : glibc-headers-2.12-1.149.el6_6.9.x86_64                                                                                                  7/12
  Verifying  : glibc-2.12-1.149.el6_6.9.x86_64                                                                                                          8/12
  Verifying  : glibc-common-2.12-1.149.el6_6.9.x86_64                                                                                                   9/12
  Verifying  : glibc-devel-2.12-1.149.el6_6.9.x86_64                                                                                                   10/12
  Verifying  : glibc-2.12-1.149.el6_6.9.i686                                                                                                           11/12
  Verifying  : glibc-devel-2.12-1.149.el6_6.9.i686                                                                                                     12/12

Updated:
  glibc.i686 0:2.12-1.166.el6_7.7                                              glibc.x86_64 0:2.12-1.166.el6_7.7

Dependency Updated:
  glibc-common.x86_64 0:2.12-1.166.el6_7.7              glibc-devel.i686 0:2.12-1.166.el6_7.7             glibc-devel.x86_64 0:2.12-1.166.el6_7.7
  glibc-headers.x86_64 0:2.12-1.166.el6_7.7

Complete!
[root@arrow ~]#
[root@arrow ~]# init 6
[root@arrow ~]#

$ rpm -qa –queryformat=”%{name}-%{version}-%{release}.%{arch}\n” | egrep ‘glibc|nscd’

glibc-devel-2.12-1.166.el6_7.7.i686
glibc-headers-2.12-1.166.el6_7.7.x86_64
glibc-2.12-1.166.el6_7.7.x86_64
glibc-devel-2.12-1.166.el6_7.7.x86_64
glibc-common-2.12-1.166.el6_7.7.x86_64
glibc-2.12-1.166.el6_7.7.i686

$ rpm -qa –queryformat=”%{name}-%{release}.%{arch}\n” | egrep ‘glibc|nscd’

oracle@arrow:hawklas:/home/oracle
glibc-devel-1.166.el6_7.7.i686
glibc-headers-1.166.el6_7.7.x86_64
glibc-1.166.el6_7.7.x86_64
glibc-devel-1.166.el6_7.7.x86_64
glibc-common-1.166.el6_7.7.x86_64
glibc-1.166.el6_7.7.i686

Create DB with minimum parameters

Sun, 2016-02-21 20:10

Just a quick post to create database with minimum parameters.

Note: for the control_files parameter to be updated, you must create spfile from pfile.

oracle@arrow:test:/u01/app/oracle/product/11.2.0/dbhome_1/dbs
$ ls *test*
inittest.ora  orapwtest
oracle@arrow:test:/u01/app/oracle/product/11.2.0/dbhome_1/dbs
$ cat inittest.ora
db_name=test
db_create_file_dest='/oradata'
oracle@arrow:test:/u01/app/oracle/product/11.2.0/dbhome_1/dbs
$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Sun Feb 21 18:02:12 2016

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

Connected to an idle instance.

SYS@test> create spfile from pfile;

File created.

SYS@test> startup nomount;
ORACLE instance started.

Total System Global Area  229683200 bytes
Fixed Size                  2251936 bytes
Variable Size             171967328 bytes
Database Buffers           50331648 bytes
Redo Buffers                5132288 bytes
SYS@test> CREATE DATABASE
CHARACTER SET AL32UTF8
  2    3  EXTENT MANAGEMENT LOCAL
DATAFILE SIZE 256M AUTOEXTEND ON NEXT 512M MAXSIZE 8388672K
  4    5  sysaux DATAFILE SIZE 64M AUTOEXTEND ON NEXT 512M MAXSIZE 8388672K
  6  LOGFILE GROUP 1 SIZE 100M,GROUP 2 SIZE 100M
DEFAULT TEMPORARY TABLESPACE temp TEMPFILE SIZE 64M AUTOEXTEND ON NEXT 512M MAXSIZE 8388672K
  7    8  DEFAULT TABLESPACE users DATAFILE SIZE 64M AUTOEXTEND ON NEXT 512M MAXSIZE 8388672K
  9  UNDO TABLESPACE undotbs DATAFILE SIZE 64M AUTOEXTEND ON NEXT 512M MAXSIZE 8388672K
; 10

Database created.

SYS@test> select name from v$controlfile;

NAME
--------------------------------------------------------------------------------
/oradata/TEST/controlfile/o1_mf_cdnv3bjv_.ctl

SYS@test> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
oracle@arrow:test:/u01/app/oracle/product/11.2.0/dbhome_1/dbs
$ strings spfiletest.ora
test.__oracle_base='/u01/app/oracle'#ORACLE_BASE set from environment
*.control_files='/oradata/TEST/controlfile/o1_mf_cdnv3bjv_.ctl'#Oracle managed file
*.db_create_file_dest='/oradata'
*.db_name='test'


oracle@arrow:test:/u01/app/oracle/product/11.2.0/dbhome_1/dbs
$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Sun Feb 21 18:09:48 2016

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


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

ARROW:(SYS@test):PRIMARY> show parameter pfile

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      /u01/app/oracle/product/11.2.0
                                                 /dbhome_1/dbs/spfiletest.ora
ARROW:(SYS@test):PRIMARY> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
oracle@arrow:test:/u01/app/oracle/product/11.2.0/dbhome_1/dbs
$

Many years ago, I had learned about drop database.
https://mdinh.wordpress.com/?s=drop+database

It does not do a complete job for cleanup.

What I did not know then which I now know, it does drop spfile as spfile is considered as part of the database, may be because it can get backup from RMAN just like the database?

oracle@arrow:test:/u01/app/oracle/product/11.2.0/dbhome_1/dbs
$ ll *test*
-rw-rw----. 1 oracle oinstall 1544 Feb 21 18:14 hc_test.dat
-rw-r--r--. 1 oracle oinstall   44 Feb 21 18:01 inittest.ora
-rw-r-----. 1 oracle oinstall 2048 Feb 21 17:54 orapwtest
-rw-r-----. 1 oracle oinstall 1536 Feb 21 18:03 spfiletest.ora
oracle@arrow:test:/u01/app/oracle/product/11.2.0/dbhome_1/dbs
$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Sun Feb 21 18:15:21 2016

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

Connected to an idle instance.

SYS@test> startup restrict force mount;
ORACLE instance started.

Total System Global Area  229683200 bytes
Fixed Size                  2251936 bytes
Variable Size             171967328 bytes
Database Buffers           50331648 bytes
Redo Buffers                5132288 bytes
Database mounted.
SYS@test> drop database;

Database dropped.

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SYS@test> exit
oracle@arrow:test:/u01/app/oracle/product/11.2.0/dbhome_1/dbs
$ ll *test*
-rw-rw----. 1 oracle oinstall 1544 Feb 21 18:17 hc_test.dat
-rw-r--r--. 1 oracle oinstall   44 Feb 21 18:01 inittest.ora
-rw-r-----. 1 oracle oinstall 2048 Feb 21 17:54 orapwtest
oracle@arrow:test:/u01/app/oracle/product/11.2.0/dbhome_1/dbs
$ sysresv

IPC Resources for ORACLE_SID "test" :
Shared Memory
ID              KEY
No shared memory segments used
Semaphores:
ID              KEY
No semaphore resources used
Oracle Instance not alive for sid "test"
oracle@arrow:test:/u01/app/oracle/product/11.2.0/dbhome_1/dbs
$ ll /oradata/
total 56
drwxr-xr-x. 2 oracle oinstall 16384 Feb  1 11:59 backup
-rw-r--r--. 1 oracle oinstall    60 Nov  5  2014 bkup.rman
-rwxr-xr-x. 1 oracle oinstall   783 Nov  5  2014 bkup.sh
-rwxr-xr-x. 1 oracle oinstall   443 Nov  5  2014 bkup.sh.bak
drwxr-xr-x. 4 oracle oinstall  4096 Jan  9 15:08 fra
-rw-r--r--. 1 oracle oinstall   287 Nov  6  2014 fra.rman
drwxr-xr-x. 5 oracle oinstall  4096 Jan 14 21:28 HAWKLAS
drwxrwxr-x. 5 oracle oinstall  4096 Jan 14 21:28 HAWKSAN
drwxr-xr-x. 2 oracle oinstall  4096 Jan 28 11:07 keep
-rw-r--r--. 1 oracle oinstall   230 Jul 24  2014 restore_validate.rman
-rw-r--r--. 1 oracle oinstall   164 Jul 25  2014 simple.rman
oracle@arrow:test:/u01/app/oracle/product/11.2.0/dbhome_1/dbs
$


oracle@arrow:hawklas:/u01/app/oracle/diag
$ ll
total 8
drwxr-xr-x. 6 oracle oinstall 4096 Feb 21 17:55 rdbms
drwxr-xr-x. 3 oracle oinstall 4096 Sep 25 06:37 tnslsnr
oracle@arrow:hawklas:/u01/app/oracle/diag
$ cd rdbms/
oracle@arrow:hawklas:/u01/app/oracle/diag/rdbms
$ ll
total 16
drwxr-xr-x. 3 oracle oinstall 4096 Jan  9 16:34 hawk
drwxr-xr-x. 3 oracle oinstall 4096 Jan  9 16:31 hawklas
drwxr-xr-x. 3 oracle oinstall 4096 Jan  9 16:39 hawksan
drwxr-xr-x. 3 oracle oinstall 4096 Feb 21 18:17 test
oracle@arrow:hawklas:/u01/app/oracle/diag/rdbms
$ cd test/
oracle@arrow:hawklas:/u01/app/oracle/diag/rdbms/test
$ ll
total 4
-rw-r-----.  1 oracle oinstall    0 Feb 21 18:02 i_1.mif
drwxr-xr-x. 15 oracle oinstall 4096 Feb 21 18:17 test
oracle@arrow:hawklas:/u01/app/oracle/diag/rdbms/test
$ cd test/
oracle@arrow:hawklas:/u01/app/oracle/diag/rdbms/test/test
$ ll
total 52
drwxr-xr-x. 2 oracle oinstall 4096 Feb 21 18:17 alert
drwxr-xr-x. 2 oracle oinstall 4096 Feb 21 18:17 cdump
drwxr-xr-x. 2 oracle oinstall 4096 Feb 21 18:17 hm
drwxr-xr-x. 2 oracle oinstall 4096 Feb 21 18:17 incident
drwxr-xr-x. 2 oracle oinstall 4096 Feb 21 18:17 incpkg
drwxr-xr-x. 2 oracle oinstall 4096 Feb 21 18:17 ir
drwxr-xr-x. 2 oracle oinstall 4096 Feb 21 18:19 lck
drwxr-xr-x. 2 oracle oinstall 4096 Feb 21 18:19 metadata
drwxr-xr-x. 2 oracle oinstall 4096 Feb 21 18:17 metadata_dgif
drwxr-xr-x. 2 oracle oinstall 4096 Feb 21 18:17 metadata_pv
drwxr-xr-x. 2 oracle oinstall 4096 Feb 21 18:17 stage
drwxr-xr-x. 2 oracle oinstall 4096 Feb 21 18:17 sweep
drwxr-xr-x. 2 oracle oinstall 4096 Feb 21 18:17 trace
oracle@arrow:hawklas:/u01/app/oracle/diag/rdbms/test/test
$