Sie sind auf Seite 1von 4

5/11/2020 Document 558478.

1
Copyright (c) 2020, Oracle. All rights reserved. Oracle Confidential.

Cloning A Database Home And Changing The User/Group That Owns It (Doc ID 558478.1)

In this Document

Purpose
Scope
Details
References

APPLIES TO:

Oracle Database - Enterprise Edition - Version 10.2.0.1 to 12.1.0.1 [Release 10.2 to 12.1]
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Cloud Machine - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Oracle Database Backup Service - Version N/A and later
Information in this document applies to any platform.
The information supplied in this bulletin is applicable to Oracle10g Release 2 (10.2) and Oracle11g Release 1 (11.1) or later
installations on any Unix/Linux platform.

It is not applicable to Oracle on any Windows platform.

***Checked for relevance on 26-Mar-2013***

PURPOSE

Support previously created Note:300062.1 to help customers to clone their Oracle database installations. This bulletin is an
extension to the above note.

The purpose of this bulletin is to provide a list of the steps required to clone an Oracle10g Release 2 (10.2) or Oracle11g
Release 1 (11.1) or later installation from a source home to a target location (on the same server, or on another server) and
simultaneously change the user/group that owns the software installation.

Oracle Development have reviewed these steps and confirmed that the procedure is supported.

SCOPE

This bulletin is intended for anyone responsible for installing/cloning Oracle software on a Unix/Linux server

The procedure below assumes that Oracle10g Release 2 (10.2) or Oracle11g Release 1 (11.1) or later version is already
installed in a source home on a server.

If you are cloning to a separate server, verify that the server meets all of the defined requirements (see Note:169706.1 for a
list of these)

If you are cloning to an AIX server that has not previously had any Oracle software installed on it, download patch 6613550
and run the supplied rootpre.sh script so that the server is configured ready for the Oracle software.

It is recommended that you not attempt to change the ORACLE_BASE when cloning an ORACLE_HOME. If you change it
anyway, you will at least need to update the $ORACLE_HOME/inventory/ContentsXML/oraclehomeproperties.xml file to reflect
a change in the ORACLE_BASE, though there could be other changes Oracle Support is not aware of.

DETAILS
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=kfsvawel0_133&id=558478.1 1/4
5/11/2020 Document 558478.1

1. Create a tarball of the source home

% cd <path_of_the_source_home>
% tar cvf /tmp/source.tar .

NOTE: Do not use the command "tar cvf /tmp/source.tar $ORACLE_HOME" because the full path for the $ORACLE_HOME will
be included in the source.tar file and this will cause problems in step 3

2. Optionally, use binary transfer to move /tmp/source.tar to the target server. If you are cloning on the same server, go to
step 3.

3. Unpack the tarball into the target location

% cd <path_of_the_target_home>
% tar xvf /tmp/source.tar

NOTE: Check that any symbolic links in the target home have been preserved so that they link to the same locations as they
did in the source home. If necessary, re-create the links.

4. As the 'root' user, use the 'chown' command to change the ownership of any files owned by user A to be owned by user B

% find . -user <userA> -exec chown <userB> {} \;

NOTE: Do not use "chown -R <userB> $ORACLE_HOME" because this will change the ownership of some files that were not
previously owned by <userA>. For example, $ORACLE_HOME/bin/oradism

5. As the 'root' user, use the 'chgrp' command to change the group ownership of any files owned by group A to be owned by
group B

% find . -group <groupA> -exec chgrp <groupB> {} \;

NOTE: Do not use "chgrp -R <groupB> $ORACLE_HOME" because this will change the ownership of some files that were not
previously owned by <groupA>. For example, $ORACLE_HOME/bin/extjob

6. Rename the $ORACLE_HOME/rdbms/lib/config.o file

% cd $ORACLE_HOME/rdbms/lib
% mv config.o config.o_backup

7. The next step is dependant on which Operating System (OS) is being used

On Linux and HPUX, edit the $ORACLE_HOME/rdbms/lib/config.c file to change the group that owns the installation

% vi config.c

Find the following lines at the end of the file:

#define SS_DBA_GRP "dba"


#define SS_OPER_GRP "dba"

Replace "dba" with the name of the group that will own the target installation

Save the changes to the config.c file

On Solaris, edit the $ORACLE_HOME/rdbms/lib/config.s file:


https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=kfsvawel0_133&id=558478.1 2/4
5/11/2020 Document 558478.1

% vi config.s

Find the following lines within the file:

/* 0x0008 15 */ .ascii "dba\0"


:
/* 0x0014 22 */ .ascii "dba\0"

Replace "dba" with the name of the group that will own the target installation

Save the changes to the config.s file

On AIX, edit the $ORACLE_HOME/rdbms/lib/config.s file:

% vi config.s

