[prev in list] [next in list] [prev in thread] [next in thread]
List: hpux-admin
Subject: [HPADM] Summary: Cloning Oracle SID software ($ORACLE_HOME) with BCVs
From: "Abramson, Stuart" <SAbramson () Wabtec ! com>
Date: 2003-11-26 15:21:25
[Download RAW message or body]
Thanks to:
Denny Koovakattu
Dan Copeland
IlicR@stentor.ca <mailto:IlicR@stentor.ca>
Lynn Sattler
We're cloning Oracle BCVs to another server, and changing the:
hostname
SID Name
Mount Point names
Listener Ports
The "clone rules" are:
1. Edit Files to point to proper locations/values:
initSID.ora
tnsnames.ora
listener.ora
2. Replace symbolic links under ORACLE_HOME with new path.
3. Need to relink binaries to (if path has changed.). (See
above.)
4. mv $ORACLE_HOME/admin/SID to the new SID name.
5. Edit Apache files (above) if we use the Oracle bundled
Apache.
6. Reset the Oracle passwds with "orapwd" utility, if
initSID.ora:"remote_login_passwordfile" = "exclusive",
which ours is.
7. If you use "Oracle Intelliget Agent", then edit:
snmp_ro.ora
snmp_rw.ora
services.ora
8. If you use "Oracle Enterprise Manager", then edit:
OEMclient.properties.
The followin code will do that:
# 1. Rename files in Oracle Software directory from $OLD_SID
# to $NEW_SID.
find $NEW_MP_SW -name "*${OLD_SID}*" | while read FILE
do
NEWFILE=$( echo $FILE | sed "s/${OLD_SID}/${NEW_SID}/g" )
mv $FILE $NEWFILE
chown oracle:dba $NEWFILE
done
# Do it TWICE!
find $NEW_MP_SW -name "*${OLD_SID}*" | while read FILE
do
NEWFILE=$( echo $FILE | sed "s/${OLD_SID}/${NEW_SID}/g" )
mv $FILE $NEWFILE
done
# 2. Edit key files:
# The key files are:
KEY_FILES=" $ORA_HOME/dbs/init${NEW_SID}.ora
$ORA_HOME/network/admin/listener.ora
$ORA_HOME/network/admin/tnsnames.ora "
# The key "values" to replace are:
for FILE in $KEY_FILES
do
# Host, Oracle SID name, Port
sed "s/$OLD_HOST/$NEW_HOST/g" $FILE \
| sed "s/$OLD_SID/$NEW_SID/g" \
| sed "s/$OLD_PORT/$NEW_PORT/g" > $FILE.new1
# Mount Points:
set -A OLD_DIRS $OLD_MPS
set -A NEW_DIRS $NEW_MPS
CNT=${#OLD_DIRS[@]}
#
(( I=0 ))
while (( I < CNT ))
do
sed "s?${OLD_DIRS[$I]}?${NEW_DIRS[$I]}?g" $FILE.new1
> $FILE.new2
mv $FILE.new2 $FILE.new1
(( I=I+1 ))
done
mv $FILE.new1 $FILE
chown oracle:dba $FILE
done
# 3. Relink symbolic-linked files
find $NEW_MP_SW -type l | while read LINK
do
FILE=$( ll $LINK | awk -F">" '{print $2}' )
NEW_FILE=$( echo $FILE | sed "s?$OLD_MP_SW?$NEW_MP_SW?" )
echo $FILE | grep -q $OLD_MP_SW
if (( $? == 0 ))
then
# This is a soft link to the Old Mount Point Name
rm $LINK
ln -s $NEW_FILE $LINK
ll $LINK
fi
done
_____
From: Abramson, Stuart
Sent: Friday, November 21, 2003 5:10 PM
To: 'Denny Koovakattu'
Subject: RE: [HPADM] Cloning Oracle SID software ($ORACLE_HOME) with BCVs
Denny:
Here are some files that I'm looking at either because they reference
"hostname", "SID name" or contain the host or SID in their names.:
(Asterisk indicate files you mentioned below.)
/u1001/app/oracle/product/9.2.0/Apache/Apache/conf/httpd.conf
/u1001/app/oracle/product/9.2.0/Apache/Apache/conf/httpd.conf.default
/u1001/app/oracle/product/9.2.0/Apache/Apache/setupinfo.txt
/u1001/app/oracle/product/9.2.0/admin/HOTB*
/u1001/app/oracle/product/9.2.0/dbs/initHOTB.ora*
/u1001/app/oracle/product/9.2.0/dbs/lkHOTB
/u1001/app/oracle/product/9.2.0/dbs/orapwHOTB
/u1001/app/oracle/product/9.2.0/network/admin/listener.ora*
/u1001/app/oracle/product/9.2.0/network/admin/snmp_ro.ora
/u1001/app/oracle/product/9.2.0/network/admin/snmp_rw.ora
/u1001/app/oracle/product/9.2.0/network/admin/tnsnames.ora*
/u1001/app/oracle/product/9.2.0/network/agent/services.ora
/u1001/app/oracle/product/9.2.0/sysman/config/OEMClient.properties
What do you think?
Stuart
_____
From: Denny Koovakattu [mailto:groups@koovakattu.com]
Sent: Friday, November 21, 2003 4:52 PM
To: Abramson, Stuart
Subject: Re: [HPADM] Cloning Oracle SID software ($ORACLE_HOME) with BCVs
I am not aware of any Oracle utilities to do this. I am assuming you have
the cloning part covered, i.e., recovering the DB. If the path to
$ORACLE_HOME is changing I would suggest relinking the Oracle binaries (even
though it might work without relinking.) In the past some utilities have
failed due to embedded paths to shared libraries. I make it a point to set
LDOPTS=+s while linking Oracle. Else chatr them later. What we have done in
the past is to keep a template of the initSID.ora, listener.ora and the
tnsnames.ora and overwrite the copy of the PROD files with that.
- You might already have it covered, but check if the REPORT server is using
a password file.
- Rename the directory SID under $ORACLE_BASE/admin or create a new
directory structure (Assuming you are using OFA)
Regards,
Denny
Abramson, Stuart wrote:
Hpux-admins:
We used to "clone" our Production Oracle Instance to a BCV Reporting
Instance by only "BCV-ing" the data files.
We set up the oracle software on the BCV server for a SID called REPORT, and
we left it there. Over time, REPORT didn't get patched, etc, and wasn't an
exact copy of PROD.
We now want to BCV the Oracle software, in $ORACLE_HOME as well as the data.
So, I'm looking at changing SID names, port numbers, hostnames, file system
names in the Oracle software directories from PROD to REPORT, every time I
split the Oracle software:
$ORACLE_HOME/dbs/initSID.ora
$ORACLE_HOME/network/admin/listener.ora
$ORACLE_HOME/network/admin/tnsnames.ora
Is there an Oracle utility that does this for you?:
OracleClone OLDSID NEWSID
Does anyone have a list of the places that you have to change?
Hasn't someone done this before?
Stuart
Stuart Abramson | Off: 412/825-1434 | Cell: 412/417-1567 | email:
sabramson@wabtec.com <mailto:sabramson@wabtec.com>
***** CONFIDENTIALITY NOTE *****
The content contained in this e-mail transmission is legally privileged and
confidential information intended only for the use of the individual or
entity named herein. If the reader of this transmission is not the intended
recipient, you are hereby notified that any dissemination, distribution, or
copying of this transmission is strictly prohibited.
***** CONFIDENTIALITY NOTE *****
The content contained in this e-mail transmission is legally privileged and \
confidential information intended only for the use of the individual or entity named \
herein. If the reader of this transmission is not the intended recipient, you are \
hereby notified that any dissemination, distribution, or copying of this transmission \
is strictly prohibited.
[Attachment #3 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE></TITLE>
<META content="MSHTML 6.00.2800.1276" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff>
<DIV dir=ltr align=left><FONT face=Courier color=#0000ff size=2><SPAN
class=678320715-26112003>Thanks to:</SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Courier color=#0000ff size=2><SPAN
class=678320715-26112003></SPAN></FONT> </DIV>
<DIV dir=ltr align=left><FONT face=Courier color=#0000ff size=2><SPAN
class=678320715-26112003> <FONT face=Tahoma
color=#000000>Denny Koovakattu</FONT></SPAN></FONT></DIV>
<DIV dir=ltr align=left><FONT face=Courier color=#0000ff size=2><SPAN
class=678320715-26112003> <FONT face=Tahoma color=#000000>Dan
Copeland</FONT></SPAN></FONT></DIV>
<DIV><SPAN class=678320715-26112003><FONT face=Tahoma
size=2> <A
href="mailto:IlicR@stentor.ca">IlicR@stentor.ca</A></FONT></SPAN></DIV>
<DIV><SPAN class=678320715-26112003></SPAN><SPAN class=678320715-26112003><FONT
face=Tahoma size=2> <FONT face=Courier
color=#0000ff>Lynn Sattler</FONT></FONT></SPAN></DIV>
<DIV><SPAN class=678320715-26112003><FONT face=Courier color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=678320715-26112003><FONT face=Courier color=#0000ff
size=2>We're cloning Oracle BCVs to another server, and changing
the:</FONT></SPAN></DIV>
<DIV><SPAN class=678320715-26112003> <FONT face=Courier
color=#0000ff size=2>hostname</FONT></SPAN></DIV>
<DIV><SPAN class=678320715-26112003> <FONT face=Courier
color=#0000ff size=2>SID Name</FONT></SPAN></DIV>
<DIV><SPAN class=678320715-26112003> <FONT face=Courier
color=#0000ff size=2>Mount Point names</FONT></SPAN></DIV>
<DIV><SPAN class=678320715-26112003> <FONT face=Courier
color=#0000ff size=2>Listener Ports</FONT></SPAN></DIV>
<DIV><SPAN class=678320715-26112003><FONT face=Courier color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=678320715-26112003><FONT face=Courier color=#0000ff size=2>The
"clone rules" are:</FONT></SPAN></DIV>
<DIV><SPAN class=678320715-26112003><FONT face=Courier color=#0000ff
size=2></FONT></SPAN> </DIV><SPAN class=678320715-26112003>
<DIV><BR><FONT face=Courier color=#0000ff
size=2>
1. Edit Files to point to proper
locations/values:<BR> \
initSID.ora<BR> \
tnsnames.ora<BR> \
listener.ora<BR>
2. <SPAN class=678320715-26112003>Replace
symbolic </SPAN>links under ORACLE_HOME with new
path. </FONT></DIV>
<DIV><FONT face=Courier color=#0000ff
size=2>
3. Need to relink binaries to (if path has
changed.). (See above.)<BR>
4. mv $ORACLE_HOME/admin/SID to the new SID
name.</FONT></DIV>
<DIV><FONT face=Courier color=#0000ff
size=2><BR>
5. Edit Apache files (above) if we use the Oracle
bundled Apache.<BR>
6. Reset the Oracle passwds with "orapwd" utility,
if<BR> \
initSID.ora:"remote_login_passwordfile" =
"exclusive",<BR> \
which ours is.<BR>
7. If you use "Oracle Intelliget Agent", then
edit:<BR> \
snmp_ro.ora<BR> \
snmp_rw.ora<BR> \
services.ora<BR>
8. If you use "Oracle Enterprise Manager", then
edit:<BR> \
OEMclient.properties.</FONT></DIV>
<DIV><FONT face=Courier color=#0000ff size=2></FONT> </DIV>
<DIV><BR><SPAN class=678320715-26112003><FONT face=Courier color=#0000ff
size=2>The followin code will do that:</FONT></SPAN></DIV>
<DIV><SPAN class=678320715-26112003><FONT face=Courier color=#0000ff
size=2></FONT></SPAN> </DIV>
<BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px">
<DIV><SPAN class=678320715-26112003><FONT face=Courier color=#0000ff
size=2># 1.
Rename files in Oracle Software directory from
$OLD_SID<BR># \
to $NEW_SID.<BR>find $NEW_MP_SW -name "*${OLD_SID}*" | while read
FILE<BR>do<BR> NEWFILE=$( echo $FILE
| sed "s/${OLD_SID}/${NEW_SID}/g"
)<BR> mv $FILE
$NEWFILE<BR> chown oracle:dba
$NEWFILE<BR>done<BR># Do it TWICE!<BR>find
$NEW_MP_SW -name "*${OLD_SID}*" | while read
FILE<BR>do<BR> NEWFILE=$( echo $FILE
| sed "s/${OLD_SID}/${NEW_SID}/g"
)<BR> mv $FILE
$NEWFILE<BR>done<BR>#
2. Edit key
files:<BR># \
The key files are:<BR>KEY_FILES="
$ORA_HOME/dbs/init${NEW_SID}.ora<BR> \
$ORA_HOME/network/admin/listener.ora<BR> \
$ORA_HOME/network/admin/tnsnames.ora
"<BR># \
The key "values" to replace are:<BR>for FILE in
$KEY_FILES<BR>do<BR>
# Host, Oracle SID name,
Port<BR> sed
"s/$OLD_HOST/$NEW_HOST/g" $FILE
\<BR> \
| sed "s/$OLD_SID/$NEW_SID/g"
\<BR> \
| sed "s/$OLD_PORT/$NEW_PORT/g" >
$FILE.new1<BR>
# Mount
Points:<BR> set -A OLD_DIRS
$OLD_MPS<BR> set -A NEW_DIRS
$NEW_MPS<BR>
CNT=${#OLD_DIRS[@]}<BR>
#<BR> (( I=0
))<BR> while (( I < CNT
))<BR>
do<BR> \
sed "s?${OLD_DIRS[$I]}?${NEW_DIRS[$I]}?g" $FILE.new1
>$FILE.new2<BR> \
mv $FILE.new2
$FILE.new1<BR> \
(( I=I+1 ))<BR>
done<BR> mv $FILE.new1
$FILE<BR> chown oracle:dba
$FILE<BR>done<BR>#
3. Relink symbolic-linked files<BR>find
$NEW_MP_SW -type l | while read
LINK<BR>do<BR> FILE=$( ll $LINK |
awk -F">" '{print $2}' )<BR>
NEW_FILE=$( echo $FILE | sed "s?$OLD_MP_SW?$NEW_MP_SW?"
)<BR> echo $FILE | grep -q
$OLD_MP_SW<BR> if (( $? == 0
))<BR>
then<BR> \
# This is a soft link to the Old Mount
Point
Name<BR> \
rm
$LINK<BR> \
ln -s $NEW_FILE
$LINK<BR> \
ll $LINK<BR>
fi<BR>done<BR></FONT></SPAN></SPAN></DIV></BLOCKQUOTE>
<DIV><SPAN class=678320715-26112003><FONT face=Courier color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=678320715-26112003><SPAN class=802110722-21112003><FONT
face=Courier color=#0000ff size=2> </DIV>
<DIV><BR> </FONT></SPAN></SPAN><BR></DIV>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Abramson, Stuart <BR><B>Sent:</B> Friday,
November 21, 2003 5:10 PM<BR><B>To:</B> 'Denny Koovakattu'<BR><B>Subject:</B>
RE: [HPADM] Cloning Oracle SID software ($ORACLE_HOME) with
BCVs<BR></FONT><BR></DIV>
<DIV></DIV>
<DIV dir=ltr align=left><SPAN class=802110722-21112003><FONT face=Courier
color=#0000ff size=2>Denny:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=802110722-21112003><FONT face=Courier
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=802110722-21112003><FONT face=Courier
color=#0000ff size=2>Here are some files that I'm looking at either because they
reference "hostname", "SID name" or contain the host or SID in their
names.:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=802110722-21112003><FONT face=Courier
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=802110722-21112003><FONT face=Courier
color=#0000ff size=2>(Asterisk indicate files you mentioned
below.)</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=802110722-21112003><FONT face=Courier
color=#0000ff size=2></FONT></SPAN> </DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px" align=left><SPAN
class=802110722-21112003><FONT face=Courier color=#0000ff
size=2> /u1001/app/oracle/product/9.2.0/Apache/Apache/conf/httpd.conf<BR> \
/u1001/app/oracle/product/9.2.0/Apache/Apache/conf/httpd.conf.default<BR> \
/u1001/app/oracle/product/9.2.0/Apache/Apache/setupinfo.txt<BR> \
/u1001/app/oracle/product/9.2.0/admin/HOTB*<BR> \
/u1001/app/oracle/product/9.2.0/dbs/initHOTB.ora*<BR> \
/u1001/app/oracle/product/9.2.0/dbs/lkHOTB<BR> \
/u1001/app/oracle/product/9.2.0/dbs/orapwHOTB<BR> \
/u1001/app/oracle/product/9.2.0/network/admin/listener.ora*<BR> \
/u1001/app/oracle/product/9.2.0/network/admin/snmp_ro.ora<BR> \
/u1001/app/oracle/product/9.2.0/network/admin/snmp_rw.ora<BR> \
/u1001/app/oracle/product/9.2.0/network/admin/tnsnames.ora*<BR> \
/u1001/app/oracle/product/9.2.0/network/agent/services.ora<BR> \
/u1001/app/oracle/product/9.2.0/sysman/config/OEMClient.properties</FONT></SPAN></DIV>
<DIV><SPAN class=802110722-21112003><FONT face=Courier color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=802110722-21112003><FONT face=Courier color=#0000ff size=2>What
do you think?</FONT></SPAN></DIV>
<DIV><SPAN class=802110722-21112003><FONT face=Courier color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=802110722-21112003><FONT face=Courier color=#0000ff
size=2> Stuart</DIV>
<DIV dir=ltr style="MARGIN-RIGHT: 0px" align=left><BR></DIV></FONT></SPAN><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> Denny Koovakattu
[mailto:groups@koovakattu.com] <BR><B>Sent:</B> Friday, November 21, 2003 4:52
PM<BR><B>To:</B> Abramson, Stuart<BR><B>Subject:</B> Re: [HPADM] Cloning Oracle
SID software ($ORACLE_HOME) with BCVs<BR></FONT><BR></DIV>
<DIV></DIV><BR>I am not aware of any Oracle utilities to do this. I am assuming
you have the cloning part covered, i.e., recovering the DB. If the path to
$ORACLE_HOME is changing I would suggest relinking the Oracle binaries (even
though it might work without relinking.) In the past some utilities have failed
due to embedded paths to shared libraries. I make it a point to set LDOPTS=+s
while linking Oracle. Else chatr them later. What we have done in the past is to
keep a template of the initSID.ora, listener.ora and the tnsnames.ora and
overwrite the copy of the PROD files with that. <BR><BR>- You might already have
it covered, but check if the REPORT server is using a password file.<BR>-
Rename the directory SID under $ORACLE_BASE/admin or create a new directory
structure (Assuming you are using OFA)<BR><BR>Regards,<BR>Denny<BR><BR>Abramson,
Stuart wrote:<BR>
<BLOCKQUOTE
cite=midAC198B2815CBB94587ACA150296E638E04BBA6B0@wccexcwab.wcc.wabtec.com
type="cite">
<META content="MS Exchange Server version 5.5.2654.45" name=Generator>
<P><FONT face=Courier color=#0000ff size=2>Hpux-admins:</FONT> </P><BR>
<P><FONT face=Courier size=2>We used to "clone" our Production Oracle Instance
to a BCV Reporting Instance by only "BCV-ing" the data files.</FONT> </P>
<P><FONT face=Courier size=2>We set up the oracle software on the BCV server
for a SID called REPORT, and we left it there. Over time, REPORT didn't
get patched, etc, and wasn't a</FONT><FONT face=Courier color=#0000ff size=2>n
exact</FONT><FONT face=Courier size=2> copy of PROD.</FONT></P>
<P><FONT face=Courier size=2>We now want to BCV the Oracle
software</FONT><FONT face=Courier color=#0000ff size=2>, in
$ORACLE_HOME</FONT><FONT face=Courier size=2> as well as the data.</FONT> </P>
<P><FONT face=Courier size=2>So, I'm looking at changing SID names, port
numbers, hostnames, file system names in the Oracle software directories from
PROD to REPORT, every time I split the Oracle software:</FONT></P>
<UL>
<P> <FONT face=Courier
size=2> $ORACLE_HOME/dbs/initSID.ora</FONT> </P>
<P> <FONT face=Courier
size=2> $ORACLE_HOME/network/admin/listener.ora</FONT>
<BR> <FONT face=Courier
size=2> $ORACLE_HOME/network/admin/tnsnames.ora</FONT> </P></UL>
<P><FONT face=Courier size=2>Is there an Oracle utility that does this for
you?:</FONT> </P>
<P> <FONT face=Courier size=2>
OracleClone OLDSID NEWSID</FONT> </P>
<P><FONT face=Courier size=2>Does anyone have a list of the places that you
have to change?</FONT> </P>
<P><FONT face=Courier size=2>Hasn't someone done this before?</FONT> </P>
<P> <FONT face=Courier
size=2>Stuart</FONT> </P>
<UL>
<P><FONT face=Courier size=2></FONT></P></UL>
<P><B><FONT face=Arial color=#0000ff size=2>Stuart Abramson | Off:
412/825-1434 | Cell: 412/417-1567 | email: <A
class=moz-txt-link-abbreviated
href="mailto:sabramson@wabtec.com">sabramson@wabtec.com</A></FONT></B>
</P><BR><BR>***** CONFIDENTIALITY NOTE *****<BR>The content contained in this
e-mail transmission is legally privileged and confidential information
intended only for the use of the individual or entity named herein. If the
reader of this transmission is not the intended recipient, you are hereby
notified that any dissemination, distribution, or copying of this transmission
is strictly prohibited.<BR></BLOCKQUOTE>
<BR>
***** CONFIDENTIALITY NOTE *****<BR>
The content contained in this e-mail transmission is legally privileged and \
confidential information intended only for the use of the individual or entity named \
herein. If the reader of this transmission is not the intended recipient, you are \
hereby notified that any dissemination, distribution, or copying of this transmission \
is strictly prohibited.<BR> </BODY></HTML>
--
---> Please post QUESTIONS and SUMMARIES only!! <---
To subscribe/unsubscribe to this list, contact majordomo@dutchworks.nl
Name: hpux-admin@dutchworks.nl Owner: owner-hpux-admin@dutchworks.nl
Archives: ftp.dutchworks.nl/pub/digests/hpux-admin (FTP, browse only)
http://www.dutchworks.nl/htbin/hpsysadmin (Web, browse & search)
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic