2.修改參數(shù)
spfile和pfile文件里面的參數(shù):
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 通過命令修改參數(shù)
SQL> show parameter processes; --數(shù)據(jù)庫允許的大連接數(shù)
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
processes integer 150
SQL> alter system set processes=250 scope=spfile; --修改數(shù)據(jù)庫允許的大連接數(shù)
System altered.
scope解釋:
spfile:將該參數(shù)的值寫入到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:當前實例生效,重啟的時候還原,但是這種方式修改的參數(shù)是必須是動態(tài)參數(shù)
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 --此參數(shù)為靜態(tài)參數(shù),所以不能用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是靜態(tài)參數(shù),生效必須要重啟實例
動態(tài)參數(shù)的案例:
SQL> show parameter cpu_count;
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
cpu_count integer 1
SQL> alter system set cpu_count=2 scope=memory; --動態(tài)參數(shù)
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.
怎樣知道一個參數(shù)是靜態(tài)還是動態(tài)的
在視圖v$parameter中,ISINSTANCE_MODIFIABLE,如果這個值為false表示這個參數(shù)是靜態(tài)參數(shù),TRUE表示這個參數(shù)是動態(tài)參數(shù)
在session會話級別修改參數(shù):
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文件,修改參數(shù)
processes=300
(3)將新的pfile文件反解會spfile文件
SQL > shutdown immediate --注意,需要數(shù)據(jù)庫處于關閉狀態(tài)才能反解
SQL > create spfile from pfile;
SQL > startup
SQL > show parameter processes
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
processes integer 300
3. oracle參數(shù)文件分級搜索原理
A.找spfileORCL文件
B.找spfile文件
C.找pfile文件
操作:
(1)將參數(shù)文件改名,再打開數(shù)據(jù)庫
[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'
另外有需要云服務器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。