在实际Oracle培训工作中,经常碰到由于修改了一个参数导致无法启动数据库的情况出现,如果参数文件放置在文件系统上,我们可以从这个文件系统中直接创建pfile文件修改,如果参数文件放置在asm存储上,如何修改呢?
下面我们通过一个例子来进行讲述这个问题的处理:
1.查看当前数据库参数文件位置:
SQL> show parameter spfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +DATA/sztech/spfilesztech.ora
以上表明参数文件使用服务参数文件,并且参数文件放置在asm 磁盘组data.
2.使用命令修改memory_max_target参数值到一个无法启动数据库的参数.
SQL> alter system set memory_max_target=100m scope=spfile;
System altered.
3.重启数据库后,无法打开数据库
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-01078: failure in processing system parameters
ORA-00837: Specified value of MEMORY_TARGET greater than MEMORY_MAX_TARGET
4.修改参数
由于这时数据库实例没有启动,无法使用命令修改参数
SQL> show parameter spfile
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 15 Serial number: 19
也无法执行创建pfile
SQL> create pfile='/home/oracle/initsztech.ora' from spfile;
create pfile='/home/oracle/initsztech.ora' from spfile
*
ERROR at line 1:
ORA-01565: error in identifying file '?/dbs/spfile@.ora'
ORA-27037: unable to obtain file status
Linux Error: 2: No such file or directory
Additional information: 3
5.创建pfile
只要asm能够正常访问,可以直接通过以下命令创建pfile:
SQL> create pfile='/home/oracle/initsztech.ora' from spfile='+DATA/sztech/spfilesztech.ora';
File created.
6.修改pfile
通过vi 直接修改pfile参数文件
[oracle@dbserver ~]$ vi /home/oracle/initsztech.ora
sztech.__db_cache_size=67108864
sztech.__java_pool_size=4194304
sztech.__large_pool_size=4194304
sztech.__oracle_base='/oracle/app/oracle'#ORACLE_BASE set from environment
sztech.__pga_aggregate_target=62914560
sztech.__sga_target=146800640
sztech.__shared_io_pool_size=0
sztech.__shared_pool_size=117440512
sztech.__streams_pool_size=4194304
*.audit_file_dest='/oracle/app/oracle/admin/sztech/adump'
*.audit_trail='db'
*.compatible='11.2.0.0.0'
*.control_files='+DATA/sztech/controlfile/current.267.781051935'
*.db_block_size=8192
*.db_create_file_dest='+DATA'
*.db_domain=''
*.db_name='sztech'
*.diagnostic_dest='/oracle/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=sztechXDB)'
*.memory_max_target=214857600 --该 参数出问题时为100m,修改为200m
*.memory_target=209715200
*.open_cursors=300
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'
~
7.使用pfile启动数据库
SQL> startup nomount pfile='/home/oracle/initsztech.ora';
ORACLE instance started.
Total System Global Area 217608192 bytes
Fixed Size 1344004 bytes
Variable Size 159387132 bytes
Database Buffers 50331648 bytes
Redo Buffers 6545408 bytes
8.通过pfile创建spfile
SQL> create spfile='+DATA/sztech/spfilesztech.ora' from pfile='/home/oracle/initsztech.ora';
File created.
SQL> show parameter spfile
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string
9.使用新的spfile启动数据库
SQL> shutdown immediate
ORA-01507: database not mounted
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
Total System Global Area 217608192 bytes
Fixed Size 1344004 bytes
Variable Size 159387132 bytes
Database Buffers 50331648 bytes
Redo Buffers 6545408 bytes
Database mounted.
Database opened.
SQL> show parameter spfile;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
spfile string +DATA/sztech/spfilesztech.ora
通过以上过程可以看出参数文件已经修改回来,并且使用spfile成功启动数据库.
以上文档由 甲骨文(重庆思庄)认证学习中心
提供,转贴请注明出处.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/24433396/viewspace-746521/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/24433396/viewspace-746521/