您好,登錄后才能下訂單哦!
2.修改參數
spfile和pfile文件里面的參數:
ORCL.__db_cache_size=373293056
ORCL.__java_pool_size=33554432
ORCL.__large_pool_size=4194304
ORCL.__shared_pool_size=192937984
ORCL.__streams_pool_size=0
*.audit_file_dest='/u01/oracle/admin/ORCL/adump'
*.background_dump_dest='/u01/oracle/admin/ORCL/bdump'
*.compatible='10.2.0.1.0'
*.control_files='/u01/oracle/oradata/ORCL/control01.ctl','/u01/oracle/oradata/ORCL/control02.ctl','/u01/oracle/oradata/ORCL/control03.ctl'
*.core_dump_dest='/u01/oracle/admin/ORCL/cdump'
*.db_block_size=8192
*.db_domain=''
*.db_file_multiblock_read_count=16
*.db_name='ORCL'
*.db_recovery_file_dest='/u01/oracle/flash_recovery_area'
*.db_recovery_file_dest_size=2147483648
*.dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)'
*.job_queue_processes=10
*.local_listener='ORCL'
*.open_cursors=300
*.pga_aggregate_target=201326592
*.processes=150
*.remote_login_passwordfile='EXCLUSIVE'
*.sga_target=605028352
*.undo_management='AUTO'
*.undo_tablespace='UNDOTBS1'
*.user_dump_dest='/u01/oracle/admin/ORCL/udump'
2.1 通過命令修改參數
SQL> show parameter processes; --數據庫允許的最大連接數
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
processes integer 150
SQL> alter system set processes=250 scope=spfile; --修改數據庫允許的最大連接數
System altered.
scope解釋:
spfile:將該參數的值寫入到spfile文件,下次重啟實例的生效
重新啟動之后
SQL> show parameter processes;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
aq_tm_processes integer 0
db_writer_processes integer 1
gcs_server_processes integer 0
job_queue_processes integer 10
log_archive_max_processes integer 2
processes integer 250
memory:當前實例生效,重啟的時候還原,但是這種方式修改的參數是必須是動態參數
SQL> alter system set processes=300 scope=memory;
alter system set processes=300 scope=memory
*
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified --此參數為靜態參數,所以不能用memory的方式
both:結合上面兩種方式
SQL> alter system set processes=300 scope=both;
alter system set processes=300 scope=both
*
ERROR at line 1:
ORA-02095: specified initialization parameter cannot be modified
說明processes是靜態參數,生效必須要重啟實例
動態參數的案例:
SQL> show parameter cpu_count;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cpu_count integer 1
SQL> alter system set cpu_count=2 scope=memory; --動態參數
System altered.
SQL> show parameter cpu_count;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cpu_count integer 2
SQL> alter system set cpu_count=2 scope=both;
System altered.
怎樣知道一個參數是靜態還是動態的
在視圖v$parameter中,ISINSTANCE_MODIFIABLE,如果這個值為false表示這個參數是靜態參數,TRUE表示這個參數是動態參數
在session會話級別修改參數:
SQL> show parameter db_file_mu
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_file_multiblock_read_count integer 16
SQL> alter session set db_file_multiblock_read_count=32;
Session altered.
SQL> show parameter db_file_multiblock_read_count
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_file_multiblock_read_count integer 32
2.2 通過修改pfile文件--需要重啟
(1) 反解spfile文件
SQL > create pfile from spfile;
(2) 打開initORCL.ora文件,修改參數
processes=300
(3)將新的pfile文件反解會spfile文件
SQL > shutdown immediate --注意,需要數據庫處于關閉狀態才能反解
SQL > create spfile from pfile;
SQL > startup
SQL > show parameter processes
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
processes integer 300
3. oracle參數文件分級搜索原理
A.找spfileORCL文件
B.找spfile文件
C.找pfile文件
操作:
(1)將參數文件改名,再打開數據庫
[oracle@oracle3 dbs]$ mv spfileORCL.ora spfileORCL.ora-
[oracle@oracle3 dbs]$ mv initORCL.ora initORCL.ora-
SQL > startup
SQL> startup
ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/u01/oracle/product/10.2.0/db_1/dbs/initORCL.ora'
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。