Oracle基礎 07 引數檔案 pfile/spfile

j04212發表於2014-02-12


--檢視資料庫執行模式(spfile還是pfile)
select decode(count(*),1,'spfile','pfile')
from v$spparameter
where rownum=1 and isspecified='TRUE';


--以pfile啟動資料庫

create pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initdbtest.ora' from spfile;
shutdown immediate;
startup pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initdbtest.ora';


--以spfile啟動資料庫

create spfile from pfile='/u01/app/oracle/product/11.2.0/db_1/dbs/initdbtest.ora';
shutdown immediate;
startup;


--從記憶體建立spfile或pfile

create spfile from memory
create pfile from memory

此命令在丟失當前引數檔案時很方便。在RAC環境中,此命令將捕捉系統中每個例項正在使用的引數值。

 


--pfile重建
adump :審計資訊
bdump :後臺程式trace 和alert log ,就是說 alert_sid.log也存在這個目錄中
cdump :core trace,一般是用來日誌應用程式的 除非資料庫出了問題 否則基本上不會有什麼資訊
dpdump :是存放一些登入資訊的
udump :前臺手動trace的 比如sql trace之後session的trace檔案


--10g pfile模板 /u01/app/oracle/admin/test10g/bdump alert_test10.log檔案

processes                = 150
sga_target               = 205520896
control_files            = /u01/app/oracle/oradata/test10g/control01.ctl, /u01
/app/oracle/oradata/test10g/control02.ctl, /u01/app/oracle/oradata/test10g/contr
ol03.ctl
db_block_size            = 8192
compatible               = 10.2.0.1.0
log_archive_format       = %t_%s_%r.dbf
db_file_multiblock_read_count= 16
db_recovery_file_dest    = /u01/app/oracle/flash_recovery_area
db_recovery_file_dest_size= 2147483648
undo_management          = AUTO
undo_tablespace          = UNDOTBS1
remote_login_passwordfile= EXCLUSIVE
db_domain                =
dispatchers              = (PROTOCOL=TCP) (SERVICE=test10gXDB)
job_queue_processes      = 10
background_dump_dest     = /u01/app/oracle/admin/test10g/bdump
user_dump_dest           = /u01/app/oracle/admin/test10g/udump
core_dump_dest           = /u01/app/oracle/admin/test10g/cdump
audit_file_dest          = /u01/app/oracle/admin/test10g/adump
db_name                  = test10g
open_cursors             = 300
pga_aggregate_target     = 68157440


--11g pfile模板 /u01/app/oracle/diag/rdbms/test11g/test11g/trace alert_test11g.log檔案

processes                = 150
nls_language             = "AMERICAN"
nls_territory            = "AMERICA"
sga_target               = 400M
control_files            = "/u01/app/oracle/oradata/test11g/control01.ctl"
control_files            = "/u01/app/oracle/oradata/test11g/control02.ctl"
control_files            = "/u01/app/oracle/oradata/test11g/control03.ctl"
db_block_size            = 8192
compatible               = "11.2.0"
db_recovery_file_dest    = "$ORACLE_BASE/flash_recovery_area"
db_recovery_file_dest_size= 2G
undo_management          = "AUTO"
undo_tablespace          = "UNDOTBS1"
undo_retention           = 7200
remote_login_passwordfile= "EXCLUSIVE"
db_domain                = ""
dispatchers              = "(PROTOCOL=TCP) (SERVICE=ORCLXDB)"
audit_file_dest          = "/u01/app/oracle/admin/test11g/adump"
audit_trail              = "NONE"
db_name                  = "TEST11G"
open_cursors             = 300
pga_aggregate_target     = 300M
statistics_level         = "typical"
diagnostic_dest          = "/u01/app/oracle"

 

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

相關文章