Find the following lines within the file:

.csect H.12.NO_SYMBOL{RO}, 3
.string "dba"
:
.csect H.14.NO_SYMBOL{RO}, 3
.string "dba"

Replace "dba" with the name of the group that will own the target installation

Save the changes to the config.s file

See Note:50507.1 for further details

8. Set any environment variables (for example, LD_LIBRARY_PATH) to point to the target home rather than the source home

9. Optionally, regenerate config.o and relink the 'oracle' binary

% make -f ins_rdbms.mk config.o


% make -f ins_rdbms.mk ioracle

These commands are also executed during the relinking phase at the end of the cloning process (step 10)

NOTE: On Sun SPARC Solaris (64-bit), the command to regenerate config.o may fail with the following errors:

/usr/ccs/bin/as -P -K PIC -o config.o config.s


/usr/ccs/bin/as: "config.s", line 12: error: cannot use v9 instructions in a non-v9 target binary
/usr/ccs/bin/as: "config.s", line 14: error: cannot use v9 instructions in a non-v9 target binary
*** Error code 1
make: Fatal error: Command failed for target `config.o'

To workaround this problem, rename $ORACLE_HOME/rdbms/lib/config.o (if it exists) and just relink the 'oracle' binary.
Relinking the 'oracle' binary should also regenerate the config.o file.

10. Run the $ORACLE_HOME/clone/bin/clone.pl script (or ./runInstaller -clone) to clone the installation

% cd $ORACLE_HOME/clone/bin
% perl clone.pl ORACLE_HOME="<target_home>" ORACLE_HOME_NAME="<unique_home_name>"

or

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=kfsvawel0_133&id=558478.1 3/4
5/11/2020 Document 558478.1

% cd $ORACLE_HOME/oui/bin
% ./runInstaller -clone -silent -ignorePreReq ORACLE_HOME="<target_home>" ORACLE_HOME_NAME="
<unique_home_name>"

If you wish to use an oraInst.loc file in a non-default location, update the "clone_command_line" in
$ORACLE_HOME/clone/config/cs.properties so that it includes "-invPtrLoc <path>/oraInst.loc"

See Note:559304.1 and Note:559305.1 for further details about the cloning process

11. Run the $ORACLE_HOME/root.sh script as the 'root' user

12. Optionally, run the $ORACLE_HOME/install/changePerm.sh script to relax permissions on the home

13. DB Console users may need to refer to Note:467598.1 and/or Note:278100.1 to enable them to startup the console on the
new server

14. Also make to changes the ownership / group of the database files (like control, data, redo, etc.) to the new user and
group.

Starting from 12c alternatively we change the group or owner by using following command which will update config.c file

$ORACLE_HOME/perl/bin/perl clone.pl ORACLE_BASE="/u01/app/oracle"


ORACLE_HOME="/u01/app/oracle/product/12.1.0.2/dbhome_clone" ORACLE_HOME_NAME="12102_clone"
OSDBA_GROUP=dba OSOPER_GROUP=oper OSBACKUPDBA_GROUP=backupdba OSDGDBA_GROUP=dgdba
OSKMDBA_GROUP=kmdba

OR

./runInstaller -clone -waitForCompletion "ORACLE_BASE=/u01/app/oracle"


"ORACLE_HOME=/u01/app/oracle/product/12.1.0.2/dbhome_clone" "ORACLE_HOME_NAME=12102_clone"
"oracle_install_OSDBA=dba" "oracle_install_OSOPER=oper" "oracle_install_OSBKP=backupdba"
"oracle_install_OSDGD=dgdba" "oracle_install_OSKMT=kmdba" -silent -paramFile
/u01/app/oracle/product/12.1.0.2/dbhome_clone/clone/clone_oraparam.ini

REFERENCES

NOTE:278100.1 - How To Drop, Create And Recreate Database Control (dbconsole) Web Site in Releases 10g and 11g
NOTE:169706.1 - Oracle Database (RDBMS) on Unix AIX,HP-UX,Linux,Mac OS X,Solaris,Tru64 Unix Operating Systems
Installation and Configuration Requirements Quick Reference (8.0.5 to 11.2)
NOTE:300062.1 - How to Clone an Existing RDBMS / Client Installation Using OUI
NOTE:467598.1 - The Database Console Fails to Start After Hostname was Changed
NOTE:50507.1 - SYSDBA and SYSOPER Privileges in Oracle
NOTE:559304.1 - Cloning An Existing Oracle10g Release 2 (10.2.0.x) RDBMS Installation Using OUI
NOTE:559305.1 - Cloning An Existing Oracle11g Release 1 (11.1.0.x) RDBMS Installation Using OUI
Didn't find what you are looking for?

https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=kfsvawel0_133&id=558478.1 4/4

Das könnte Ihnen auch gefallen