Saturday 30 September 2017

Zero downtime database migration using GG.

Note: In below process i am considaring scott as my Application user.

part I)  setup golden gate on source and target machine.
(below steps perform on both source and target database)

-check archive log mode of both database.

SQL> SELECT log_mode FROM v$database;
LOG_MODE
------------
ARCHIVELOG

SQL> SELECT force_logging, supplemental_log_data_min FROM v$database;

FOR SUPPLEME
-----------
NO NO

SQL> ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;

Database altered.
SQL> ALTER DATABASE FORCE LOGGING;
Database altered.

SQL> SELECT force_logging, supplemental_log_data_min FROM v$database;

FOR SUPPLEME
-----------
YES YES

SQL> create tablespace ggate
datafile '/u01/app/oracle/oradata/DB11G/ggate.dbf' size 5G;
Tablespace created.

SQL> create user ggate
identified by ****
default tablespace ggate;
User created.

SQL> GRANT dba TO ggate;

paert II) set up extract,datapump and replicate process on both source and targate side.

A) on source side node1:

[oracle@node1 ~]$ cd $GG_HOME
[oracle@node1 gg]$ ./ggsci

GGSCI (node1.example.com) > edit params manager
Saturday, September 30, 2017
7:12 PM
New Section 3 Page 1
----add below parameter
PORT 7809
DYNAMICPORTLIST 7810-7820
PURGEOLDEXTRACTS /u01/app/oracle/product/gg/dirdat/rx*, USECHECKPOINTS, MINKEEPHOURS 2

GGSCI (node1.example.com) > edit params CAPT01
EXTRACT CAPT01
setenv (ORACLE_SID="DB11G")
setenv (NLS_LANG="AMERICAN_AMERICA.WE8MSWIN1252")
USERID ggate, PASSWORD oracle
EXTTRAIL /u01/app/oracle/product/gg/dirdat/rx
TABLE scott.*;

GGSCI (node1.example.com) > edit params dp01
EXTRACT dp01
setenv (ORACLE_SID="DB11G")
setenv (NLS_LANG="AMERICAN_AMERICA.WE8MSWIN1252")
USERID ggate, PASSWORD ****
RMTHOST node2.example.com, MGRPORT 7809
RMTTRAIL /u01/app/oracle/product/gg/dirdat/rt
TABLE scott.*;

GGSCI (node1.example.com) > edit params frep01
REPLICAT frep01
setenv (ORACLE_SID="DB11G")
setenv (NLS_LANG="AMERICAN_AMERICA.WE8MSWIN1252")
USERID ggate, PASSWORD ****
ASSUMETARGETDEFS
MAP scott.*, TARGET scott.*;

GGSCI (node1.example.com) > EDIT PARAMS ./GLOBALS

CHECKPOINTTABLE ggate.OGGCHKPT

GGSCI (node1.example.com) > start mgr

GGSCI (node1.example.com) > dblogin userid ggate, Password ***

GGSCI (node1.example.com) > add trandata scott.*

GGSCI (node1.example.com) > Add CheckpointTable

GGSCI (node1.example.com) > Add Extract capt01, TranLog, Begin Now

GGSCI (node1.example.com) > Add ExtTrail ./u01/app/oracle/product/gg/dirdat/rx, Extract capt01, Megabytes 5

GGSCI (node1.example.com) > Add Extract dp01, ExtTrailSource
/u01/app/oracle/product/gg/dirdat/rt

GGSCI (node1.example.com) > Add RmtTrail /u01/app/oracle/product/gg/dirdat/rt, Extract dp01, Megabytes 5

GGSCI (node1.example.com) > Add Replicat frep01, ExtTrail /u01/app/oracle/product/gg/dirdat/ft ----( this replicate process for fail back target to source)

GGSCI (node1.example.com) > info all

Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER STOPPED
EXTRACT STOPPED CAPT01 00:00:00 00:00:54
EXTRACT STOPPED DP01 00:00:00 00:00:46
REPLICAT STOPPED REP01 00:00:00 00:00:02

B) on target database.

[oracle@node2 ~]$ cd $GG_HOME

[oracle@node2 gg]$ ./ggsci

GGSCI (node2.example.com) > edit params mgr

----add below parameter
PORT 7809
DYNAMICPORTLIST 7810-7820
PURGEOLDEXTRACTS /u01/app/oracle/product/gg/dirdat/fx*, USECHECKPOINTS, MINKEEPHOURS 2

GGSCI (node2.example.com) > edit params FCAPT01

EXTRACT FCAPT01
setenv (ORACLE_SID="DB11G")
setenv (NLS_LANG="AMERICAN_AMERICA.WE8MSWIN1252")
USERID ggate, PASSWORD oracle
EXTTRAIL /u01/app/oracle/product/gg/dirdat/fx
TABLE scott.*;

GGSCI (node2.example.com) > edit params Fdp01

EXTRACT Fdp01
setenv (ORACLE_SID="DB11G")
setenv (NLS_LANG="AMERICAN_AMERICA.WE8MSWIN1252")
USERID ggate, PASSWORD ****
RMTHOST node2.example.com, MGRPORT 7809
RMTTRAIL /u01/app/oracle/product/gg/dirdat/ft
TABLE scott.*;

GGSCI (node2.example.com) > edit params rep01

REPLICAT rep01
setenv (ORACLE_SID="DB11G")
setenv (NLS_LANG="AMERICAN_AMERICA.WE8MSWIN1252")
USERID ggate, PASSWORD ****
ASSUMETARGETDEFS
MAP scott.*, TARGET scott.*;

GGSCI (node2.example.com) > EDIT PARAMS ./GLOBALS

CHECKPOINTTABLE ggate.OGGCHKPT
GGSCI (node2.example.com) > start mgr

GGSCI (node2.example.com) > dblogin userid ggate, Password ***

