Total Pageviews

Saturday, 28 November 2015

-bash: /usr/bin/find: Argument list too long



[oracle@test  adump]$

 find /u01/app/oracle/admin/prod/adump/prod_ora_*.aud -mtime +365 -exec rm {} \;

-bash: /usr/bin/find: Argument list too long

Solution :
------------

[oracle@test  adump]$

find /u01/app/oracle/admin/prod/adump/ -name 'prod_ora_*.aud'  -mtime +365  -exec /bin/rm {} \;




Tuesday, 27 October 2015

Install MongoDB on Redhat 6

Compiled versions of MongoDB for Linux provide a simple option for installing MongoDB for other Linux systems without supported packages.

Install for 64-bit Linux

1 . Download the binary files for the desired release of MongoDB.Download the binaries from https://www.mongodb.org/downloads.

2 Extract the files from the downloaded archive.

[oracle@node1 mongoDB]$ tar -zxvf mongodb-linux-x86_64-rhel62-3.0.7
mongodb-linux-x86_64-rhel62-3.0.7/README
mongodb-linux-x86_64-rhel62-3.0.7/THIRD-PARTY-NOTICES
mongodb-linux-x86_64-rhel62-3.0.7/GNU-AGPL-3.0
mongodb-linux-x86_64-rhel62-3.0.7/bin/mongodump
mongodb-linux-x86_64-rhel62-3.0.7/bin/mongorestore
mongodb-linux-x86_64-rhel62-3.0.7/bin/mongoexport
mongodb-linux-x86_64-rhel62-3.0.7/bin/mongoimport
mongodb-linux-x86_64-rhel62-3.0.7/bin/mongostat
mongodb-linux-x86_64-rhel62-3.0.7/bin/mongotop
mongodb-linux-x86_64-rhel62-3.0.7/bin/bsondump
mongodb-linux-x86_64-rhel62-3.0.7/bin/mongofiles
mongodb-linux-x86_64-rhel62-3.0.7/bin/mongooplog
mongodb-linux-x86_64-rhel62-3.0.7/bin/mongoperf
mongodb-linux-x86_64-rhel62-3.0.7/bin/mongod
mongodb-linux-x86_64-rhel62-3.0.7/bin/mongos
mongodb-linux-x86_64-rhel62-3.0.7/bin/mongo


3 Copy the extracted archive to the target directory.
Copy the extracted folder to the location from which MongoDB will run.

mkdir -p  /data01/mongoDB/mongodb/
cp -R -n mongodb-linux-x86_64-rhel62-3.0.7/ /data01/mongoDB/mongodb/


4
Ensure the location of the binaries is in the PATH variable.
The MongoDB binaries are in the bin/ directory of the archive. To ensure that the binaries are in your PATH, you can modify your PATH.

For example, you can add the following line to your shell’s rc file (e.g. ~/.bashrc):

export PATH=<mongodb-install-directory>/bin:$PATH
Replace <mongodb-install-directory> with the path to the extracted MongoDB archive.


export PATH=/data01/mongoDB/mongodb/bin:$PATH


Run MongoDB

1. Create the data directory.

Before you start MongoDB for the first time, create the directory to which the mongod process will write data. By default, the mongod process uses the /data/db directory. If you create a directory other than this one, you must specify that directory in the dbpath option when starting the mongod process later in this procedure.

The following example command creates the data directory . ( Default location is /data/db. )

mkdir -p /data01/mongoDB/db/

2 .Set permissions for the data directory.

Before running mongod for the first time, ensure that the user account running mongod has read and write permissions for the directory.

3 . Run MongoDB.
To run MongoDB, run the mongod process at the system prompt. If necessary, specify the path of the mongod or the data directory. See the following examples.

Run without specifying paths
If your system PATH variable includes the location of the mongod binary and if you use the default data directory (i.e., /data/db), simply enter mongod at the system prompt:

mongod
Specify the path of the mongod . If your PATH does not include the location of the mongod binary, enter the full path to the mongod binary at the system prompt:

<path to binary>/mongod

[oracle@node1 ~]$ which mongod

/data01/mongoDB/mongodb/bin/mongod


Specify the path of the data directory
If you do not use the default data directory (i.e., /data/db), specify the path to the data directory using the --dbpath option:

[oracle@node1 ~]$ mongod --dbpath /data01/mongoDB/db/

