Translate

Friday, 22 March 2013

11203 RMAN Active Database Cloning without Source Backup



11203 RMAN Active Database Cloning without Source Backup:

Source database will be in Mount Stage (No ArchiveLog Mode) è SRCDB
Target Database will be In NoMount Stage while Active cloning:  è DUPB
Time Taken: 12mins for 180GB (Same Server with ASM DiskGroup) 

Steps Overview:

Step1: Source DB = Mount (NO ARCHIVE LOG)

Setp2: Target DB - Nomount  (Auxiliary)

Step3: RMAN -

run {
 ALLOCATE CHANNEL d1 TYPE DISK ;
 ALLOCATE CHANNEL d2 TYPE DISK ;
 ALLOCATE CHANNEL d3 TYPE DISK ;
 ALLOCATE AUXILIARY CHANNEL a1 TYPE DISK ;
 ALLOCATE AUXILIARY CHANNEL a2 TYPE DISK ;
 ALLOCATE AUXILIARY CHANNEL a3 TYPE DISK ;
 duplicate target database to DUPDB  from active database;
 }


Step 4: Copy the wallet encryption file from source db  to target db (if you having Wallet encryption in your database)

Step5: start the db in mount stage (after cloning) 

step6: open the wallet

step7: Alter database open;
 


 
Generating Pfile from Cloning Duplicate Database:

[oracle@MyServer ~]$ echo $ORACLE_SID
SRCDB
[oracle@MyServer ~]$ sqlplus '/as sysdba'
SQL> create pfile='/localfs/export/SRCDB/initSRCDB.ora' from spfile;
File created.
SQL> exit
 
Edit your PFILE:
[oracle@MyServer SRCDB]$ cp initSRCDB.ora initDUPDB.ora
[oracle@MyServer SRCDB]$ vi initDUPDB.ora           
*.audit_file_dest='/localfs/orasrc/admin/DUPDB/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
#*.control_files='/localfs/oradata/DUPDB/control01.ctl','/localfs/oradata/DUPDB/control02.ctl'
*.db_block_size=8192
*.db_domain='MYDOMAIN.ORG'
*.db_name='DUPDB'
*.diagnostic_dest='/localfs/orasrc'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=DUPDBXDB)'
*.open_cursors=300
*.pga_aggregate_target=235929600
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=707788800
*.undo_tablespace='UNDOTBS1'
db_file_name_convert='/localfs/oradata/SRCDB/','/localfs/oradata/DUPDB/'
log_file_name_convert='/localfs/oradata/SRCDB/','/localfs/oradata/DUPDB/'
 
Copy your Soruce Password file
[oracle@MyServer SRCDB]$ cd $ORACLE_HOME/dbs
[oracle@MyServer dbs]$ cp orapwSRCDB orapwDUPDB
[oracle@MyServer dbs]$ cd -
/localfs/export/SRCDB 
Creating Spfile:
 
[oracle@MyServer SRCDB]$ sqlplus '/as sysdba'
SQL*Plus: Release 11.2.0.2.0 Production on Tue Feb 19 04:14:33 2013
Copyright (c) 1982, 2010, Oracle.  All rights reserved.
Connected to an idle instance.
SQL> create spfile from pfile='/localfs/export/SRCDB/initDUPDB.ora';
File created. 
SQL> startup nomount;
ORACLE instance started.
Total System Global Area  705662976 bytes
Fixed Size                  2229840 bytes
Variable Size             201329072 bytes
Database Buffers          494927872 bytes
Redo Buffers                7176192 bytes
SQL> exit
 
Source Database Mount:
 
[oracle@MyServer admin]$ echo $ORACLE_SID
SRCDB 
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
 
SQL> startup mount;
ORACLE instance started.
Total System Global Area  705662976 bytes
Fixed Size                  2229840 bytes
Variable Size             201329072 bytes
Database Buffers          494927872 bytes
Redo Buffers                7176192 bytes
Database mounted.
SQL> exit
 
My Listener Entries:
 
LSNR_DUPDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = MyServer.MYDOMAIN.ORG)(PORT = 1522))
  )
 
