数据库冷迁移(路径不同)

1:创建数据库实例,,创建文件目录,创建密码文件

2:拷贝数据库文件到新

F:\app\Administrator\oradata\purplee>dir /a/b
CONTROL01.CTL
DRSYS01.DBF
EXAMPLE01.DBF
INDEX01.DBF
INDEX_NEW01.DBF
RBS01.DBF
REDO01.LOG
REDO02.LOG
REDO03.LOG
SYSAUX01.DBF
SYSTEM01.DBF
TEMP01.DBF
TOOLS01.DBF
UNDOTBS01.DBF
USERS01.DBF
USERS_NEW12.DBF
USERS_NEW201.DBF

3:修改参数文件control_file

SQL> show parameter control_file

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
control_file_record_keep_time        integer     7
control_files                        string      F:\APP\ADMINISTRATOR\ORADATA\P
                                                 URPLEE\CONTROL01.CTL, F:\APP\A
                                                 DMINISTRATOR\RECOVERY_AREA\PUR
                                                 PLEE\CONTROL02.CTL


SQL>startup nomount
SQL> alter system set control_files='F:\app\Administrator\oradata\purple\contro01.ctl','F:\app\Administrator\recovery_area\purple\CONTROL02.CTL' scope=spfile;

SQL>shutdown abort

SQL>startup mount

SQL>

alter database rename file 'F:\app\Administrator\oradata\purplee\CONTROL01.CTL' to	'F:\app\Administrator\oradata\purple\CONTROL01.CTL';
alter database rename file 'F:\app\Administrator\oradata\purplee\DRSYS01.DBF' to	'F:\app\Administrator\oradata\purple\DRSYS01.DBF';
alter database rename file 'F:\app\Administrator\oradata\purplee\EXAMPLE01.DBF' to	'F:\app\Administrator\oradata\purple\EXAMPLE01.DBF';
alter database rename file 'F:\app\Administrator\oradata\purplee\INDEX01.DBF' to	'F:\app\Administrator\oradata\purple\INDEX01.DBF';
alter database rename file 'F:\app\Administrator\oradata\purplee\INDEX_NEW01.DBF' to	'F:\app\Administrator\oradata\purple\INDEX_NEW01.DBF';
alter database rename file 'F:\app\Administrator\oradata\purplee\RBS01.DBF' to	'F:\app\Administrator\oradata\purple\RBS01.DBF';
alter database rename file 'F:\app\Administrator\oradata\purplee\REDO01.LOG' to	'F:\app\Administrator\oradata\purple\REDO01.LOG';
alter database rename file 'F:\app\Administrator\oradata\purplee\REDO02.LOG' to	'F:\app\Administrator\oradata\purple\REDO02.LOG';
alter database rename file 'F:\app\Administrator\oradata\purplee\REDO03.LOG' to	'F:\app\Administrator\oradata\purple\REDO03.LOG';
alter database rename file 'F:\app\Administrator\oradata\purplee\SYSAUX01.DBF' to	'F:\app\Administrator\oradata\purple\SYSAUX01.DBF';
alter database rename file 'F:\app\Administrator\oradata\purplee\SYSTEM01.DBF' to	'F:\app\Administrator\oradata\purple\SYSTEM01.DBF';
alter database rename file 'F:\app\Administrator\oradata\purplee\TEMP01.DBF' to	'F:\app\Administrator\oradata\purple\TEMP01.DBF';
alter database rename file 'F:\app\Administrator\oradata\purplee\TOOLS01.DBF' to	'F:\app\Administrator\oradata\purple\TOOLS01.DBF';
alter database rename file 'F:\app\Administrator\oradata\purplee\UNDOTBS01.DBF' to	'F:\app\Administrator\oradata\purple\UNDOTBS01.DBF';
alter database rename file 'F:\app\Administrator\oradata\purplee\USERS01.DBF' to	'F:\app\Administrator\oradata\purple\USERS01.DBF';
alter database rename file 'F:\app\Administrator\oradata\purplee\USERS_NEW12.DBF' to	'F:\app\Administrator\oradata\purple\USERS_NEW12.DBF';
alter database rename file 'F:\app\Administrator\oradata\purplee\USERS_NEW201.DBF' to	'F:\app\Administrator\oradata\purple\USERS_NEW201.DBF';

SQL>alter database open;

SQL> select name from v$datafile;

NAME
--------------------------------------------------------------------------------

F:\APP\ADMINISTRATOR\ORADATA\PURPLE\SYSTEM01.DBF
F:\APP\ADMINISTRATOR\ORADATA\PURPLE\SYSAUX01.DBF
F:\APP\ADMINISTRATOR\ORADATA\PURPLE\UNDOTBS01.DBF
F:\APP\ADMINISTRATOR\ORADATA\PURPLE\USERS01.DBF
F:\APP\ADMINISTRATOR\ORADATA\PURPLE\EXAMPLE01.DBF
F:\APP\ADMINISTRATOR\ORADATA\PURPLE\DRSYS01.DBF
F:\APP\ADMINISTRATOR\ORADATA\PURPLE\INDEX_NEW01.DBF
F:\APP\ADMINISTRATOR\ORADATA\PURPLE\INDEX01.DBF
F:\APP\ADMINISTRATOR\ORADATA\PURPLE\RBS01.DBF
F:\APP\ADMINISTRATOR\ORADATA\PURPLE\TOOLS01.DBF
F:\APP\ADMINISTRATOR\ORADATA\PURPLE\USERS_NEW12.DBF
F:\APP\ADMINISTRATOR\ORADATA\PURPLE\USERS_NEW201.DBF

12 rows selected.


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值