mongod: /usr/lib64/libssl.so.10: no version information available (required by mongod)
mongod: /usr/lib64/libcrypto.so.10: no version information available (required by mongod)
mongod: /usr/lib64/libcrypto.so.10: no version information available (required by mongod)
2015-10-27T01:26:59.213-0400 I JOURNAL  [initandlisten] journal dir=/data01/mongoDB/db/journal
2015-10-27T01:26:59.213-0400 I JOURNAL  [initandlisten] recover : no journal files present, no recovery needed
2015-10-27T01:26:59.583-0400 I JOURNAL  [initandlisten] preallocateIsFaster=true 4.26
2015-10-27T01:26:59.854-0400 I JOURNAL  [initandlisten] preallocateIsFaster=true 3
2015-10-27T01:27:01.562-0400 I JOURNAL  [initandlisten] preallocateIsFaster=true 10.6
2015-10-27T01:27:01.562-0400 I JOURNAL  [initandlisten] preallocating a journal file /data01/mongoDB/db/journal/prealloc.0
2015-10-27T01:27:08.844-0400 I -        [initandlisten]   File Preallocator Progress: 471859200/1073741824 43%
2015-10-27T01:27:11.207-0400 I -        [initandlisten]   File Preallocator Progress: 681574400/1073741824 63%
2015-10-27T01:27:14.075-0400 I -        [initandlisten]   File Preallocator Progress: 775946240/1073741824 72%
2015-10-27T01:27:17.134-0400 I -        [initandlisten]   File Preallocator Progress: 859832320/1073741824 80%
2015-10-27T01:27:21.530-0400 I -        [initandlisten]   File Preallocator Progress: 933232640/1073741824 86%
2015-10-27T01:27:26.223-0400 I -        [initandlisten]   File Preallocator Progress: 996147200/1073741824 92%
2015-10-27T01:27:37.468-0400 I JOURNAL  [initandlisten] preallocating a journal file /data01/mongoDB/db/journal/prealloc.1
2015-10-27T01:27:40.330-0400 I -        [initandlisten]   File Preallocator Progress: 471859200/1073741824 43%
2015-10-27T01:27:43.282-0400 I -        [initandlisten]   File Preallocator Progress: 566231040/1073741824 52%
2015-10-27T01:27:47.742-0400 I -        [initandlisten]   File Preallocator Progress: 608174080/1073741824 56%
2015-10-27T01:27:50.298-0400 I -        [initandlisten]   File Preallocator Progress: 744488960/1073741824 69%
2015-10-27T01:27:53.087-0400 I -        [initandlisten]   File Preallocator Progress: 817889280/1073741824 76%
2015-10-27T01:27:56.464-0400 I -        [initandlisten]   File Preallocator Progress: 901775360/1073741824 83%
2015-10-27T01:27:59.441-0400 I -        [initandlisten]   File Preallocator Progress: 964689920/1073741824 89%
2015-10-27T01:28:02.206-0400 I -        [initandlisten]   File Preallocator Progress: 1038090240/1073741824 96%
2015-10-27T01:28:17.693-0400 I JOURNAL  [initandlisten] preallocating a journal file /data01/mongoDB/db/journal/prealloc.2
2015-10-27T01:28:20.164-0400 I -        [initandlisten]   File Preallocator Progress: 492830720/1073741824 45%
2015-10-27T01:28:23.287-0400 I -        [initandlisten]   File Preallocator Progress: 566231040/1073741824 52%
2015-10-27T01:28:26.361-0400 I -        [initandlisten]   File Preallocator Progress: 671088640/1073741824 62%
2015-10-27T01:28:29.421-0400 I -        [initandlisten]   File Preallocator Progress: 765460480/1073741824 71%
2015-10-27T01:28:32.484-0400 I -        [initandlisten]   File Preallocator Progress: 849346560/1073741824 79%
2015-10-27T01:28:35.216-0400 I -        [initandlisten]   File Preallocator Progress: 954204160/1073741824 88%
2015-10-27T01:28:38.353-0400 I -        [initandlisten]   File Preallocator Progress: 1038090240/1073741824 96%
2015-10-27T01:28:54.789-0400 I JOURNAL  [durability] Durability thread started
2015-10-27T01:28:54.789-0400 I JOURNAL  [journal writer] Journal writer thread started
2015-10-27T01:28:54.815-0400 I CONTROL  [initandlisten] MongoDB starting : pid=3131 port=27017 dbpath=/data01/mongoDB/db/ 64-bit host=node1.localdomain
2015-10-27T01:28:54.823-0400 I CONTROL  [initandlisten]
2015-10-27T01:28:54.823-0400 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2015-10-27T01:28:54.823-0400 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2015-10-27T01:28:54.823-0400 I CONTROL  [initandlisten]
2015-10-27T01:28:54.823-0400 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2015-10-27T01:28:54.823-0400 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2015-10-27T01:28:54.823-0400 I CONTROL  [initandlisten]
2015-10-27T01:28:54.823-0400 I CONTROL  [initandlisten] db version v3.0.7
2015-10-27T01:28:54.823-0400 I CONTROL  [initandlisten] git version: 6ce7cbe8c6b899552dadd907604559806aa2e9bd
2015-10-27T01:28:54.823-0400 I CONTROL  [initandlisten] build info: Linux ip-10-101-218-12 2.6.32-220.el6.x86_64 #1 SMP Wed Nov 9 08:03:13 EST 2011 x86_64 BOOST_LIB_VERSION=1_49
2015-10-27T01:28:54.823-0400 I CONTROL  [initandlisten] allocator: tcmalloc
2015-10-27T01:28:54.823-0400 I CONTROL  [initandlisten] options: { storage: { dbPath: "/data01/mongoDB/db/" } }
2015-10-27T01:28:54.922-0400 I INDEX    [initandlisten] allocating new ns file /data01/mongoDB/db/local.ns, filling with zeroes...
2015-10-27T01:28:55.376-0400 I STORAGE  [FileAllocator] allocating new datafile /data01/mongoDB/db/local.0, filling with zeroes...
2015-10-27T01:28:55.376-0400 I STORAGE  [FileAllocator] creating directory /data01/mongoDB/db/_tmp
2015-10-27T01:28:55.554-0400 I STORAGE  [FileAllocator] done allocating datafile /data01/mongoDB/db/local.0, size: 64MB,  took 0.156 secs
2015-10-27T01:28:55.569-0400 I NETWORK  [initandlisten] waiting for connections on port 27017

[oracle@node1 sf_SOFTWARES]$ ps -ef| grep mongo
oracle    3131  2884  2 01:26 pts/0    00:00:03 mongod --dbpath /data01/mongoDB/db/


4 . Begin using MongoDB.

