当原有的SPFILE丢失后如何生成新的SPFILE

Sometimes, the SPFILE gets damaged. When this happens, the SPFILE can be replaced by a
有时候SPFILE会被破坏掉。当这种情况发生的时候,它可已被新的代替,这个新的SPFILE是通过PFILE生成的。PFILE是在数据库创建的时候被自动生成在ORACLE_HOME/admin/SID/pfile目录下的。
新的SPFILE可以这样被生成:
- 以SYSDBA的身份连接数据库实例
- 利用下面的命令创建新的SPFILE:
SQL> CREATE SPFILE FROM PFILE = 'ORACLE_HOME/admin/SID/pfile /my_pfile.ora';
//具我实验的这个才是对的:
create spfile from pfile = '/orasys/app/oracle/product/10.2.0/db_1/dbs/initorcl.ora'

这个命令将把SPFILE创建在默认的目录下。如果目录下SPFILE已存在则将被覆盖。
或者可以用下面的命令将SPFILE创建到指定目录下:
SQL> CREATE SPFILE = 'desired_directory/my_spfile.ora'
     FROM PFILE = 'ORACLE_HOME/admin/SID/pfile/my_pfile.ora';
用上免得命令非默认的SPFILE将被创建。并且名字必须与现在实例运行用得SPFILE的名字不同。
要想覆盖旧的SPFILE,只需要把旧的从ORACLE_HOME/ora92/database/目录下删除,然后将新的SPFILE拷到这里并重名跟以前的一样。最后启动实例,新的SPFILE将被使用。
new one, generated from the PFILE file. The PFILE file is made automatically when the database is created and it can be found in the folder ORACLE_HOME/admin/SID/pfile.
The new SPFILE can be generated as follows:
- connect with sqlplus to the instance as sysdba
- use one of the following commands:
SQL> CREATE SPFILE FROM PFILE = 'ORACLE_HOME/admin/SID/pfile /my_pfile.ora';
Using this command Oracle will assume you are creating a default SPFILE. If a default SPFILE already exists Oracle will overwrite it.
Or you can use
SQL> CREATE SPFILE = 'desired_directory/my_spfile.ora'
     FROM PFILE = 'ORACLE_HOME/admin/SID/pfile/my_pfile.ora';
Using this, a non-default SPFILE will be created. The name of the new SPFILE must not be the same as the SPFILE that was used to start the current instance.
For replacing the old SPFILE just delete the old one from ORACLE_HOME/ ora92/database/directory, copy here the new one and rename it with the name of the original SPFILE. After that you can start the instance and it will start with the parameters from the new SPFILE.

附常用sql命令:
  sqlplus /nolog
监听的打开./lsnrctl start
  sqlplus /nolog
conn  / as sysdba
  startup

  • 4
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值