Quantcast
Channel: Oracle DBA's Blog
Viewing all 32 articles
Browse latest View live

Oracle GoldenGate Replication (Oracle to Oracle) - RAC Database

$
0
0


Operating System           : RHEL5 - 64bit.
Database                          : Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production



STEP 1 :- Installation of GoldenGate Software by unzipping/untar the tar file.
**************************** SOURCE   ***********************
[oracle@rac3 goldengate]$ cd /home/oracle/gg

[oracle@rac3 gg]$ ls
fbo_ggs_Linux_x86_ora11g_32bit.tar

[oracle@rac3 gg]$ tar -xvf fbo_ggs_Linux_x86_ora11g_32bit.tar

****************************  TARGET   ***********************

[oracle@rac3 goldengate]$ cd /home/oracle/gg

[oracle@rac3 gg]$ ls
fbo_ggs_Linux_x86_ora11g_32bit.tar

[oracle@rac3 gg]$ tar -xvf fbo_ggs_Linux_x86_ora11g_32bit.tar

STEP 2:- It is mandatory to setup the Path, LD_Library_path to execute ggsci command else you will receive the highlighted error below.

 ****************************  SOURCE   ***********************

[oracle@rac3 bin-D_H]$export PATH=$PATH:/home/oracle/gg
[oracle@rac3 bin-D_H]$export LD_LIBRARY_PATH=$ORACLE_HOME/lib/:/home/oracle/gg
[oracle@rac3 bin-D_H]$cd /home/oracle/gg
[oracle@rac3 gg-D_H]$./ggsci

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

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

GGSCI (rac3.sukku.com) 1>
 

*****************************  TARGET   ***********************

[oracle@rac4 gg-D_H]$./ggsci
./ggsci: error while loading shared libraries: libnnz11.so: cannot open shared object file: No such file or directory

[oracle@rac4 gg-D_H]$export PATH=$PATH:/home/oracle/gg
[oracle@rac4 gg-D_H]$export LD_LIBRARY_PATH=$ORACLE_HOME/lib/:/home/oracle/gg
[oracle@rac4 gg-D_H]$pwd
/home/oracle/gg
[oracle@rac4 gg-D_H]$./ggsci

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

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

GGSCI (rac4.sukku.com) 1>


STEP 3:- it is mandatory to create sub directories by using “create subdirs” command at ggsci prompt.

**************************** SOURCE   ***********************

GGSCI (rac3.sukku.com) 1> create subdirs

Creating subdirectories under current directory /home/oracle/gg

Parameter files                /home/oracle/gg/dirprm: already exists
Report files                   /home/oracle/gg/dirrpt: created
Checkpoint files               /home/oracle/gg/dirchk: created
Process status files           /home/oracle/gg/dirpcs: created
SQL script files               /home/oracle/gg/dirsql: created
Database definitions files     /home/oracle/gg/dirdef: created
Extract data files             /home/oracle/gg/dirdat: created
Temporary files                /home/oracle/gg/dirtmp: created
Stdout files                   /home/oracle/gg/dirout: created


***************************** TARGET   ***********************

GGSCI (rac4.sukku.com) 1> create subdirs

Creating subdirectories under current directory /home/oracle/gg

Parameter files                /home/oracle/gg/dirprm: already exists
Report files                   /home/oracle/gg/dirrpt: created
Checkpoint files               /home/oracle/gg/dirchk: created
Process status files           /home/oracle/gg/dirpcs: created
SQL script files               /home/oracle/gg/dirsql: created
Database definitions files     /home/oracle/gg/dirdef: created
Extract data files             /home/oracle/gg/dirdat: created
Temporary files                /home/oracle/gg/dirtmp: created
Stdout files                   /home/oracle/gg/dirout: created


STEP 4:- create a user at database level to access DB from ggsci.

****************************  SOURCE   ***********************

SQL> grant connect,resource, dba, select any dictionary, select any table, create table, flashback any table, execute on dbms_flashback, execute on utl_file to ggs identified by ggs;

Grant succeeded.

SQL> conn ggs/ggs
Connected.

*****************************  TARGET   ***********************

SQL>  grant connect,resource, dba, select any dictionary, select any table, create table, flashback any table, execute on dbms_flashback, execute on utl_file to ggs identified by ggs;

Grant succeeded.

SQL> conn ggt/ggt
Connected.


 STEP 5:- It is mandatory to login to database to access date from ggsci
 
****************************  SOURCE   ***********************

GGSCI (rac3.sukku.com) 2> dblogin userid ggs, password ggs
Successfully logged into database.

*****************************  TARGET   ***********************

Note: There may be a chance of multiple DB instances running on same node. It is mandatory to export the instance name where we have created a user for GoldenGate.

GGSCI (rac4.sukku.com) 2> dblogin userid ggt, password ggt
ERROR: Unable to connect to database using user ggt. Please check privileges.
ORA-12162: TNS:net service name is incorrectly specified.

[oracle@rac4 gg-D_H]$. oraenv
ORACLE_SID = [oracle] ? ggtestdb2
The Oracle base for ORACLE_HOME=/oraeng/app/oracle/product/11.2.0 is /oraeng/app/oracle/product

GGSCI (rac4.sukku.com) 1> dblogin userid ggt, password ggt
Successfully logged into database.

##############################################################

Note: ggsci command won’t accept ‘;’ at the end of the commands.

GGSCI (rac3.sukku.com) 3> info all;               -----     ; not allowed for ggsci commands.
ERROR: Invalid command.

##############################################################

STEP 6:- To check what are the resources running on goldengate.

****************************  SOURCE   ***********************

GGSCI (rac3.sukku.com) 4> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt  --- by default Manager process will be in stopped status.

MANAGER     STOPPED 
 
Note: Edit the parameter file.
 User authentication is not mandatory in the parameter file, but it is recommended to authenticate.

GGSCI (rac3.sukku.com) 5> edit params mgr
---------- vi editor----
port 7809
userid ggs, password ggs --- (NOT Mandatory)
------------------------

Note: To start the manager process.

GGSCI (rac3.sukku.com) 6> start manager

Manager started.

GGSCI (rac3.sukku.com) 7> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                          

*****************************  TARGET   ***********************
 
[oracle@rac4 dirprm-D_H]$pwd
/home/oracle/gg/dirprm

[oracle@rac4 dirprm-D_H]$vi mgr.prm

port 7809

GGSCI (rac4.sukku.com) 4> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     STOPPED

Note: To start the manager process.

GGSCI (rac4.sukku.com) 5> start manager

Manager started.


Note: To stop the manager process.

GGSCI (rac4.sukku.com) 6> stop manager
Manager process is required by other GGS processes.
Are you sure you want to stop it (y/n)? yes

Sending STOP request to MANAGER ...
Request processed.
Manager stopped.

GGSCI (rac4.sukku.com) 7> start manager

Manager started.

Note: To check the status of manager process.

GGSCI (rac4.sukku.com) 8> status manager

Manager is running (IP port rac4.sukku.com.7809).


GGSCI (rac4.sukku.com) 9>

****************************  SOURCE   ***********************
             --- Initial Load through extract process -------
Note: before starting the initial load replication, make sure that the structure of table exists at Target side.
SOURCEISTABLE” is the keyword/parameter to run the Initial load through GoldenGate.

GGSCI (rac3.sukku.com) 9> ADD EXTRACT initload, SOURCEISTABLE
EXTRACT added.

GGSCI (rac3.sukku.com) 10> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt   ---  Initial load extract process will not show in info all

MANAGER     RUNNING          


GGSCI (rac3.sukku.com) 11> edit params initload

EXTRACT initload
USERID ggs, PASSWORD ggs
RMTHOST rac4, MGRPORT 7809
RMTTASK replicat, GROUP repload
TABLE ggs.t;

 *****************************  TARGET   ***********************

SPECIALRUN” is the keyword to receive the initial load at replicat side.
Extract/Replicat group name must be less than 8 characters.

GGSCI (rac4.sukku.com) 8> ADD REPLICAT initload2, SPECIALRUN
ERROR: Invalid group name (must be at most 8 characters).

GGSCI (rac4.sukku.com) 9> ADD REPLICAT repload, SPECIALRUN
REPLICAT added.

GGSCI (rac4.sukku.com) 10> EDIT PARAMS  repload

REPLICAT repload
USERID ggt, PASSWORD ggt
ASSUMETARGETDEFS
MAP ggs.t, TARGET ggt.t;

****************************  SOURCE   ***********************
Example:  Create a table and insert few records..

SQL> select count(*) from t;

  COUNT(*)
----------
       160

GGSCI (rac3.sukku.com) 23> start extract initload

Sending START request to MANAGER...
EXTRACT INITLOAD starting
 
GGSCI (rac3.sukku.com) 24> info extract initload

EXTRACT    INITLOAD Last Started 2012-09-20 15:17   Status RUNNING
Checkpoint Lag       Not Available
Log Read Checkpoint Table GGS.T
                     2012-09-20 15:17:51 Record 1
Task                 SOURCEISTABLE

GGSCI (rac3.sukku.com) 25> info extract initload

EXTRACT    INITLOAD  Last Started 2012-09-20 15:20   Status STOPPED
Checkpoint Lag       Not Available
Log Read Checkpoint  Table GGS.T
                     2012-09-20 15:20:22  Record 160
Task                 SOURCEISTABLE

*****************************  TARGET   ***********************

create a table as similar to source..

GGSCI (rac4.sukku.com) 17> info replicat repload

REPLICAT   REPLOAD   Initialized   2012-09-20 15:02   Status RUNNING
Checkpoint Lag       00:00:00 (updated 00:18:04 ago)
Log Read Checkpoint  Not Available
Task                 SPECIALRUN


GGSCI (rac4.sukku.com) 18> info replicat repload

REPLICAT   REPLOAD   Initialized   2012-09-20 15:02   Status STOPPED
Checkpoint Lag       00:00:00 (updated 00:18:55 ago)
Log Read Checkpoint  Not Available
Task                 SPECIALRUN

SQL> select count(*) from t;

  COUNT(*)
----------
       160


Note: Checkpoint Table is mandatory for normal Extract & Replicat.
GGSCI (rac3.sukku.com) 26> edit params ./GLOBALS
GGSCHEMA ggs
CHECKPOINTTABLE ggs.chkpt

GGSCI (rac3.sukku.com) 27> dblogin userid ggs, password ggs
Successfully logged into database.

GGSCI (rac3.sukku.com) 28> add checkpointtable ggs.chkpt
Successfully created checkpoint table ggs.chkpt.

SQL> select * from tab;

TNAME                          TABTYPE  CLUSTERID
------------------------------ ------- ----------
CHKPT             TABLE
CHKPT_LOX         TABLE
T                 TABLE

SQL> desc chkpt_lox
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 GROUP_NAME                                NOT NULL VARCHAR2(8)
 GROUP_KEY                                 NOT NULL NUMBER(19)
 LOG_CMPLT_CSN                             NOT NULL VARCHAR2(129)
 LOG_CMPLT_XIDS_SEQ                        NOT NULL NUMBER(5)
 LOG_CMPLT_XIDS                            NOT NULL VARCHAR2(2000)

SQL> desc chkpt
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 GROUP_NAME                                NOT NULL VARCHAR2(8)
 GROUP_KEY                                 NOT NULL NUMBER(19)
 SEQNO                                              NUMBER(10)
 RBA                                       NOT NULL NUMBER(19)
 AUDIT_TS                                           VARCHAR2(29)
 CREATE_TS                                 NOT NULL DATE
 LAST_UPDATE_TS                            NOT NULL DATE
 CURRENT_DIR                               NOT NULL VARCHAR2(255)
 LOG_CSN                                            VARCHAR2(129)
 LOG_XID                                            VARCHAR2(129)
 LOG_CMPLT_CSN                                      VARCHAR2(129)
 LOG_CMPLT_XIDS                                     VARCHAR2(2000)
 VERSION                                            NUMBER(3)


*****************************  SOURCE    ***********************

threads 2” is for RAC databases, so that Goldengate will be aware of that it should get the data from 2 sources (Node1 & Node2 online redologs).

GGSCI (rac3.sukku.com) 30> add extract ext,tranlog, threads 2, begin now
EXTRACT added.

GGSCI (rac3.sukku.com) 31> add rmttrail /home/oracle/gg/dirdat/rt, extract ext
RMTTRAIL added.

GGSCI (rac3.sukku.com) 32> edit params ext

EXTRAXT ext
USERID ggs, PASSWORD ggs
RMTHOST rac4, MGRPORT 7809
RMTTRAIL /home/oracle/gg/dirdat/rt
TABLE ggs.t;

*****************************  TARGET   ***********************

GGSCI (rac4.sukku.com) 19> add replicat rep, exttrail /home/oracle/gg/dirdat/rt
ERROR: No checkpoint table specified for ADD REPLICAT.

GGSCI (rac4.sukku.com) 20> edit params ./GLOBALS
GGSCHEMA ggt
CHECKPOINTTABLE ggt.chkpt

GGSCI (rac4.sukku.com) 21> dblogin userid ggt, password ggt
Successfully logged into database.

GGSCI (rac4.sukku.com) 22> add checkpointtable ggt.chkpt
Successfully created checkpoint table ggt.chkpt.

GGSCI (rac4.sukku.com) 23> add replicat rep, exttrail /home/oracle/gg/dirdat/rt
REPLICAT added.

GGSCI (rac4.sukku.com) 24> edit params rep
REPLICAT rep
ASSUMETARGETDEFS
USERID ggt, PASSWORD ggt
MAP ggs.t, TARGET ggt.t;

##############################################################

*****************************  SOURCE   ***********************

GGSCI (rac3.sukku.com) 36> start extract ext

Sending START request to MANAGER ...
EXTRACT EXT starting

GGSCI (rac3.sukku.com) 51> info extract ext

EXTRACT    EXT       Initialized   2012-09-20 16:10   Status RUNNING
Checkpoint Lag       00:00:00 (updated 00:00:49 ago)
Log Read Checkpoint  Oracle Redo Logs
                     2012-09-20 16:10:08  Thread 1, Seqno 0, RBA 0
                     SCN 0.0 (0)
Log Read Checkpoint  Oracle Redo Logs
                     2012-09-20 16:10:08  Thread 2, Seqno 0, RBA 0
                     SCN 0.0 (0)


GGSCI (rac3.sukku.com) 52> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                          
EXTRACT     RUNNING     EXT         00:00:00      00:00:58   

---------------------------------------------   without threads 2 option in RAC DB   ------------------------------------------
2012-09-20 15:57:18  ERROR   OGG-00446  Oracle GoldenGate Capture for Oracle, ext.prm:  The number of Oracle redo threads (2) is not the same as the number of checkpoint threads (1). EXTRACT groups on RAC systems should be created with the THREADS parameter (e.g., ADD EXT <group name>, TRANLOG, THREADS 2, BEGIN...).
----------------------------------------------------------------------------------------------------------------------------------

*****************************  TARGET   ***********************

GGSCI (rac4.sukku.com) 29> start replicat rep

Sending START request
REPLICAT REP starting

GGSCI (rac4.sukku.com) 30> info all

Program     Status      Group       Lag at Chkpt  Time Since Chkpt

MANAGER     RUNNING                                          
REPLICAT    RUNNING     REP         00:00:00      00:00:00   

GGSCI (rac4.sukku.com) 31> info replicat rep

REPLICAT   REP       Last Started 2012-09-20 16:13   Status RUNNING
Checkpoint Lag       00:00:00 (updated 00:00:06 ago)
Log Read Checkpoint  File /home/oracle/gg/dirdat/rt000000
                     First Record  RBA 0