[oracle@node1 bin]$ ./mongo

./mongo: /usr/lib64/libssl.so.10: no version information available (required by ./mongo)
./mongo: /usr/lib64/libcrypto.so.10: no version information available (required by ./mongo)
./mongo: /usr/lib64/libcrypto.so.10: no version information available (required by ./mongo)
MongoDB shell version: 3.0.7
connecting to: test
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
http://docs.mongodb.org/
Questions? Try the support group
http://groups.google.com/group/mongodb-user
Server has startup warnings:
2015-10-27T01:28:54.823-0400 I CONTROL  [initandlisten]
2015-10-27T01:28:54.823-0400 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/enabled is 'always'.
2015-10-27T01:28:54.823-0400 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2015-10-27T01:28:54.823-0400 I CONTROL  [initandlisten]
2015-10-27T01:28:54.823-0400 I CONTROL  [initandlisten] ** WARNING: /sys/kernel/mm/transparent_hugepage/defrag is 'always'.
2015-10-27T01:28:54.823-0400 I CONTROL  [initandlisten] **        We suggest setting it to 'never'
2015-10-27T01:28:54.823-0400 I CONTROL  [initandlisten]
>
> db
test

Saturday, 10 October 2015

Configure DDL replication for GoldenGate

[oracle@node1 ggs]$ ggsci

Oracle GoldenGate Command Interpreter for Oracle
Version 11.2.1.0.1 OGGCORE_11.2.1.0.1_PLATFORMS_120423.0230_FBO
Linux, x64, 64bit (optimized), Oracle 11g on Apr 23 2012 08:32:14

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

GGSCI (node1.localdomain) 1> edit params ./GLOBALS
GGSCHEMA ggadmin

SQL> alter system set recyclebin=off deferred ;

System altered.


SQL> grant restricted session to ggadmin ;

Grant succeeded.

[oracle@node1 ggs]$ pwd
/data01/oracle/ggs
[oracle@node1 ggs]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Sat Oct 10 03:34:49 2015

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


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

SQL> @marker_setup.sql

Marker setup script

You will be prompted for the name of a schema for the Oracle GoldenGate database objects.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.

Enter Oracle GoldenGate schema name:GGADMIN


Marker setup table script complete, running verification script...
Please enter the name of a schema for the GoldenGate database objects:
Setting schema name to GGADMIN

MARKER TABLE
-------------------------------
OK

MARKER SEQUENCE
-------------------------------
OK

Script complete.


SQL> @ddl_setup.sql

Oracle GoldenGate DDL Replication setup script

Verifying that current user has privileges to install DDL Replication...

You will be prompted for the name of a schema for the Oracle GoldenGate database objects.
NOTE: For an Oracle 10g source, the system recycle bin must be disabled. For Oracle 11g and later, it can be enabled.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.

Enter Oracle GoldenGate schema name:GGADMIN

Working, please wait ...
Spooling to file ddl_setup_spool.txt

Checking for sessions that are holding locks on Oracle Golden Gate metadata tables ...

Check complete.



Using GGADMIN as a Oracle GoldenGate schema name.

Working, please wait ...

DDL replication setup script complete, running verification script...
Please enter the name of a schema for the GoldenGate database objects:
Setting schema name to GGADMIN

CLEAR_TRACE STATUS:

Line/pos   Error
---------- -----------------------------------------------------------------
No errors  No errors

CREATE_TRACE STATUS:

Line/pos   Error
---------- -----------------------------------------------------------------
No errors  No errors

TRACE_PUT_LINE STATUS:

Line/pos   Error
---------- -----------------------------------------------------------------
No errors  No errors

INITIAL_SETUP STATUS:

Line/pos   Error
---------- -----------------------------------------------------------------
No errors  No errors

DDLVERSIONSPECIFIC PACKAGE STATUS:

Line/pos   Error
---------- -----------------------------------------------------------------
No errors  No errors

DDLREPLICATION PACKAGE STATUS:

Line/pos   Error
---------- -----------------------------------------------------------------
No errors  No errors

DDLREPLICATION PACKAGE BODY STATUS:

Line/pos   Error
---------- -----------------------------------------------------------------
No errors  No errors

DDL IGNORE TABLE
-----------------------------------
OK

DDL IGNORE LOG TABLE
-----------------------------------
OK

DDLAUX PACKAGE STATUS:

Line/pos   Error
---------- -----------------------------------------------------------------
No errors  No errors

DDLAUX PACKAGE BODY STATUS:

Line/pos   Error
---------- -----------------------------------------------------------------
No errors  No errors

SYS.DDLCTXINFO PACKAGE STATUS:

Line/pos   Error
---------- -----------------------------------------------------------------
No errors  No errors

SYS.DDLCTXINFO PACKAGE BODY STATUS:

Line/pos   Error
---------- -----------------------------------------------------------------
No errors  No errors

DDL HISTORY TABLE
-----------------------------------
OK

DDL HISTORY TABLE(1)
-----------------------------------
OK

DDL DUMP TABLES
-----------------------------------
OK

DDL DUMP COLUMNS
-----------------------------------
OK

DDL DUMP LOG GROUPS
-----------------------------------
OK

DDL DUMP PARTITIONS
-----------------------------------
OK

DDL DUMP PRIMARY KEYS
-----------------------------------
OK

DDL SEQUENCE
-----------------------------------
OK

GGS_TEMP_COLS
-----------------------------------
OK

GGS_TEMP_UK
-----------------------------------
OK

DDL TRIGGER CODE STATUS:

