Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

2_Oracle_Admin_PFILE and SID

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

There can be multiple initialization parameter files, and specific files can be specified at startup; parameterized files can be modified.

You can query the value of a specific parameter through v$parameter

SQL > desc v$parameter

Name Null? Type-NUM NUMBER NAME VARCHAR2 (80) TYPE NUMBER VALUE VARCHAR2 (4000) DISPLAY_VALUE VARCHAR2 (4000) ISDEFAULT VARCHAR2 (9) ISSES_MODIFIABLE VARCHAR2 (5) ISSYS_MODIFIABLE VARCHAR2 (9) ISINSTANCE_MODIFIABLE VARCHAR2 (5) ISMODIFIED VARCHAR2 (10) ISADJUSTED VARCHAR2 (5) ISDEPRECATED VARCHAR2 (5) ) ISBASIC VARCHAR2 (5) DESCRIPTION VARCHAR2 (255) UPDATE_COMMENT VARCHAR2 (255) HASH NUMBER

SQL > col name formata20

SQL > col value format A30

SQL > select name, valuefrom v$parameter

NAME VALUE--lock_name_spaceprocesses 150sessions 247timed_statistics TRUEtimed_os_statistics 0resource_limit FALSElicense_max_sessions 0license_sessions_war 0ning...NAME VALUE- -sqltune_category DEFAULTdiagnostic_dest / oracletracefile_identifiermax_dump_file_size unlimitedtrace_enabled TRUE 342rows selected.

SQL > select name, valuefrom v$parameter where name='pga_aggregate_target'

NAME VALUE- pga_aggregate_target 0

/ * = it is easier to use show parameter to query parameters = * /

SQL > show parameter sga

NAME TYPE VALUE---lock_sga boolean FALSEpre_page_sga boolean FALSEsga_max_size big integer 404Msga_target big integer 0

PFILE is a text file, which can be opened and modified using vi in Linux environment, but the modification will not take effect immediately. You must close the current instance and open it again before starting it. ORACLE_HOME/dbs is the directory of the Linux environment, and the directory of the Windows environment is database.

[oracle@localhost ~] $env | grep ORACLE_HOME

ORACLE_HOME=/oracle/11g

[oracle@localhost ~] $cd/oracle/11g

[oracle@localhost 11g] $ls

Apex deinstall jdbc olap relnotesassistants demo jdev ons root.shbin diagnostics jdk OPatch schedulerccr dv jlib opmn slaxcdata emcli ldap oracore sqldevelopercfgtoollogs EMStagePatches_orcl lib OraInst.loc sqljclone has localhost_orcl ord sqlplusconfig hs log oui srvmcrs ide md owb sysmancsmig install mesg owm timingframeworkcss install.platform mgw perl Ucpctx instantclient network plsql uixcv inventory nls precomp utldbs j2ee oc4j racg wwgdc_ocm javavm odbc rdbms xdk

[oracle@localhost 11g] $cd dbs

[oracle@localhost dbs] $ll

Total 24, RW, and RW. 1 oracle oinstall 1544 Sep 8 22:10 hc_orcl.dat-rw-r--r--. 1 oracle oinstall 2851 May 15 2009 init.ora# init.ora is the Sample-rw-r-. of PFILE 1 oracle oinstall 24 Aug 5 18:28 lkORCL-rw-r-. 1 oracle oinstall 1536 Aug 7 16:08 orapworcldrwx-. 2 oracle oinstall 4096 Aug 5 18:25 peshm_orcl_0-rw-r-. 1 oracle oinstall 2560 Sep 8 22:10 spfileorcl.ora

[oracle@localhost dbs] $vim init.ora

... # Change''to point to the oracle base (the one you specify at# install time) db_name='ORCL'memory_target=1Gprocesses = 150audit_file_dest='/admin/orcl/adump'audit_trail = 'db'db_block_size=8192...

All kinds of software related to ORACLE can be stored in ORACLE_BASHE.

ORACLE_HOME is used to store ORACLE databases, and the same computer can have multiple ORACLE_HOME

There can be multiple ORACLE_SID, and the value of each SID and ORACLE_HOME hash together will be used as the unique identifier of the database SGA.

The PATH directory is ORACLE_HOME/bin, and if PATH is not set, other software such as sql*plus and dbca cannot be called directly on the command line.

The SID in the name of / * = PFILE can be determined by querying ORACL.

[oracle@localhost dbs] $env | grep ORACL

ORACLE_SID=orclORACLE_BASE=/oracleORACLE_HOME=/oracle/11g

[oracle@localhost dbs] $env | grep PATH

PATH=/oracle/11g/bin:/usr/lib/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/oracle/bin

/ * = View the current PFILE=*/

[oracle@localhost ~] $cd/oracle/11g/dbs