GGSCI (node2.example.com) > Add CheckpointTable

GGSCI (node2.example.com) > add trandata scott.*

GGSCI (node2.example.com) > Add Extract Fcapt01, TranLog, Begin Now

GGSCI (node2.example.com) > Add ExtTrail ./u01/app/oracle/product/gg/dirdat/fx, Extract capt01, Megabytes 5 ---(process for fail back replication)

GGSCI (node2.example.com) > Add Extract Fdp01, ExtTrailSource /u01/app/oracle/product/gg/dirdat/ft

GGSCI (node2.example.com) > Add RmtTrail /u01/app/oracle/product/gg/dirdat/ft, Extract dp01, Megabytes 5 ----(process for fail back replication)

GGSCI (node2.example.com) > Add Replicat Frep01, ExtTrail /u01/app/oracle/product/gg/dirdat/rt

GGSCI (node2.example.com) > info all

Program Status Group Lag at Chkpt Time Since Chkpt
MANAGER STOPPED
EXTRACT STOPPED FCAPT01 00:00:00 00:00:54
EXTRACT STOPPED FDP01 00:00:00 00:00:46
REPLICAT STOPPED FREP01 00:00:00 00:00:02

part III) start migration process

1)start capture process

GGSCI (node1.example.com) > start EXTRACT FCAPT01
GGSCI (node1.example.com) > start EXTRACT FDP01

2)check latest flshback_scn from source database

SQL> select dbms_flashback.get_system_change_number from dual;
GET_SYSTEM_CHANGE_NUMBER
------------------------
1189734

3)export application schema data using import and export utility .

[oracle@node1 gg]$ expdp ggate schemas=scott directory=DATA_PUMP_DIR dumpfile=SCHEMA_scott_dp.dmp logfile=SCHEMA_scott_dp.log flashback_scn=1189734