Line/pos   Error
---------- -----------------------------------------------------------------
No errors  No errors

DDL TRIGGER INSTALL STATUS
-----------------------------------
OK

DDL TRIGGER RUNNING STATUS
-----------------------------------
ENABLED

STAYMETADATA IN TRIGGER
-----------------------------------
OFF

DDL TRIGGER SQL TRACING
-----------------------------------
0

DDL TRIGGER TRACE LEVEL
-----------------------------------
0

LOCATION OF DDL TRACE FILE
------------------------------------------------------------------------------------------------------------------------
/data01/app/oracle/diag/rdbms/ggsrc/ggsrc/trace/ggs_ddl_trace.log

Analyzing installation status...


STATUS OF DDL REPLICATION
------------------------------------------------------------------------------------------------------------------------
SUCCESSFUL installation of DDL Replication software components

Script complete.
SQL>

SQL> @role_setup.sql

GGS Role setup script

This script will drop and recreate the role GGS_GGSUSER_ROLE
To use a different role name, quit this script and then edit the params.sql script to change the gg_role parameter to the preferred name. (Do not run the script.)

You will be prompted for the name of a schema for the GoldenGate database objects.
NOTE: The schema must be created prior to running this script.
NOTE: Stop all DDL replication before starting this installation.

Enter GoldenGate schema name:GGADMIN
Wrote file role_setup_set.txt

PL/SQL procedure successfully completed.


Role setup script complete

Grant this role to each user assigned to the Extract, GGSCI, and Manager processes, by using the following SQL command:

GRANT GGS_GGSUSER_ROLE TO <loggedUser>

where <loggedUser> is the user assigned to the GoldenGate processes.

SQL> grant GGS_GGSUSER_ROLE to HR ;

Grant succeeded.

SQL> revoke GGS_GGSUSER_ROLE from ggadmin ;

Revoke succeeded.

SQL> @ddl_enable.sql

Trigger altered.

Oracle is now ready to replicate DDL operation along with DML operations . You can now configure the extract process with DDLOPTIONS paramter to  control DDL replication for that extract process .

Create dblink for an user

declare
uid number;
sqltext varchar2(1000) := 'CREATE DATABASE LINK TEST CONNECT TO "TEST_USER" IDENTIFIED BY "TestPWD" USING ''TEST_TNS''' ;
myint integer;
begin
select user_id into uid from all_users where username like 'MYUSER';
myint:=sys.dbms_sys_sql.open_cursor();
sys.dbms_sys_sql.parse_as_user(myint,sqltext,dbms_sql.native,UID);
sys.dbms_sys_sql.close_cursor(myint);
end ;


SQL> select host , db_link , owner  from  dba_db_links where db_link like '%TEST%' ;

    DB_LINK                 OWNER               HOST
----------------------------------------------------------------------
    TEST                    MYUSER              TEST_TNS

Sunday, 27 September 2015

Stop oem agent and oms from autostartup on reboot

For OEM agent depending upon the OS below is the location of oratab :

The general EM startup script is /etc/rc.d/init.d/gcstartup.

From the above script you can find the oratab file path for em agent :
-------------------------------------------------------------------------------

if [ -f /etc/oragchomelist ]
then
     oratab="/etc/oragchomelist"
else
oratab="/var/opt/oracle/oragchomelist"
fi

Just comment the path of agent home and oms home in file /etc/oragchomelist to prevent it from auto-start at server reboot :

[root@grid12c ~]# cat /etc/oragchomelist

#/u01/app/oracle/oms12cr2/oms
#/u01/app/oracle/agent12cr2/core/12.1.0.2.0

Sunday, 20 September 2015

GoldenGate Extract Process failed with : OGG-00717 Found unsupported in-memory undo record

GGSCI (node1.localdomain as ggadmin@ggsrc) 4> start extract exhr01

Sending START request to MANAGER ...
EXTRACT EXHR01 starting


GGSCI (node1.localdomain as ggadmin@ggsrc) 5> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                        
EXTRACT     ABENDED     EXHR01      00:28:25      00:00:03  


GGSCI (node1.localdomain as ggadmin@ggsrc) 6> view report exhr01


***********************************************************************
                 Oracle GoldenGate Capture for Oracle
   Version 12.1.2.1.0 OGGCORE_12.1.2.1.0_PLATFORMS_140727.2135.1_FBO
   Linux, x64, 64bit (optimized), Oracle 12c on Aug  7 2014 10:40:21

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


                    Starting at 2015-09-20 12:26:29
***********************************************************************

Operating System Version:
Linux
Version #1 SMP Fri Feb 22 18:16:18 PST 2013, Release 2.6.39-400.17.1.el6uek.x86_64
Node: node1.localdomain
Machine: x86_64
                         soft limit   hard limit
Address Space Size   :    unlimited    unlimited
Heap Size            :    unlimited    unlimited
File Size            :    unlimited    unlimited
CPU Time             :    unlimited    unlimited

Process id: 5706

Description:

***********************************************************************
**            Running with the following parameters                  **
***********************************************************************

2015-09-20 12:26:29  INFO    OGG-03059  Operating system character set identified as UTF-8.

2015-09-20 12:26:29  INFO    OGG-02695  ANSI SQL parameter syntax is used for parameter parsing.
EXTRACT EXHR01
SETENV (ORACLE_SID=ggsrc)

2015-09-20 12:26:29  INFO    OGG-02095  Successfully set environment variable ORACLE_SID=ggsrc.
USERID ggadmin , PASSWORD *******

