Oracle 12c DBF转移

碰到空间不够使怎办?DBF转移也是一个办法。

本实验成功了,但有一个疑问:systaux tablespace offline不确定是否造成其它数据无法访问。

https://blog.csdn.net/xionglang7/article/details/8284152,参考这里,但后面还有没做实验了。
实验开始:
SQL> alter tablespace system offline;
alter tablespace system offline
*
ERROR at line 1:
ORA-01541: system tablespace cannot be brought offline; shut down if necessary
看来system无法在线操作,不拿system下手了。
SQL> alter tablespace sysaux offline;
Tablespace altered.
SQL> alter tablespace sysaux rename datafile '/opt/oracle/oradata/ORCL/sysaux01.dbf' to
'/home/oracle/sysaux01.dbf';
alter tablespace sysaux rename datafile '/opt/oracle/oradata/ORCL/sysaux01.dbf' to
'/home/oracle/sysaux01.dbf'
*
ERROR at line 1:
ORA-01525: error in renaming data files
ORA-01141: error renaming data file 3 - new file '/home/oracle/sysaux01.dbf'
not found
ORA-01110: data file 3: '/opt/oracle/oradata/ORCL/sysaux01.dbf'
ORA-27037: unable to obtain file status
Linux-x86_64 Error: 2: No such file or directory
Additional information: 7
看起来,目标端,必须先有东西啊。回到根目录下,su - oracle
[oracle@ora116 ~]$ cp /opt/oracle/oradata/ORCL/sysaux01.dbf /home/oracle/sysaux01.dbf;

因为tablespace已经offline了,所以应该不会造成数据不一致。


SQL> alter tablespace sysaux rename datafile '/opt/oracle/oradata/ORCL/sysaux01.dbf' to
'/home/oracle/sysaux01.dbf';

Tablespace altered. 居然可以啊,兴奋中
SQL> alter tablespace sysaux online;
Tablespace altered.
重启看看是否正常?
SQL> shutdown immediate;
ORA-01097: cannot shutdown while in a transaction - commit or rollback first
SQL> commit;
Commit complete.
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup;
ORACLE instance started.

Total System Global Area 1258291200 bytes
Fixed Size            8792296 bytes
Variable Size          822085400 bytes
Database Buffers      419430400 bytes
Redo Buffers            7983104 bytes
Database mounted.
Database opened.
成功啦!把原来的/opt/oracle/oradata/ORCL/sysaux01.dbf删除,再重启,还是正常!喝酒去了
 

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值