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删除,再重启,还是正常!喝酒去了
 

猜你喜欢

转载自blog.csdn.net/der322/article/details/83110185