Oracle主要配置文件介绍
profile文件或者.bash_profile文件(系统级环境变量文件:/home/Oracle); oratab 文件(oracle自运行文件:/etc/oratab ); in
profile文件或者.bash_profile文件(系统级环境变量文件:/home/Oracle);
oratab 文件(oracle自运行文件:/etc/oratab );
initSID.ora或者spfileSID.ora文件(数据库实例初始化文件:$ORACLE_HOME/dbs/或者$ORACLE HOME\database);
listener.ora、sqlnet.ora文件和tnsnames.ora 文件(监听配置文件:$ORACLE_HOME/network/admin);
Alert.log文件(数据库警告日志:$ORACLE_BASE/diag/rdbms/db_name/SID/trace);
一、 环境变量文件 /etc/profile
系统级的环境变量一般在/etc/profile 文件中定义,如下所示:
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/8.1.7
export PATH=$PATH:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib
export ORACLE_SID=topicis
export ORACLE_TERM=vt100
export ORA_NLS33=$ORACLE_HOME/ocommon/nls/admin/data
export NLS_LANG=AMERICAN.ZHS16CGB231280
说明:
1 配置上述环境变量要注意定义的先后顺序 ,如 定义 ORACLE_HOME时用到了 ORACLE_BASE, 那 么 ORACLE_HOME 的 定 义 应该 在ORACLE_BASE之后;
2 在使用中文版时 环境变量 NLS_LANG 的值应该设置为AMERICAN.ZHS16CGB231280; 如上所示 在使用英文版时 可以不设置 NLS_LANG 即去掉 export NLS_LANG=... ... 那一行。也可以设置 NLS_LANG 的值为 AMERICAN_AMERICA.US7ASCII。
--------------------------------------分割线 --------------------------------------
在CentOS 6.4下安装Oracle 11gR2(x64)
Oracle 11gR2 在VMWare虚拟机中安装步骤
Debian 下 安装 Oracle 11g XE R2
--------------------------------------分割线 --------------------------------------
二、 数据库自启动文件/etc/oratab
/etc/oratab 文件描述目前系统中创建的数据库实例 以及是否通过 dbstart 和dbshut 来控制该实例的启动与关闭。如下所示 忽略以#开头的注释部分 :
topicis:/u01/app/oracle/product/8.1.7:Y
其中 topicis为实例 ID, /u01/app/oracle/product/8.1.7为ORACLE_HOME目录, Y表示允许使用, dbstart和 dbshut 启动和关闭该实例数据库 如果设置为N 表示不通过dbstart 和 dbshut 启动和关闭实例数据库topicis,系统要求在安装完 ORACLE 后要求将该参数修改为 Y,以保证 ORACLE 数据库自启动和关闭;
三、 数据库实例初始化参数文件spfileSID.ora(或者spfile.ora 或者initSID.ora,可通过show parameter pfile进行查询)
每个数据库实例都有一个初始化参数文件,其缺省存放的路径为$ORACLE_BASE/admin/
在启动的第一步,oracle首先寻找参数文件,然后根据参数文件中的设置,创建实例(Instance),分配内存,启动后天进程。
初始化参数文件是一个包含实例配置参数的文本文件,这些参数被设置为特定的值,用于初始化Oracle 实例的多数内存和进程设置。
oracle首先spfileSID.ora文件作为初始化参数文件,,其次分别选择spfile.ora、initSID.ora。如果都不存在,将无法创建和启动Instance。
在参数文件中,至少需要的参数是DB_NAME。
以下是一些主要参数的说明:
1 实例的数据库名称 db_name = "topicis"
2 实例名称 instance_name = topicis
3 数据库控制文件的名称和位置 (也可以通过show parameter control_files查询)
control_files = ("/u02/app/oracle/topicis/control01.ctl","/u02/app/oracle/topicis/control02.ctl","/u02/app/oracle/topicis/control03.ctl")
4 调度作业队列的 SNP 进程的数量以及 SNP 进程觉醒时间间隔 秒
JOB_QUEUE_PROCESSES=2
JOB_QUEUE_INTERVAL=60
5 存储追踪和告警文件的路径(可以通过show parameter dump_dest查询)
user_dump_dest 指定记录 Oracle 用户进程产生的追踪和告警信息的文件的存放路径;
background_dump_dest 指定记录 Oracle 后台进程产生的追踪和告警信息的文件的存放路径;
core_dump_dest指定Oracle运行所产生的coredump 信息的文件的存放路径。
background_dump_dest = /u02/app/oracle/admin/topicis/bdump
core_dump_dest = /u02/app/oracle/admin/topicis/cdump
user_dump_dest = /u02/app/oracle/admin/topicis/udump
6 UTL_FILE_DIR 参数
UTL_FILE_DIR = *
UTL_FILE_DIR 参数指定一个或多个目录用于 Oracle 应用的文件 I/O 如备份数据到文件,将该值设置为 * 表示可供 Oracle 应用进行文件 I/O操作的目录为任意目录 因此 只要空间允许 可以将备份数据存放到任意目录下。
四、 监听配置文件
为了使得外部进程,如topicis后台程序,能够访问 Oracle 数据库,必须配置 Oracle 网络服务器环境,配置 Oracle 网络服务器环境是通过配置 listener.ora sqlnet.ora 和tnsnames.ora 共三个文件来进行的
监听配置文件 listener.ora 的存放路径为 $ORACLE_HOME/network/admin
以下是一个示例
LISTENER = #监听器名称
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =(PROTOCOL = IPC)(KEY = EXTPROC))
)
(ADDRESS_LIST =
(ADDRESS =(PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 1521))
)
)
(DESCRIPTION =
(PROTOCOL_STACK =
(PRESENTATION = GIOP)
(SESSION = RAW)
)
(ADDRESS =
(PROTOCOL = TCP)(HOST = localhost.localdomain)(PORT = 2481))
)
)
SID_LIST_LISTENER =
###命名规则 SID_LIST_+上面定义的监听器名称,该段用于定义监听器的服务 即为哪些数据库实例提供监听服务
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc1)
(ORACLE_HOME = /u01/app/oracle/product/8.1.7)
(PROGRAM = extproc)
)
(SID_DESC =
(GLOBAL_DBNAME = topicis)
(ORACLE_HOME = /u01/app/oracle/product/8.1.7)
(SID_NAME =topicis)
)
(SID_DESC =
(GLOBAL_DBNAME = oid)
(ORACLE_HOME = /u01/app/oracle/product/8.1.7)
(SID_NAME = oid)
)
)

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Go language is an efficient, concise and easy-to-learn programming language. It is favored by developers because of its advantages in concurrent programming and network programming. In actual development, database operations are an indispensable part. This article will introduce how to use Go language to implement database addition, deletion, modification and query operations. In Go language, we usually use third-party libraries to operate databases, such as commonly used sql packages, gorm, etc. Here we take the sql package as an example to introduce how to implement the addition, deletion, modification and query operations of the database. Assume we are using a MySQL database.

