oracle-添加controlfile重建spfile-013
2011-09-08 23:12
169 查看
添加controlfile,重新创建spfile
1.编辑init.ora文件
指定需要添加的控制文件的路径
control_files=("E:\oracle\product\10.1.0\oradata\orcl\control01.ctl", "E:\oracle\product\10.1.0\oradata\orcl\control02.ctl", "E:\oracle\product\10.1.0\oradata\orcl\control03.ctl", "E:\oracle\product\10.1.0\oradata\orcl\control04.ctl","E:\oracle\product\10.1.0\oradata\orcl\control05.ctl")
--添加control04.ctl,control05.ctl的路径
2.创建control04.ctl,control05.ctl文件
E:\oracle\product\10.1.0\admin\orcl\init.ora --添加controlfile
SQL> shutdown--切换状态
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> host copy e:\oracle\product\10.1.0\oradata\orcl\control01.ctl e:\oracle\product\10.1.0\oradata\orcl\control04.ctl
已复制 1 个文件。
SQL> host copy e:\oracle\product\10.1.0\oradata\orcl\control01.ctl e:\oracle\product\10.1.0\oradata\orcl\control05.ctl
已复制 1 个文件。
3.使用pflie文件引导oracle启动
--系统首选启动文件e:\oracle\product\10.1.0\Db_1\database\spfileorcl.ora
--管理员无法直接更改spfileorcl.ora文件,只能重新创建
SQL> startup pfile='e:\oracle\product\10.1.0\admin\orcl\pfile\init.ora.7112011153835';
ORACLE instance started.
Total System Global Area 171966464 bytes
Fixed Size 787988 bytes
Variable Size 145488364 bytes
Database Buffers 25165824 bytes
Redo Buffers 524288 bytes
Database mounted.
Database opened.
--controlfile已经添加成功
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
E:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\CONTROL01.CTL
E:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\CONTROL02.CTL
E:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\CONTROL03.CTL
E:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\CONTROL04.CTL
E:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\CONTROL05.CTL
SQL>
4.重新创建spfile
--(1)oracle使用pfile登录 open状态创建spfile
SQL> create spfile from pfile='e:\oracle\product\10.1.0\admin\orcl\pfile\init.ora.7112011153835';
File created.
--(2)nomount 状态无法创建spflie
--oracle使用pfile登录nomount状态可以创建spfile
SQL> startup nomount
ORACLE instance started.
Total System Global Area 171966464 bytes
Fixed Size 787988 bytes
Variable Size 145488364 bytes
Database Buffers 25165824 bytes
Redo Buffers 524288 bytes
SQL> create spfile from pfile='e:\oracle\product\10.1.0\admin\orcl\pfile\init.ora.7112011153835';
create spfile from pfile='e:\oracle\product\10.1.0\admin\orcl\pfile\init.ora.7112011153835'
*
ERROR at line 1:
ORA-32002: cannot create SPFILE already being used by the instance
SQL>
--(3)oracle关闭状态创建spfile
SQL> shutdown
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> create spfile from pfile='e:\oracle\product\10.1.0\admin\orcl\pfile\init.ora.7112011153835';
File created.
SQL>
1.编辑init.ora文件
指定需要添加的控制文件的路径
control_files=("E:\oracle\product\10.1.0\oradata\orcl\control01.ctl", "E:\oracle\product\10.1.0\oradata\orcl\control02.ctl", "E:\oracle\product\10.1.0\oradata\orcl\control03.ctl", "E:\oracle\product\10.1.0\oradata\orcl\control04.ctl","E:\oracle\product\10.1.0\oradata\orcl\control05.ctl")
--添加control04.ctl,control05.ctl的路径
2.创建control04.ctl,control05.ctl文件
E:\oracle\product\10.1.0\admin\orcl\init.ora --添加controlfile
SQL> shutdown--切换状态
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> host copy e:\oracle\product\10.1.0\oradata\orcl\control01.ctl e:\oracle\product\10.1.0\oradata\orcl\control04.ctl
已复制 1 个文件。
SQL> host copy e:\oracle\product\10.1.0\oradata\orcl\control01.ctl e:\oracle\product\10.1.0\oradata\orcl\control05.ctl
已复制 1 个文件。
3.使用pflie文件引导oracle启动
--系统首选启动文件e:\oracle\product\10.1.0\Db_1\database\spfileorcl.ora
--管理员无法直接更改spfileorcl.ora文件,只能重新创建
SQL> startup pfile='e:\oracle\product\10.1.0\admin\orcl\pfile\init.ora.7112011153835';
ORACLE instance started.
Total System Global Area 171966464 bytes
Fixed Size 787988 bytes
Variable Size 145488364 bytes
Database Buffers 25165824 bytes
Redo Buffers 524288 bytes
Database mounted.
Database opened.
--controlfile已经添加成功
SQL> select name from v$controlfile;
NAME
--------------------------------------------------------------------------------
E:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\CONTROL01.CTL
E:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\CONTROL02.CTL
E:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\CONTROL03.CTL
E:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\CONTROL04.CTL
E:\ORACLE\PRODUCT\10.1.0\ORADATA\ORCL\CONTROL05.CTL
SQL>
4.重新创建spfile
--(1)oracle使用pfile登录 open状态创建spfile
SQL> create spfile from pfile='e:\oracle\product\10.1.0\admin\orcl\pfile\init.ora.7112011153835';
File created.
--(2)nomount 状态无法创建spflie
--oracle使用pfile登录nomount状态可以创建spfile
SQL> startup nomount
ORACLE instance started.
Total System Global Area 171966464 bytes
Fixed Size 787988 bytes
Variable Size 145488364 bytes
Database Buffers 25165824 bytes
Redo Buffers 524288 bytes
SQL> create spfile from pfile='e:\oracle\product\10.1.0\admin\orcl\pfile\init.ora.7112011153835';
create spfile from pfile='e:\oracle\product\10.1.0\admin\orcl\pfile\init.ora.7112011153835'
*
ERROR at line 1:
ORA-32002: cannot create SPFILE already being used by the instance
SQL>
--(3)oracle关闭状态创建spfile
SQL> shutdown
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> create spfile from pfile='e:\oracle\product\10.1.0\admin\orcl\pfile\init.ora.7112011153835';
File created.
SQL>
相关文章推荐
- Oracle 重建或添加对象
- Oracle中添加视图
- Oracle中:已请求写入 SPFILE, 但是在启动时未指定 SPFILE
- oracle添加和查看注释
- RedHat 5.6_x86_64 + ASM + RAW+ Oracle 10g RAC (十) 添加节点—创建监听
- oracle 表约束的添加、修改以及约束的禁用启用
- maven如何添加oracle依赖
- Oracle 添加冗余控制文件 for RAC On Linux
- Oracle中的pfile和spfile详解
- oracle转mysql中的一些注意点(后面会继续添加)
- Oracle 重建索引脚本
- 查看ORACLE启动时使用spfile还是pfile
- oracle spfile和pfile小结
- 『ORACLE』表字段的修改和添加(11g)
- OSSIM下添加oracle listener.log
- oracle 条件:1=1或1=0,动态添加条件
- 手动修改spfile.ora文件导致oracle启动不了的解决办法
- 非RAC环境如何设置Oracle以spfile启动
- maven添加oracle依赖失败问题的处理方法
- Oracle数据文件位置重建迁移