Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1099615
  • 博文数量: 178
  • 博客积分: 2776
  • 博客等级: 少校
  • 技术积分: 2809
  • 用 户 组: 普通用户
  • 注册时间: 2012-03-22 15:36
文章分类

全部博文(178)

文章存档

2014年(3)

2013年(66)

2012年(109)

分类: Oracle

2013-05-24 11:19:15

Oracle 11g 补丁在$ORACLE_HOME/dbs目录下创建pfile文件修改参数文件和控制文件中指定的文件


[root@data dev]# df -Th

[root@data ~]# df -Th
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda3 ext3 27G 15G 11G 59% /
/dev/sda1 ext3 99M 22M 72M 24% /boot
tmpfs tmpfs 1002M 480M 522M 48% /dev/shm
/dev/sdb1 ext3 5.0G 128M 3.1G 34% /u01/app/oracle/neworadata



一、从备份文件拷贝到neworadata目录下

[oracle@data oracle]$ cp -Rf/u01/app/oracle/backup/* /u01/app/oracle/neworadata



二、登录数据库,这时候肯定是不会启动成功,我们要修改参数文件和控制文件中指定的文件;

1)[oracle@data oracle]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production onThu May 16 10:50:59 201

Copyright (c) 1982, 2009, Oracle.All rights reserved.

SQL> conn /as sysdba

Connected to an idle instance.

SQL> create pfile from spfile; //创建pfile文件;

File created.



在$ORACLE_HOME/dbs目录下可以看到pfile文件

-rw-r--r-- 1 oracle oinstall946 May 16 13:05 initundosql.ora



2)编辑pfile文件(initundosql.ora)重新指定控制文件的新路径路径



*.control_files='/u01/app/oracle/neworadata/control01.ctl','/u01/app/oracle/flash_recovery_area/undosql/control02.ctl'



3)保存退出,在切换到oracle下,生成新的spfile文件,

SQL>create spfile from pfil

File created.

4)接下来修改稿控制文件里面的信息:把数据库加载到mount状态

SQL>startup mount;

ORACLE instance started.

Total System Global Area835104768 bytes

Fixed Size2217952 bytes

Variable Size499124256 bytes

Database Buffers331350016 bytes

Redo Buffers2412544 bytes

Database mounted.

SQL> desc v$datafile;

SQL> col name format a50

SQL> select file#,name from v$datafile;



FILE# NAME

------------------------------------------------------------

1/u01/app/oracle/oradata/undosql/system01.dbf

2 /u01/app/oracle/oradata/undosql/sysaux01.dbf

3/u01/app/oracle/oradata/undosql/undotbs01.dbf

4/u01/app/oracle/oradata/undosql/users01.dbf

5/u01/app/oracle/oradata/undosql/example01.dbf

修改这些文件的路径名称,指定到新的目录下面;

SQL> alter database rename file'/u01/app/oracle/oradata/undosql/system01.dbf' to'/u01/app/oracle/neworadata/system01.dbf';

Database altered.



SQL> alter database rename file'/u01/app/oracle/oradata/undosql/sysaux01.dbf' to'/u01/app/oracle/neworadata/sysaux01.dbf';

Database altered.



SQL> alter database rename file'/u01/app/oracle/oradata/undosql/undotbs01.dbf' to'/u01/app/oracle/neworadata/undotbs01.dbf';

Database altered.



SQL> alter database rename file'/u01/app/oracle/oradata/undosql/users01.dbf' to'/u01/app/oracle/neworadata/users01.dbf';

Database altered.



SQL> alter database rename file'/u01/app/oracle/oradata/undosql/example01.dbf' to'/u01/app/oracle/neworadata/example01.dbf';

Database altered.





SQL> select file#,name from v$datafile;



FILE# NAME

------------------------------------------------------------

1 /u01/app/oracle/neworadata/system01.dbf

2 /u01/app/oracle/neworadata/sysaux01.dbf

3 /u01/app/oracle/neworadata/undotbs01.dbf

4 /u01/app/oracle/neworadata/users01.dbf

5 /u01/app/oracle/neworadata/example01.dbf

修改成功 
阅读(7854) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~