Export: Release 11.2.0.3.0 -Production on Sat Sep 30 10:07:05 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Password:
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 -64bit Production
New Section 3 Page 4
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 -64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
FLASHBACK automatically enabled to preserve database integrity.
Starting "GGATE"."SYS_EXPORT_SCHEMA_01": ggate/******** schemas=scott directory=DATA_PUMP_DIR dumpfile=SCHEMA_scott_dp.dmp logfile=SCHEMA_scott_dp.log
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 192 KB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
Processing object type SCHEMA_EXPORT/DEFAULT_ROLE
Processing object type SCHEMA_EXPORT/PRE_SCHEMA/PROCACT_SCHEMA
Processing object type SCHEMA_EXPORT/TABLE/TABLE
Processing object type SCHEMA_EXPORT/TABLE/INDEX/INDEX
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/INDEX/STATISTICS/INDEX_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/CONSTRAINT/REF_CONSTRAINT
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
. . exported "SCOTT"."DEPT" 5.984 KB 6 rows
. . exported "SCOTT"."EMP" 8.570 KB 14 rows
. . exported "SCOTT"."SALGRADE" 5.882 KB 6 rows
. . exported "SCOTT"."BONUS" 0 KB 0 rows
Master table "GGATE"."SYS_EXPORT_SCHEMA_01" successfully loaded/unloaded
******************************************************************************
Dump file set for GGATE.SYS_EXPORT_SCHEMA_01 is:
/u01/app/oracle/admin/DB11G/dpdump/SCHEMA_scott_dp.dmp
Job "GGATE"."SYS_EXPORT_SCHEMA_01" successfully completed at 10:07:36

4)import Application user data usig import export utility:

[oracle@node1 gg]$ impdp ggate schemas=scott directory=DATA_PUMP_DIR dumpfile=SCHEMA_scott_dp.dmp logfile=SCHEMA_scott_dp.log

5)start replication process on target database.
GGSCI (node2.example.com) > start rep01 aftercsn 1189734;

6)wait utile source and target database in sync.
check lag both capt01 and DP01 process mass will be as follow
as EOF no more record to process

7)stop application.

8)stop exrtact, datapump,replicat process

9)start the GG failback process.

on tagate database which now source.

GGSCI (node2.example.com) > alter FCAPT01 begin now
GGSCI (node2example.com) > info FDP01 detail
GGSCI (node2.example.com) > start extract  FDP01
GGSCI (node1.example.com) > alter FREP01 extseqno 2 ------(on source database)
GGSCI (node2.example.com) > alter FREP01 extrba 0
GGSCI (node2.example.com) > start EXTRACT FCAPT01
GGSCI (node2.example.com) > start EXTRACT FCAPT01
GGSCI (node2.example.com) > start FREP01
step 10)switch application to new database server.

now all Applications running on new database server , old database server is your standby database server once you
confirm about transaction , performance etc about new database server you can stop gg process.

note: during import export operation you can use extra parameter for fast performance and also change some parameter in init.ora file.

Monday 27 March 2017

Oracle 12c R2 new feature configure Datagaurd using DBCA


Os details:
[oracle@db11g ~]$ cat /etc/oracle-release
Oracle Linux Server release 6.8

Database details:

Release 12.2.0.1.0

Node details:

node01(source database)
node02(targate database)


==> check and create souce database in archive log mode.

[oracle@node01 ~]$ sqlplus

SQL*Plus: Release 12.2.0.1.0 Production on Mon Mar 27 06:18:05 2017

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

Enter user-name: /as sysdba

Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production

SELECT log_mode FROM v$database;

LOG_MODE
------------
NOARCHIVELOG

SQL>

SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER DATABASE ARCHIVELOG;
ALTER DATABASE OPEN;

ALTER DATABASE FORCE LOGGING;

==> tnsname.ora file details on both node.

Node01:

# Generated by Oracle configuration tools.

ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = node01.example.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )
orcl_tar =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = node02.example.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

Node02:

# Generated by Oracle configuration tools.

ORCL =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = node02.example.com)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )
orcl_tar =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = node01.example.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )


===> configure datagaurd using dbca silent command.

[oracle@node02 admin]$ dbca -silent -createDuplicateDB -gdbName orcl  -primaryDBConnectionString  orcl.example.com:1521/orcl -sid orcl -createAsStandby -dbUniqueName orcl1

Enter SYS user password:                           -----Enter sysp assword of source database.

Listener config step
33% complete
Auxiliary instance creation
66% complete
RMAN duplicate
100% complete
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/orcl1/orcl.log" for further details.

For more details about data gaurd configuration progress check below logs.

[oracle@node02 admin]$ tail -f /u01/app/oracle/cfgtoollogs/dbca/orcl1/orcl.log
[ 2017-03-27 05:37:15.662 IST ] Listener config step
DBCA_PROGRESS : 33%
[ 2017-03-27 05:37:20.555 IST ] Auxiliary instance creation
DBCA_PROGRESS : 66%
[ 2017-03-27 05:38:01.103 IST ] RMAN duplicate
DBCA_PROGRESS : 100%

Note: automaticaly password file and parameter file have been created.

[oracle@node02 admin]$ cd /u01/app/oracle/product/12.1.0.2/db_1/dbs
[oracle@node02 dbs]$ ls -ltr
total 24
-rw-r--r--. 1 oracle oinstall 3079 May 15  2015 init.ora
-rw-r-----. 1 oracle oinstall   82 Mar 27 05:37 initorcl.ora
-rw-r-----. 1 oracle oinstall 3584 Mar 27 05:38 orapworcl
-rw-r-----. 1 oracle oinstall   24 Mar 27 05:38 lkORCL1
-rw-rw----. 1 oracle oinstall 1544 Mar 27 05:39 hc_orcl.dat
-rw-r-----. 1 oracle oinstall 3584 Mar 27 05:39 spfileorcl.ora

===> create standby log files on both database.

Node01:

ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=MANUAL;
ALTER DATABASE ADD LOGFILE ('/u01/app/oracle/oradata/ORCL/onlinelog/online_redo01.log') SIZE 50M;
ALTER DATABASE ADD LOGFILE ('/u01/app/oracle/oradata/ORCL/onlinelog/online_redo02.log') SIZE 50M;
ALTER DATABASE ADD LOGFILE ('/u01/app/oracle/oradata/ORCL/onlinelog/online_redo03.log') SIZE 50M;
ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO;


Node02:

ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=MANUAL;
ALTER DATABASE ADD LOGFILE ('/u01/app/oracle/oradata/ORCL1/onlinelog/online_redo01.log') SIZE 50M;
ALTER DATABASE ADD LOGFILE ('/u01/app/oracle/oradata/ORCL1/onlinelog/online_redo02.log') SIZE 50M;
ALTER DATABASE ADD LOGFILE ('/u01/app/oracle/oradata/ORCL1/onlinelog/online_redo03.log') SIZE 50M;
ALTER SYSTEM SET STANDBY_FILE_MANAGEMENT=AUTO;
SQL> SELECT protection_mode FROM v$database;

check standby protection mode:

PROTECTION_MODE
--------------------
MAXIMUM PERFORMANCE

SQL> ALTER DATABASE FORCE LOGGING;

Database altered.

SQL> select database_role from v$database;

DATABASE_ROLE
----------------
PHYSICAL STANDBY


log sequence on both database :

Node1:

SQL> ALTER SESSION SET nls_date_format='DD-MON-YYYY HH24:MI:SS';

Session altered.

SQL> SELECT sequence#, first_time, next_time
FROM   v$archived_log
ORDER BY sequence#;  2    3

 SEQUENCE# FIRST_TIME           NEXT_TIME
---------- -------------------- --------------------
         4 27-MAR-2017 05:10:37 27-MAR-2017 05:38:07
         5 27-MAR-2017 05:38:07 27-MAR-2017 05:39:32
         6 27-MAR-2017 05:39:32 27-MAR-2017 05:39:32
         7 27-MAR-2017 05:39:32 27-MAR-2017 05:59:36
         8 27-MAR-2017 05:59:36 27-MAR-2017 05:59:37

Node2: 

SQL> ALTER SESSION SET nls_date_format='DD-MON-YYYY HH24:MI:SS';

Session altered.

SQL> SELECT sequence#, first_time, next_time
FROM   v$archived_log
ORDER BY sequence#;  2    3

 SEQUENCE# FIRST_TIME           NEXT_TIME
---------- -------------------- --------------------
         5 27-MAR-2017 05:38:07 27-MAR-2017 05:39:32
         6 27-MAR-2017 05:39:32 27-MAR-2017 05:39:32

               *********end************

Tuesday 14 March 2017

oracle asm configuration on oracle eterprise linux 6


-----:) create raw partion which you use in asm disk configuration.

----:) install oracle asm packages.

[root@db11g Packages]# yum install oracleasm*
Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
Examining oracleasm-support-2.1.8-1.el6.x86_64.rpm: oracleasm-support-2.1.8-1.el6.x86_64
Marking oracleasm-support-2.1.8-1.el6.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package oracleasm-support.x86_64 0:2.1.8-1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================
 Package             Arch     Version        Repository                               Size
===========================================================================================
Installing:
 oracleasm-support   x86_64   2.1.8-1.el6    /oracleasm-support-2.1.8-1.el6.x86_64   216 k

Transaction Summary
===========================================================================================
Install       1 Package(s)

Total size: 216 k
Installed size: 216 k
Is this ok [y/N]: u
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : oracleasm-support-2.1.8-1.el6.x86_64                                    1/1
  Verifying  : oracleasm-support-2.1.8-1.el6.x86_64                                    1/1

Installed:
  oracleasm-support.x86_64 0:2.1.8-1.el6

Complete!
[root@db11g Packages]#

[root@db11g ~]# oracleasm init
Creating /dev/oracleasm mount point: /dev/oracleasm
Loading module "oracleasm": oracleasm
Configuring "oracleasm" to use device physical block size
Mounting ASMlib driver filesystem: /dev/oracleasm

[root@db11g ~]# oracleasm createdisk ASMDISK1 /dev/sda4
Writing disk header: done
Instantiating disk: done
[root@db11g ~]# oracleasm scandisks
Reloading disk partitions: done
Cleaning any stale ASM disks...
Scanning system for ASM disks...
[root@db11g ~]# oracleasm listdisks
ASMDISK1
[root@db11g ~]#

local yum configuration on oracle enterprise linux step by step

[root@db11g ~]# mount /dev/cdrw /media

mount: block device /dev/sr0 is write-protected, mounting read-only
[root@db11g ~]# cd /media

[root@db11g media]# cd Packages

[root@db11g Packages]# ls -ltr vsftpd*
-rw-rw-r--. 1 1039 1039 158284 May 12  2016 vsftpd-2.2.2-21.el6.x86_64.rpm

[root@db11g Packages]# rpm -ivh vsftpd-2.2.2-21.el6.x86_64.rpm
warning: vsftpd-2.2.2-21.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
        package vsftpd-2.2.2-21.el6.x86_64 is already installed
[root@db11g Packages]# mkdir /var/ftp/pub/Server

[root@db11g Packages]# cp * -rv /var/ftp/pub/Server

[root@db11g media]# cd /etc/yum.repos.d/

[root@db11g yum.repos.d]# cat  Server.repo
[Server]
name=Oracle Linux $releasever Latest ($basearch)
baseurl=ftp://192.168.***.***/pub/Server         (use local server ip ot hostname)
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-oracle
gpgcheck=0
enabled=1

