2

A good link as answer is ok. I want to change "homedir" or "basedir" of oracle db from /oracle to /var/oracle. How to do? I have set the oracle unix variables($ORACLE_HOME,$ORACLE_BASE) with the new path,but db doesn't start. So i reset them to old dir,and make a symlink for now,it work but how to tell to oracle the new path?

0

Solution found,following this link

I wrote so a dirty and quick solution In my case olddir was /oracle and new /var/oracle on aix 71 oracle was working,user created,etc..

#for safe shutdown oracle,is not necessary,but better

#mkdir
mkdir -p /var/oracle/app/oracle/product/12.2.0/dbhome_1;chown -R oracle:oradba  /var/oracle

#clone with tar
tar -zcvf  /var/oracle/Oracle_Home11g_clone.tar.gz . -X ~/exclude.txt
or better  use  rsync
rsync -avP --delete $HOMEOLD/ $HOMENEW

#edit /etc/ora* and set new home

#clone with runinstaller
/oracle/app/oracle/product/12.2.0/dbhome_1/oui/bin/runInstaller -clone -silent -defaultHomeName ORACLE_HOME=/var/oracle/app/oracle/product/12.2.0/dbhome_1 ORACLE_BASE=/var/oracle/app -waitForCompletion

# script from root
su root -
/var/oracle/app/oracle/product/12.2.0/dbhome_1/root.sh

#rsync remaining dir
rsync -avP --exclude app /oracle/* .

#edit all variables on oracle homedir(.profile,.bashrc,etc)

#edit  /etc/filesystems or fstab

#edit orafiles
find . -iname *.ora|xargs grep -lw "/oracle"
vim file.ora..

#test running db with olddir unmounted
  • I forgot,i have must reimport the db with dump,someone know how to change the db paths? – elbarna Dec 17 '15 at 4:15
0

Here are the main steps and links to the appropriate manuals:

If you want to change the ORACLE_HOME this means you want to change the location where the Oracle software is installed. This is described in the Database Installation Guide of your Oracle tralease and your operating system. Either you install the Oracle software in the new ORACLE_HOME or you clone it to the new ORACLE_HOME.

Then you have to move the configuration files to the new location and modify them appropriate, eg init*.ora, spfile*.ora, sqlnet.ora, tnsnames.ora, listener.ora)

If you also want to move the database to a new location of the same server you can lok up in the Database Administrator's Guide how to relocate data files, temp files, conrtol files, etc.

stop the database, copy the database files to the new location and recreate the control file with the new filenames If you move the control files, too, you have to change there pathes in the init.ora/spfile.ora. Also some other pathes may change and have to be adapted

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.