########################################################################################

Note: Unable to replicate.. because redo's are in ASM..

2012-09-20 16:57:33  ERROR   OGG-00446  Oracle GoldenGate Capture for Oracle, ext.prm:  No valid log files for current redo sequence 256, thread 1, error retrieving redo file name for sequence 256, archived = 0, use_alternate = 0Not able to establish initial position for begin time 2012-09-20 16:56:52.
2012-09-20 16:57:33  ERROR   OGG-01668  Oracle GoldenGate Capture for Oracle, ext.prm:  PROCESS ABENDING.

Note: create password file and grant sysasm privilege and added this parameter to read ASM logfiles to fix the above error.

EXTRACT ext
USERID ggs, PASSWORD ggs
RMTHOST rac4, MGRPORT 7809
RMTTRAIL /home/oracle/gg/dirdat/rt
tranlogoptions asmuser sys@asm1, asmpassword sys
TABLE ggs.t;

GGSCI (rac3.sukku.com) 63> stats extract ext

Sending STATS request to EXTRACT EXT ...

Start of Statistics at 2012-09-20 21:21:27.

DDL replication statistics (for all trails):

*** Total statistics since extract started     ***
        Operations                                         3.00
        Mapped operations                                  3.00
        Unmapped operations                                0.00
        Other operations                                   0.00
        Excluded operations                                0.00

Output to /home/oracle/gg/dirdat/rt:

Extracting from GGS.A to GGS.A:

*** Total statistics since 2012-09-20 18:45:06 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00

*** Daily statistics since 2012-09-20 18:45:06 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00

*** Hourly statistics since 2012-09-20 21:00:00 ***

        No database operations have been performed.

*** Latest statistics since 2012-09-20 18:45:06 ***
        Total inserts                                      1.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                                   1.00

Extracting from GGS.GGS_MARKER to GGS.GGS_MARKER:

*** Total statistics since 2012-09-20 18:45:06 ***

        No database operations have been performed.

*** Daily statistics since 2012-09-20 18:45:06 ***

        No database operations have been performed.

*** Hourly statistics since 2012-09-20 21:00:00 ***

        No database operations have been performed.

*** Latest statistics since 2012-09-20 18:45:06 ***

        No database operations have been performed.

Extracting from GGS.GGS_MARKER to GGS.GGS_MARKER:

*** Total statistics since 2012-09-20 18:45:06 ***

        No database operations have been performed.

*** Daily statistics since 2012-09-20 18:45:06 ***

        No database operations have been performed.

*** Hourly statistics since 2012-09-20 21:00:00 ***

        No database operations have been performed.

*** Latest statistics since 2012-09-20 18:45:06 ***

        No database operations have been performed.

Extracting from GGS.H to GGS.H:

*** Total statistics since 2012-09-20 18:45:06 ***
        Total inserts                                      2.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                                   2.00

*** Daily statistics since 2012-09-20 18:45:06 ***
        Total inserts                                      2.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                                   2.00

*** Hourly statistics since 2012-09-20 21:00:00 ***

        No database operations have been performed.

*** Latest statistics since 2012-09-20 18:45:06 ***
        Total inserts                                      2.00
        Total updates                                      0.00
        Total deletes                                      0.00
        Total discards                                     0.00
        Total operations                                   2.00

End of Statistics.

Fix Undo Block Corruption

$
0
0

************************************************************

ORA-00604: error occurred at recursive SQL level 1
ORA-01552: cannot use system rollback segment for non-system tablespace 'USERS'
ORA-06512: at line 19

Errors in file/export/home/oracle/admin/df4/dwnon/bdump/dwnon_smon_26175.trc:
ORA-00604: error occurred at recursive SQL level 1
ORA-00376: file 238 cannot be read at this time
ORA-01110: data file 238: '/u2/df4/oradata/dwnon/undotbs2_dwnon_01.dbf'

************************************************************
Dbv:
The Database Verify utility (dbv) provides a mechanism to validate the structure of Oracle data files at the operating system level.  It should be used on a regular basis to inspect data files for signs of corruption.  
Although it can be used against open data files, the primary purpose of dbv is to verify the integrity of cold datafiles that would be used for a backup.  If used against online datafiles, intermittent errors can occur and the utility should be executed again against the same file to verify accuracy.  The utility can only be used against datafiles however, not control files or archived redo logs. 

bash-2.05$ dbv file=/u2/df4/oradata/dwnon/undotbs2_dwnon_01.dbf blocksize=16384

DBVERIFY: Release 10.2.0.2.0 - Production on Tue Feb 7 12:56:11 2012

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

DBVERIFY - Verification starting: FILE = /u2/df4/oradata/dwnon/undotbs2_dwnon_01.dbf

DBV-00200: Block, dba 998244473, already marked corrupted
DBVERIFY - Verification complete

Total Pages Examined         : 125440
Total Pages Processed (Data) : 0
Total Pages Failing   (Data) : 0
Total Pages Processed (Index): 0
Total Pages Failing   (Index): 0
Total Pages Processed (Other): 121776
Total Pages Processed (Seg)  : 0
Total Pages Failing   (Seg)  : 0
Total Pages Empty            : 3664
Total Pages Marked Corrupt   : 1
Total Pages Influx           : 0
Highest block SCN            : 2468459942 (17.2468459942)
bash-2.05$


Mount Stage:

Step 1:

SQL> select FILE#, NAME, STATUS, ERROR, RECOVER from v$datafile_header
where status <> 'ONLINE';

FILE#      NAME                                      STATUS          ERRORREC
--------   ----------------------------------------  -----------     -----
238       /u2/df4/oradata/dwnon/undotbs2_dwnon_01.dbf  OFFLINE            NO

SQL> alter database recover datafile '/u2/df4/oradata/dwnon/undotbs2_dwnon_01.dbf'

Media Recovery Complete.


SQL> alter database datafile '/u2/df4/oradata/dwnon/sysaux_dwnon_01.dbf' online;

Database altered.

SQL> alter database open;

Note: Database is in open mode and able to connect to schemas but we are not able to perform any DDL and DML operation.

SQL> connect sukku/sukku
Connected.

SQL> Create table test (n number);
Error : 

ORA-00604: error occurred at recursive SQL level 1
ORA-01552: cannot use system rollback segment for non-system tablespace 'USERS'
ORA-06512: at line 19

Errors in file /export/home/oracle/admin/df4/dwnon/bdump/dwnon_smon_26175.trc:
ORA-00604: error occurred at recursive SQL level 1
ORA-00376: file 238 cannot be read at this time
ORA-01110: data file 238: '/u2/df4/oradata/dwnon/undotbs2_dwnon_01.dbf'


SQL> Select segment_name, status from dba_rollback_segs where tablespace_name='UNDOTBS2'
And status = 'NEEDS RECOVERY'; 

SEGMENT_NAME                   STATUS
------------------------------ ----------------
_SYSSMU4$                      NEEDS RECOVERY
_SYSSMU5$                      NEEDS RECOVERY
_SYSSMU6$                      NEEDS RECOVERY
_SYSSMU7$                      NEEDS RECOVERY
_SYSSMU8$                      NEEDS RECOVERY
_SYSSMU9$                      NEEDS RECOVERY
_SYSSMU10$                    NEEDS RECOVERY

7 rows selected.

SQL> Shut Immediate

Note:   If the old segments are online, then they must be taken offline. Once these segments are offline it will be easy to drop old undo tablespace without any exceptions.

SQL>alter rollback segment “_SYSSMU4$” offline;


Step 2:

SQL> Startup nomount;   
SQL> Create pfile='initdwnon.ora' from spfile;
SQL> Shutdown immediate;

Step 3:

Modify parameter file

*.undo_management='MANUAL'
#*.undo_tablespace='UNDOTBS1'
*._OFFLINE_ROLLBACK_SEGMENTS=(_SYSSMU4$,_SYSSMU5$,_SYSSMU6$,_SYSSMU7$,_SYSSMU8$,_SYSSMU9$,_SYSSMU10$)


SQL> Startup mount pfile='initdwnon.ora'
SQL> Alter database open ;

SQL> drop rollback segment "_SYSSMU4$";
Rollback segment dropped.

SQL> drop rollback segment "_SYSSMU5$";
Rollback segment dropped.

SQL> drop rollback segment "_SYSSMU6$";
Rollback segment dropped.

SQL> drop rollback segment "_SYSSMU7$";
Rollback segment dropped.

SQL> drop rollback segment "_SYSSMU8$";
Rollback segment dropped.

SQL> drop rollback segment "_SYSSMU9$";
Rollback segment dropped.

SQL> drop rollback segment "_SYSSMU10$";
Rollback segment dropped.



SQL> drop tablespace UNDOTBS2 including contents and datafiles;
Tablespace dropped.

SQL> CREATE UNDO TABLESPACE "UNDOTBS4"
  DATAFILE'/u2/df4/oradata/dwnon/undotbs04.dbf' SIZE 1024M; 
Tablespace created.


Step 4 :


Modify parameter file

*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS4'

Remove hidden parameter
*._OFFLINE_ROLLBACK_SEGMENTS=(_SYSSMU4$,_SYSSMU5$,_SYSSMU6$,_SYSSMU7$,_SYSSMU8$,_SYSSMU9$,_SYSSMU10$)

SQL> Shutdown immediate;
SQL> Startup nomount; ---> Using spfile
SQL> Create Spfile=’/export/home/oracle/product/10.2/dbs/spfiledwnon.ora’ from
Pfile=’ initdwnon.ora’
SQL> Shutdown immediate;
SQL> Startup





Calculate Archives Logs per day (Hourly)

$
0
0
col day for a10
col thread# format 9999 heading "Thread"
break on thread# skip 2;
set lines 500
set pages 300
set trimspool on

select thread#, to_char(first_time,'YYYY-MM-DD') day,
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'00',1,0)),'999') "00",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'01',1,0)),'999') "01",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'02',1,0)),'999') "02",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'03',1,0)),'999') "03",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'04',1,0)),'999') "04",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'05',1,0)),'999') "05",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'06',1,0)),'999') "06",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'07',1,0)),'999') "07",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'08',1,0)),'999') "08",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'09',1,0)),'999') "09",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'10',1,0)),'999') "10",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'11',1,0)),'999') "11",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'12',1,0)),'999') "12",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'13',1,0)),'999') "13",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'14',1,0)),'999') "14",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'15',1,0)),'999') "15",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'16',1,0)),'999') "16",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'17',1,0)),'999') "17",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'18',1,0)),'999') "18",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'19',1,0)),'999') "19",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'20',1,0)),'999') "20",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'21',1,0)),'999') "21",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'22',1,0)),'999') "22",
to_char(sum(decode(substr(to_char(first_time,'HH24'),1,2),'23',1,0)),'999') "23",
count(*) Total
from v$log_history
where first_time > sysdate - &go_back
group by thread#, to_char(first_time,'YYYY-MM-DD') order by 2 ;

Enter the value for how many days you want to check the archives generation per day in hourly basis.

Here is the sample output for the above query.


Thread DAY        00   01   02   03   04   05   06   07   08   09   10   11   12   13   14   15   16   17   18   19   20   21   22   23        TOTAL
------ ---------- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----------
     1 2012-10-07    0    0    0    0    0    0    0    0    0    0    0    0    0    2    2    2    2    2    2    2    2    2    2    2         22


     2 2012-10-07    0    0    0    0    0    0    0    0    0    0    0    0    0    2    2    2    2    2    2    2    2    2    2    2         22


     1 2012-10-08    2    2    2    2    2    2    2    2    2    2    2    2    1    0    0    0    0    0    0    0    0    0    0    0         25


     2 2012-10-08    2    2    2    2    2    2    2    2    2    2    2    2    1    0    0    0    0    0    0    0    0    0    0    0         25




Installation of Oracle-12C database

$
0
0



 

Create groups, user and directories


#groupadd -g 54321 oinstall
#groupadd -g 54322 dba
#groupadd -g 54323 oper
#useradd -u 54321 -g oinstall -G dba,oper oracle
#passwd xxxxxx

#mkdir -p /u01/app/oracle/product/12.1.0
#chown -R oracle:oinstall /u01
#chmod -R 775 /u01

Pre-Requisite check for 12CR1 installation

Installation of required RPMs:

  1. Automatic  Process
All necessary prerequisites will be performed automatically. It is probably worth doing a full update as well. The simple "yum update" command will set the oracle recommended values to sysctl.conf and limit.conf files.
# yum update

  1. Manual Process
Add the following lines to the "/etc/sysctl.conf" file.

kernel.msgmnb = 65536
kernel.msgmax = 65536
kernel.hostname = localhost.localdomain
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
kernel.shmmni = 4096
kernel.shmall = 1073741824
kernel.shmmax = 4398046511104
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048576
fs.aio-max-nr = 1048576
net.ipv4.ip_local_port_range = 9000 65500

Add the following lines to the "/etc/security/limits.conf" file.

oracle   soft   nofile    1024
oracle   hard   nofile    65536
oracle   soft   nproc    2047
oracle   hard   nproc    16384
oracle   soft   stack    10240
oracle   hard   stack    32768

Install the following packages if they are not already present.
# From Public Yum or ULN

yum install binutils -y
yum install compat-libcap1 -y
yum install compat-libstdc++-33 -y
yum install compat-libstdc++-33.i686 -y
yum install gcc -y
yum install gcc-c++ -y
yum install glibc -y
yum install glibc.i686 -y
yum install glibc-devel -y
yum install glibc-devel.i686 -y
yum install ksh -y
yum install libgcc -y
yum install libgcc.i686 -y
yum install libstdc++ -y
yum install libstdc++.i686 -y
yum install libstdc++-devel -y
yum install libstdc++-devel.i686 -y
yum install libaio -y
yum install libaio.i686 -y
yum install libaio-devel -y
yum install libaio-devel.i686 -y
yum install libXext -y
yum install libXext.i686 -y
yum install libXtst -y
yum install libXtst.i686 -y
yum install libX11 -y
yum install libX11.i686 -y
yum install libXau -y
yum install libXau.i686 -y
yum install libxcb -y
yum install libxcb.i686 -y
yum install libXi -y
yum install libXi.i686 -y
yum install make -y
yum install sysstat -y
yum install unixODBC -y
yum install unixODBC-devel -y

Installation Of Database Software


$unzip linuxamd64_12c_database_1of2.zip
$unzip linuxamd64_12c_database_2of2.zip

ü  Unzipping of above Zip files will create a database directory under the software location folder.
ü  Make sure sufficient Temp size and Swap Memory is available.
ü  Execute the runInstallerfile as an ORACLE user.


After executing the runInstaller, It will prompt for continue with the installation. Please proceed with option ‘Y’
continuing with the installation,

Continue? (y/n) [n] Y


Step 1: Configure Security updates

  • Dis-select the security update checkbox and click NEXT.



 Click yes and proceed to next step.

 
Step 2:Software Updates.
  • Select Skip Software Updates and proceed to next step.
 

Step 3: Installation Option

  • If you want to create the database along with the installation select the first option.
  • If you want to just install the database software alone, select the second option. 
  •  If you want to upgrade an existing database proceed with third option.


Click Next and proceed Further.


Step 4: System Class

  • Select server class and proceed to next step




Step 5: Grid Installation Options
 
  • Please select the option depends on your requirement and proceed further.



Step 6: Install Type

  • Select Typical Install and proceed to next step.





Step 7: Typical Installation

  • Fill the details and proceed further



Step 8: Create Inventory


  • Simply Click Next and Proceed
  

 