SID_LIST_LSNR_DUPDB =
  (SID_LIST =
    (SID_DESC =
      (GLOBAL_DBNAME = DUPDB.MYDOMAIN.ORG)
      (ORACLE_HOME = /localfs/orasrc/product/db/11.2.0.2)
      (SID_NAME = DUPDB)
    )
    (SID_DESC =
      (GLOBAL_DBNAME = SRCDB.MYDOMAIN.ORG)
      (ORACLE_HOME = /localfs/orasrc/product/db/11.2.0.2)
      (SID_NAME = SRCDB)
    )
  )
 
[oracle@MyServer admin]$ ps -ef | grep tns
oracle   28013     1  0 04:36 ?        00:00:00 /localfs/orasrc/product/db/11.2.0.2/bin/tnslsnr LSNR_DUPDB -inherit
 
Note:  NoMount Stage Database required the Seperate Listener to avoid the below error while cloning the database using RMAN Auxiliary connection
ORA-12528: TNS:listener: all appropriate instances are blocking new connections
 
My TnsName Entry:
SRCDB.MYDOMAIN.ORG =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = MyServer.MYDOMAIN.ORG)(PORT = 1522))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = SRCDB.MYDOMAIN.org)
    )
  )
 
DUPDB.MYDOMAIN.ORG =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = MyServer.MYDOMAIN.ORG)(PORT = 1522))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = DUPDB.MYDOMAIN.org)
    )
  )
 
=============================================================================
RMAN Execution:
 
[oracle@MyServer SRCDB]$ rman
Recovery Manager: Release 11.2.0.2.0 - Production on Tue Feb 19 04:40:54 2013
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  All rights reserved.
RMAN> connect auxiliary sys/PassWd@DUPDB
connected to auxiliary database: DUPDB (not mounted)
RMAN> connect target sys/PassWd@SRCDB
connected to target database: SRCDB (DBID=523443299, not open)
RMAN> run
2>  {
3>  ALLOCATE CHANNEL d1 TYPE DISK ;
 ALLOCATE CHANNEL d2 TYPE DISK ;
4> 5>  ALLOCATE CHANNEL d3 TYPE DISK ;
6>  ALLOCATE AUXILIARY CHANNEL a1 TYPE DISK ;
7>  ALLOCATE AUXILIARY CHANNEL a2 TYPE DISK ;
8>  ALLOCATE AUXILIARY CHANNEL a3 TYPE DISK ;
9>  duplicate target database to DUPDB from active database;
10>  }
using target database control file instead of recovery catalog
allocated channel: d1
channel d1: SID=63 device type=DISK
allocated channel: d2
channel d2: SID=129 device type=DISK
allocated channel: d3
channel d3: SID=191 device type=DISK
allocated channel: a1
channel a1: SID=63 device type=DISK
allocated channel: a2
channel a2: SID=129 device type=DISK
allocated channel: a3
channel a3: SID=192 device type=DISK
Starting Duplicate Db at 19-FEB-13
contents of Memory Script:
{
   sql clone "alter system set  db_name =
 ''SRCDB'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   sql clone "alter system set  db_unique_name =
 ''DUPDB'' comment=
 ''Modified by RMAN duplicate'' scope=spfile";
   shutdown clone immediate;
   startup clone force nomount
   backup as copy current controlfile auxiliary format  '/localfs/orasrc/product/db/11.2.0.2/dbs/cntrlDUPDB.dbf';
   alter clone database mount;
}
executing Memory Script
......
......
......
......
 
contents of Memory Script:
{
   Alter clone database open resetlogs;
}
executing Memory Script
database opened
Finished Duplicate Db at 19-FEB-13
released channel: d1
released channel: d2
released channel: d3
released channel: a1
released channel: a2
released channel: a3
RMAN> exit

Recovery Manager complete.
[oracle@MyServer SRCDB]$
 
=============================================================================
 
[oracle@MyServer ~]$ export ORACLE_SID=DUPDB
[oracle@MyServer ~]$ sqlplus '/as sysdba'
 
SQL*Plus: Release 11.2.0.2.0 Production on Tue Feb 19 04:45:02 2013
Copyright (c) 1982, 2010, Oracle.  All rights reserved.

Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
 
SQL> select open_mode from v$database;
OPEN_MODE
------------------------------------------------------------
READ WRITE
 
======================================================================




 

Oracle 11203 Database Creation Using CommandLine DBCA