2015-09-20 12:26:30  INFO    OGG-03522  Setting session time zone to source database time zone 'GMT'.
EXTTRAIL ./dirdat/hr
TABLE HR.* ;

2015-09-20 12:26:30  INFO    OGG-01815  Virtual Memory Facilities for: BR
    anon alloc: mmap(MAP_ANON)  anon free: munmap
    file alloc: mmap(MAP_SHARED)  file free: munmap
    target directories:
    /data01/oracle/ggs/BR/EXHR01.

Bounded Recovery Parameter:
BRINTERVAL = 4HOURS
BRDIR      = /data01/oracle/ggs

2015-09-20 12:26:30  INFO    OGG-01851  filecaching started: thread ID: 140605740996352.

2015-09-20 12:26:30  INFO    OGG-01815  Virtual Memory Facilities for: COM
    anon alloc: mmap(MAP_ANON)  anon free: munmap
    file alloc: mmap(MAP_SHARED)  file free: munmap
    target directories:
    /data01/oracle/ggs/dirtmp.

CACHEMGR virtual memory values (may have been adjusted)
CACHESIZE:                               64G
CACHEPAGEOUTSIZE (default):               8M
PROCESS VM AVAIL FROM OS (min):         128G
CACHESIZEMAX (strict force to disk):     96G

Database Version:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
PL/SQL Release 12.1.0.1.0 - Production
CORE 12.1.0.1.0 Production
TNS for Linux: Version 12.1.0.1.0 - Production
NLSRTL Version 12.1.0.1.0 - Production

Database Language and Character Set:
NLS_LANGUAGE     = "AMERICAN"
NLS_TERRITORY    = "AMERICA"
NLS_CHARACTERSET = "WE8MSWIN1252"

2015-09-20 12:26:30  INFO    OGG-01513  Positioning to Sequence 9, RBA 5464080, SCN 0.0.

2015-09-20 12:26:30  INFO    OGG-01516  Positioned to Sequence 9, RBA 5464080, SCN 0.0, Sep 20, 2015 11:58:05 AM.

2015-09-20 12:26:30  INFO    OGG-01055  Recovery initialization completed for target file ./dirdat/hr000001, at RBA 1474.

2015-09-20 12:26:30  INFO    OGG-01478  Output file ./dirdat/hr is using format RELEASE 12.1.

2015-09-20 12:26:30  INFO    OGG-01026  Rolling over remote file ./dirdat/hr000001.

2015-09-20 12:26:30  INFO    OGG-01053  Recovery completed for target file ./dirdat/hr000002, at RBA 1474.

2015-09-20 12:26:30  INFO    OGG-01057  Recovery completed for all targets.

***********************************************************************
**                     Run Time Messages                             **
***********************************************************************


2015-09-20 12:26:30  INFO    OGG-01517  Position of first record processed Sequence 9, RBA 5464080, SCN 0.1863330, Sep 20, 20
15 11:59:57 AM.

Source Context :
  SourceModule            : [er.redo.ora.rdr]
  SourceID                : [/scratch/aime1/adestore/views/aime1_adc4150384/oggcore/OpenSys/src/app/er/redo/oracle/redoorardr
.c]
  SourceFunction          : [REDOORARDR_get_next_record]
  SourceLine              : [6988]
  ThreadBacktrace         : [14] elements
                          : [/data01/oracle/ggs/libgglog.so(CMessageContext::AddThreadContext()+0x1e) [0x7fe160262dae]]
                          : [/data01/oracle/ggs/libgglog.so(CMessageFactory::CreateMessage(CSourceContext*, unsigned int, ...
)+0x340) [0x7fe16025dac0]]
                          : [/data01/oracle/ggs/libgglog.so(_MSG_ERR_ORACLE_IN_MEMORY_UNDO_UNHANDLED(CSourceContext*, unsigne
d int, long, char const*, CMessageFactory::MessageDisposition)+0x41) [0x7fe160245c85]]
                          : [/data01/oracle/ggs/extract(REDOORARDR_get_next_record(log_context_t*, log_cursor_t*, unsigned in
t, int, char*, unsigned int*, unsigned int*, long*, rec_position_t*, char (&) [2048])+0x1bba) [0x7ae66a]]
                          : [/data01/oracle/ggs/extract(REDO_read(char*, int*, long*, char*, short*, int, char (&) [2048])+0x
50e) [0x7586ee]]
                          : [/data01/oracle/ggs/extract(READ_EXTRACT_RECORD(chkpt_context_t*, short, char*, unsigned long, __
std_rec_hdr*, int*, int*, long*, short, char*, short*, char*, short*, long*, char (&) [2048])+0xe9) [0x53ed19]]
                          : [/data01/oracle/ggs/extract(process_extract_loop()+0x7f6) [0x5c1c96]]
                          : [/data01/oracle/ggs/extract(extract_main(int, char**)+0x418) [0x5c0098]]
                          : [/data01/oracle/ggs/extract(ggs::gglib::MultiThreading::MainThread::ExecMain()+0x4f) [0x6ab4df]]
                          : [/data01/oracle/ggs/extract(ggs::gglib::MultiThreading::Thread::RunThread(ggs::gglib::MultiThread
ing::Thread::ThreadArgs*)+0x104) [0x6ab9e4]]
                          : [/data01/oracle/ggs/extract(ggs::gglib::MultiThreading::MainThread::Run(int, char**)+0x8b) [0x6ab
dab]]
                          : [/data01/oracle/ggs/extract(main+0x3f) [0x5bfa2f]]
                          : [/lib64/libc.so.6(__libc_start_main+0xfd) [0x34a3e1ecdd]]
                          : [/data01/oracle/ggs/extract() [0x534319]]

