oracle创建步骤,创建ORACLE步骤(1-5)

本文详细指导如何在Windows平台创建Oracle数据库,包括指定Instance Identifier(SID),设置环境变量,选择DBA认证方法,创建初始化参数文件,以及手动创建实例。重点讲解了如何设置SID,确保环境变量正确和创建初始文本参数文件的过程。
摘要由CSDN通过智能技术生成

Step 1: Specify an Instance Identifier (SID)

Decide on a unique Oracle system identifier (SID) for your instance, open a command window, and set the ORACLE_SID environment variable. Use this command windows for the subsequent steps.

ORACLE_SIDis used to distinguish this instance from other Oracle Database instances that you may create later and run concurrently on the same host computer. The maximum number of characters forORACLE_SIDis 12, and only letters and numeric digits are permitted. On some platforms, the SID is case-sensitive.

第一步,指定一个oracle系统标识ID(SID),ORACLE_SID环境变量用来唯一区别同一台主机上不同的oracle实例。 ORACLE_SID 最大12个字符长度,由字母和数字组成,不同的平台可能区分大小写。

Note:

It is common practice to set the SID to be equal to the database name. The maximum number of characters for the database name is eight. For more information, see the discussion of theDB_NAMEinitialization parameter inOracle Database Reference.

备注: 通常情况下SID和数据库名db_name一样,因此,SID长度最大为8个字符。具体情况和平台有关系。

The following example for UNIX and Linux operating systems sets the SID for the instance that you will connect to in Step 6: Connect to the Instance:

Bourne, Bash, or Korn shell:

ORACLE_SID=mynewdb

export ORACLE_SID

C shell:

setenv ORACLE_SID mynewdb

The following example sets the SID for the Windows operating system:

set ORACLE_SID=mynewdb

在unix和linux 系统上,设置SID 方法是,B shell K shell上执行 export ORACLE_SID=mynewdb , C shell 上是 setenv ORACLE_SID mynewdbStep 2: Ensure That the Required Environment Variables Are Set设定要求的环境变量值。

For example, on most platforms,ORACLE_SIDandORACLE_HOMEmust be set. In addition, it is advisable to set thePATHvariable to include theORACLE_HOME/bin directory. On the UNIX and Linux platforms, you must set these environment variables manually. On the Windows platform, OUI automatically assigns values toORACLE_HOMEandORACLE_SIDin the Windows registry. If you did not create a database upon installation, OUI does not setORACLE_SIDin the registry, and you will have to set theORACLE_SIDenvironment variable when you create your database later.

大多数平台上,要求环境变量ORACLE_HOME ORACLE_SID必须设置,并且ORACLE_HOME/bin目录必须加到PATH路径下。在unix和linux 平台这些变量必须设置,在windows平台不用设置,OUI(没理解错应该是Oracleuniversal Installer),自动为ORACLE_HOME,ORACLE_SID分配值注册到系统,如果你不是用oui创建oracle 数据库,那么ORACLE_SID不会被设置,你需要手动设置ORACLE_SID变量。Step 3: Choose a Database Administrator Authentication MethodYou must be authenticated and granted appropriate system privileges in order to create a database. You can authenticate as an administrator with the required privileges in the following ways:

With a password file

With operating system authentication

In this step, you decide on an authentication method.

If you decide to authenticate with a password file, create the password file as described in "Creating and Maintaining a Password File". If you decide to authenticate with operating system authentication, ensure that you log in to the host computer with a user account that is a member of the appropriate operating system user group. On the UNIX and Linux platforms, for example, this is typically the dba user group. On the Windows platform, the user installing the Oracle software is automatically placed in the required user group.

第三步,选择ORACLE管理认证方式。

为了安装数据库,必须验证和授予管理员一定的权限。你可以通过2种方式鉴权。第一种使用密码文件方式鉴权,第二种使用操作系统鉴权。如果使用密码文件(只是扩展,蓝色为扩展内容),orapwd 命令创建sys用户密码,用法为

Usage: orapwd file=password=entries=force=

如果使用操作系统鉴权,你必须使用归属于适当组用户口令登录系统,在unix和Linux平台,一般使用dba用户组下的用户。在Windows平台,安装oracle软件的用户被默认为通过鉴权用户。Step 4: Create the Initialization Parameter FileWhen an Oracle instance starts, it reads an initialization parameter file. This file can be a text file, which can be created and modified with a text editor, or a binary file, which is created and dynamically modified by the database. The binary file, which is preferred, is called a server parameter file. In this step, you create a text initialization parameter file. In a later step, you create a server parameter file from the text file.

One way to create the text initialization parameter file is to edit the sample presented in "Sample Initialization Parameter File".

For convenience, store your initialization parameter file in the Oracle Database default location, using the default file name. Then when you start your database, it will not be necessary to specify the PFILE clause of the STARTUP command, because Oracle Database automatically looks in the default location for the initialization parameter file.

For more information about initialization parameters and the initialization parameter file, including the default name and location of the initialization parameter file for your platform, see "About Initialization Parameters and Initialization Parameter Files".

第四步,创建oracle初始化参数文件。

当数据库实例启动时,它去读初始化参数文件,这个文件可以是一个文本文件,可以使用文本编辑器修改,也可以是一个二进制文件,它自动被oracle创建和修改,二进制文件是oracle server优先加载的文件,下面告诉你如何通过文本方式创建初始化参数文件,一个server 参数文件是由这个文本文件创建。

为管理方便,初始化参数文件被放在本地默认目录,使用默认的名字。当你启动数据库,不用指定由startup启动指定的pfile参数。因为oracle数据库自动查找默认位置下的参数文件。

题外话: 创建spfile文件方法,以oracle 用户 执行sqlplus "/as sysdba"  先shutdown abort  数据库实例,然后执行 如下命令:

create  spfile  from  pfile='?/dbs/initsid.ora';Step 5: (Windows Only) Create an InstanceOn the Windows platform, before you can connect to an instance, you must manually create it if it does not already exist. The ORADIM command creates an Oracle instance by creating a new Windows service.

To create an instance:

Enter the following command at a Windows command prompt:

oradim -NEW -SID sid -STARTMODE MANUAL -PFILE pfile

where sid is the desired SID (for example mynewdb) and pfile is the full path to the text initialization parameter file. This command creates the instance but does not start it.

Warning:

Do not set the -STARTMODE argument to AUTO at this point, because this causes the new instance to start and attempt to mount the database, which does not exist yet. You can change this parameter to AUTO, if desired, in Step 14.

See the section "Using ORADIM to Administer an Oracle Database Instance" in Oracle Database Platform Guide for Microsoft Windows for more information on the ORADIM command.

第五步,创建oracle实例(只Windows平台)

在Windows平台上,在你连接数据库实例之前,如果oracle实例不存在,必须先创建oracle实例,oradim 命令创建一个实例,输入如下命令执行创建oracle实例

oradim -NEW -SID sid -STARTMODE MANUAL -PFILE pfile

pfile 文件为绝对路径的初始化文件名。命令只启动实例,不启动数据库。

由于水平有限,属于自我学习的整理资料,这篇先翻译到这,明天再学习学习。

翻译oracle文档地址:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值