Oracle 11203 Database Creation Using CommandLine DBCA
 

I have configure my Database using General Purpose template with Common Datafile Location
it's a Non-RAC Standalone Database



dbca -silent -createDatabase   \
 -templateName General_Purpose.dbc \
 -gdbname MYDEVDB.MYCORPDOMAIN.COM -sid MYDEVDB  \
 -sysPassword oracle -systemPassword oracle \
  -totalmemory 700 \
 -responseFile NO_VALUE  \
 -DATAFILEDESTINATION /oradata/MYDEVP \
 -characterSet UTF8  \
-emConfiguration NONE

11G Binary Silent mode Installation


Oracle 11.2.0.3 Binary Installation using Silent mode method

Hi DBA’s,


I have tried and completed the Silent Mode installation in Solaris for the Non-RAC Database setup.

Here am shared the Response file and logs for your view, try this in your test box first.

I hope it will be useful for you to avoid, GUI mode in Future.

 
Please check Response file carefully because, there are lot of changes from previous versions.
 
Please check where you need to set your environment.
 

Response file: Common Parameters for all environments


 

  • oracle.install.responseFileVersion=/oracle/install/rspfmt_dbinstall_response_schema_v11_2_0
  • oracle.install.option=INSTALL_DB_SWONLY
  • #ORACLE_HOSTNAME=
  • UNIX_GROUP_NAME=
  • INVENTORY_LOCATION=
  • SELECTED_LANGUAGES=en
  • ORACLE_HOME=
  • ORACLE_BASE=
  • oracle.install.db.InstallEdition=EE
  • oracle.install.db.EEOptionsSelection=false
  • oracle.install.db.optionalComponents=oracle.rdbms.partitioning:11.2.0.3.0,oracle.oraolap:11.2.0.3.0,oracle.rdbms.dm:11.2.0.3.0,oracle.rdbms.dv:11.2.0.3.0,oracle.rdbms.lbac:11.2.0.3.0,oracle.rdbms.rat:11.2.0.3.0
  • oracle.install.db.DBA_GROUP= < Provide Group Name>
  • oracle.install.db.OPER_GROUP=
  • #oracle.install.db.CLUSTER_NODES=
  • #oracle.install.db.isRACOneInstall=
  • #oracle.install.db.racOneServiceName=
  • #oracle.install.db.config.starterdb.type=
  • #oracle.install.db.config.starterdb.globalDBName=
  • #oracle.install.db.config.starterdb.SID=
  • oracle.install.db.config.starterdb.characterSet=UTF8
  • #oracle.install.db.config.starterdb.memoryOption=true
  • #oracle.install.db.config.starterdb.memoryLimit=
  • #oracle.install.db.config.starterdb.installExampleSchemas=false
  • #oracle.install.db.config.starterdb.enableSecuritySettings=true
  • #oracle.install.db.config.starterdb.password.ALL=
  • #oracle.install.db.config.starterdb.password.SYS=
  • #oracle.install.db.config.starterdb.password.SYSTEM=
  • #oracle.install.db.config.starterdb.password.SYSMAN=
  • #oracle.install.db.config.starterdb.password.DBSNMP=
  • #oracle.install.db.config.starterdb.control=DB_CONTROL
  • #oracle.install.db.config.starterdb.gridcontrol.gridControlServiceURL=
  • #oracle.install.db.config.starterdb.automatedBackup.enable=false
  • #oracle.install.db.config.starterdb.automatedBackup.osuid=
  • #oracle.install.db.config.starterdb.automatedBackup.ospwd=
  • #oracle.install.db.config.starterdb.storageType=
  • #oracle.install.db.config.starterdb.fileSystemStorage.dataLocation=
  • #oracle.install.db.config.starterdb.fileSystemStorage.recoveryLocation=
  • #oracle.install.db.config.asm.diskGroup=
  • #oracle.install.db.config.asm.ASMSNMPPassword=
  • #MYORACLESUPPORT_USERNAME=
  • #MYORACLESUPPORT_PASSWORD=
  • #SECURITY_UPDATES_VIA_MYORACLESUPPORT=
  • DECLINE_SECURITY_UPDATES=true
  • #PROXY_HOST=
  • #PROXY_PORT=
  • #PROXY_USER=
  • #PROXY_PWD=
  • #PROXY_REALM=
  • #COLLECTOR_SUPPORTHUB_URL=
  • oracle.installer.autoupdates.option=SKIP_UPDATES
  • oracle.installer.autoupdates.downloadUpdatesLoc=
  • #AUTOUPDATES_MYORACLESUPPORT_USERNAME=
  • #AUTOUPDATES_MYORACLESUPPORT_PASSWORD=



