1.先查看Oracle参数文件位置**(在数据库内)**
SQL> show parameter pfile;
NAME TYPE
VALUE
spfile string
/u01/app/oracle/product/19.2.0
/db_1/dbs/spfilezzw.ora(参数文件所在地址)
2.查看参数文件**(但是参数文件属于二进制文件所以查看时存在乱码)**
[oracle@zzw dbs]$ cat spfilezzw.ora
C\”0Â$ýCC\”dzzw.__data_transfer_cache_size=0
zzw.__db_cache_size=398458880
zzw.__inmemory_ext_roarea=0
zzw.__inmemory_ext_rwarea=0
zzw.__java_pool_size=0
zzw.__large_pool_size=4194304
zzw.__oracle_base=’/u01/app/oracle’#ORACLE_BASE set from environment
zzw.__pga_aggregate_target=281018368
zzw.__sga_target=834666496
zzw.__shared_io_pool_size=37748736
zzw.__shared_pool_size=377487360
zzw.__streams_pool_size=0
zzw.__unified_pga_pool_size=0
*.audit_file_dest=’/u01/app/oracle/admin/zzw/adump’
*.auditCC\”Z_trail=‘db’
*.compatible=‘19.0.0’
*.control_files=’/u01/app/oracle/oradata/ZZW/control01.ctl’,’/u01/app/oracle/oradata/ZZW/control02.ctl’
*.db_block_size=8192
*.db_name=‘zzw’
*.diagnostic_dest=’/u01/app/oracle’
*.dispatchers=’(PROTOCOL=TCP) (SERVICE=zzwXDB)’
*.enable_pluggable_database=true
*.local_listener=‘LISTENER_ZZW’
*.nls_language=‘SIMPLIFIED CHINESE’
*.nls_territory=‘CHINA’
*.open_cursors=300
*.pga_aggregate_target=266m
*.processes=320
*.remote_login_passwordfile=‘EXCLUSIVE’
*CC\”.sga_target=795m
*.star_transformation_enabled=‘TRUE’
*.undo_tablespace=‘UNDOTBS1’
3.回到数据库内把参数文件拷贝新建一个txt文件
SQL> create pfile=’/home/oracle/zzw.txt’ from spfile;
File created.
注意这里’/home/oracle/zzw.txt’新建参数文件名字自定位置要和之前的参数文件位置一样
4.再次查看新建参数文件
[oracle@zzw dbs]$ cat /home/oracle/zzw.txt
zzw.__data_transfer_cache_size=0
zzw.__db_cache_size=398458880
zzw.__inmemory_ext_roarea=0
zzw.__inmemory_ext_rwarea=0
zzw.__java_pool_size=0
zzw.__large_pool_size=4194304
zzw.__oracle_base=’/u01/app/oracle’#ORACLE_BASE set from environment
zzw.__pga_aggregate_target=281018368
zzw.__sga_target=834666496
zzw.__shared_io_pool_size=37748736
zzw.__shared_pool_size=377487360
zzw.__streams_pool_size=0
zzw.__unified_pga_pool_size=0
*.audit_file_dest=’/u01/app/oracle/admin/zzw/adump’
*.audit_trail=‘db’
*.compatible=‘19.0.0’
*.control_files=’/u01/app/oracle/oradata/ZZW/control01.ctl’,’/u01/app/oracle/oradata/ZZW/control02.ctl’
*.db_block_size=8192
*.db_name=‘zzw’
*.diagnostic_dest=’/u01/app/oracle’
*.dispatchers=’(PROTOCOL=TCP) (SERVICE=zzwXDB)’
*.enable_pluggable_database=true
*.local_listener=‘LISTENER_ZZW’
*.nls_language=‘SIMPLIFIED CHINESE’
*.nls_territory=‘CHINA’
*.open_cursors=300
*.pga_aggregate_target=266m
*.processes=320
*.remote_login_passwordfile=‘EXCLUSIVE’
*.sga_target=795m
*.star_transformation_enabled=‘TRUE’
*.undo_tablespace=‘UNDOTBS1’
已经创建成功新的参数文件因为是txt格式所以查看不会出现乱码
5.回到数据库内先关闭数据库
SQL> shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
6.将Oracle数据库参数文件改为新建参数文件
SQL> startup pfile=’/home/oracle/zzw.txt’;
ORACLE instance started.
Total System Global Area 834664552 bytes
Fixed Size 9140328 bytes
Variable Size 381681664 bytes
Database Buffers 436207616 bytes
Redo Buffers 7634944 bytes
Database mounted.
Database opened.
7.再次查看参数文件
SQL> show parameter pfile;
NAME TYPE
VALUE
spfile string
修改成功