Step 9: Prerequisite Check

  • Please wait until completion of prerequisite check and click next.




  
Step 10:  Ignore the SWAP related warning and proceed further.



Step 11: Summary

  •  Before Installation of DB software, please go through all the option and click edit if you want to change any settings else click INSTALL button to proceed installation.





Step 12: Install Product
  

 
  • Run the root.sh files as a root user.
 

Installation of Database.





  • If you click on Password Management you will manage the default user accounts.  





Step 13 :  Install Product.

  • Installation of DB is complete by clicking the next.



Post Installation Configuration Steps.


Set the values in .bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/12.1.0
export ORACLE_SID=odb12c

export PATH=/usr/sbin:$PATH
export PATH=$ORACLE_HOME/bin:$PATH

export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export CLASSPATH=$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib


Listener Configuration:                $ORACLE_HOME/network/admin/listener.ora
ODB12C =
  (DESCRIPTION_LIST =
    (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = odb12c.appsassociates.com)(PORT = 1521))
    )
  )

SID_LIST_ODB12C =
  (SID_LIST =
    (SID_DESC =
      (ORACLE_HOME= /u01/app/oracle/product/12.1.0)
      (SID_NAME = odb12c)
    )
  )

TNS Configuration:  $ORACLE_HOME/network/admin/tnsnames.ora
ODB12C=
        (DESCRIPTION=
                (ADDRESS=(PROTOCOL=tcp)(HOST=odb12c.appsassociates.com)(PORT=1521))
            (CONNECT_DATA=
                (SID=ODB12C)
            )
        )

Working with 12c:



[oracle@odb12c ~]$ sqlplus / as sysdba
SQL*Plus: Release 12.1.0.1.0 Production on Sun Jun 30 14:52:50 2013

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

Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> select status from v$instance;

STATUS
------------------------------------
OPEN

SQL> select name from v$database;

NAME
---------------------------
ODB12C

ü  User Creation
SQL> grant connect, resource to TEST identified by TEST;
grant connect, resource to TEST identified by TEST
*
ERROR at line 1:
ORA-65049: creation of local user or role is not allowed in CDB$ROOT

ü  Here is the syntax for user Creation
SQL> grant connect, resource to C##TEST identified by TEST container=all;

Grant succeeded.

ü  Query to check the DB Details.

COLUMN "DB DETAILS" FORMAT A100
SELECT
 'DB_NAME: ' ||sys_context('userenv', 'db_name')||
 ' / CDB?: ' ||(select cdb from v$database)||
 ' / AUTH_ID: ' ||sys_context('userenv', 'authenticated_identity')||
 ' / USER: ' ||sys_context('userenv', 'current_user')||
 ' / CONTAINER: '||nvl(sys_Context('userenv', 'con_Name'), 'NON-CDB')
 "DB DETAILS"
 FROM DUAL
 /

DB DETAILS
-------------------------------------------------------------------------------------------------
DB_NAME: odb12c / CDB?: YES / AUTH_ID: oracle / USER: SYS / CONTAINER: CDB$ROOT



ü  Query to check the DB Details from v$PDBS

SQL> select NAME, CON_ID, DBID, OPEN_TIME, OPEN_MODE from v$pdbs;

NAME                     CON_ID       DBID OPEN_TIME                       OPEN_MODE
-------------------- ---------- ---------- ------------------------------- -------------------
PDB$SEED                      2 4062010165 30-JUN-13 01.05.45.950 AM       READ ONLY
PDB12C                        3  471577855 30-JUN-13 01.07.45.831 AM       READ WRITE


ü  Query to check the Datafile Details from cdb_data_files

col TABLESPACE_NAME for a20
col FILE_NAME for a80
select      con_id,
      tablespace_name,
      file_Name
from  cdb_data_files
order by 1, 2;


    CON_ID TABLESPACE_NAME      FILE_NAME
---------- -------------------- -----------------------------------------------------------
         1 SYSAUX               /u01/app/oracle/oradata/odb12c/sysaux01.dbf
         1 SYSTEM               /u01/app/oracle/oradata/odb12c/system01.dbf
         1 UNDOTBS1             /u01/app/oracle/oradata/odb12c/undotbs01.dbf
         1 USERS                /u01/app/oracle/oradata/odb12c/users01.dbf
         2 SYSAUX               /u01/app/oracle/oradata/odb12c/pdbseed/sysaux01.dbf
         2 SYSTEM               /u01/app/oracle/oradata/odb12c/pdbseed/system01.dbf
         3 EXAMPLE              /u01/app/oracle/oradata/odb12c/pdb12c/example01.dbf
         3 SYSAUX               /u01/app/oracle/oradata/odb12c/pdb12c/sysaux01.dbf
         3 SYSTEM               /u01/app/oracle/oradata/odb12c/pdb12c/system01.dbf
         3 USERS                /u01/app/oracle/oradata/odb12c/pdb12c/SAMPLE_SCHEMA_users01.dbf

10 rows selected.

CON_ID 1: Normal Database
CON_ID 2: Container Database
CON_ID 3: Pluggable Database

ü  Here are some queries with new Data Dictionary Views.

SQL> SELECT pdb FROM dba_services;
SQL> SELECT sys_context('userenv','con_name') "MY_CONTAINER" FROM dual;
SQL> SHOW con_name
SQL> SELECT NAME, CON_ID FROM v$active_services ORDER BY 1;

SQL Behaviour with the SQL_ID

$
0
0

You can get the behavior of SQL query with SQL ID


set linesize 200
set pagesize 200

col BEGIN_INTERVAL_TIME format A28
col END_INTERVAL_TIME format A28
col SNAP_ID format 999999 heading "Snap"
col PLAN_HASH_VALUE format 99999999999 heading "Plan|Hash"
col TOTAL_CNT noprint
col EXECUTIONS_DELTA format 999,999,999 heading "Executions"
col ELAPSED_TIME_DELTA format 999,999 heading "Total|Elapsed|(secs)"
col BUFFER_GETS_DELTA format 999,999,999 heading "Buffer Gets"
col DISK_READS_DELTA format 999,999,999 heading "Disk|Reads"
col CPU_TIME_DELTA format 999,999 heading "Total CPU|(secs)"
col IOWAIT_DELTA format 999,999,999,999 heading "IO|Delta"
col ELAPSED_PER_EXECUCTION format 9,999.9 heading "Elapsed|/Exec|(secs)"
col GETS_PER_EXECUCTION format 999,999,999 heading "Buffer|Gets|/Exec"
col CPU_PER_EXECUCTION format 999.99 heading "CPU Time|/Exec|(secs)"
col DISKREADS_PER_EXECUCTION format 999,999,999 heading "Disk Reads|/Exec"
col ROWS_PROCESSED_DELTA format 999,999,999 heading "Rows|Processed"
col ROWS_PROCESSED_PER_EXECUTION format 999,999 heading "Rows|/Exec"
col IO_PER_EXECUCTION format 999,999,999 heading "IO|/Exec"
col REPORT_TIME format A15
col SNAP_ID_FOUND format A12 heading "First/Last|snap|found in"
col SPACER format A5 heading ''
col INSTANCE_NUMBER format 9 heading "I" print
set linesize 200
SELECT B.INSTANCE_NUMBER, B.BEGIN_INTERVAL_TIME, B.END_INTERVAL_TIME, PLAN_HASH_VALUE, A.EXECUTIONS_DELTA, A.DISK_READS_DELTA, A.BUFFER_GETS_DELTA,
round(A.ROWS_PROCESSED_DELTA / DECODE(A.EXECUTIONS_DELTA,0,1, A.EXECUTIONS_DELTA)) ROWS_PROCESSED_PER_EXECUTION,
round(A.DISK_READS_DELTA / DECODE(A.EXECUTIONS_DELTA,0,1, A.EXECUTIONS_DELTA)) diskreads_per_execuction,
round(A.BUFFER_GETS_DELTA / DECODE(A.EXECUTIONS_DELTA,0,1, A.EXECUTIONS_DELTA)) gets_per_execuction,
round(( A.ELAPSED_TIME_DELTA / 1000 / 1000) / DECODE(A.EXECUTIONS_DELTA,0,1, A.EXECUTIONS_DELTA),1) elapsed_per_execuction
from DBA_HIST_SQLSTAT A, DBA_HIST_SNAPSHOT B
where A.SNAP_ID = B.SNAP_ID
and A.INSTANCE_NUMBER = B.INSTANCE_NUMBER
and A.SQL_ID = '&SQL_ID'
and B.BEGIN_INTERVAL_TIME >= sysdate - &GO_BACK
order by B.BEGIN_INTERVAL_TIME, B.INSTANCE_NUMBER;


Please pass the SQL_ID and GO_BACK (for how many days you want to check the SQL behaviour)

Here is an example to pass the values.

Enter value for sql_id: 1fkh93md0802n
Enter value for go_back: 3




DB Clone using RMAN duplicate database command

$
0
0



Set the Required Mandatory Parameters

Source DB   -- db_name  = VIS
Clone DB    -- db_name  = VIS1

Source DB   -- control_files = /u02/VIS/visdata/cntrl01.dbf,/u02/VIS/visdata/cntrl02.dbf,/u02/VIS/visdata/cntrl03.dbf
Clone DB    -- control_files = /VIS1/visdata/cntrl01.dbf,/VIS1/visdata/cntrl02.dbf,/VIS1/visdata/cntrl03.dbf

Source DB   -- diagnostic_dest  = /u02/VIS/visdb/11.2.0.3/admin/VIS_ebs11i
Clone DB    -- diagnostic_dest  = /VIS1/visdb/11.2.0.3/admin/VIS1_ebs11i

Source DB   -- core_dump_dest   = /u02/VIS/visdb/11.2.0.3/admin/VIS_ebs11i/cdump
Clone DB    -- core_dump_dest   = /VIS1/visdb/11.2.0.3/admin/VIS1_ebs11i/cdump

#Add New entries to Clone DB pfile.
Clone DB    -- db_file_name_convert  = '/u02/VIS/visdata/','/VIS1/visdata/'
Clone DB    -- log_file_name_convert = '/u02/VIS/visdata/','/VIS1/visdata/'


Set the ORACLE_SID and ORACLE_HOME parameters

[oracle@ebs11i ~]$ export ORACLE_SID=VIS1
[oracle@ebs11i ~]$ export ORACLE_HOME=/VIS1/visdb/11.2.0.3


Connect to Instance

[oracle@ebs11i ~]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Wed Dec 4 05:13:20 2013

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

Connected to an idle instance.

Bring up the Instance to No Mount with Pfile

SQL> startup nomount pfile='/VIS1/visdb/11.2.0.3/dbs/initVIS1.ora';

Total System Global Area  640323584 bytes
Fixed Size                  1346728 bytes
Variable Size             461374296 bytes
Database Buffers          163577856 bytes
Redo Buffers               14024704 bytes
SQL>
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options


Connect to RMAN Auxiliary instance
[oracle@ebs11i ~]$ rman auxiliary /

Recovery Manager: Release 11.2.0.3.0 - Production on Wed Dec 4 05:14:41 2013

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

connected to auxiliary database: VIS1 (not mounted)


Issue Duplicate Database command to Clone the Database

RMAN> duplicate database to VIS1 backup location '/u03/Backup_new/' NOFILENAMECHECK;

Starting Duplicate Db at 04-DEC-13

contents of Memory Script:
{
   sql clone "create spfile from memory";
}
executing Memory Script

sql statement: create spfile from memory