I have used the minimum requirement for my environment:

./runInstaller -silent -ignoreSysPrereqs -debug -force \
FROM_LOCATION=/home/oracle/orabinary/11GR2-Solaris64/database/stage/products.xml \
oracle.install.option=INSTALL_DB_SWONLY \
UNIX_GROUP_NAME=dba \
INVENTORY_LOCATION=/MYDEVP/app/oraInventory \
ORACLE_HOME=/MYDEVP/app/oracle/product/db/11.2.0.3 \
ORACLE_HOME_NAME="OraDb11g_Home1" \
ORACLE_BASE=/MYDEVP/app/oracle \
oracle.install.db.InstallEdition=EE \
oracle.install.db.isCustomInstall=false \
oracle.install.db.DBA_GROUP=dba \
oracle.install.db.OPER_GROUP=dba \
DECLINE_SECURITY_UPDATES=true \
SECURITY_UPDATES_VIA_MYORACLESUPPORT=false
==========================================================================


Please check your logfile during installation.

You get following output during execution : (sample)
MYHOST=> cd
MYHOST=>./runInstaller -responseFile /database/response/db_install.rsp -silent -ignoreSysPrereqs
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 180 MB.   Actual 28287 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 28654 MB    Passed

The commandline for unzip:
/home/oracle/orabinary/11GR2-Solaris64/database/install/unzip -o ../stage/Components/oracle.jdk/1.5.0.30.03/1/DataFiles/\*.jar -d /tmp/OraInstall2013-03-21_07-44-44AM
Using the umask value '022' available from oraparam.ini

....
.....
.......

The installation of Oracle Database 11g was successful.
Please check '/MYDEVP/app/oraInventory/logs/silentInstall2013-03-21_07-49-50AM.log' for more details.

As a root user, execute the following script(s):
        1. /MYDEVP/app/oraInventory/orainstRoot.sh
        2. /MYDEVP/app/oracle/product/db/11.2.0.3/root.sh


Successfully Setup Software.
copying /MYDEVP/app/oraInventory/logs/oraInstall2013-03-21_07-49-50AM.out to /MYDEVP/app/oracle/product/db/11.2.0.3/cfgtoollogs/oui/oraInstall2013-03-21_07-49-50AM.out
copying /MYDEVP/app/oraInventory/logs/oraInstall2013-03-21_07-49-50AM.err to /MYDEVP/app/oracle/product/db/11.2.0.3/cfgtoollogs/oui/oraInstall2013-03-21_07-49-50AM.err
copying /MYDEVP/app/oraInventory/logs/installActions2013-03-21_07-49-50AM.log to /MYDEVP/app/oracle/product/db/11.2.0.3/cfgtoollogs/oui/installActions2013-03-21_07-49-50AM.log
copying /MYDEVP/app/oraInventory/logs/silentInstall2013-03-21_07-49-50AM.log to /MYDEVP/app/oracle/product/db/11.2.0.3/cfgtoollogs/oui/silentInstall2013-03-21_07-49-50AM.log

======================================================================
MYHOST#/MYDEVP/app/oraInventory/orainstRoot.sh
Changing permissions of /MYDEVP/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /MYDEVP/app/oraInventory to dba.
The execution of the script is complete.

MYHOST#/MYDEVP/app/oracle/product/db/11.2.0.3/root.sh
Check /MYDEVP/app/oracle/product/db/11.2.0.3/install/root_MYHOST_2013-03-21_08-24-57.log for the output of root script

Performing root user operation for Oracle 11g
The following environment variables are set as:
    ORACLE_OWNER= oracle
    ORACLE_HOME=  /MYDEVP/app/oracle/product/db/11.2.0.3
Creating /var/opt/oracle/oratab file...
Entries will be added to the /var/opt/oracle/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
Finished product-specific root actions.

~
=====================================================================