2015-09-20 12:26:30  ERROR   OGG-00717  Found unsupported in-memory undo record in sequence 9, at RBA 5474956, with SCN 0.186
3343 (1863343) ... Minimum supplemental logging must be enabled to prevent data loss.

***********************************************************************
*                   ** Run Time Statistics **                         *
***********************************************************************


Report at 2015-09-20 12:26:30 (activity since 2015-09-20 12:26:29)

Output to ./dirdat/hr:

No records extracted.


2015-09-20 12:26:30  ERROR   OGG-01668  PROCESS ABENDING.

CACHE OBJECT MANAGER statistics

CACHE MANAGER VM USAGE
vm current     =      0    vm anon queues =      0
vm anon in use =      0    vm file        =      0
vm used max    =      0    ==> CACHE BALANCED

CACHE CONFIGURATION
cache size            =  64G   cache force paging =  96G
buffer min            =  64K   buffer max (soft)  =   8M
pageout eligible size =   8M

================================================================================
RUNTIME STATS FOR SUPERPOOL

CACHE Transaction Stats
trans active    =      0    max concurrent =      1

Solution :
=======
SQL> alter database add supplemental log data ; 

Enable schema level supplemental loging using ggsci 

GGSCI> add schematrandata HR

Alter the extract to start to position when supplemental log has been enabled :

GGSCI (node1.localdomain as ggadmin@ggsrc) 7> alter extract, exhr01 begin now 
EXTRACT altered.

GGSCI (node1.localdomain as ggadmin@ggsrc) 8> start extract exhr01

Sending START request to MANAGER ...
EXTRACT EXHR01 starting


GGSCI (node1.localdomain as ggadmin@ggsrc) 9> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                           

EXTRACT     RUNNING     EXHR01      00:00:00      00:00:01    

GGSCI (node1.localdomain as ggadmin@ggsrc) 11> info extract exhr01

EXTRACT    EXHR01    Last Started 2015-09-20 12:28   Status RUNNING
Checkpoint Lag       00:00:00 (updated 00:00:02 ago)
Process ID           5735
Log Read Checkpoint  Oracle Redo Logs
                     2015-09-20 12:46:51  Seqno 10, RBA 802304
                     SCN 0.1867251 (1867251)


GGSCI (node1.localdomain as ggadmin@ggsrc) 12> info extract exhr01 , detail
EXTRACT    EXHR01    Last Started 2015-09-20 12:28   Status RUNNING
Checkpoint Lag       00:00:00 (updated 00:00:06 ago)
Process ID           5735
Log Read Checkpoint  Oracle Redo Logs
                     2015-09-20 12:46:51  Seqno 10, RBA 802304
                     SCN 0.1867251 (1867251)

  Target Extract Trails:

  Trail Name                                       Seqno        RBA     Max MB Trail Type
  ./dirdat/hr                                          3       1474        100 EXTTRAIL

  Extract Source                          Begin             End            
  /data01/app/oracle/oradata/ggsrc/redo01.log  2015-09-20 12:28  2015-09-20 12:46
  /data01/app/oracle/oradata/ggsrc/redo03.log  * Initialized *   2015-09-20 12:28
  /data01/app/oracle/oradata/ggsrc/redo03.log  2015-09-20 11:58  2015-09-20 11:58
  /data01/app/oracle/oradata/ggsrc/redo03.log  2015-09-20 11:58  2015-09-20 11:58
  /data01/app/oracle/oradata/ggsrc/redo03.log  2015-09-20 11:58  2015-09-20 11:58
  Not Available                           * Initialized *   2015-09-20 11:58
  Not Available                           * Initialized *   2015-09-20 11:58

Current directory    /data01/oracle/ggs

Report file          /data01/oracle/ggs/dirrpt/EXHR01.rpt
Parameter file       /data01/oracle/ggs/dirprm/exhr01.prm
Checkpoint file      /data01/oracle/ggs/dirchk/EXHR01.cpe
Process file         /data01/oracle/ggs/dirpcs/EXHR01.pce
Error log            /data01/oracle/ggs/ggserr.log
GGSCI (node1.localdomain as ggadmin@ggsrc) 13>

Wednesday, 2 September 2015

ASM backup strategies

With 11g R2 , Oracle provided two new commands md_backup and md_restore , which can be used within the ASMCMD utility to backup and restore the disk group metadata .

[grid@node1 ~]$ asmcmd md_backup /tmp/asmbackups/databkps2 -G DATA

Disk group metadata to be backed up: DATA
Current alias directory path: _MGMTDB/TEMPFILE
Current alias directory path: _MGMTDB
Current alias directory path: RACDB/ONLINELOG
Current alias directory path: RACDB/PARAMETERFILE
Current alias directory path: node-cluster/ASMPARAMETERFILE
Current alias directory path: node-cluster
Current alias directory path: RACDB/CONTROLFILE
Current alias directory path: RACDB
Current alias directory path: ASM/PASSWORD
Current alias directory path: RACDB/TEMPFILE
Current alias directory path: _MGMTDB/CONTROLFILE
Current alias directory path: _MGMTDB/PARAMETERFILE
Current alias directory path: RACDB/PASSWORD
Current alias directory path: RACDB/DATAFILE
Current alias directory path: _MGMTDB/DATAFILE
Current alias directory path: node-cluster/OCRFILE
Current alias directory path: _MGMTDB/ONLINELOG
Current alias directory path: ASM

