ITPub博客

首页 > Linux操作系统 > Linux操作系统 > 修改数据文件地址

修改数据文件地址

原创 Linux操作系统 作者:shuangoracle 时间:2012-05-10 23:13:35 0 删除 编辑
现场反应前台研发建表空间时建错了目录,让修改:
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/home/oracle/oradata/orcl/system01.dbf
/home/oracle/oradata/orcl/undotbs01.dbf
/home/oracle/oradata/orcl/sysaux01.dbf
/home/oracle/oradata/orcl/users01.dbf
/home/oracle/oradata/orcl/mytmp01.dbf
/home/oracle/oradata/test01.dbf
6 rows selected.
SQL> archive log list;
Database log mode Archive Mode
Automatic archival Enabled
Archive destination /home/oracle/archive
Oldest online log sequence 123
Next log sequence to archive 125
Current log sequence 125
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> host
[oracle@RAC1 ~]$ cp /home/oracle/oradata/test01.dbf /home/oracle/oradata/orcl/test01.dbf
[oracle@RAC1 ~]$ exit
exit
SQL> startup mount
ORACLE instance started.
Total System Global Area 167772160 bytes
Fixed Size 1218316 bytes
Variable Size 62916852 bytes
Database Buffers 100663296 bytes
Redo Buffers 2973696 bytes
Database mounted.
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/home/oracle/oradata/orcl/system01.dbf
/home/oracle/oradata/orcl/undotbs01.dbf
/home/oracle/oradata/orcl/sysaux01.dbf
/home/oracle/oradata/orcl/users01.dbf
/home/oracle/oradata/orcl/mytmp01.dbf
/home/oracle/oradata/test01.dbf
6 rows selected.
SQL> alter database rename file '/home/oracle/oradata/test01.dbf' to
2 '/home/oracle/oradata/orcl/test01.dbf';
Database altered.
SQL> alter database open;
Database altered.
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/home/oracle/oradata/orcl/system01.dbf
/home/oracle/oradata/orcl/undotbs01.dbf
/home/oracle/oradata/orcl/sysaux01.dbf
/home/oracle/oradata/orcl/users01.dbf
/home/oracle/oradata/orcl/mytmp01.dbf
/home/oracle/oradata/orcl/test01.dbf
6 rows selected.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24496749/viewspace-723298/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2010-08-25

  • 博文量
    84
  • 访问量
    206882