Oracle中的pfile和spfile

football2006發表於2008-07-11

Oracle資料中spfilepfile各有許多不同的優缺點,pfile中的引數可以利用vi或者編輯器進行修改,但是spfile是二進位制格式,修改起來就不那麼容易了,那麼如何修改spfile中的引數呢?下面就具體介紹一下方法講解如何把spfile轉成pfile,並修改,然後結合一個例子進行實踐。

步驟:
1. create pfile from spfile.
2. update the pfile accordingly
3. shutdown the database
4. startup the database with pfile
5. create spfile from pfile and write down the spfile directory
6. shutdown the database
7. replace the pfile with the spfile directory like ’spfile=xxxxx’
8. startup with pfile

下面是一個具體的操作步驟:

SQL> show parameter spfile;

NAME TYPE VALUE
———————————— ———– ——————————
spfile string +DG_DB/orcldb/spfileorcldb.ora
SQL> show parameter process

NAME TYPE VALUE
———————————— ———– ——————————
aq_tm_processes integer 0
db_writer_processes integer 1
gcs_server_processes integer 2
global_txn_processes integer 1
job_queue_processes integer 1000
log_archive_max_processes integer 4
processes integer 150
SQL>
SQL> create pfile=’c:pfile.ora’ from spfile;

File created.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup pfile=’c:pfile.ora’
ORACLE instance started.

Total System Global Area 857903104 bytes
Fixed Size 1336380 bytes
Variable Size 457182148 bytes
Database Buffers 394264576 bytes
Redo Buffers 5120000 bytes
Database mounted.
Database opened.

SQL> show parameter process

NAME TYPE VALUE
———————————— ———– ——————————
aq_tm_processes integer 0
db_writer_processes integer 1
gcs_server_processes integer 2
global_txn_processes integer 1
job_queue_processes integer 1000
log_archive_max_processes integer 4
processes integer 500

SQL> create spfile=’+DG_DB/orcldb/spfile.ora’ from pfile=’c:pfile.ora’;

File created.

SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

SQL> startup pfile=’c:pfile.ora’
ORACLE instance started.

Total System Global Area 857903104 bytes
Fixed Size 1336380 bytes
Variable Size 457182148 bytes
Database Buffers 394264576 bytes
Redo Buffers 5120000 bytes
Database mounted.
Database opened.

SQL> show parameter process

NAME TYPE VALUE
———————————— ———– ——————————
aq_tm_processes integer 0
db_writer_processes integer 1
gcs_server_processes integer 2
global_txn_processes integer 1
job_queue_processes integer 1000
log_archive_max_processes integer 4
processes integer 500

SQL> show parameter spfile;

NAME TYPE VALUE
———————————— ———– ——————————
spfile string +DG_DB/orcldb/spfile.ora
[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8119050/viewspace-1007154/,如需轉載,請註明出處,否則將追究法律責任。

相關文章