实例名:PCBMES
将/oracle_ebs/pcbmes/db下面的oracle11gr2数据库迁移到/ebs/pcbmes/db目录下
一、前期准备
1、创建pfile文件(DB使用spfile启动的情况下)
create pfile from spfile;
alter database backup controlfile to trace;
生成一个trace文件,本次操作生成文件路径在/oracle_ebs/pcbmes/db/diag/rdbms/pcbmes/PCBMES/trace,可以使用ls -l -t | more来排序查看文件
more /oracle_ebs/pcbmes/db/diag/rdbms/pcbmes/PCBMES/trace/PCBMES_ora_16295.trc
将显示出来的脚本复制到一个新建文件脚本(createctlf.sql)中,并根据新路径需要编辑保存,编辑生成的脚本如下:
CREATE CONTROLFILE REUSE DATABASE "PCBMES" RESETLOGS NOARCHIVELOG
MAXLOGFILES 16
MAXLOGMEMBERS 3
MAXDATAFILES 100
MAXINSTANCES 8
MAXLOGHISTORY 292
LOGFILE
GROUP 1
'/ebs/pcbmes/db/apps_st/data/PCBMES/redo01.log' SIZE 50M BLOCKSIZE 512,
GROUP 2 '/ebs/pcbmes/db/apps_st/data/PCBMES/redo02.log' SIZE 50M BLOCKSIZE
512,
GROUP 3 '/ebs/pcbmes/db/apps_st/data/PCBMES/redo03.log' SIZE 50M
BLOCKSIZE 512
-- STANDBY LOGFILE
DATAFILE
'/ebs/pcbmes/db/apps_st/data/PCBMES/system01.dbf',
'/ebs/pcbmes/db/apps_st/data/PCBMES/sysaux01.dbf',
'/ebs/pcbmes/db/apps_st/data/PCBMES/undotbs01.dbf',
'/ebs/pcbmes/db/apps_st/data/PCBMES/users01.dbf',
'/ebs/pcbmes/db/apps_st/data/PCBMES/pcbmes_d_01.dbf',
'/ebs/pcbmes/db/apps_st/data/PCBMES/pcbmes_d_02.dbf',
'/ebs/pcbmes/db/apps_st/data/PCBMES/pcbmes_x_01.dbf',
'/ebs/pcbmes/db/apps_st/data/PCBMES/pcbmes_x_02.dbf'
CHaraCTER SET
ZHS16GBK
;
ALTER DATABASE OPEN RESETLOGS;
ALTER TABLESPACE TEMP ADD TEMPFILE
'/ebs/pcbmes/db/apps_st/data/PCBMES/temp01.dbf'
SIZE 30408704 REUSE
AUTOEXTEND ON NEXT 655360 MAXSIZE 32767M;
shutdown immediate;
lsnrctl stop;
2、拷贝文件
cp -RH /oracle_ebs/pcbmes/db/. /ebs/pcbmes/db/
cd /ebs/pcbmes/db/tech_st/11.2.0/dbs
vi initPCBMES.ora
将其中配置的原路径全部修改成新路径
2、修改监听配置
cd /ebs/pcbmes/db/tech_st/11.2.0/network/admin
vi listener.ora
vi sqlnet.ora
cd
cp .profile .profile.bak
vi .profile
四、重新创建控制文件
1、重新用orames用户登录,并检查环境变量是否正确并生效
2、创建控制文件
sqlplus /nolog
sql> conn / as sysdba;
sql> startup nomount pfile='/ebs/pcbmes/db/tech_st/11.2.0/dbs/initPCBMES.ora';
sql> create spfile from pfile;
sql> shutdown immediate;
sql> startup;
3、启动监听
lsnrctl start