基础知识补漏-参数及参数文件

参数及参数文件


session=process*1.5+22


一次显示多个parameter:
SQL> select name,value from v$parameter where name in ('processes','sessions');


在数据库启动时,会预先为 Processes 分配内存地址空间,并向 Shared Pool 注册,所以该参数无法 动态修改。缺省的每个进程会在共享池中分配 4 Bytes 的注册空间。


sqlplus>变为EYGLE @ danaly>:
set sqlprompt "_user @ _connect_identifier>"


通过在pfile中调用spfile,使用后设置的参数覆盖spfile中的参数设置,是解决spfile中参数设置错误的一种方法,比如修改sga_max_size超过系统最大内存数量:
SQL> alter system set sga_max_size=5G scope=spfile;
System altered.
下次启动时,内存不足,数据库无法启动,出现ora-27102错误:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORA-27102: out of memory
在unix,Linux系统上可以使用pfile,在windows上,无法启动服务,会出现这样的错误:
C:\>sqlplus "/ as sysdba"
SQL*Plus: Release 10.2.0.4.0 - Production on     7   15 10:48:04 2008 Copyright (c) 1982, 2007, Oracle. All Rights Reserved.
ERROR:
ORA-12560: TNS: 协议适配器错误
此时可以创建文本,内容如下:
[oracle@test126 dbs]$ cat initeygle.ora 
SPFILE='/opt/oracle/product/10.2.0/dbs/spfileeygle.ora'
sga_max_size=1073741824 
然后用此文本启动
SQL> startup pfile=$ORACLE_HOME/dbs/initeygle.ora 
ORACLE instance started.
Database mounted.
Database opened.


SCOPE参数: MEMORY ,SPFILE , BOTH                   
MEMORY-只改变当前实例,重新启动数据库后无效
SPFILE-不改变当前实例,重新启动数据库后生效
BOTH-实例和spfile同时改变,立即生效,重启后依然有效


设置了sga_target参数启用了自动sga调整后,oracle会同时启用一系列的新的隐含参数来控制sga各组建的大小。每次启动这些参数的设置通常都是不同的。


重设参数为默认值(将该参数从spfile中去除):
SQL> alter system reset open_cursors scope=spfile sid='*';


数据库不mount,不能用rman恢复
[oracle@jumper dbs]$ rman target /
Recovery Manager: Release 9.2.0.4.0 - Production
Copyright (c) 1995, 2002, Oracle Corporation. All rights reserved.
connected to target database: conner (not mounted)
RMAN> restore controlfile to '/tmp/control01.ctl' from autobackup;
Starting restore at 08-MAR-06
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=11 devtype=DISK
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of restore command at 03/08/2006 11:38:29
RMAN-06495: must explicitly specify DBID with SET DBID command
此时,需要提供dbid或指定自动备份集:
RMAN> restore controlfile to '/tmp/control01.ctl' from 'c-3152029224-20051221-00';
Starting restore at 08-MAR-06
using target database controlfile instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: sid=9 devtype=DISK
channel ORA_DISK_1: restoring controlfile
channel ORA_DISK_1: restore complete
Finished restore at 08-MAR-06


获得当前实例的非缺省参数:
set linesize 120
set pagesize 999
set heading off
set feedback off
spool /tmp/inittmp.ora
select '*.'||name||' = ' || value from v$parameter where isdefault = 'FALSE';
spool off







评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值