contents of Memory Script:
{
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     640323584 bytes

Fixed Size                     1346728 bytes
Variable Size                461374296 bytes
Database Buffers             163577856 bytes
Redo Buffers                  14024704 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''VIS'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''VIS1'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   restore clone primary controlfile from  '/u03/Backup_new/06oqiltp_1_1.bkp';
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''VIS'' comment= ''Modified by RMAN duplicate'' scope=spfile

sql statement: alter system set  db_unique_name =  ''VIS1'' comment= ''Modified by RMAN duplicate'' scope=spfile

Oracle instance shut down

Oracle instance started

Total System Global Area     640323584 bytes

Fixed Size                     1346728 bytes
Variable Size                461374296 bytes
Database Buffers             163577856 bytes
Redo Buffers                  14024704 bytes

Starting restore at 04-DEC-13
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=301 device type=DISK

channel ORA_AUX_DISK_1: restoring control file
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:07
output file name=/VIS1/visdata/cntrl01.dbf
output file name=/VIS1/visdata/cntrl02.dbf
output file name=/VIS1/visdata/cntrl03.dbf
Finished restore at 04-DEC-13

database mounted
released channel: ORA_AUX_DISK_1
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=301 device type=DISK

contents of Memory Script:
{
   set until scn  8173891933524;
   set newname for datafile  1 to
 "/VIS1/visdata/sys1.dbf";
   set newname for datafile  2 to
 "/VIS1/visdata/sys2.dbf";
   set newname for datafile  3 to
 "/VIS1/visdata/sys3.dbf";
   set newname for datafile  4 to
 "/VIS1/visdata/sys4.dbf";
   set newname for datafile  5 to
 "/VIS1/visdata/sys5.dbf";
   set newname for datafile  6 to
 "/VIS1/visdata/sys6.dbf";
   set newname for datafile  7 to
 "/VIS1/visdata/sys7.dbf";
   set newname for datafile  8 to
 "/VIS1/visdata/undo01.dbf";
   set newname for datafile  9 to
 "/VIS1/visdata/undo02.dbf";
   set newname for datafile  10 to
 "/VIS1/visdata/undo03.dbf";
   set newname for datafile  11 to
 "/VIS1/visdata/undo04.dbf";
   set newname for datafile  12 to
 "/VIS1/visdata/archive1.dbf";
   set newname for datafile  13 to
 "/VIS1/visdata/archive2.dbf";
   set newname for datafile  14 to
 "/VIS1/visdata/media1.dbf";
   set newname for datafile  15 to
 "/VIS1/visdata/media2.dbf";
   set newname for datafile  16 to
 "/VIS1/visdata/media3.dbf";
   set newname for datafile  17 to
 "/VIS1/visdata/nologging1.dbf";
   set newname for datafile  18 to
 "/VIS1/visdata/queues1.dbf";
   set newname for datafile  19 to
 "/VIS1/visdata/queues2.dbf";
   set newname for datafile  20 to
 "/VIS1/visdata/reference1.dbf";
   set newname for datafile  21 to
 "/VIS1/visdata/reference2.dbf";
   set newname for datafile  22 to
 "/VIS1/visdata/summary1.dbf";
   set newname for datafile  23 to
 "/VIS1/visdata/summary2.dbf";
   set newname for datafile  24 to
 "/VIS1/visdata/summary3.dbf";
   set newname for datafile  25 to
 "/VIS1/visdata/summary4.dbf";
   set newname for datafile  26 to
 "/VIS1/visdata/summary5.dbf";
   set newname for datafile  27 to
 "/VIS1/visdata/tx_data1.dbf";
   set newname for datafile  28 to
 "/VIS1/visdata/tx_data2.dbf";
   set newname for datafile  29 to
 "/VIS1/visdata/tx_data3.dbf";
   set newname for datafile  30 to
 "/VIS1/visdata/tx_data4.dbf";
   set newname for datafile  31 to
 "/VIS1/visdata/tx_data5.dbf";
   set newname for datafile  32 to
 "/VIS1/visdata/tx_data6.dbf";
   set newname for datafile  33 to
 "/VIS1/visdata/tx_data7.dbf";
   set newname for datafile  34 to
 "/VIS1/visdata/tx_data8.dbf";
   set newname for datafile  35 to
 "/VIS1/visdata/tx_data9.dbf";
   set newname for datafile  36 to
 "/VIS1/visdata/tx_data10.dbf";
   set newname for datafile  37 to
 "/VIS1/visdata/tx_data11.dbf";
   set newname for datafile  38 to
 "/VIS1/visdata/tx_idx1.dbf";
   set newname for datafile  39 to
 "/VIS1/visdata/tx_idx2.dbf";
   set newname for datafile  40 to
 "/VIS1/visdata/tx_idx3.dbf";
   set newname for datafile  41 to
 "/VIS1/visdata/tx_idx4.dbf";
   set newname for datafile  42 to
 "/VIS1/visdata/tx_idx5.dbf";
   set newname for datafile  43 to
 "/VIS1/visdata/tx_idx6.dbf";
   set newname for datafile  44 to
 "/VIS1/visdata/tx_idx7.dbf";
   set newname for datafile  45 to
 "/VIS1/visdata/tx_idx8.dbf";
   set newname for datafile  46 to
 "/VIS1/visdata/tx_idx9.dbf";
   set newname for datafile  47 to
 "/VIS1/visdata/tx_idx10.dbf";
   set newname for datafile  48 to
 "/VIS1/visdata/tx_idx11.dbf";
   set newname for datafile  49 to
 "/VIS1/visdata/apps_ts_tx_interface.dbf";
   set newname for datafile  50 to
 "/VIS1/visdata/ctx1.dbf";
   set newname for datafile  51 to
 "/VIS1/visdata/sysaux01.dbf";
   set newname for datafile  52 to
 "/VIS1/visdata/aadev.dbf";
   set newname for datafile  53 to
 "/VIS1/visdata/odm.dbf";
   set newname for datafile  55 to
 "/VIS1/visdata/olap.dbf";
   set newname for datafile  56 to
 "/VIS1/visdata/owa1.dbf";
   set newname for datafile  57 to
 "/VIS1/visdata/portal.dbf";
   set newname for datafile  58 to
 "/VIS1/visdata/mobile01.dbf";
   restore
   clone database
   ;
}
executing Memory Script

executing command: SET until clause

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 04-DEC-13
using channel ORA_AUX_DISK_1

channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00001 to /VIS1/visdata/sys1.dbf
channel ORA_AUX_DISK_1: restoring datafile 00002 to /VIS1/visdata/sys2.dbf
channel ORA_AUX_DISK_1: restoring datafile 00005 to /VIS1/visdata/sys5.dbf
channel ORA_AUX_DISK_1: restoring datafile 00007 to /VIS1/visdata/sys7.dbf
channel ORA_AUX_DISK_1: restoring datafile 00010 to /VIS1/visdata/undo03.dbf
channel ORA_AUX_DISK_1: restoring datafile 00014 to /VIS1/visdata/media1.dbf
channel ORA_AUX_DISK_1: restoring datafile 00018 to /VIS1/visdata/queues1.dbf
channel ORA_AUX_DISK_1: restoring datafile 00023 to /VIS1/visdata/summary2.dbf
channel ORA_AUX_DISK_1: restoring datafile 00027 to /VIS1/visdata/tx_data1.dbf
channel ORA_AUX_DISK_1: restoring datafile 00033 to /VIS1/visdata/tx_data7.dbf
channel ORA_AUX_DISK_1: restoring datafile 00036 to /VIS1/visdata/tx_data10.dbf
channel ORA_AUX_DISK_1: restoring datafile 00038 to /VIS1/visdata/tx_idx1.dbf
channel ORA_AUX_DISK_1: restoring datafile 00039 to /VIS1/visdata/tx_idx2.dbf
channel ORA_AUX_DISK_1: restoring datafile 00042 to /VIS1/visdata/tx_idx5.dbf
channel ORA_AUX_DISK_1: restoring datafile 00044 to /VIS1/visdata/tx_idx7.dbf
channel ORA_AUX_DISK_1: restoring datafile 00045 to /VIS1/visdata/tx_idx8.dbf
channel ORA_AUX_DISK_1: restoring datafile 00051 to /VIS1/visdata/sysaux01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00056 to /VIS1/visdata/owa1.dbf
channel ORA_AUX_DISK_1: restoring datafile 00057 to /VIS1/visdata/portal.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u03/Backup_new/06oqiltp_1_1.bkp

channel ORA_AUX_DISK_1: piece handle=/u03/Backup_new/06oqiltp_1_1.bkp tag=TAG20131203T072024
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 01:10:19
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00003 to /VIS1/visdata/sys3.dbf
channel ORA_AUX_DISK_1: restoring datafile 00006 to /VIS1/visdata/sys6.dbf
channel ORA_AUX_DISK_1: restoring datafile 00008 to /VIS1/visdata/undo01.dbf
channel ORA_AUX_DISK_1: restoring datafile 00011 to /VIS1/visdata/undo04.dbf
channel ORA_AUX_DISK_1: restoring datafile 00015 to /VIS1/visdata/media2.dbf
channel ORA_AUX_DISK_1: restoring datafile 00017 to /VIS1/visdata/nologging1.dbf
channel ORA_AUX_DISK_1: restoring datafile 00019 to /VIS1/visdata/queues2.dbf
channel ORA_AUX_DISK_1: restoring datafile 00020 to /VIS1/visdata/reference1.dbf
channel ORA_AUX_DISK_1: restoring datafile 00026 to /VIS1/visdata/summary5.dbf
channel ORA_AUX_DISK_1: restoring datafile 00028 to /VIS1/visdata/tx_data2.dbf
channel ORA_AUX_DISK_1: restoring datafile 00030 to /VIS1/visdata/tx_data4.dbf
channel ORA_AUX_DISK_1: restoring datafile 00032 to /VIS1/visdata/tx_data6.dbf
channel ORA_AUX_DISK_1: restoring datafile 00034 to /VIS1/visdata/tx_data8.dbf
channel ORA_AUX_DISK_1: restoring datafile 00037 to /VIS1/visdata/tx_data11.dbf
channel ORA_AUX_DISK_1: restoring datafile 00040 to /VIS1/visdata/tx_idx3.dbf
channel ORA_AUX_DISK_1: restoring datafile 00043 to /VIS1/visdata/tx_idx6.dbf
channel ORA_AUX_DISK_1: restoring datafile 00047 to /VIS1/visdata/tx_idx10.dbf
channel ORA_AUX_DISK_1: restoring datafile 00052 to /VIS1/visdata/aadev.dbf
channel ORA_AUX_DISK_1: restoring datafile 00055 to /VIS1/visdata/olap.dbf
channel ORA_AUX_DISK_1: restoring datafile 00058 to /VIS1/visdata/mobile01.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u03/Backup_new/08oqiltp_1_1.bkp
channel ORA_AUX_DISK_1: piece handle=/u03/Backup_new/08oqiltp_1_1.bkp tag=TAG20131203T072024
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 01:18:37
channel ORA_AUX_DISK_1: starting datafile backup set restore
channel ORA_AUX_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_AUX_DISK_1: restoring datafile 00004 to /VIS1/visdata/sys4.dbf
channel ORA_AUX_DISK_1: restoring datafile 00009 to /VIS1/visdata/undo02.dbf
channel ORA_AUX_DISK_1: restoring datafile 00012 to /VIS1/visdata/archive1.dbf
channel ORA_AUX_DISK_1: restoring datafile 00013 to /VIS1/visdata/archive2.dbf
channel ORA_AUX_DISK_1: restoring datafile 00016 to /VIS1/visdata/media3.dbf
channel ORA_AUX_DISK_1: restoring datafile 00021 to /VIS1/visdata/reference2.dbf
channel ORA_AUX_DISK_1: restoring datafile 00022 to /VIS1/visdata/summary1.dbf
channel ORA_AUX_DISK_1: restoring datafile 00024 to /VIS1/visdata/summary3.dbf
channel ORA_AUX_DISK_1: restoring datafile 00025 to /VIS1/visdata/summary4.dbf
channel ORA_AUX_DISK_1: restoring datafile 00029 to /VIS1/visdata/tx_data3.dbf
channel ORA_AUX_DISK_1: restoring datafile 00031 to /VIS1/visdata/tx_data5.dbf
channel ORA_AUX_DISK_1: restoring datafile 00035 to /VIS1/visdata/tx_data9.dbf
channel ORA_AUX_DISK_1: restoring datafile 00041 to /VIS1/visdata/tx_idx4.dbf
channel ORA_AUX_DISK_1: restoring datafile 00046 to /VIS1/visdata/tx_idx9.dbf
channel ORA_AUX_DISK_1: restoring datafile 00048 to /VIS1/visdata/tx_idx11.dbf
channel ORA_AUX_DISK_1: restoring datafile 00049 to /VIS1/visdata/apps_ts_tx_interface.dbf
channel ORA_AUX_DISK_1: restoring datafile 00050 to /VIS1/visdata/ctx1.dbf
channel ORA_AUX_DISK_1: restoring datafile 00053 to /VIS1/visdata/odm.dbf
channel ORA_AUX_DISK_1: reading from backup piece /u03/Backup_new/07oqiltp_1_1.bkp
channel ORA_AUX_DISK_1: piece handle=/u03/Backup_new/07oqiltp_1_1.bkp tag=TAG20131203T072024
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 01:28:19
Finished restore at 04-DEC-13

contents of Memory Script:
{
   switch clone datafile all;
}
executing Memory Script

datafile 1 switched to datafile copy
input datafile copy RECID=58 STAMP=833274832 file name=/VIS1/visdata/sys1.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=59 STAMP=833274832 file name=/VIS1/visdata/sys2.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=60 STAMP=833274832 file name=/VIS1/visdata/sys3.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=61 STAMP=833274833 file name=/VIS1/visdata/sys4.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=62 STAMP=833274833 file name=/VIS1/visdata/sys5.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=63 STAMP=833274833 file name=/VIS1/visdata/sys6.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=64 STAMP=833274833 file name=/VIS1/visdata/sys7.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=65 STAMP=833274833 file name=/VIS1/visdata/undo01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=66 STAMP=833274833 file name=/VIS1/visdata/undo02.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=67 STAMP=833274833 file name=/VIS1/visdata/undo03.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=68 STAMP=833274833 file name=/VIS1/visdata/undo04.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=69 STAMP=833274833 file name=/VIS1/visdata/archive1.dbf
datafile 13 switched to datafile copy
input datafile copy RECID=70 STAMP=833274833 file name=/VIS1/visdata/archive2.dbf
datafile 14 switched to datafile copy
input datafile copy RECID=71 STAMP=833274833 file name=/VIS1/visdata/media1.dbf
datafile 15 switched to datafile copy
input datafile copy RECID=72 STAMP=833274833 file name=/VIS1/visdata/media2.dbf
datafile 16 switched to datafile copy
input datafile copy RECID=73 STAMP=833274833 file name=/VIS1/visdata/media3.dbf
datafile 17 switched to datafile copy
input datafile copy RECID=74 STAMP=833274833 file name=/VIS1/visdata/nologging1.dbf
datafile 18 switched to datafile copy
input datafile copy RECID=75 STAMP=833274833 file name=/VIS1/visdata/queues1.dbf
datafile 19 switched to datafile copy
input datafile copy RECID=76 STAMP=833274833 file name=/VIS1/visdata/queues2.dbf
datafile 20 switched to datafile copy
input datafile copy RECID=77 STAMP=833274833 file name=/VIS1/visdata/reference1.dbf
datafile 21 switched to datafile copy
input datafile copy RECID=78 STAMP=833274833 file name=/VIS1/visdata/reference2.dbf
datafile 22 switched to datafile copy
input datafile copy RECID=79 STAMP=833274833 file name=/VIS1/visdata/summary1.dbf
datafile 23 switched to datafile copy
input datafile copy RECID=80 STAMP=833274833 file name=/VIS1/visdata/summary2.dbf
datafile 24 switched to datafile copy
input datafile copy RECID=81 STAMP=833274833 file name=/VIS1/visdata/summary3.dbf
datafile 25 switched to datafile copy
input datafile copy RECID=82 STAMP=833274834 file name=/VIS1/visdata/summary4.dbf
datafile 26 switched to datafile copy
input datafile copy RECID=83 STAMP=833274834 file name=/VIS1/visdata/summary5.dbf
datafile 27 switched to datafile copy
input datafile copy RECID=84 STAMP=833274834 file name=/VIS1/visdata/tx_data1.dbf
datafile 28 switched to datafile copy
input datafile copy RECID=85 STAMP=833274834 file name=/VIS1/visdata/tx_data2.dbf
datafile 29 switched to datafile copy
input datafile copy RECID=86 STAMP=833274834 file name=/VIS1/visdata/tx_data3.dbf
datafile 30 switched to datafile copy
input datafile copy RECID=87 STAMP=833274834 file name=/VIS1/visdata/tx_data4.dbf
datafile 31 switched to datafile copy
input datafile copy RECID=88 STAMP=833274834 file name=/VIS1/visdata/tx_data5.dbf
datafile 32 switched to datafile copy
input datafile copy RECID=89 STAMP=833274834 file name=/VIS1/visdata/tx_data6.dbf
datafile 33 switched to datafile copy
input datafile copy RECID=90 STAMP=833274834 file name=/VIS1/visdata/tx_data7.dbf
datafile 34 switched to datafile copy
input datafile copy RECID=91 STAMP=833274834 file name=/VIS1/visdata/tx_data8.dbf
datafile 35 switched to datafile copy
input datafile copy RECID=92 STAMP=833274834 file name=/VIS1/visdata/tx_data9.dbf
datafile 36 switched to datafile copy
input datafile copy RECID=93 STAMP=833274834 file name=/VIS1/visdata/tx_data10.dbf
datafile 37 switched to datafile copy
input datafile copy RECID=94 STAMP=833274834 file name=/VIS1/visdata/tx_data11.dbf
datafile 38 switched to datafile copy
input datafile copy RECID=95 STAMP=833274834 file name=/VIS1/visdata/tx_idx1.dbf
datafile 39 switched to datafile copy
input datafile copy RECID=96 STAMP=833274834 file name=/VIS1/visdata/tx_idx2.dbf
datafile 40 switched to datafile copy
input datafile copy RECID=97 STAMP=833274834 file name=/VIS1/visdata/tx_idx3.dbf
datafile 41 switched to datafile copy
input datafile copy RECID=98 STAMP=833274834 file name=/VIS1/visdata/tx_idx4.dbf
datafile 42 switched to datafile copy
input datafile copy RECID=99 STAMP=833274834 file name=/VIS1/visdata/tx_idx5.dbf
datafile 43 switched to datafile copy
input datafile copy RECID=100 STAMP=833274834 file name=/VIS1/visdata/tx_idx6.dbf
datafile 44 switched to datafile copy
input datafile copy RECID=101 STAMP=833274834 file name=/VIS1/visdata/tx_idx7.dbf
datafile 45 switched to datafile copy
input datafile copy RECID=102 STAMP=833274834 file name=/VIS1/visdata/tx_idx8.dbf
datafile 46 switched to datafile copy
input datafile copy RECID=103 STAMP=833274835 file name=/VIS1/visdata/tx_idx9.dbf
datafile 47 switched to datafile copy
input datafile copy RECID=104 STAMP=833274835 file name=/VIS1/visdata/tx_idx10.dbf
datafile 48 switched to datafile copy
input datafile copy RECID=105 STAMP=833274835 file name=/VIS1/visdata/tx_idx11.dbf
datafile 49 switched to datafile copy
input datafile copy RECID=106 STAMP=833274835 file name=/VIS1/visdata/apps_ts_tx_interface.dbf
datafile 50 switched to datafile copy
input datafile copy RECID=107 STAMP=833274835 file name=/VIS1/visdata/ctx1.dbf
datafile 51 switched to datafile copy
input datafile copy RECID=108 STAMP=833274835 file name=/VIS1/visdata/sysaux01.dbf
datafile 52 switched to datafile copy
input datafile copy RECID=109 STAMP=833274835 file name=/VIS1/visdata/aadev.dbf
datafile 53 switched to datafile copy
input datafile copy RECID=110 STAMP=833274835 file name=/VIS1/visdata/odm.dbf
datafile 55 switched to datafile copy
input datafile copy RECID=111 STAMP=833274835 file name=/VIS1/visdata/olap.dbf
datafile 56 switched to datafile copy
input datafile copy RECID=112 STAMP=833274835 file name=/VIS1/visdata/owa1.dbf
datafile 57 switched to datafile copy
input datafile copy RECID=113 STAMP=833274835 file name=/VIS1/visdata/portal.dbf
datafile 58 switched to datafile copy
input datafile copy RECID=114 STAMP=833274835 file name=/VIS1/visdata/mobile01.dbf

contents of Memory Script:
{
   set until scn  8173891933524;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script

executing command: SET until clause

Starting recover at 04-DEC-13
using channel ORA_AUX_DISK_1

starting media recovery

channel ORA_AUX_DISK_1: starting archived log restore to default destination
channel ORA_AUX_DISK_1: restoring archived log
archived log thread=1 sequence=949
channel ORA_AUX_DISK_1: reading from backup piece /u03/Backup_new/09oqir1k_1_1.bkp
channel ORA_AUX_DISK_1: piece handle=/u03/Backup_new/09oqir1k_1_1.bkp tag=TAG20131203T084748
channel ORA_AUX_DISK_1: restored backup piece 1
channel ORA_AUX_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/VIS1/visdb/11.2.0.3/dbs/arch1_949_831836307.dbf thread=1 sequence=949
channel clone_default: deleting archived log(s)
archived log file name=/VIS1/visdb/11.2.0.3/dbs/arch1_949_831836307.dbf RECID=1 STAMP=833274841
media recovery complete, elapsed time: 00:00:06
Finished recover at 04-DEC-13
Oracle instance started

Total System Global Area     640323584 bytes

Fixed Size                     1346728 bytes
Variable Size                461374296 bytes
Database Buffers             163577856 bytes
Redo Buffers                  14024704 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''VIS1'' comment=
 ''Reset to original value by RMAN'' scope=spfile";
   sql clone "alter system reset  db_unique_name scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''VIS1'' comment= ''Reset to original value by RMAN'' scope=spfile

sql statement: alter system reset  db_unique_name scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     640323584 bytes

Fixed Size                     1346728 bytes
Variable Size                461374296 bytes
Database Buffers             163577856 bytes
Redo Buffers                  14024704 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "VIS1" RESETLOGS ARCHIVELOG
  MAXLOGFILES     32
  MAXLOGMEMBERS      5
  MAXDATAFILES      512
  MAXINSTANCES     8
  MAXLOGHISTORY     3630
 LOGFILE
  GROUP   1 ( '/VIS1/visdata/log3.dbf' ) SIZE 50 M  REUSE,
  GROUP   2 ( '/VIS1/visdata/log2.dbf' ) SIZE 50 M  REUSE,
  GROUP   3 ( '/VIS1/visdata/log1.dbf' ) SIZE 50 M  REUSE
 DATAFILE
  '/VIS1/visdata/sys1.dbf'
 CHARACTER SET UTF8


contents of Memory Script:
{
   set newname for tempfile  1 to
 "/VIS1/visdata/tmp1.dbf";
   switch clone tempfile all;
   catalog clone datafilecopy  "/VIS1/visdata/sys2.dbf",
 "/VIS1/visdata/sys3.dbf",
 "/VIS1/visdata/sys4.dbf",
 "/VIS1/visdata/sys5.dbf",
 "/VIS1/visdata/sys6.dbf",
 "/VIS1/visdata/sys7.dbf",
 "/VIS1/visdata/undo01.dbf",
 "/VIS1/visdata/undo02.dbf",
 "/VIS1/visdata/undo03.dbf",
 "/VIS1/visdata/undo04.dbf",
 "/VIS1/visdata/archive1.dbf",
 "/VIS1/visdata/archive2.dbf",
 "/VIS1/visdata/media1.dbf",
 "/VIS1/visdata/media2.dbf",
 "/VIS1/visdata/media3.dbf",
 "/VIS1/visdata/nologging1.dbf",
 "/VIS1/visdata/queues1.dbf",
 "/VIS1/visdata/queues2.dbf",
 "/VIS1/visdata/reference1.dbf",
 "/VIS1/visdata/reference2.dbf",
 "/VIS1/visdata/summary1.dbf",
 "/VIS1/visdata/summary2.dbf",
 "/VIS1/visdata/summary3.dbf",
 "/VIS1/visdata/summary4.dbf",
 "/VIS1/visdata/summary5.dbf",
 "/VIS1/visdata/tx_data1.dbf",
 "/VIS1/visdata/tx_data2.dbf",
 "/VIS1/visdata/tx_data3.dbf",
 "/VIS1/visdata/tx_data4.dbf",
 "/VIS1/visdata/tx_data5.dbf",
 "/VIS1/visdata/tx_data6.dbf",
 "/VIS1/visdata/tx_data7.dbf",
 "/VIS1/visdata/tx_data8.dbf",
 "/VIS1/visdata/tx_data9.dbf",
 "/VIS1/visdata/tx_data10.dbf",
 "/VIS1/visdata/tx_data11.dbf",
 "/VIS1/visdata/tx_idx1.dbf",
 "/VIS1/visdata/tx_idx2.dbf",
 "/VIS1/visdata/tx_idx3.dbf",
 "/VIS1/visdata/tx_idx4.dbf",
 "/VIS1/visdata/tx_idx5.dbf",
 "/VIS1/visdata/tx_idx6.dbf",
 "/VIS1/visdata/tx_idx7.dbf",
 "/VIS1/visdata/tx_idx8.dbf",
 "/VIS1/visdata/tx_idx9.dbf",
 "/VIS1/visdata/tx_idx10.dbf",
 "/VIS1/visdata/tx_idx11.dbf",
 "/VIS1/visdata/apps_ts_tx_interface.dbf",
 "/VIS1/visdata/ctx1.dbf",
 "/VIS1/visdata/sysaux01.dbf",
 "/VIS1/visdata/aadev.dbf",
 "/VIS1/visdata/odm.dbf",
 "/VIS1/visdata/olap.dbf",
 "/VIS1/visdata/owa1.dbf",
 "/VIS1/visdata/portal.dbf",
 "/VIS1/visdata/mobile01.dbf";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to /VIS1/visdata/tmp1.dbf in control file

cataloged datafile copy
datafile copy file name=/VIS1/visdata/sys2.dbf RECID=1 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/sys3.dbf RECID=2 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/sys4.dbf RECID=3 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/sys5.dbf RECID=4 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/sys6.dbf RECID=5 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/sys7.dbf RECID=6 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/undo01.dbf RECID=7 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/undo02.dbf RECID=8 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/undo03.dbf RECID=9 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/undo04.dbf RECID=10 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/archive1.dbf RECID=11 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/archive2.dbf RECID=12 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/media1.dbf RECID=13 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/media2.dbf RECID=14 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/media3.dbf RECID=15 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/nologging1.dbf RECID=16 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/queues1.dbf RECID=17 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/queues2.dbf RECID=18 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/reference1.dbf RECID=19 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/reference2.dbf RECID=20 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/summary1.dbf RECID=21 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/summary2.dbf RECID=22 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/summary3.dbf RECID=23 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/summary4.dbf RECID=24 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/summary5.dbf RECID=25 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/tx_data1.dbf RECID=26 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/tx_data2.dbf RECID=27 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/tx_data3.dbf RECID=28 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/tx_data4.dbf RECID=29 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/tx_data5.dbf RECID=30 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/tx_data6.dbf RECID=31 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/tx_data7.dbf RECID=32 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/tx_data8.dbf RECID=33 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/tx_data9.dbf RECID=34 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/tx_data10.dbf RECID=35 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/tx_data11.dbf RECID=36 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/tx_idx1.dbf RECID=37 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/tx_idx2.dbf RECID=38 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/tx_idx3.dbf RECID=39 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/tx_idx4.dbf RECID=40 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/tx_idx5.dbf RECID=41 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/tx_idx6.dbf RECID=42 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/tx_idx7.dbf RECID=43 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/tx_idx8.dbf RECID=44 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/tx_idx9.dbf RECID=45 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/tx_idx10.dbf RECID=46 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/tx_idx11.dbf RECID=47 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/apps_ts_tx_interface.dbf RECID=48 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/ctx1.dbf RECID=49 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/sysaux01.dbf RECID=50 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/aadev.dbf RECID=51 STAMP=833274869
cataloged datafile copy
datafile copy file name=/VIS1/visdata/odm.dbf RECID=52 STAMP=833274870
cataloged datafile copy
datafile copy file name=/VIS1/visdata/olap.dbf RECID=53 STAMP=833274870
cataloged datafile copy
datafile copy file name=/VIS1/visdata/owa1.dbf RECID=54 STAMP=833274870
cataloged datafile copy
datafile copy file name=/VIS1/visdata/portal.dbf RECID=55 STAMP=833274870
cataloged datafile copy
datafile copy file name=/VIS1/visdata/mobile01.dbf RECID=56 STAMP=833274870
datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=833274869 file name=/VIS1/visdata/sys2.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=833274869 file name=/VIS1/visdata/sys3.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=833274869 file name=/VIS1/visdata/sys4.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=833274869 file name=/VIS1/visdata/sys5.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=5 STAMP=833274869 file name=/VIS1/visdata/sys6.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=6 STAMP=833274869 file name=/VIS1/visdata/sys7.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=7 STAMP=833274869 file name=/VIS1/visdata/undo01.dbf
datafile 9 switched to datafile copy
input datafile copy RECID=8 STAMP=833274869 file name=/VIS1/visdata/undo02.dbf
datafile 10 switched to datafile copy
input datafile copy RECID=9 STAMP=833274869 file name=/VIS1/visdata/undo03.dbf
datafile 11 switched to datafile copy
input datafile copy RECID=10 STAMP=833274869 file name=/VIS1/visdata/undo04.dbf
datafile 12 switched to datafile copy
input datafile copy RECID=11 STAMP=833274869 file name=/VIS1/visdata/archive1.dbf
datafile 13 switched to datafile copy
input datafile copy RECID=12 STAMP=833274869 file name=/VIS1/visdata/archive2.dbf
datafile 14 switched to datafile copy
input datafile copy RECID=13 STAMP=833274869 file name=/VIS1/visdata/media1.dbf
datafile 15 switched to datafile copy
input datafile copy RECID=14 STAMP=833274869 file name=/VIS1/visdata/media2.dbf
datafile 16 switched to datafile copy
input datafile copy RECID=15 STAMP=833274869 file name=/VIS1/visdata/media3.dbf
datafile 17 switched to datafile copy
input datafile copy RECID=16 STAMP=833274869 file name=/VIS1/visdata/nologging1.dbf
datafile 18 switched to datafile copy
input datafile copy RECID=17 STAMP=833274869 file name=/VIS1/visdata/queues1.dbf
datafile 19 switched to datafile copy
input datafile copy RECID=18 STAMP=833274869 file name=/VIS1/visdata/queues2.dbf
datafile 20 switched to datafile copy
input datafile copy RECID=19 STAMP=833274869 file name=/VIS1/visdata/reference1.dbf
datafile 21 switched to datafile copy
input datafile copy RECID=20 STAMP=833274869 file name=/VIS1/visdata/reference2.dbf
datafile 22 switched to datafile copy
input datafile copy RECID=21 STAMP=833274869 file name=/VIS1/visdata/summary1.dbf
datafile 23 switched to datafile copy
input datafile copy RECID=22 STAMP=833274869 file name=/VIS1/visdata/summary2.dbf
datafile 24 switched to datafile copy
input datafile copy RECID=23 STAMP=833274869 file name=/VIS1/visdata/summary3.dbf
datafile 25 switched to datafile copy
input datafile copy RECID=24 STAMP=833274869 file name=/VIS1/visdata/summary4.dbf
datafile 26 switched to datafile copy
input datafile copy RECID=25 STAMP=833274869 file name=/VIS1/visdata/summary5.dbf
datafile 27 switched to datafile copy
input datafile copy RECID=26 STAMP=833274869 file name=/VIS1/visdata/tx_data1.dbf
datafile 28 switched to datafile copy
input datafile copy RECID=27 STAMP=833274869 file name=/VIS1/visdata/tx_data2.dbf
datafile 29 switched to datafile copy
input datafile copy RECID=28 STAMP=833274869 file name=/VIS1/visdata/tx_data3.dbf
datafile 30 switched to datafile copy
input datafile copy RECID=29 STAMP=833274869 file name=/VIS1/visdata/tx_data4.dbf
datafile 31 switched to datafile copy
input datafile copy RECID=30 STAMP=833274869 file name=/VIS1/visdata/tx_data5.dbf
datafile 32 switched to datafile copy
input datafile copy RECID=31 STAMP=833274869 file name=/VIS1/visdata/tx_data6.dbf
datafile 33 switched to datafile copy
input datafile copy RECID=32 STAMP=833274869 file name=/VIS1/visdata/tx_data7.dbf
datafile 34 switched to datafile copy
input datafile copy RECID=33 STAMP=833274869 file name=/VIS1/visdata/tx_data8.dbf
datafile 35 switched to datafile copy
input datafile copy RECID=34 STAMP=833274869 file name=/VIS1/visdata/tx_data9.dbf
datafile 36 switched to datafile copy
input datafile copy RECID=35 STAMP=833274869 file name=/VIS1/visdata/tx_data10.dbf
datafile 37 switched to datafile copy
input datafile copy RECID=36 STAMP=833274869 file name=/VIS1/visdata/tx_data11.dbf
datafile 38 switched to datafile copy
input datafile copy RECID=37 STAMP=833274869 file name=/VIS1/visdata/tx_idx1.dbf
datafile 39 switched to datafile copy
input datafile copy RECID=38 STAMP=833274869 file name=/VIS1/visdata/tx_idx2.dbf
datafile 40 switched to datafile copy
input datafile copy RECID=39 STAMP=833274869 file name=/VIS1/visdata/tx_idx3.dbf
datafile 41 switched to datafile copy
input datafile copy RECID=40 STAMP=833274869 file name=/VIS1/visdata/tx_idx4.dbf
datafile 42 switched to datafile copy
input datafile copy RECID=41 STAMP=833274869 file name=/VIS1/visdata/tx_idx5.dbf
datafile 43 switched to datafile copy
input datafile copy RECID=42 STAMP=833274869 file name=/VIS1/visdata/tx_idx6.dbf
datafile 44 switched to datafile copy
input datafile copy RECID=43 STAMP=833274869 file name=/VIS1/visdata/tx_idx7.dbf
datafile 45 switched to datafile copy
input datafile copy RECID=44 STAMP=833274869 file name=/VIS1/visdata/tx_idx8.dbf
datafile 46 switched to datafile copy
input datafile copy RECID=45 STAMP=833274869 file name=/VIS1/visdata/tx_idx9.dbf
datafile 47 switched to datafile copy
input datafile copy RECID=46 STAMP=833274869 file name=/VIS1/visdata/tx_idx10.dbf
datafile 48 switched to datafile copy
input datafile copy RECID=47 STAMP=833274869 file name=/VIS1/visdata/tx_idx11.dbf
datafile 49 switched to datafile copy
input datafile copy RECID=48 STAMP=833274869 file name=/VIS1/visdata/apps_ts_tx_interface.dbf
datafile 50 switched to datafile copy
input datafile copy RECID=49 STAMP=833274869 file name=/VIS1/visdata/ctx1.dbf
datafile 51 switched to datafile copy
input datafile copy RECID=50 STAMP=833274869 file name=/VIS1/visdata/sysaux01.dbf
datafile 52 switched to datafile copy
input datafile copy RECID=51 STAMP=833274869 file name=/VIS1/visdata/aadev.dbf
datafile 53 switched to datafile copy
input datafile copy RECID=52 STAMP=833274870 file name=/VIS1/visdata/odm.dbf
datafile 55 switched to datafile copy
input datafile copy RECID=53 STAMP=833274870 file name=/VIS1/visdata/olap.dbf
datafile 56 switched to datafile copy
input datafile copy RECID=54 STAMP=833274870 file name=/VIS1/visdata/owa1.dbf
datafile 57 switched to datafile copy
input datafile copy RECID=55 STAMP=833274870 file name=/VIS1/visdata/portal.dbf
datafile 58 switched to datafile copy
input datafile copy RECID=56 STAMP=833274870 file name=/VIS1/visdata/mobile01.dbf

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script

database opened
Finished Duplicate Db at 04-DEC-13

RMAN>
RMAN>


Your clone Instance is ready.


SQL> select INSTANCE_NAME, STATUS from V$INSTANCE;

INSTANCE_NAME   STATUS 
-------------  ------ 
VIS1            OPEN  


What Happens During DB Creation.

$
0
0


Starting Oracle Instance by exporting  ORACLE_HOME and INITIAL parameters

Starting Sequence of Back Ground Process


PMON background process Started
PSP0 background process started
VKTM background process started
GEN0 background process started
DIAG background process started
DBRM background process started
DIA0 background process started
MMAN background process started
DBW0 background process started
LGWR background process started
CKPT background process started
SMON background process started
RECO background process started
MMON background process started
MMNL background process started

Starting 1 Dispatcherfor Network Address '(ADDRESS=(PARTIAL=YES)(PROTOCOL=TCP))'
Starting 1 SharedServer

Creation of Control File


Starting ASMB background process
Starting RBAL background process
Starting MARK background process
MARK load ASM lib and mount the diskgroups

Database mounted in Exclusive mode

Lost write protection disabled

Successful MOUNT


onlinelog1- created and open

SMON enables cache recovery

SYSTEM– created and set to default
SYSAUX - created and set to default
UNDO - created and set to default
TEMP - created and set to default

SMON enabling Txion Recovery
SMCO started
QMNC started

Create Database completed


USERS– Created and set to default

onlinelog2- created and open
onlinelog3- created and open


Set db_securefile = ‘PERMITTED’  à LOBs are allowed to be created as SecureFiles.

Shutting down instance (immediate)
Stopping background process SMCO
Shutting down instance: further logons disabled
Stopping background process CJQ0
Stopping background process QMNC
Stopping background process MMNL
Stopping background process MMON

All dispatchers and shared servers shutdown

ALTER DATABASE CLOSE NORMAL

SMON: disabling tx recovery
SMON: disabling cache recovery
Shutting down archive processes
Archiving is disabled
Archive process shutdown avoided: 0 active
Deferred communication with ASM instance
Completed: ALTER DATABASE CLOSE NORMAL

ALTER DATABASE DISMOUNT

Shutting down archive processes
ARCH: Archival disabled due to shutdown: 1089
Stopping background process VKTM
Shutting down MARK background process
Instance shutdown complete

Oracle will start the instance and open the database.

SQL>

Total 7 log switches are happening during Database creation


To Check the Background process from Data Dictionary View.

select NAME, DESCRIPTION
  fromV$BGPROCESS
 wherePADDR<> '00'order by 1;

NAME  DESCRIPTION
----- -----------------------------------
ASMB  ASM Background
CJQ0  Job Queue Coordinator
CKPT  checkpoint
DBRM  DataBase Resource Manager
DBW0  db writer process 0
DIA0  diagnosibility process 0
DIAG  diagnosibility process
GEN0  generic0
LGWR  Redo etc.
MARK  mark AU for resync coordinator
MMAN  Memory Manager
MMNL  Manageability Monitor Process 2
MMON  Manageability Monitor Process
PMON  process cleanup
PSP0  process spawner 0
QMNC  AQ Coordinator
RBAL  ASM Rebalance master
RECO  distributed recovery
SMCO  Space Manager Process
SMON  System Monitor Process
VKTM  Virtual Keeper of TiMe process

Optimize Oracle UNDO Parameters

$
0
0

Optimize Oracle UNDO Parameters



Overview 

Starting in Oracle9i, rollback segments are re-named undo logs. Traditionally transaction undo information was stored in Rollback Segments until a commit or rollback statement was issued, at which point it was made available for overlaying. 

Best of all, automatic undo management allows the DBA to specify how long undo information should be retained after commit, preventing "snapshot too old" errors on long running queries.
This is done by setting the UNDO_RETENTION parameter.  The default is 900 seconds (5 minutes), and you can set this parameter to guarantee that Oracle keeps undo logs for extended periods of time.
Rather than having to define and manage rollback segments, you can simply define an Undo tablespace and let Oracle take care of the rest. Turning on automatic undo management is easy.  All you need to do is create an undo tablespace and set UNDO_MANAGEMENT = AUTO.
However it is worth to tune the following important parameters
1.      The size of the UNDO tablespace
2.      The UNDO_RETENTION parameter 

Calculate UNDO_RETENTION  for given UNDO Tabespace
You can choose to allocate a specific size for the UNDO tablespace and then set the UNDO_RETENTION parameter to an optimal value according to the UNDO size and the database activity. If your disk space is limited and you do not want to allocate more space than necessary to the UNDO tablespace, this is the way to proceed. The following query will help you to optimize the UNDO_RETENTION parameter:

http://www.akadia.com/img/optimal_undo_retention.gif
 Because these following queries use the V$UNDOSTAT statistics, run the queries only after the database has been running with UNDO for a significant and representative time!
Actual Undo Size
 
SELECT SUM(a.bytes) "UNDO_SIZE"
  FROM v$datafile a,
       v$tablespace b,
       dba_tablespaces c
 WHERE c.contents = 'UNDO'
   AND c.status = 'ONLINE'
   AND b.name = c.tablespace_name
   AND a.ts# = b.ts#;
UNDO_SIZE
----------
  209715200

Undo Blocks per Second

SELECT MAX(undoblks/((end_time-begin_time)*3600*24))
    
 "UNDO_BLOCK_PER_SEC"
  FROM v$undostat;
UNDO_BLOCK_PER_SEC
------------------
        3.12166667
 
DB Block Size 

SELECT TO_NUMBER(value) "DB_BLOCK_SIZE [KByte]"
 FROM v$parameter
WHERE name = 'db_block_size';
DB_BLOCK_SIZE [Byte]
--------------------
                4096

Optimal Undo Retention

209'715'200 / (3.12166667 * 4'096) = 16'401 [Sec]

Using Inline Views, you can do all in one query!

SELECT d.undo_size/(1024*1024) "ACTUAL UNDO SIZE [MByte]",
       SUBSTR(e.value,1,25) "UNDO RETENTION [Sec]",
       ROUND((d.undo_size / (to_number(f.value) *
      g.undo_block_per_sec))) "OPTIMAL UNDO RETENTION [Sec]"
  FROM (
       SELECT SUM(a.bytes) undo_size
          FROM v$datafile a,
               v$tablespace b,
               dba_tablespaces c
         WHERE c.contents = 'UNDO'
           AND c.status = 'ONLINE'
           AND b.name = c.tablespace_name
           AND a.ts# = b.ts#
       ) d,

       v$parameter e,
       v$parameter f,
       (
       SELECT MAX(undoblks/((end_time-begin_time)*3600*24))
             undo_block_per_sec
         FROM v$undostat
       ) g

WHERE e.name = 'undo_retention'
  AND f.name = 'db_block_size'
/
ACTUAL UNDO SIZE [MByte]
------------------------
200

UNDO RETENTION [Sec]
--------------------
10800

OPTIMAL UNDO RETENTION [Sec]
----------------------------
16401

Calculate Needed UNDO Size for given Database Activity
If you are not limited by disk space, then it would be better to choose the UNDO_RETENTION time that is best for you (for FLASHBACK, etc.). Allocate the appropriate size to the UNDO tablespace according to the database activity: 

 
Again, all in one query:

SELECT d.undo_size/(1024*1024) "ACTUAL UNDO SIZE [MByte]",
       SUBSTR(e.value,1,25) "UNDO RETENTION [Sec]",
       (TO_NUMBER(e.value) * TO_NUMBER(f.value) *
       g.undo_block_per_sec) / (1024*1024)
      "NEEDED UNDO SIZE [MByte]"
  FROM (
       SELECT SUM(a.bytes) undo_size
         FROM v$datafile a,
              v$tablespace b,
              dba_tablespaces c
        WHERE c.contents = 'UNDO'
          AND c.status = 'ONLINE'
          AND b.name = c.tablespace_name
          AND a.ts# = b.ts#
       ) d,
      v$parameter e,
       v$parameter f,
       (
       SELECT MAX(undoblks/((end_time-begin_time)*3600*24))
         undo_block_per_sec
         FROM v$undostat
       ) g
 WHERE e.name = 'undo_retention'
  AND f.name = 'db_block_size'
/
ACTUAL UNDO SIZE [MByte]
------------------------
200
UNDO RETENTION [Sec]
--------------------
10800
NEEDED UNDO SIZE [MByte]
------------------------
131.695313

The previous query may return a "NEEDED UNDO SIZE" that is less than the "ACTUAL UNDO SIZE". If this is the case, you may be wasting space. You can choose to resize your UNDO tablespace to a lesser value or increase your UNDO_RETENTION parameter to use the additional space.


Performance Issues – Get SQL and session details with OS process ID

$
0
0
Here are some handy queries, which are helpful to find out the performance killing sessions.

It will be easy for DBA's to get the culprit process with a single query. Here are few for you.

-- Get SID with PID

set lines 200 pages 5000
col sid format 999999
col username format a20
col osuser format a15
select b.spid,a.sid, a.serial#,a.username, a.osuser
from v$session a, v$process b
where a.paddr= b.addr
and b.spid='&spid'
order by b.spid;


SPID             SID    SERIAL# USERNAME             OSUSER
------------ ------- ---------- -------------------- ---------------
7887            1518      31396 TEST_USER           SYSTEM


-- Get Details for SID

set lines 200 pages 5000
col program for a25
col event for a40
select a.sid, a.serial#, a.status, a.program, b.event,to_char(a.logon_time, 'dd-mon-yy hh24:mi') LOGON_TIME,
to_char(Sysdate, 'dd-mon-yy--hh24:mi') CURRENT_TIME, (a.last_call_et/3600) "Hrs connected" from v$session a,
v$session_wait b where a.sid=&sid and a.sid=b.sid;

     SID    SERIAL# STATUS   PROGRAM               EVENT                      LOGON_TIME            CURRENT_TIME           Hrs connected
------- ---------- -------- --------------------- -------------------------- --------------------- ---------------------- -------------
   1518      31396 ACTIVE   JDBC Thin Client      latch: library cache       14-mar-14 15:31       19-mar-14--11:43              110.82



 -- Identifying Sever Machine and Client Machine names of a session

col server_machine for a15
col client_machine for a15
select p.spid server_pid, s.sid oracle_sid, s.machine client_machine,i.host_name server_machine
from gv$session s, gv$process p, gv$instance I
where
p.inst_id = s.inst_id and
p.addr = s.paddr and
i.inst_id = s.inst_id and
p.spid = '&server_pid';


SERVER_PID   ORACLE_SID CLIENT_MACHINE  SERVER_MACHINE
------------ ---------- --------------- ---------------
7887               1518 prodweb20b      prodinst5

-- Identifying Sever Machine and Client Machine names, SQL details  of a session

set head on
set lin 700
col "SQL TEXT" for a100
col module format a20

SELECT s.sid, p.spid "OS Pid", s.module, s.process, s.username "Username",
s.osuser "OS User", s.program "Program", a.sql_id, substr(a.sql_text,1,550) "SQL Text"
FROM v$session s, v$sqlarea a, v$process p
WHERE s.sql_hash_value = a.hash_value (+)
AND s.sql_address = a.address (+)
AND s.paddr = p.addr
and s.sid = (select s.sid from v$session s, v$process p where s.paddr = p.addr and p.spid = &p);

    SID OS Pid       MODULE               PROCESS      Username             OS User     Program               SQL_ID        SQL Text
------- ------------ -------------------- ------------ -------------------- ----------- --------------------- ------------- ------------------------------------------------------------------------------------------------------------------------------------------------------
   1518 7887         JDBC Thin Client     1234         TEST_USER           SYSTEM      JDBC Thin Client      aqdb7xr4cm72h DELETE TEST_RECORDS WHERE EVENTID = :B3 AND ACTID = :B2 AND INVDATE = :B1


GoldenGate - Add new table to existing Replication setup

$
0
0
###########################################################
Source -  SOURCE.TABLE                          Target -  TARGET.TABLE
###########################################################

STEP 1 (TARGET):Create table on Target using dblink or export import or DDL and DML statements. (Initial Load)

SQL> create table TARGET.TABLE as select * from SOURCE.TABLE@dblink_to_src;

Table created.

SQL> select count(*) from TARGET.TABLE;

  COUNT(*)
----------
        24

SQL> select count(*) from SOURCE.TABLE@dblink_to_src;

  COUNT(*)
----------
        24

STEP 2 (SOURCE):Add Trandata for table which needs to be replicated

GGSCI (SOURCE) 2> dblogin userid system, password tiger
Successfully logged into database.

GGSCI (SOURCE) 4> add trandata SOURCE.TABLE

Logging of supplemental redo data enabled for table SOURCE.TABLE.

GGSCI (SOURCE) 5> info trandata SOURCE.TABLE

Logging of supplemental redo log data is enabled for table SOURCE.TABLE


STEP 3 (SOURCE):Take a backup of parameter file

-rw-r--r--   1 oracle     oinstall      4813 Jan  2 14:58 extsrc.prm_bkp
-rw-r--r--   1 oracle     oinstall      4854 Apr  9 09:20 extsrc.prm


STEP 4 (SOURCE):Added table name to parameter file and check the difference between the backup and current param files.

oracle@SOURCE:/u02/GG/source/dirprm$ diff extsrc.prm_bkp extsrc.prm

> TABLE SOURCE.TABLE;


STEP 5 (SOURCE):Create a new definition file by adding a new table to the defgen param file.

oracle@SOURCE:/u02/GG/source/dirdef$ mv proddefgen.def proddefgen.def_bkp   --- rename the existing .def file to avoid file exist error.
oracle@SOURCE:/u02/GG/source$ cp -pr proddefgen.prm proddefgen.prm_bkp

added table entry to defgen param file

oracle@SOURCE:/u02/GG/source$ diff proddefgen.prm proddefgen.prm_bkp

< TABLE SOURCE.TABLE;


STEP 6 (SOURCE) :create a new defnition file using defgen utility

oracle@SOURCE:/u02/GG/source$ ./defgen paramfile proddefgen.prm

***********************************************************************
        Oracle GoldenGate Table Definition Generator for Oracle
     Version 11.1.1.1.2 OGGCORE_11.1.1.1.2_PLATFORMS_111004.2100
  HP/UX, IA64, 64bit (optimized), Oracle 10g on Oct  5 2011 00:39:52

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


                    Starting at 2014-04-09 09:34:41
***********************************************************************
.
.
.
.
.
.
TABLE SOURCE.TABLE;
Retrieving definition for SOURCE.TABLE


STEP 7 (SOURCE):Check whether the definition got generated for new table.

oracle@SOURCE:/u02/GG/source$ diff proddefgen.def_bkp proddefgen.def

< * Definitions created/modified  2014-01-09 22:39
---
> * Definitions created/modified  2014-04-09 09:34
> *
> Definition for table SOURCE.TABLE
> Record length: 56
> Syskey: 0
> Columns: 3
> EVENT_ID     134     11        0  0  0 1 0      8      8      8 0 0 0 0 1    0 1 3
> PKUSERID     134     11       12  0  0 1 0      8      8      8 0 0 0 0 1    0 0 3
> PKTIMESTAMP  192     29       24  0  0 1 0     29     29     29 0 6 0 0 1    0 0 0


STEP 8 (SOURCE):Copy the new definition file to TARGET location.

oracle@SOURCE:/u02/GG/source$ scp proddefgen.def TARGET:/u02/GG/target/dirdef
Password:
proddefgen.def                           100%  154KB 153.5KB/s   00:00


STEP 9 (TARGET):Add Mapping to the Replicat Param file.

oracle@TARGET:/u02/GG/target/dirprm$ diff reptgt.prm reptgt.prm_bkp

< MAP SOURCE.TABLE, TARGET TARGET.TABLE;

oracle@TARGET:/u02/GG/target/dirprm$


STEP 10 (SOURCE) :STOP EXTRACT <EXTRACT NAME>
                                          : START EXTRACT <EXTRACT NAME>

STEP 11 (TARGET) :STOP REPLICAT <REPLICAT NAME>
                                          : START REPLICAT <REPLICAT NAME>


STEP 12 (SOURCE) :If pump process is configured for the extract, dont forget to add the table name to pump process param file.



If you do not have primary/Unique key constraints on any of the columns you may receive this error during update statements.


Expected Errors and resolution.

To avoid this error use APPLYNOOPUPDATESkey word on Replicat param file.

2014-04-11 10:25:10  ERROR   OGG-01168  Oracle GoldenGate Delivery for Oracle, reptgt.prm:  Encountered an update for target table TARGET.TABLE, which has no unique key defined.  KEYCOLS can be used to define a key.  Use ALLOWNOOPUPDATES to process the update without applying it to the target database.  Use APPLYNOOPUPDATES to force the update to be applied using all columns in both the SET and WHERE clause.
2014-04-11 10:25:10  ERROR   OGG-01668  Oracle GoldenGate Delivery for Oracle, reptgt.prm:  PROCESS ABENDING.

GGSCI command Summary

$
0
0
ggsci> help

Object:          Command:
SUBDIRS          CREATE
ER               INFO, KILL, LAG, SEND, STATUS, START, STATS, STOP
EXTRACT          ADD, ALTER, CLEANUP, DELETE, INFO, KILL, LAG,
                 SEND, START, STATS, STATUS, STOP
EXTTRAIL         ADD, ALTER, DELETE, INFO
GGSEVT           VIEW
MANAGER          INFO, REFRESH, SEND, START, STOP, STATUS
MARKER           INFO
PARAMS           EDIT, VIEW
REPLICAT         ADD, ALTER, CLEANUP, DELETE, INFO, KILL, LAG,
                 SEND, START, STATS, STATUS, STOP
REPORT           VIEW
RMTTRAIL         ADD, ALTER, DELETE, INFO
TRACETABLE       ADD, DELETE, INFO
TRANDATA         ADD, DELETE, INFO
CHECKPOINTTABLE  ADD, DELETE, CLEANUP, INFO



Commands without an object:

(Database)       DBLOGIN, LIST TABLES, ENCRYPT PASSWORD
(DDL)            DUMPDDL
(Miscellaneous)  FC, HELP, HISTORY, INFO ALL, OBEY, SET EDITOR, 
                 SHELL, SHOW, VERSIONS, !


For help on a specific command, type HELP [command] [object]

Example: HELP ADD REPLICAT

Note: You must use the keyword COMMAND to display the “!” help topic. 

ggsci> help ! command

ggsci> help add rmttrail


To create default directories within Oracle GoldenGate home directory

ggsci> CREATE SUBDIRS   

To display the status of all Manager, Extract, and Replicat processes
ggsci> INFO ALL [TASKS | ALLPROCESSES] 
ggsci> info all

Program     Status      Group       Lag       Time Since Chkpt
MANAGER     RUNNING
EXTRACT     RUNNING     EXTR      00:00:00      00:00:01
REPLICAT    ABENDED     REP       00:00:00      00:25:08


ggsci> info all tasks
ggsci> info all allprocesses

To determine whether or not the Manager process is running

ggsci> INFO MANAGER
ggsci> INFO MGR

To review recently processed markers from a NonStop system

ggsci> INFO MARKER [COUNT number_of_items]
ggsci> info marker

To display Status of Extract, Approximate Extract lag, Checkpoint information, Process run history

ggsci> INFO EXTRACT group_name [, SHOWCH [n]] [, DETAIL] [, TASKS | ALLPROCESSES]
ggsci> info extract emp_ext
ggsci> info extract cust_ext, detail
ggsci> info extract ext*, showch
ggsci> info extract *, detail
ggsci> info extract hr, tasks

To display status of Replicat, Approximate replication lag, the trail from which Replicat is reading, Replicat run history, including checkpoints in the trail, Information about the Replicat environment.

ggsci> INFO REPLICAT group_name [, SHOWCH [n]] [, DETAIL] [, TASKS | ALLPROCESSES]
ggsci> info replicat emp_rep
ggsci> info replicat emp_rep, detail
ggsci> info replicat prd*, detail, allprocesses
ggsci> info replicat *, tasks
ggsci> info replicat fin, showch

To retrieve configuration information for a local trail

ggsci> INFO EXTTRAIL trail_name 
ggsci> info exttrail *
ggsci> info exttrail e:\ogg\dirdat\ex

To retrieve configuration information for a remote trail

ggsci> INFO RMTTRAIL trail_name 
ggsci> info rmttrail *
ggsci> info rmttrail d:\ogg\dirdat\ex

To determine whether logging/replication enabled or not




ggsci> INFO TRANDATA user_name.table_names [, OLDFORMAT] [, USETRIGGER] 
ggsci> info trandata hr.*
ggsci> info trandata fin.acct


To confirm the existence of a checkpoint table and view the date and time that it was created

ggsci> INFO CHECKPOINTTABLE [user_name.table_name] 
ggsci> info checkpointtable gg_owner.chkpt_table

To verify the existence of the specified trace table

ggsci> INFO TRACETABLE [owner.table]   
ggsci> info tracetable ora_trace

To get information on multiple Extract and Replicat groups as a unit
ggsci> INFO ER group_wildcard_specification 
ggsci> info ER *ext*

To display the Oracle GoldenGate environment

ggsci> SHOW
ggsci> SHOW ALL

To establish a database connection

ggsci> DBLOGIN {SOURCEDB|TARGETDB dsn | USERID user_name[, PASSWORD password] [SYSDBA] | 
SOURCEDB|TARGETDB dsn, USERID user_name[, PASSWORD password] [SYSDBA] [SQLID sqlid] 
ggsci> dblogin sourcedb testdb
ggsci> dblogin targetdb repldb
ggsci> dblogin userid gg
ggsci> dblogin userid gg, password oracle
ggsci> dblogin userid system@localhost:1521/prod, password 12345678
ggsci> dblogin sourcedb ctdb@host1, userid gg_owner, password ggs sysdba

To encrypt a database login password

ggsci> ENCRYPT PASSWORD password [ENCRYPTKEY keyname] 
ggsci> encrypt password oracle143 encryptkey spiderman

To list all tables in the database that match the specification

ggsci> LIST TABLES table_name 
ggsci> list tables cust*

To create or change a parameter file

ggsci> EDIT PARAMS {MGR | ./GLOBALS | group_name | file_name} 
ggsci> edit params mgr
ggsci> edit params ./GLOBALS
ggsci> edit params myload
ggsci> edit params rep_emp
ggsci> edit params e:\gg\dirprm\replp.prm

To view the contents of a parameter file

ggsci> VIEW PARAMS {MGR | group_name | file_name}  ggsci> view params mgr
ggsci> view params s_extr
ggsci> view params e:\prm\replp.prm

To view GoldenGate error log (ggserr.log file)

ggsci> VIEW GGSEVT
             

To view the process report that is generated by Extract or Replicat

ggsci> VIEW REPORT {group_name[n] | file_name} 
ggsci> view report ext6
ggsci> view report rep
ggsci> view report c:\ogg\dirrpt\orders.rpt


To create an Extract group
ggsci> ADD EXTRACT group_name
{, SOURCEISTABLE |, TRANLOG [bsds_name] |, VAM |, EXTFILESOURCE file_name |, EXTTRAILSOURCE trail_name |, VAMTRAILSOURCE VAM_trail_name} {, BEGIN {NOW | yyyy-mm-dd hh:mi:[ss[.cccccc]]]} |, EXTSEQNO seqno, EXTRBA relative_byte_address |, LOGNUM log_number, LOGPOS byte_offset |, EOF |, LSN value |, EXTRBA relative_byte_address |, PAGE data_page, ROW row | } [, THREADS n] [, PASSIVE] [, PARAMS parameter_file] [, REPORT report_file] [, DESC "description"]

Syntax for an alias Extract:

ADD EXTRACT group_name, RMTHOST {host_name | IP_address}, {MGRPORT port} | {PORT port} [, RMTNAME name] [, DESC "description"]

ggsci> add extract s_extr, tranlog, begin now
ggsci> add extract finext, tranlog, begin now, threads 4
ggsci> add extract fin, tranlog, begin now, passive
ggsci> add extract ext_ms, extseqno 111, begin now
ggsci> add extract hr_ext, extrba 567890, begin 2012-02-02 12:00:00
ggsci> add extract initload, sourceistable
ggsci> add extract pump, exttrailsource /oracle/gg11/dirdat/hr
ggsci> add extract fin, vam       -- VAM - Vendor Access Module
ggsci> add extract fin, vamtrailsource /ogg/dirdat/vt
ggsci> add extract finA, rmthost host123, mgrport 7810, rmtname fin

To create a Replicat group

ggsci> ADD REPLICAT group_name
{, SPECIALRUN |, EXTFILE full_path_name |, EXTTRAIL full_path_name}
[, BEGIN {NOW | YYYY-MM-DD HH:MM[:SS[.CCCCCC]]} |, EXTSEQNO seqno, EXTRBA rba] [, CHECKPOINTTABLE owner.table | NODBCHECKPOINT]
[, PARAMS parameter_file] [, REPORT report_file] [, DESC "description"] 
ggsci> add replicat repl, exttrail C:\OGG10G\dirdat\lt
ggsci> add replicat t_rep, exttrail /oracle/gg11/dirdat/lt, checkpointtable gg_owner.checkpoint
ggsci> add replicat initload, specialrun
ggsci> add replicat sales, exttrail /oracle/gg11/dirdat/lt, nodbcheckpoint

To create a trail for online processing on local system

ggsci> ADD EXTTRAIL trail_name, EXTRACT group_name [, MEGABYTES n] [, SEQNO n] 
ggsci> add exttrail /oracle/gg11/dirdat/lt, extract s_extr
ggsci> add exttrail C:\OGG10G\dirdat\et, extract emp_ext
ggsci> add exttrail c:\ogg\dirdat\fi, extract fin, megabytes 30

To create a trail for online processing on remote system

ggsci> ADD RMTTRAIL trail_name, EXTRACT group_name [, MEGABYTES n] [, SEQNO n] 
ggsci> add rmttrail C:\OGG10G\dirdat\hr, extract extr
ggsci> add rmttrail /u01/app/oracle/ogg/dirdat/ms, extract msextr
ggsci> add rmttrail /u01/app/oracle/ogg/dirdat/my, extract mysql, megabytes 50

To enable Oracle GoldenGate to acquire the transaction information it needs from the transaction records

ggsci> ADD TRANDATA user_name.table_names [, COLS (column_list)] [, INCLUDELONG | EXCLUDELONG]
 [, LOBSNEVER | LOBSALWAYS | LOBSIFCHANGED | LOBSALWAYSNOINDEX] [, NOKEY] [, OLDFORMAT] [, USETRIGGER]     
ggsci> add trandata hr.*
ggsci> add trandata emp.employees
ggsci> add trandata fin.acct, cols (name, address)
ggsci> add trandata fin.acct, nokey, cols (name, pid)
ggsci> add trandata fin.acct, lobsalwaysnoindex
To create a checkpoint table in the target database

ggsci> ADD CHECKPOINTTABLE [user_name.table_name] 
ggsci> add checkpointtable
ggsci> add checkpointtable gg_owner.checkpoint

To create a trace table in the Oracle database

ggsci> ADD TRACETABLE [owner.table]
 
ggsci> add tracetable
ggsci> add tracetable ora_trace

ggsci> REGISTER EXTRACT extract_group_name LOGRETENTION
ggsci> register extract extr logretention

To start Manager process

ggsci> START MANAGER   
ggsci> START MGR
ggsci> START *

To start Extract process

ggsci> START EXTRACT extract_name   
ggsci> start extract extr

To start Replicat process

ggsci> START REPLICAT group_name [SKIPTRANSACTION | ATCSN csn | AFTERCSN csn] 
ggsci> start replicat rep
ggsci> start replicat fin, atcsn 5238306       -- commit sequence number (CSN)
ggsci> start replicat fin, aftercsn 0X000006B1:0002334D:0004

To start multiple Extract and Replicat groups as a unit

ggsci> START ER group_wildcard_specification   
ggsci> start er *rep*

To stop Manager process

ggsci> STOP MANAGER [!]   
ggsci> stop manager
ggsci> stop manager !              -- will not ask for confirmation

ggsci> STOP EXTRACT extract_name
  -- To stop Extract gracefully
ggsci> stop extract extr
To stop Replicat gracefully

ggsci> STOP REPLICAT replicat_name [!]
 
ggsci> stop replicat rep

To stop multiple Extract and Replicat groups as a unit

ggsci> STOP ER group_wildcard_specification  
ggsci> stop er *ext*

To determine whether or not the Manager process is running

ggsci> STATUS MANAGER 

To determine whether or not Extract is running

ggsci> STATUS EXTRACT group_name [, TASKS | ALLPROCESSES] 
ggsci> status extract extr_hr
ggsci> status extract ext*, tasks
ggsci> status extract *ext*, allprocesses

To determine whether or not Replicat is running

ggsci> STATUS REPLICAT group_name [, TASKS | ALLPROCESSES
ggsci> status replicat emp_rep
ggsci> status replicat cust_rep, allprocesses

To check the status of multiple Extract and Replicat groups as a unit

ggsci> STATUS ER group_wildcard_specification    
ggsci> status er *EX*

To display statistics for one or more Extract group

ggsci> STATS EXTRACT group_name [, statistic] [, TABLE table] [, TOTALSONLY table_specification] [, REPORTFETCH | NOREPORTFETCH] [, REPORTRATE HR|MIN|SEC] [, ... ] 
ggsci> stats ext_hr
ggsci> stats extract ext
ggsci> stats extract ext2 reportrate sec
ggsci> stats extract fin, total, daily
ggsci> stats extract fin, total, hourly, table acct, reportrate min, reset, reportfetch

To display statistics for one or more Replicat groups

ggsci> STATS REPLICAT group_name [, statistic] [, TABLE table] [, TOTALSONLY table_specification] [, REPORTDETAIL | NOREPORTDETAIL] [, REPORTRATE HR|MIN|SEC] [, ... ] 
ggsci> stats rep_hr
ggsci> stats replicat fin, total, table acct, reportrate hr, reset, noreportdetail

To get statistics on multiple Extract and Replicat groups as a unit

ggsci> STATS ER group_wildcard_specification 
ggsci> stats er ext*

ggsci> REFRESH MANAGER  -- not available in Oracle 11g

To retrieve the status of the active Manager process or to retrieve dynamic port information as configured in the Manager parameter file

ggsci> SEND MANAGER [CHILDSTATUS [DEBUG]] [GETPORTINFO [DETAIL]] [GETPURGEOLDEXTRACTS] 
ggsci> send manager childstatus
ggsci> send manager childstatus debug
ggsci> send manager getportinfo
ggsci> send manager getportinfo detail
ggsci> send manager getpurgeoldextracts

To communicate with a running Extract process

ggsci> SEND EXTRACT group_name, 
{ CACHEMGR {CACHESTATS | CACHEQUEUES | CACHEPOOL} | FORCESTOP | FORCETRANS id [THREAD n] [FORCE] | GETLAG | GETTCPSTATS | LOGEND | REPORT | ROLLOVER | SHOWTRANS [id] [THREAD n] [COUNT n] [DURATION duration_unit] [TABULAR] [FILE file_name [DETAIL]] | SKIPTRANS id [THREAD n] [FORCE] | STATUS | STOP | TLTRACE {DEBUG | OFF | level} [SIZELIMIT size] [DDLINCLUDE | DDL[ONLY]] [FILE] file_name | TRACE[2] {tracefile | OFF} | TRACEINIT | TRANLOGOPTIONS {PURGEORPHANEDTRANSACTIONS | NOPURGEORPHANEDTRANSACTIONS} | TRANLOGOPTIONS TRANSCLEANUPFREQUENCY minutes | VAMMESSAGE "Teradata_command" | VAMMESSAGE {ARSTATS | INCLUDELIST [filter] | EXCLUDELIST [filter]} | VAMMESSAGE OPENTRANS
}   
Teradata_command = {"control:terminate" | "control:suspend" | "control:resume" | "control:copy database.table"
ggsci> send extract exthr status
ggsci> send extract extr, getlag
ggsci> send extract group_name tltrace file file_name ddlinclude
ggsci> send extract fin, rollover
ggsci> send extract fin  stop
ggsci> send extract fin, vammessage control:suspend
ggsci> send extract fin, tranlogoptions transcleanupfrequency 15
ggsci> send extract fin, showtrans count 10
ggsci> send extract fin, skiptrans 5.17.27634 thread 2

To communicate with a starting or running Replicat process

ggsci> SEND REPLICAT group_name,
{ FORCESTOP | GETLAG | HANDLECOLLISIONS [table_specification] | NOHANDLECOLLISIONS [table_specification] | REPORT [HANDLECOLLISIONS [table_specification]] | STATUS | STOP | TRACE[2] [DDLINCLUDE | DDL[ONLY]] [FILE] file_name | TRACE[2] OFF | TRACEINIT
 
ggsci> send replicat fin, handlecollisions
ggsci> send replicat fin, report handlecollisions fin_*
ggsci> send replicat fin, getlag

To send instructions to multiple Extract and Replicat groups as a unit

ggsci> SEND ER group_wildcard_specification 
ggsci> send er *ext

To change the attributes of an Extract group, To increment a trail to the next file in the sequence

ggsci> ALTER EXTRACT group_name [, ADD_EXTRACT_attribute] [, THREAD number] [, ETROLLOVER] 
ggsci> alter extract fin, begin 2012-02-16
ggsci> alter extract fin, etrollover
ggsci> alter extract fin, extseqno 26, extrba 338
ggsci> alter extract accounts, thread 4, begin 2012-03-09
ggsci> alter extract sales, lsn 1234:123:1

To change the attributes of a Replicat group

ggsci> ALTER REPLICAT group_name , 
[, BEGIN {NOW | YYYY-MM-DD HH:MM[:SS[.CCCCCC]]} |, EXTSEQNO seqno, EXTRBA rba] [, PARAMS parameter_file] [, REPORT report_file] [, DESC "description"] 
ggsci> alter replicat fin, begin 2011-09-28 08:08:08
ggsci> alter replicat fin, extseqno 53
ggsci> alter replicat fin, extrba 666

To change the attributes of a trail (on the local system)

ggsci> ALTER EXTTRAIL trail_name, EXTRACT group_name [, MEGABYTES n]  
ggsci> alter exttrail c:\ogg\dirdat\aa, extract fin, megabytes 30

To change the attributes of a trail (on a remote system)

ggsci> ALTER RMTTRAIL trail_name, EXTRACT group_name [, MEGABYTES n] 
ggsci> alter rmttrail c:\ogg\dirdat\et, extract fin, megabytes 25

To delete run history for specified Extract group

ggsci> CLEANUP EXTRACT group_name [, SAVE count]   
ggsci> cleanup extract fin
ggsci> cleanup extract e*, save 6

To delete run history for specified Replicat group

ggsci> CLEANUP REPLICAT group_name [, SAVE count]  
ggsci> cleanup replicat fin
ggsci> cleanup replicat *, save 10

To remove checkpoint records from the checkpoint table

ggsci> CLEANUP CHECKPOINTTABLE [user_name.table_name]
 
ggsci> cleanup checkpointtable ggs.fin_check

To delete an Extract group

ggsci> DELETE EXTRACT group_name [!] 
ggsci> delete extract emp_ext
ggsci> delete extract emp_ext !              -- will not ask for confirmation

To delete a Replicat group

ggsci> DELETE REPLICAT group_name [!] 
ggsci> delete replicat emp_ext
ggsci> delete replicat emp_ext !             -- will not ask for confirmation

To delete the record of checkpoints associated with a trail on a local system

ggsci> DELETE EXTTRAIL trail_name   
ggsci> delete exttrail /home/ogg/dirdat/et

To delete the record of checkpoints associated with a trail on a remote system

ggsci> DELETE RMTTRAIL trail_name     
ggsci> delete rmttrail /home/ogg/dirdat/et

To delete logging/replication data

ggsci> DELETE TRANDATA user_name.table_names [, OLDFORMAT] [, USETRIGGER] 
ggsci> delete trandata fin.acct
ggsci> delete trandata fin.cust*
ggsci> delete trandata emp.hr, usetrigger

To drop checkpoint table from database

ggsci> DELETE CHECKPOINTTABLE [user_name.table_name] [!]    
ggsci> delete checkpointtable ggs.fin_check

To delete a trace table

ggsci> DELETE TRACETABLE [owner.table] 
ggsci> delete tracetable ora_trace

To kill an Extract process running in regular or PASSIVE mode

ggsci> KILL EXTRACT group_name  
ggsci> kill extract fin

To kill a Replicat process

ggsci> KILL REPLICAT group_name
 
ggsci> kill replicat fin

To forcefully terminate multiple Extract and Replicat groups as a unit

ggsci> KILL ER group_wildcard_specification 
ggsci> kill er *x*

To determine a true lag time between Extract and the datasource

ggsci> LAG EXTRACT group_name   
ggsci> lag extract ext*
ggsci> lag extract *

To determine a true lag time between Replicat and the trail

ggsci> LAG REPLICAT group_name   
ggsci> lag replicat myrepl
ggsci> lag replicat *

To get lag information on multiple Extract and Replicat groups as a unit

ggsci> LAG ER group_wildcard_specification 
ggsci> lag er *ext*

To view the data in the Oracle GoldenGate DDL history table

ggsci> DUMPDDL [SHOW] 
ggsci> dumpddl

To view the most recently issued GGSCI commands since the session started

ggsci> HISTORY [n] 
ggsci> history       -- by default, shows last 10 commands
ggsci> history 30

To change the default text editor for the current session of GGSCI, default editors are Notepad for Windows and vi for UNIX

ggsci> SET EDITOR program_name     
ggsci> set editor wordpad

To display operating system and database version information

ggsci> VERSIONS
To display edit a previously issued GGSCI command and then execute it again
ggsci> FC [n | -n | string] 
ggsci> fc
ggsci> fc 9
ggsci> fc -3
ggsci> fc sta

FC editor commands

i text  -- Inserts text
r text  -- Replaces text
d       -- Deletes a character
replacement_text  -- Replaces the displayed command with the text that we enter on a one-for-one basis.

To execute shell commands from within GGSCI interface

ggsci> SHELL shell_command 
ggsci> shell ls -l /u01/app/oracle/gg/dirdat
ggsci> shell dir dirprm\*
ggsci> shell rm ./dat*

To execute previous GGSCI command

ggsci> ! [n | -n | string]     
ggsci> !
ggsci> ! 6    -- To run the command 6 listed in the history
ggsci> ! -3
ggsci> ! sta
ggsci> help ! command

To process a file that contains a list of GoldenGate commands.

ggsci> OBEY ggsci_script     
ggsci> shell more /u01/app/oracle/gg/startup.txt
START MANAGER
START EXTRACT EXT3
START EXTRACT DPUMP
INFO ALL
ggsci> OBEY /u01/app/oracle/gg/startup.txt
ggsci> OBEY ./mycommands.txt

ggsci> EXIT
 






 


 

GoldenGate parameter "SCHEMATRANDATA"

$
0
0
Use ADD SCHEMATRANDATA to enable schema-level supplemental logging for Oracle tables. ADD SCHEMATRANDATA acts on all of the current and future tables in a given schema to automatically log a superset of available keys that Oracle GoldenGate needs for row identification.

ADD SCHEMATRANDATA does the following:

● Enables Oracle supplemental logging for new tables created with a CREATE TABLE.
● Updates supplemental logging for tables affected by an ALTER TABLE to add or drop columns.
● Updates supplemental logging for tables that are renamed.
● Updates supplemental logging for tables for which unique or primary keys are added or dropped.
ADD SCHEMATRANDATA logs the key columns of a table in the following order of priority:
● Primary key
● In the absence of a primary key, all of the unique keys of the table, including those that are disabled, unusable or invisible. Unique keys that contain ADT member columns
are also logged. Only unique keys on virtual columns (function-based indexes) are not logged.
● If none of the preceding exists, all scalar columns

When to Use ADD SCHEMATRANDATA

ADD SCHEMATRANDATA must be used in the following cases:
  • For all tables that are part of an Extract group that is to be configured for integrated capture. ADD SCHEMATRANDATA ensures that the correct key is logged by logging all of the keys.
  • For all tables that will be processed in an integrated Replicat group. Options are provided that enable the logging of the primary, unique, and foreign keys to support the computation of dependencies among relational tables being processed through different apply servers.
  • When DDL replication is active and DML is concurrent with DDL that creates new tables or alters key columns. It best handles scenarios where DML can be applied to objects very shortly after DDL is issued on them. ADD SCHEMATRANDATA causes the appropriate key values to be logged in the redo log atomically with each DDL operation, thus ensuring metadata continuity for the DML when it is captured from the log, despite any lag in Extract processing.
Database-level Logging Requirements for Using ADD SCHEMATRANDATA
Oracle strongly encourages putting the source database into forced logging mode and enabling minimal supplemental logging at the database level when using Oracle GoldenGate. This adds row chaining information, if any exists, to the redo log for update operations. See Installing and Configuring Oracle GoldenGate for Oracle Databasefor more information about configuring logging to support Oracle GoldenGate.

Additional Considerations for Using ADD SCHEMATRANDATA

·         Before using ADD SCHEMATRANDATA, issue the DBLOGIN command. The user who issues the command must be granted the Oracle Streams administrator privilege.

SQL> exec dbms_streams_auth.grant_admin_privilege('user')

·         ADD SCHEMATRANDATA can be used instead of the ADD TRANDATA command when DDL replication is not enabled. Note, however, that if a table has no primary key but has multiple unique keys, ADD SCHEMATRANDATA causes the database to log all of the unique keys. In such cases, ADD SCHEMATRANDATA causes the database to log more redo data than does ADD TRANDATA. To avoid the extra logging, designate one of the unique keys as a primary key, if possible.

·         For tables with a primary key, with a single unique key, or without a key, ADD SCHEMATRANDATA adds no additional logging overhead, as compared to ADD TRANDATA.

·         If you must log additional, non-key columns of a specific table (or tables) for use by Oracle GoldenGate, such as those needed for FILTER statements and KEYCOLS clauses in the TABLE and MAP parameters, issue an ADD TRANDATA command for those columns. That command has a COLS option to issue table-level supplemental logging for the columns, and it can be used in conjunction with ADD SCHEMATRANDATA.

Syntax

ADD SCHEMATRANDATA schema  [ALLOWNONVALIDATEDKEYS] [NOSCHEDULINGCOLS | ALLCOLS] schema

The schema for which you want the supplementary key information to be logged. Do not use a wildcard. To issue ADD SCHEMATRANDATA for schemas in more than one pluggable database of a multitenant container database, log in to each pluggable database separately with  
DBLOGIN and then issue ADD SCHEMATRANDATA.

ALLOWNONVALIDATEDKEYS

This option is valid for Oracle 11.2.0.4 and later 11g versions and Oracle 12.1.0.2 and later 12c versions. (Not available for Oracle 12.1.0.1.) It includes NON VALIDATED and NOT VALID primary keys in the supplemental logging. These keys override the normal key selection criteria that is used by Oracle GoldenGate. If the GLOBALS parameter ALLOWNONVALIDATEDKEYS is being used, ADD SCHEMATRANDATA runs with ALLOWNONVALIDATEDKEYS whether or not it is specified. By default NON VALIDATED and NOT VALID primary keys are not logged. For more information, see the GLOBALSALLOWNONVALIDATEDKEYSparameter.

NOSCHEDULINGCOLS | ALLCOLS

These options support integrated Replicat for an Oracle target database.

NOSCHEDULINGCOLS

Disables the logging of scheduling columns. By default, ADD SCHEMATRANDATA enables the unconditional logging of the primary key and the conditional supplemental logging of all unique key(s) and foreign key(s) of all current and future tables in the given schema. Unconditional logging forces the primary key values to the log whether or not the key was changed in the current operation. Conditional logging logs all of the column values of a foreign or unique key if at least one of them was changed in the current operation. The primary key, unique keys, and foreign keys must all be available to the inbound server to compute dependencies. For more information about integrated Replicat, see Installing and Configuring Oracle GoldenGate for Oracle Database.

ALLCOLS

Enables the unconditional supplemental logging of all supported key and non-key columns for all current and future tables in the given schema. This option enables the logging of the keys required to compute dependencies, plus columns that are required for filtering, conflict resolution, or other purposes.
 
Example 1   
The following enables supplemental logging for the schema scott.

ADD SCHEMATRANDATA scott

Example 2   
The following example logs all supported key and non-key columns for all current and future tables in the schema named scott.

ADD SCHEMATRANDATA scott ALLCOLS

Viewing all 32 articles
Browse latest View live