你好,游客 登录 注册 搜索
背景:
阅读新闻

Oracle教程:移动所有数据文件

[日期:2012-05-29] 来源:Linux社区  作者:gtlions [字体:大 中 小]

现在还剩下控制文件、system和用户数据文件。
针对控制文件我们可以直接复制文件副本,然后修改参数文件即可:
SQL> create pfile='/u01/Oracle/10gpfile.ora' from spfile;

File created.

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.

[oracle@gtlions oracle]$ cp 10gpfile.ora  10gpfile.ora.bak
[oracle@gtlions oracle]$ cp /u01/oracle/10g/oradata/gt10g/control0* /u01/oracle/10g/oradata/gt10gnew/
[oracle@gtlions oracle]$ ll /u01/oracle/10g/oradata/gt10gnew/con*
-rw-r-----  1 oracle oinstall 7061504  5月 29 14:30 /u01/oracle/10g/oradata/gt10gnew/control01.ctl
-rw-r-----  1 oracle oinstall 7061504  5月 29 14:30 /u01/oracle/10g/oradata/gt10gnew/control02.ctl
-rw-r-----  1 oracle oinstall 7061504  5月 29 14:30 /u01/oracle/10g/oradata/gt10gnew/control03.ctl
vi 10gpfile.ora编辑新的控制文件位置。
[oracle@gtlions oracle]$ cat 10gpfile.ora | grep control
*.control_files='/u01/oracle/10g/oradata/gt10gnew/control01.ctl','/u01/oracle/10g/oradata/gt10gnew/control02.ctl','/u01/oracle/10g/oradata/gt10gnew/control03.ctl'
然后使用pfile启动数据库,并创建spfile,然后重启使用spfile:
sys@GT10G> startup pfile='/u01/oracle/10gpfile.ora';
ORACLE instance started.

Total System Global Area  167772160 bytes
Fixed Size            2094800 bytes
Variable Size          104859952 bytes
Database Buffers       54525952 bytes
Redo Buffers            6291456 bytes
Database mounted.
Database opened.

sys@GT10G> create spfile from pfile='/u01/oracle/10gpfile.ora';

File created.

sys@GT10G> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
sys@GT10G> startup
ORACLE instance started.

Total System Global Area  167772160 bytes
Fixed Size            2094800 bytes
Variable Size          104859952 bytes
Database Buffers       54525952 bytes
Redo Buffers            6291456 bytes
Database mounted.
Database opened.
sys@GT10G> show parameter spfile;

NAME                     TYPE     VALUE
------------------------------------ -------- ------------------------------
spfile                     string   /u01/oracle/10g/product/10.2.0
                          /db_1/dbs/spfilegt10g.ora

linux
相关资讯       Oracle高级培训 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款