[root@db11g Packages]# rpm -ivh deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
warning: deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
   1:deltarpm               ########################################### [100%]
[root@db11g Packages]# rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
warning: python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
   1:python-deltarpm        ########################################### [100%]
[root@db11g Packages]# rpm -ivh createrepo-0.9.9-24.el6.noarch.rpm
warning: createrepo-0.9.9-24.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Preparing...                ########################################### [100%]
   1:createrepo             ########################################### [100%]
[root@db11g Packages]#
[root@db11g Packages]# service network restart
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]

[root@db11g Packages]# service vsftpd restart
Shutting down vsftpd:                                      [FAILED]
Starting vsftpd for vsftpd:                                [  OK  ]

[root@db11g Packages]# chkconfig network on
[root@db11g Packages]# chkconfig vsftpd on

[root@db11g Packages]# createrepo -v /var/ftp/pub/Server

[root@db11g Packages]# yum install oracleasm*
Loaded plugins: refresh-packagekit, security, ulninfo
Setting up Install Process
Examining oracleasm-support-2.1.8-1.el6.x86_64.rpm: oracleasm-support-2.1.8-1.el6.x86_64
Marking oracleasm-support-2.1.8-1.el6.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package oracleasm-support.x86_64 0:2.1.8-1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================
 Package             Arch     Version        Repository                               Size
===========================================================================================
Installing:
 oracleasm-support   x86_64   2.1.8-1.el6    /oracleasm-support-2.1.8-1.el6.x86_64   216 k

Transaction Summary
===========================================================================================
Install       1 Package(s)

Total size: 216 k
Installed size: 216 k
Is this ok [y/N]: u
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : oracleasm-support-2.1.8-1.el6.x86_64                                    1/1
  Verifying  : oracleasm-support-2.1.8-1.el6.x86_64                                    1/1

Installed:
  oracleasm-support.x86_64 0:2.1.8-1.el6

Complete!
[root@db11g Packages]#

Wednesday 8 March 2017

convert oracle ASM database instance to normal database instance step by step.

OS details of both node:-
Linux DB11G.example.com 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
Red Hat Enterprise Linux Server release 5.4 (Tikanga)
DB name:
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL> select name from v$database;
NAME
---------
DB11G
Node1 hostname:
ASM.example.com
Node2 hostname:
DB11g.example.com
step1)
create pfile for spfile for duplicate database.
SQL> create pfile from spfile;
File created.
step2)
Create directory structure, same as DB11Gory database.
$ mkdir -p /u01/app/oracle/oradata/DB11G
$ mkdir -p /u01/app/oracle/fast_recovery_area/DB11G
$ mkdir -p /u01/app/oracle/admin/DB11G/adump
step3)
Make the following changes in pfile.

Replace the ASM disk with file system path.
*.audit_file_dest='/u01/app/oracle/admin/DB11G/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='/u01/app/oracle/oradata/DB11G/control01.CTL','/u01/app/oracle/fast_recovery_area/DB11G/control02.CTL'
*.db_block_size=8192
*.db_create_file_dest='/u01/app/oracle/oradata'
*.db_create_online_log_dest_1='/u01/app/oracle/fast_recovery_area'
*.db_domain=''
*.db_name='DB11G'
*.diagnostic_dest='/u01/app/oracle'

Step4)
Move password file and pfile to target location.
[oracle@ASM dbs]$ scp initDB11G.ora oracle@clone:/u01/app/oracle/product/11.2.0/db_1/dbs/
oracle@clone's password:
initDB11G.ora 100% 997 1.0KB/s 00:00
Monday, February 20, 2017
[oracle@ASM dbs]$ scp orapwDB11G oracle@clone:/u01/app/oracle/product/11.2.0/db_1/dbs/
oracle@clone's password:
orapwDB11G 100% 1536 1.5KB/s 00:00
[oracle@ASM dbs]$

Step5)
tnsname.ora on primary database server(DB11G.example.com)
# Generated by Oracle configuration tools.
DB11G =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DB11G.example.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = DB11G)
)
)
DB11G_tar =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = clone.example.com)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = DB11G)
(UR = A)
)
)