[grid@node1 ~]$

[grid@node1 ~]$ ls -l  /tmp/asmbackups/databkps2
-rw-r--r-- 1 grid oinstall 19098 Sep  2 02:59 /tmp/asmbackups/databkps2



[grid@node1 ~]$ asmcmd md_backup /tmp/asmbackups/datapbkps

Disk group metadata to be backed up: OCRVOTE
Disk group metadata to be backed up: DATA
Current alias directory path: node-cluster/ASMPARAMETERFILE
Current alias directory path: node-cluster
Current alias directory path: node-cluster/OCRFILE
Current alias directory path: _MGMTDB/TEMPFILE
Current alias directory path: _MGMTDB
Current alias directory path: RACDB/ONLINELOG
Current alias directory path: RACDB/PARAMETERFILE
Current alias directory path: node-cluster/ASMPARAMETERFILE
Current alias directory path: node-cluster
Current alias directory path: RACDB/CONTROLFILE
Current alias directory path: RACDB
Current alias directory path: ASM/PASSWORD
Current alias directory path: RACDB/TEMPFILE
Current alias directory path: _MGMTDB/CONTROLFILE
Current alias directory path: _MGMTDB/PARAMETERFILE
Current alias directory path: RACDB/DATAFILE
Current alias directory path: RACDB/PASSWORD
Current alias directory path: _MGMTDB/DATAFILE
Current alias directory path: node-cluster/OCRFILE
Current alias directory path: _MGMTDB/ONLINELOG
Current alias directory path: ASM
[grid@node1 ~]$


[grid@node1 ~]$ ls -lrth /tmp/asmbackups/datapbkps
-rw-r--r-- 1 grid oinstall 32K Sep  2 03:01 /tmp/asmbackups/datapbkps
[grid@node1 ~]$


md_restore :

To restore entire diskgroup settings :

md_restore --full -G data  /tmp/asmbackups/databkps

Recreates DATA diskgroup and its metadata :

md_resore -nodeg -G data /tmp/asmbackups/databkps

Re-creates only metadata for the data disk group :

md_restore --newdg -o 'data:data2' /tmp/asmbackups/databkps

This example helps you to re-create full DATA diskgroup into a new diskgroup named data2





Create Diskgroup in silent mode

asmca -silent -creatediskgroup -diskGroupName DG_DATA  -disk '/dev/sdf1'
-redundancy External
-compatible.asm='11.2'
-compatible.rdbms='11.2'

Thursday, 27 August 2015

To find complete path of all asm disks

[grid@node1 ~]$  kfod disks=all
--------------------------------------------------------------------------------
 Disk          Size Path                                     User     Group  
================================================================================
   1:       5914 Mb /dev/oracleasm/disks/DATA                grid     oinstall
   2:       6345 Mb /dev/oracleasm/disks/DATA2               grid     oinstall
   3:       3176 Mb /dev/oracleasm/disks/DATA3               grid     oinstall
--------------------------------------------------------------------------------
ORACLE_SID ORACLE_HOME                                                        
================================================================================
     +ASM2 /data01/app/11204/grid_11204                                        
     +ASM1 /data01/app/11204/grid_11204                                        
[grid@node1 ~]$ 

Sunday, 9 August 2015

Tablespace growth Report

SQL> select TS# from v$tablespace where name='ABC' ;

       TS#
----------
         6

set serverout on
set verify off
set lines 200
set pages 2000
DECLARE
v_ts_id number;
not_in_awr EXCEPTION;
v_ts_name varchar2(200) := UPPER('&Tablespace_Name');
v_ts_block_size number;
v_begin_snap_id number;
v_end_snap_id number;
v_begin_snap_date date;
v_end_snap_date date;
v_numdays number;
v_ts_begin_size number;
v_ts_end_size number;
v_ts_growth number;
v_count number;
v_ts_begin_allocated_space number;
v_ts_end_allocated_space number;
BEGIN
SELECT ts# into v_ts_id FROM v$tablespace where name = v_ts_name;
SELECT count(*) INTO v_count FROM dba_hist_tbspc_space_usage where tablespace_id=v_ts_id;
IF v_count = 0 THEN
RAISE not_in_awr;
END IF ;
SELECT block_size into v_ts_block_size FROM dba_tablespaces where tablespace_name = v_ts_name;
SELECT min(snap_id), max(snap_id), min(trunc(to_date(rtime,'MM/DD/YYYY HH24:MI:SS'))), max(trunc(to_date(rtime,'MM/DD/YYYY HH24:MI:SS')))
into v_begin_snap_id,v_end_snap_id, v_begin_snap_date, v_end_snap_date from dba_hist_tbspc_space_usage where tablespace_id=v_ts_id;
v_numdays := v_end_snap_date - v_begin_snap_date;

