ITPub博客

首页 > 数据库 > Oracle > 手动创建数据库

手动创建数据库

原创 Oracle 作者:不二黑猫 时间:2015-01-01 17:01:07 0 删除 编辑

1.安装了oracle的软件

2.配置的环境如下

ORACLE_SID=orcl; export ORACLE_SID=ORCL

ORACLE_BASE=/u01/app/oracle; export ORACLE_BASE

ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1; export ORACLE_HOME

PATH=$ORACLE_HOME/bin:$PATH; export PATH

NLS_LANG=american_america.al32utf8; export NLS_LANG

3.编写参数文件 initORCL.ora

db_name=orcl

instance_name=ORCL

memory_target=600m

undo_management=auto

undo_tablespace=undotbs

diagnostic_dest=/u01/app/oracle

processes=150

control_files='/u01/app/oracle/oradata/ORCL/control01.ctl'

4.创建密码文件

orapwdfile='/u01/app/oracle/product/11.2.0/db_1/dbs/orapwORCL' password=oracle

5.创建必要的目录

mkdir-p /u01/app/oracle/oradata/ORCL

6.启动数据库到nomount模式,创建spfile

createspfile from pfile;

7.创建数据库

createdatabase orcl

logfile

group1 ('/u01/app/oracle/oradata/ORCL/redo01.log') size 512000k, #这里有个逗号,文件大小可能要用k

group2 ('/u01/app/oracle/oradata/ORCL/redo02.log') size 512000k

maxinstances8

maxdatafiles200

maxlogfiles32

maxlogmembers5

maxloghistory1000

usersys identified by oracle

usersystem identified by oracle

characterset al32utf8

nationalcharacter set al16utf16

datafile'/u01/app/oracle/oradata/ORCL/system01.dbf' size 512000k autoextendon maxsize unlimited

sysauxdatafile '/u01/app/oracle/oradata/ORCL/sysaux01.dbf' size 512000kautoextend on maxsize unlimited

undotablespace undotbs datafile'/u01/app/oracle/oradata/ORCL/undotbs01.dbf' size 512000k autoextendon maxsize unlimited #一定要和参数文件中指定的回滚表空间名称一样。

defaulttemporary tablespace temp tempfile'/u01/app/oracle/oradata/ORCL/temp01.dbf' size 512000k autoextend onmaxsize unlimited ;

8.创建一个默认的永久表空间

createtablespace users datafile '/u01/app/oracle/oradata/ORCL/users01.dbf'size 100m autoextend on maxsize 1g;

alterdatabase default tablespace users;

9.执行必须的脚本文件

sys:

@?/rdbms/admin/catalog //创建数据字典

@?/rdbms/admin/catproc//创建必须的PL/sql

system

@?/sqlplus/admin/pupbld//创建必须的pl/sql

9.配置监听

创建文件$ORACLE_HOME/network/admin/listener.ora

LISTENER=

    (DESCRIPTION_LIST =

         (DESCRIPTION =

              (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

          )

     )

10.编辑TNS文件

orcl=

    (description=

        (address_list=

            (address=(protocol=tcp)(host=localhost)(port=1521))

        )

        (connect_data=

            (service_name=ORCL)

        )

    )  

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30083145/viewspace-1386941/,如需转载,请注明出处,否则将追究法律责任。

下一篇: nagios--check_oracle
请登录后发表评论 登录
全部评论

注册时间:2014-12-28

  • 博文量
    16
  • 访问量
    24315