Step6)
Start duplicate (tareget) database in nomount.
[oracle@DB11G admin]$ export $ORACLE_SID=DB11G
[oracle@DB11G admin]$ echo $ORACLE_SID
DB11G
[oracle@DB11G admin]$ sqlplus
SQL*Plus: Release 11.2.0.3.0 Production on Fri Apr 1 21:50:36 2016
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Enter user-name: /as sysdba
Connected to an idle instance.

SQL> startup nomount;
ORACLE instance started.
Total System Global Area 839282688 bytes
Fixed Size 2233000 bytes
Variable Size 503319896 bytes
Database Buffers 331350016 bytes
Redo Buffers 2379776 bytes
SQL> exit
[oracle@asm dbs]$ rman TARGET sys/******@DB11G AUXILIARY sys/******@DB11G_tar
Recovery Manager: Release 11.2.0.3.0 - Production on Wed Mar 8 02:40:24 2017
Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.
connected to target database: DB11G (DBID=404263693)
connected to auxiliary database: DB11G (not mounted)
RMAN> DUPLICATE DATABASE TO DB11G
FROM ACTIVE DATABASE
NOFILENAMECHECK;2> 3>

Starting Duplicate Db at 08-MAR-17
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=20 device type=DISK
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     839282688 bytes
Fixed Size                     2233000 bytes
Variable Size                515902808 bytes
Database Buffers             318767104 bytes
Redo Buffers                   2379776 bytes
contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''DB11G'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''DB11G'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   backup as copy current controlfile auxiliary format  '/u01/app/oracle/oradata/DB11G/CONTROL01.CTL';
   restore clone controlfile to  '/u01/app/oracle/fast_recovery_area/DB11G/control02.CTL' from
 '/u01/app/oracle/oradata/DB11G/CONTROL01.CTL';
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  db_name =  ''DB11G'' comment= ''Modified by RMAN duplicate'' scope=spfile
sql statement: alter system set  db_unique_name =  ''DB11G'' comment= ''Modified by RMAN duplicate'' scope=spfile
Oracle instance shut down
Oracle instance started
Total System Global Area     839282688 bytes
Fixed Size                     2233000 bytes
Variable Size                515902808 bytes
Database Buffers             318767104 bytes
Redo Buffers                   2379776 bytes
Starting backup at 08-MAR-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=21 device type=DISK
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_DB11G.f tag=TAG20170308T024549 RECID=4 STAMP=938054749
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 08-MAR-17
Starting restore at 08-MAR-17
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=18 device type=DISK
channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 08-MAR-17
database mounted
contents of Memory Script:
{
   set newname for clone datafile  1 to new;
   set newname for clone datafile  2 to new;
   set newname for clone datafile  3 to new;
   set newname for clone datafile  4 to new;
   set newname for clone datafile  5 to new;
   backup as copy reuse
   datafile  1 auxiliary format new
   datafile  2 auxiliary format new
   datafile  3 auxiliary format new
   datafile  4 auxiliary format new
   datafile  5 auxiliary format new
   ;
   sql 'alter system archive log current';
}
executing Memory Script
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
executing command: SET NEWNAME
Starting backup at 08-MAR-17
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=+DATA/db11g/datafile/system.256.934594061
output file name=/u01/app/oracle/oradata/DB11G/datafile/o1_mf_system_04ruj535_.dbf tag=TAG20170308T024557
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=+DATA/db11g/datafile/sysaux.257.934594061
output file name=/u01/app/oracle/oradata/DB11G/datafile/o1_mf_sysaux_05ruj53u_.dbf tag=TAG20170308T024557
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=+DATA/db11g/datafile/example.261.934594145
output file name=/u01/app/oracle/oradata/DB11G/datafile/o1_mf_example_06ruj54n_.dbf tag=TAG20170308T024557
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=+DATA/db11g/datafile/undotbs1.258.934594063
output file name=/u01/app/oracle/oradata/DB11G/datafile/o1_mf_undotbs1_07ruj556_.dbf tag=TAG20170308T024557
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=+DATA/db11g/datafile/users.259.934594063
output file name=/u01/app/oracle/oradata/DB11G/datafile/o1_mf_users_08ruj559_.dbf tag=TAG20170308T024557
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 08-MAR-17
sql statement: alter system archive log current
contents of Memory Script:
{
   backup as copy reuse
   archivelog like  "/u01/app/oracle/product/11.2.0/db_1/dbs/archive1_8_934594127.arc" auxiliary format
 "/u01/app/oracle/product/11.2.0/db_1/dbs/archive1_8_934594127.arc"   ;
   catalog clone archivelog  "/u01/app/oracle/product/11.2.0/db_1/dbs/archive1_8_934594127.arc";
   switch clone datafile all;
}
executing Memory Script
Starting backup at 08-MAR-17
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=8 RECID=6 STAMP=938054828
output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/archive1_8_934594127.arc RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:01
Finished backup at 08-MAR-17
cataloged archived log
archived log file name=/u01/app/oracle/product/11.2.0/db_1/dbs/archive1_8_934594127.arc RECID=6 STAMP=938074630
datafile 1 switched to datafile copy
input datafile copy RECID=4 STAMP=938074630 file name=/u01/app/oracle/oradata/DB11G/datafile/o1_mf_system_04ruj535_.dbf
datafile 2 switched to datafile copy
input datafile copy RECID=5 STAMP=938074630 file name=/u01/app/oracle/oradata/DB11G/datafile/o1_mf_sysaux_05ruj53u_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=6 STAMP=938074630 file name=/u01/app/oracle/oradata/DB11G/datafile/o1_mf_undotbs1_07ruj556_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=7 STAMP=938074630 file name=/u01/app/oracle/oradata/DB11G/datafile/o1_mf_users_08ruj559_.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=8 STAMP=938074630 file name=/u01/app/oracle/oradata/DB11G/datafile/o1_mf_example_06ruj54n_.dbf
contents of Memory Script:
{
   set until scn  1163114;
   recover
   clone database
    delete archivelog
   ;
}
executing Memory Script
executing command: SET until clause
Starting recover at 08-MAR-17
using channel ORA_AUX_DISK_1
starting media recovery
archived log for thread 1 with sequence 8 is already on disk as file /u01/app/oracle/product/11.2.0/db_1/dbs/archive1_8_934594127.arc
archived log file name=/u01/app/oracle/product/11.2.0/db_1/dbs/archive1_8_934594127.arc thread=1 sequence=8
media recovery complete, elapsed time: 00:00:01
Finished recover at 08-MAR-17
Oracle instance started
Total System Global Area     839282688 bytes
Fixed Size                     2233000 bytes
Variable Size                515902808 bytes
Database Buffers             318767104 bytes
Redo Buffers                   2379776 bytes
contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''DB11G'' 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 =  ''DB11G'' 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     839282688 bytes
Fixed Size                     2233000 bytes
Variable Size                515902808 bytes
Database Buffers             318767104 bytes
Redo Buffers                   2379776 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "DB11G" RESETLOGS ARCHIVELOG
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES      100
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP   1  SIZE 50 M ,
  GROUP   2  SIZE 50 M ,
  GROUP   3  SIZE 50 M
 DATAFILE
  '/u01/app/oracle/oradata/DB11G/datafile/o1_mf_system_04ruj535_.dbf'
 CHARACTER SET WE8MSWIN1252
contents of Memory Script:
{
   set newname for clone tempfile  1 to new;
   switch clone tempfile all;
   catalog clone datafilecopy  "/u01/app/oracle/oradata/DB11G/datafile/o1_mf_sysaux_05ruj53u_.dbf",
 "/u01/app/oracle/oradata/DB11G/datafile/o1_mf_undotbs1_07ruj556_.dbf",
 "/u01/app/oracle/oradata/DB11G/datafile/o1_mf_users_08ruj559_.dbf",
 "/u01/app/oracle/oradata/DB11G/datafile/o1_mf_example_06ruj54n_.dbf";
   switch clone datafile all;
}
executing Memory Script
executing command: SET NEWNAME
renamed tempfile 1 to /u01/app/oracle/oradata/DB11G/datafile/o1_mf_temp_%u_.tmp in control file
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/DB11G/datafile/o1_mf_sysaux_05ruj53u_.dbf RECID=1 STAMP=938074644
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/DB11G/datafile/o1_mf_undotbs1_07ruj556_.dbf RECID=2 STAMP=938074644
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/DB11G/datafile/o1_mf_users_08ruj559_.dbf RECID=3 STAMP=938074644
cataloged datafile copy
datafile copy file name=/u01/app/oracle/oradata/DB11G/datafile/o1_mf_example_06ruj54n_.dbf RECID=4 STAMP=938074644
datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=938074644 file name=/u01/app/oracle/oradata/DB11G/datafile/o1_mf_sysaux_05ruj53u_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=938074644 file name=/u01/app/oracle/oradata/DB11G/datafile/o1_mf_undotbs1_07ruj556_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=938074644 file name=/u01/app/oracle/oradata/DB11G/datafile/o1_mf_users_08ruj559_.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=938074644 file name=/u01/app/oracle/oradata/DB11G/datafile/o1_mf_example_06ruj54n_.dbf

contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script
database opened
Finished Duplicate Db at 08-MAR-17
[oracle@db11g dbs]$ sqlplus

SQL*Plus: Release 11.2.0.3.0 Production on Wed Mar 8 08:35:17 2017
Copyright (c) 1982, 2011, Oracle.  All rights reserved.
Enter user-name: /as sysdba
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select instance_name from v$instance;
INSTANCE_NAME
----------------
DB11G


Sunday 19 February 2017

convert oracle RDBMS to ASM RDBMS step by step.

OS details of Both node:-

Linux DB11G.example.com 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux

Red Hat Enterprise Linux Server release 5.4 (Tikanga)

DB name:

SQL> select name from v$database;

NAME
---------
DB11G

Node1 hostname:

DB11G.example.com

Node2 hostname:

ASM_DB.example.com

step1)

create pfile for spfile for duplicate database.

SQL> create pfile from spfile;

File created.

step2)
make the following changes in pfile.

I have already created 2 ASM diskgroups DATA and FRA.

*.control_files=(+DATA, +FRA)
*.db_recovery_file_dest=+FRA
*.db_recovery_file_dest_size=2147483648
*.db_create_file_dest=+DATA
*.db_create_online_log_dest_1=+FRA
*.db_create_online_log_dest_2=+DATA -- optional if you want another online redo logs dest.

move password file and pfile to target location.

[oracle@DB11G dbs]$ scp initDB11G.ora oracle@ASM_DB:/u01/app/oracle/product/11.2.0/db_1/dbs/
oracle@ASM_DB's password:
initDB11G.ora 100% 997 1.0KB/s 00:00

[oracle@DB11G dbs]$ scp orapwDB11G oracle@ASM_DB:/u01/app/oracle/product/11.2.0/db_1/dbs/
oracle@ASM_DB's password:
orapwDB11G 100% 1536 1.5KB/s 00:00
[oracle@DB11G dbs]$

step3)

Create directory structure, same as DB11Gory database.         ---------optional

$ mkdir -p /u01/app/oracle/oradata/DB11G
$ mkdir -p /u01/app/oracle/fast_recovery_area/DB11G
$ mkdir -p /u01/app/oracle/admin/DB11G/adump

step4)
tnsname.ora  on primary database server(DB11G.example.com)

# Generated by Oracle configuration tools.

DB11G =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = DB11G.example.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = DB11G)
    )
  )
DB11G_tar =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = ASM_DB.example.com)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = DB11G)
    (UR = A)
    )
  )

step5)

Start duplicate (tareget) database in nomount.

[oracle@ASM_DB admin]$ export $ORACLE_SID=DB11G
[oracle@ASM_DB admin]$ echo $ORACLE_SID
DB11G
[oracle@ASM_DB admin]$ sqlplus

SQL*Plus: Release 11.2.0.3.0 Production on Fri Apr 1 21:50:36 2016
Copyright (c) 1982, 2011, Oracle. All rights reserved.

Enter user-name: /as sysdba

Connected to an idle instance.

SQL> startup nomount;

ORACLE instance started.
Total System Global Area 839282688 bytes
Fixed Size 2233000 bytes
Variable Size 503319896 bytes
Database Buffers 331350016 bytes
Redo Buffers 2379776 bytes

SQL> exit

step6)
-->connect rman using target and auxilary command.

[oracle@DB11G admin]$ rman TARGET sys/*****@DB11G AUXILIARY sys/*****@DB11G_tar
Recovery Manager: Release 11.2.0.3.0 - Production on Mon Feb 20 05:22:22 2017

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

connected to target database: DB11G (DBID=405647198)
connected to auxiliary database (not started)

RMAN> DUPLICATE DATABASE TO DB11G
FROM ACTIVE DATABASE
NOFILENAMECHECK;2> 3>

Starting Duplicate Db at 20-FEB-17
using target database control file instead of recovery catalog
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=25 device type=DISK

contents of Memory Script:
{
   sql clone "alter system set  control_files =
  ''+DATA/db11g/controlfile/current.256.936422163'', ''+FRA/db11g/controlfile/current.256.936422163'' comment=
 ''Set by RMAN'' scope=spfile";
   sql clone "alter system set  db_name =
 ''DB11G'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''DB11G'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   backup as copy current controlfile auxiliary format  '+DATA/db11g/controlfile/current.256.936422163';
   restore clone controlfile to  '+FRA/db11g/controlfile/current.256.936422163' from
 '+DATA/db11g/controlfile/current.256.936422163';
   sql clone "alter system set  control_files =
  ''+DATA/db11g/controlfile/current.256.936422163'', ''+FRA/db11g/controlfile/current.256.936422163'' comment=
 ''Set by RMAN'' scope=spfile";
   shutdown clone immediate;
   startup clone nomount;
   alter clone database mount;
}
executing Memory Script

sql statement: alter system set  control_files =   ''+DATA/db11g/controlfile/current.256.936422163'', ''+FRA/db11g/controlfile/current.256.936422163'' comment= ''Set by RMAN'' scope=spfile

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

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

Oracle instance shut down

Oracle instance started

Total System Global Area     839282688 bytes

Fixed Size                     2233000 bytes
Variable Size                503319896 bytes
Database Buffers             331350016 bytes
Redo Buffers                   2379776 bytes

Starting backup at 20-FEB-17
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=41 device type=DISK
channel ORA_DISK_1: starting datafile copy
copying current control file
output file name=/u01/app/oracle/product/11.2.0/db_1/dbs/snapcf_DB11G.f tag=TAG20170220T052331 RECID=2 STAMP=936422612
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
Finished backup at 20-FEB-17

Starting restore at 20-FEB-17
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=23 device type=DISK

channel ORA_AUX_DISK_1: copied control file copy
Finished restore at 20-FEB-17

sql statement: alter system set  control_files =   ''+DATA/db11g/controlfile/current.256.936422163'', ''+FRA/db11g/controlfile/current.256.936422163'' comment= ''Set by RMAN'' scope=spfile

Oracle instance shut down

connected to auxiliary database (not started)
Oracle instance started

Total System Global Area     839282688 bytes

Fixed Size                     2233000 bytes
Variable Size                503319896 bytes
Database Buffers             331350016 bytes
Redo Buffers                   2379776 bytes

database mounted

contents of Memory Script:
{
   set newname for clone datafile  1 to new;
   set newname for clone datafile  2 to new;
   set newname for clone datafile  3 to new;
   set newname for clone datafile  4 to new;
   set newname for clone datafile  5 to new;
   backup as copy reuse
   datafile  1 auxiliary format new
   datafile  2 auxiliary format new
   datafile  3 auxiliary format new
   datafile  4 auxiliary format new
   datafile  5 auxiliary format new
   ;
   sql 'alter system archive log current';
}
executing Memory Script

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting backup at 20-FEB-17
using channel ORA_DISK_1
channel ORA_DISK_1: starting datafile copy
input datafile file number=00001 name=/u01/app/oracle/oradata/DB11G/system01.dbf
output file name=+DATA/db11g/datafile/system.258.936422633 tag=TAG20170220T052351
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:45
channel ORA_DISK_1: starting datafile copy
input datafile file number=00002 name=/u01/app/oracle/oradata/DB11G/sysaux01.dbf
output file name=+DATA/db11g/datafile/sysaux.259.936422679 tag=TAG20170220T052351
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:25
channel ORA_DISK_1: starting datafile copy
input datafile file number=00005 name=/u01/app/oracle/oradata/DB11G/example01.dbf
output file name=+DATA/db11g/datafile/example.260.936422703 tag=TAG20170220T052351
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:15
channel ORA_DISK_1: starting datafile copy
input datafile file number=00003 name=/u01/app/oracle/oradata/DB11G/undotbs01.dbf
output file name=+DATA/db11g/datafile/undotbs1.261.936422719 tag=TAG20170220T052351
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:03
channel ORA_DISK_1: starting datafile copy
input datafile file number=00004 name=/u01/app/oracle/oradata/DB11G/users01.dbf
output file name=+DATA/db11g/datafile/users.262.936422721 tag=TAG20170220T052351
channel ORA_DISK_1: datafile copy complete, elapsed time: 00:00:01
Finished backup at 20-FEB-17

sql statement: alter system archive log current

contents of Memory Script:
{
   backup as copy reuse
   archivelog like  "/u01/archive/1_6_935977633.arc" auxiliary format
 "/u01/archive/1_6_935977633.arc"   ;
   catalog clone archivelog  "/u01/archive/1_6_935977633.arc";
   switch clone datafile all;
}
executing Memory Script

Starting backup at 20-FEB-17
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log copy
input archived log thread=1 sequence=6 RECID=4 STAMP=936422722
output file name=/u01/archive/1_6_935977633.arc RECID=0 STAMP=0
channel ORA_DISK_1: archived log copy complete, elapsed time: 00:00:03
Finished backup at 20-FEB-17

cataloged archived log
archived log file name=/u01/archive/1_6_935977633.arc RECID=4 STAMP=936422727

datafile 1 switched to datafile copy
input datafile copy RECID=2 STAMP=936422727 file name=+DATA/db11g/datafile/system.258.936422633
datafile 2 switched to datafile copy
input datafile copy RECID=3 STAMP=936422727 file name=+DATA/db11g/datafile/sysaux.259.936422679
datafile 3 switched to datafile copy
input datafile copy RECID=4 STAMP=936422727 file name=+DATA/db11g/datafile/undotbs1.261.936422719
datafile 4 switched to datafile copy
input datafile copy RECID=5 STAMP=936422727 file name=+DATA/db11g/datafile/users.262.936422721
datafile 5 switched to datafile copy
input datafile copy RECID=6 STAMP=936422727 file name=+DATA/db11g/datafile/example.260.936422703

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

executing command: SET until clause

Starting recover at 20-FEB-17
allocated channel: ORA_AUX_DISK_1
channel ORA_AUX_DISK_1: SID=23 device type=DISK

starting media recovery

archived log for thread 1 with sequence 6 is already on disk as file /u01/archive/1_6_935977633.arc
archived log file name=/u01/archive/1_6_935977633.arc thread=1 sequence=6
media recovery complete, elapsed time: 00:00:01
Finished recover at 20-FEB-17
Oracle instance started

Total System Global Area     839282688 bytes

Fixed Size                     2233000 bytes
Variable Size                503319896 bytes
Database Buffers             331350016 bytes
Redo Buffers                   2379776 bytes

contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''DB11G'' 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 =  ''DB11G'' 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     839282688 bytes

Fixed Size                     2233000 bytes
Variable Size                503319896 bytes
Database Buffers             331350016 bytes
Redo Buffers                   2379776 bytes
sql statement: CREATE CONTROLFILE REUSE SET DATABASE "DB11G" RESETLOGS ARCHIVELOG
  MAXLOGFILES     16
  MAXLOGMEMBERS      3
  MAXDATAFILES      100
  MAXINSTANCES     8
  MAXLOGHISTORY      292
 LOGFILE
  GROUP   1  SIZE 50 M ,
  GROUP   2  SIZE 50 M ,
  GROUP   3  SIZE 50 M
 DATAFILE
  '+DATA/db11g/datafile/system.258.936422633'
 CHARACTER SET WE8MSWIN1252


contents of Memory Script:
{
   set newname for clone tempfile  1 to new;
   switch clone tempfile all;
   catalog clone datafilecopy  "+DATA/db11g/datafile/sysaux.259.936422679",
 "+DATA/db11g/datafile/undotbs1.261.936422719",
 "+DATA/db11g/datafile/users.262.936422721",
 "+DATA/db11g/datafile/example.260.936422703";
   switch clone datafile all;
}
executing Memory Script

executing command: SET NEWNAME

renamed tempfile 1 to +DATA in control file

cataloged datafile copy
datafile copy file name=+DATA/db11g/datafile/sysaux.259.936422679 RECID=1 STAMP=936422745
cataloged datafile copy
datafile copy file name=+DATA/db11g/datafile/undotbs1.261.936422719 RECID=2 STAMP=936422745
cataloged datafile copy
datafile copy file name=+DATA/db11g/datafile/users.262.936422721 RECID=3 STAMP=936422745
cataloged datafile copy
datafile copy file name=+DATA/db11g/datafile/example.260.936422703 RECID=4 STAMP=936422745

datafile 2 switched to datafile copy
input datafile copy RECID=1 STAMP=936422745 file name=+DATA/db11g/datafile/sysaux.259.936422679
datafile 3 switched to datafile copy
input datafile copy RECID=2 STAMP=936422745 file name=+DATA/db11g/datafile/undotbs1.261.936422719
datafile 4 switched to datafile copy
input datafile copy RECID=3 STAMP=936422745 file name=+DATA/db11g/datafile/users.262.936422721
datafile 5 switched to datafile copy
input datafile copy RECID=4 STAMP=936422745 file name=+DATA/db11g/datafile/example.260.936422703

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

database opened
Finished Duplicate Db at 20-FEB-17

RMAN> exit

step7)
check ASM RDBMS

[oracle@ASM_DB ~]$ sqlplus

SQL*Plus: Release 11.2.0.3.0 Production on Mon Feb 20 05:27:39 2017

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

Enter user-name: /as sysdba

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

SQL> select name from v$database;

NAME
---------
DB11G

SQL> select FILE_NAME from dba_data_files;

FILE_NAME
--------------------------------------------------------------------------------
+DATA/db11g/datafile/system.258.936422633
+DATA/db11g/datafile/sysaux.259.936422679
+DATA/db11g/datafile/undotbs1.261.936422719
+DATA/db11g/datafile/users.262.936422721
+DATA/db11g/datafile/example.260.936422703


SQL>

work on autovacuum postgreSQL parameter

 In This blog, we are discussing the auto vacuum parameter on a small scale. we will understand the below parameters and will see how to mod...