[oracle@localhost dbs] $ll

Total 24, RW, and RW. 1 oracle oinstall 1544 Aug 22 09:27 hc_orcl.dat-rw-r--r--. 1 oracle oinstall 2851 May 15 2009 init.ora-- init.ora is a sample PFILE-rw-r-. 1 oracle oinstall 24 Aug 5 18:28 lkORCL-rw-r-. 1 oracle oinstall 1536 Aug 7 16:08 orapworcldrwx-. 2 oracle oinstall 4096 Aug 5 18:25 peshm_orcl_0-rw-r-. 1 oracle oinstall 2560 Aug 22 09:27spfileorcl.ora

/ * = backup sample file = * /

[oracle@localhost dbs] $mkdirold

[oracle@localhost dbs] $mv * old

Mv: cannot move `old' to a subdirectory of itself, `old/old'

[oracle@localhost dbs] $ll

Total 4drwxr-xr-x. 3 oracle oinstall 4096 Aug 27 09:09 old

/ * = make a copy of init.ora=*/

[oracle@localhost dbs] $env | grep ORACL

ORACLE_SID=orclORACLE_BASE=/oracleORACLE_HOME=/oracle/11g

[oracle@localhost dbs] $cpold/init.ora. / initorcl.ora

[oracle@localhost dbs] $ll

Total 8, RW, RW, and Rafe. 1 oracle oinstall 2851 Aug 27 09:14 initorcl.oradrwxr-xr-x. 3 oracle oinstall 4096 Aug 27 09:09 old

/ * = Let's start modifying init.ora=*/

[oracle@localhost dbs] $vim initorcl.ora

# Change''to point to the oracle base (the one you specify at# install time) db_name='ORCL'# db_name needs to be consistent with the sid of the local database memory_target=1Gprocesses = 150audit_file_dest='/admin/orcl/adump'audit_trail = 'db'db_block_size=8192 db_domain=''db_recovery_file_dest='/flash_recovery_area'db_recovery_file_dest_size=2Gdiagnostic_dest=''dispatchers=' (PROTOCOL=TCP) (SERVICE=ORCLXDB)' open_cursors=300remote_login_ Passwordfile='EXCLUSIVE'undo_tablespace='UNDOTBS1'# You may want to ensure that control files are created onseparate physical# devices#control_files = (ora_control1 Ora_control2) control_files = ('/ oracle/oradata/orcl/control01.ctl','/oracle/oradata/orcl/control02.ctl','/ oracle/oradata/orcl/control03.ctl') # depending on the specific installation You need to modify the path of control_file compatible = '11.2.0'

For the meaning of each parameter, you can refer to the section 1 Initialization Parameters in Oracle's online documentation reference for

[oracle@localhost ~] $ll/oracle/oradata/orcl

Total 1662164 RW / RFT / RW / RW / RW / 1 oracle oinstall 9748480 Aug 27 09:21 control01.ctl-rw-r-. 1 oracle oinstall 9748480 Aug 27 09:21 control02.ctl-rw-r-. 1 oracle oinstall 9748480 Aug 27 09:21 control03.ctl-rw-r-. 1 oracle oinstall 104865792 Aug 26 22 47example01.dbfMurrwMurr. 1 oracle oinstall 52429312 Aug 26 19:56 redo01.log-rw-r-. 1 oracle oinstall 52429312 Aug 26 22:42 redo02.log-rw-r-. 1 oracle oinstall 52429312 Aug 27 09:20 redo03.log-rw-r-. 1 oracle oinstall 618668032 Aug 27 09 19sysaux01.dbfmurr RW Murray. 1 oracle oinstall 723525632 Aug 27 09 18system01.dbf Murray RW Murray. 1 oracle oinstall 20979712 Aug 27 03:48 temp01.dbf-rw-r-. 1 oracle oinstall 57679872 Aug 27 09:20 undotbs01.dbf-rw-r-. 1 oracle oinstall 5251072 Aug 26 22:47 users01.dbf

/ * = start the database = * /

[oracle@localhost ~] $sqlplus/nolog

SQL*Plus: Release 11.2.0.1.0 Production on Wed Aug 2709 Copyright 11 2014 Copyright (c) 1982, 2009, Oracle. All rights reserved.

SQL > conn / as sysdba

Connected to an idle instance.

SQL > startup

ORA-48108: invalid value given for the diagnostic_destinit.ora parameterORA-48140: the specified ADR Base directory does not customers [/ oracle/11g/dbs/] ORA-48187: specified directory does not existLinux Error: 2: No such file or directoryAdditional information: 1 the startup failed because the sample file init.ora is relatively old, and the configuration of many parameters is not suitable for the current system, so it is recommended to find a more complete initSID.ora file with a more experienced DBA copy and then modify it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report