SELECT round(max(tablespace_size)*v_ts_block_size/1024/1024,2) into v_ts_begin_allocated_space from dba_hist_tbspc_space_usage where tablespace_id=v_ts_id and snap_id = v_begin_snap_id;
SELECT round(max(tablespace_size)*v_ts_block_size/1024/1024,2) into v_ts_end_allocated_space from dba_hist_tbspc_space_usage where tablespace_id=v_ts_id and snap_id = v_end_snap_id;
SELECT round(max(tablespace_usedsize)*v_ts_block_size/1024/1024,2) into v_ts_begin_size from dba_hist_tbspc_space_usage where tablespace_id=v_ts_id and snap_id = v_begin_snap_id;
SELECT round(max(tablespace_usedsize)*v_ts_block_size/1024/1024,2) into v_ts_end_size from dba_hist_tbspc_space_usage where tablespace_id=v_ts_id and snap_id = v_end_snap_id;
v_ts_growth := v_ts_end_size - v_ts_begin_size;
DBMS_OUTPUT.PUT_LINE(CHR(10));
DBMS_OUTPUT.PUT_LINE('Tablespace Block Size: '||v_ts_block_size);
DBMS_OUTPUT.PUT_LINE('---------------------------');
DBMS_OUTPUT.PUT_LINE(CHR(10));
DBMS_OUTPUT.PUT_LINE('Summary');
DBMS_OUTPUT.PUT_LINE('========');
DBMS_OUTPUT.PUT_LINE('1) Allocated Space: '||v_ts_end_allocated_space||' MB'||' ('||round(v_ts_end_allocated_space/1024,2)||' GB)');
DBMS_OUTPUT.PUT_LINE('2) Used Space: '||v_ts_end_size||' MB'||' ('||round(v_ts_end_size/1024,2)||' GB)');
DBMS_OUTPUT.PUT_LINE('3) Used Space Percentage: '||round(v_ts_end_size/v_ts_end_allocated_space*100,2)||' %');
DBMS_OUTPUT.PUT_LINE(CHR(10));
DBMS_OUTPUT.PUT_LINE('History');
DBMS_OUTPUT.PUT_LINE('========');
DBMS_OUTPUT.PUT_LINE('1) Allocated Space on '||v_begin_snap_date||': '||v_ts_begin_allocated_space||' MB'||' ('||round(v_ts_begin_allocated_space/1024,2)||' GB)');
DBMS_OUTPUT.PUT_LINE('2) Current Allocated Space on '||v_end_snap_date||': '||v_ts_end_allocated_space||' MB'||' ('||round(v_ts_end_allocated_space/1024,2)||' GB)');
DBMS_OUTPUT.PUT_LINE('3) Used Space on '||v_begin_snap_date||': '||v_ts_begin_size||' MB'||' ('||round(v_ts_begin_size/1024,2)||' GB)' );
DBMS_OUTPUT.PUT_LINE('4) Current Used Space on '||v_end_snap_date||': '||v_ts_end_size||' MB'||' ('||round(v_ts_end_size/1024,2)||' GB)' );
DBMS_OUTPUT.PUT_LINE('5) Total growth during last '||v_numdays||' days between '||v_begin_snap_date||' and '||v_end_snap_date||': '||v_ts_growth||' MB'||' ('||round(v_ts_growth/1024,2)||' GB)');
IF (v_ts_growth <= 0 OR v_numdays <= 0) THEN
DBMS_OUTPUT.PUT_LINE(CHR(10));
DBMS_OUTPUT.PUT_LINE('!!! NO DATA GROWTH WAS FOUND FOR TABLESPCE '||V_TS_NAME||' !!!');
ELSE
DBMS_OUTPUT.PUT_LINE('6) Per day growth during last '||v_numdays||' days: '||round(v_ts_growth/v_numdays,2)||' MB'||' ('||round((v_ts_growth/v_numdays)/1024,2)||' GB)');
DBMS_OUTPUT.PUT_LINE(CHR(10));
DBMS_OUTPUT.PUT_LINE('Expected Growth');
DBMS_OUTPUT.PUT_LINE('===============');
DBMS_OUTPUT.PUT_LINE('1) Expected growth for next 30 days: '|| round((v_ts_growth/v_numdays)*30,2)||' MB'||' ('||round(((v_ts_growth/v_numdays)*30)/1024,2)||' GB)');
DBMS_OUTPUT.PUT_LINE('2) Expected growth for next 60 days: '|| round((v_ts_growth/v_numdays)*60,2)||' MB'||' ('||round(((v_ts_growth/v_numdays)*60)/1024,2)||' GB)');
DBMS_OUTPUT.PUT_LINE('3) Expected growth for next 90 days: '|| round((v_ts_growth/v_numdays)*90,2)||' MB'||' ('||round(((v_ts_growth/v_numdays)*90)/1024,2)||' GB)');
END IF;
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.PUT_LINE(CHR(10));
DBMS_OUTPUT.PUT_LINE('!!! TABLESPACE DOES NOT EXIST !!!');
WHEN NOT_IN_AWR THEN
DBMS_OUTPUT.PUT_LINE(CHR(10));
DBMS_OUTPUT.PUT_LINE('!!! TABLESPACE USAGE INFORMATION NOT FOUND IN AWR !!!');

END;
/


Summary
========
1) Allocated Space: 2048 MB (2 GB)
2) Used Space: 1558.44 MB (1.52 GB)
3) Used Space Percentage: 76.1 %


History
========
1) Allocated Space on 06-DEC-14: 2048 MB (2 GB)
2) Current Allocated Space on 10-JAN-15: 2048 MB (2 GB)
3) Used Space on 06-DEC-14: 1273 MB (1.24 GB)
4) Current Used Space on 10-JAN-15: 1558.44 MB (1.52 GB)
5) Total growth during last 35 days between 06-DEC-14 and 10-JAN-15: 285.44 MB (.28 GB)
6) Per day growth during last 35 days: 8.16 MB (.01 GB)


Expected Growth
===============
1) Expected growth for next 30 days: 244.66 MB (.24 GB)
2) Expected growth for next 60 days: 489.33 MB (.48 GB)
3) Expected growth for next 90 days: 733.99 MB (.72 GB)

PL/SQL procedure successfully completed.