How to use MySQLi to establish a database connection in PHP: Include MySQLi extension (require_once) Create connection function (functionconnect_to_db) Call connection function ($conn=connect_to_db()) Execute query ($result=$conn->query()) Close connection ( $conn->close())

Hibernate polymorphic mapping can map inherited classes to the database and provides the following mapping types: joined-subclass: Create a separate table for the subclass, including all columns of the parent class. table-per-class: Create a separate table for subclasses, containing only subclass-specific columns. union-subclass: similar to joined-subclass, but the parent class table unions all subclass columns.

Apple's latest releases of iOS18, iPadOS18 and macOS Sequoia systems have added an important feature to the Photos application, designed to help users easily recover photos and videos lost or damaged due to various reasons. The new feature introduces an album called "Recovered" in the Tools section of the Photos app that will automatically appear when a user has pictures or videos on their device that are not part of their photo library. The emergence of the "Recovered" album provides a solution for photos and videos lost due to database corruption, the camera application not saving to the photo library correctly, or a third-party application managing the photo library. Users only need a few simple steps

HTML cannot read the database directly, but it can be achieved through JavaScript and AJAX. The steps include establishing a database connection, sending a query, processing the response, and updating the page. This article provides a practical example of using JavaScript, AJAX and PHP to read data from a MySQL database, showing how to dynamically display query results in an HTML page. This example uses XMLHttpRequest to establish a database connection, send a query and process the response, thereby filling data into page elements and realizing the function of HTML reading the database.

Analysis of the basic principles of the MySQL database management system MySQL is a commonly used relational database management system that uses structured query language (SQL) for data storage and management. This article will introduce the basic principles of the MySQL database management system, including database creation, data table design, data addition, deletion, modification, and other operations, and provide specific code examples. 1. Database Creation In MySQL, you first need to create a database instance to store data. The following code can create a file named "my

PHP is a back-end programming language widely used in website development. It has powerful database operation functions and is often used to interact with databases such as MySQL. However, due to the complexity of Chinese character encoding, problems often arise when dealing with Chinese garbled characters in the database. This article will introduce the skills and practices of PHP in handling Chinese garbled characters in databases, including common causes of garbled characters, solutions and specific code examples. Common reasons for garbled characters are incorrect database character set settings: the correct character set needs to be selected when creating the database, such as utf8 or u

To handle database connection errors in PHP, you can use the following steps: Use mysqli_connect_errno() to obtain the error code. Use mysqli_connect_error() to get the error message. By capturing and logging these error messages, database connection issues can be easily identified and resolved, ensuring the smooth running of your application.
