你好,游客 登录 注册 搜索
背景:
阅读新闻

Oracle 修改 MEMORY_TARGET

[日期:2012-11-09] 来源:Linux社区  作者:cswggod [字体:大 中 小]

3.临时建立SPFILE
 
[Oracle@h1 dbs]$ ls
hc_orcl.dat  init.ora  lkORCL  orapworcl
 
 
 
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down
 
SQL> startup nomount
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/app/oracle/product/11.2.0/dbhome_2/dbs/initorcl.ora'
 
#------------------------------spfile不存在
 
#-----------------------------spfile位置:$ORACLE_HOME/dbs/init[ORACLE_SID].ora
 
#-----------------------------名字格式为:initORACLE_SID.ora
 
[oracle@h1 dbhome_2]$ cd /app/oracle/admin/orcl/pfile/
[oracle@h1 pfile]$ ls
init.ora.103201271612
 
 
 
[oracle@h1 pfile]$echo $ORACLE_SID
 
orcl
 
#-------------------查看环境变量$ORACLE_SID
 
[oracle@h1 pfile]$ cp init.ora.103201271612 /app/oracle/product/11.2.0/dbhome_2/dbs
 
[oracle@h1 pfile]$ cd /app/oracle/product/11.2.0/dbhome_2/dbs
 
[oracle@h1 dbs]$ mv init.ora.103201271612  initorcl.ora
 
#------------------------------更改名字格式为:initORACLE_SID.ora
 
 
 
4.mount数据库
 
 
 
[oracle@h1 dbs]$ sqlplus "/as SYSDBA"
 
SQL*Plus: Release 11.2.0.1.0 Production on Sun Nov 4 16:59:09 2012
 
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
 
Connected to an idle instance.
 
SQL> startup mount
ORACLE instance started.
 
Total System Global Area 1219260416 bytes
Fixed Size                  2212856 bytes
Variable Size            738200584 bytes
Database Buffers          469762048 bytes
Redo Buffers                9084928 bytes
Database mounted.
SQL>

 
 
SQL> show parameter memory_target;
 
NAME                                TYPE        VALUE
------------------------------------ ----------- ------------------------------
memory_target                        big integer 1168M
SQL> show parameter memory_max_target;
 
NAME                                TYPE        VALUE
------------------------------------ ----------- ------------------------------
memory_max_target                    big integer 1168M
SQL>       
SQL>  alter system set memory_max_target=1G scope=spfile;
alter system set memory_max_target=1G scope=spfile
*
ERROR at line 1:
ORA-32001: write to SPFILE requested but no SPFILE is in use
 

SQL> show parameter spfile;
 
NAME                                TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                              string
 
#------------------重建spfile
SQL> create spfile from pfile;
 
File created.
 

SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>  startup
ORACLE instance started.
 
Total System Global Area 1219260416 bytes
Fixed Size                  2212856 bytes
Variable Size            738200584 bytes
Database Buffers          469762048 bytes
Redo Buffers                9084928 bytes
Database mounted.
Database opened.
SQL> show parameter spfile;
 
NAME                                TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                              string      /app/oracle/product/11.2.0/dbh
                                                ome_2/dbs/spfileorcl.ora
 
 
 
SQL> alter system set memory_max_target=1G scope=spfile;
 
System altered.
 
 
 
SQL> alter system set memory_target=1G scope=both;
 
System altered.
 
 
 
SQL> alter system set memory_max_target=1332M scope=both;
alter system set memory_max_target=1332M scope=both
                *
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified
 
 
 
SQL> alter system set memory_max_target=1332M scope=spfile;
 
 
 
System altered.
 
-------------------------------
 
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup
ORACLE instance started.
 
Total System Global Area 1402982400 bytes
Fixed Size                  2213296 bytes
Variable Size            922749520 bytes
Database Buffers          469762048 bytes
Redo Buffers                8257536 bytes
Database mounted.
Database opened.
SQL> show parameter memory_max_target;
 
NAME                                TYPE        VALUE
------------------------------------ ----------- ------------------------------
memory_max_target                    big integer 1344M

 

SQL> show parameter memory_target;
 
NAME                                TYPE        VALUE
------------------------------------ ----------- ------------------------------
memory_target                        big integer 1G
SQL>

-----------------------finish

linux
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款