博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Oracle11gR2--手工建库&dbca建库
阅读量:5245 次
发布时间:2019-06-14

本文共 4617 字,大约阅读时间需要 15 分钟。

1 Oracle11gR2 dbca建库

[oracle@localhost ~]$ cd $ORACLE_BASE/database[oracle@localhost database]$ dbca -silent -createDatabase -templateName $ORACLE_HOME/assistants/dbca/templates/General_Purpose.dbc -gdbname orcl -sid orcl -characterSet ZHS16GBK  Enter SYS user password:   Enter SYSTEM user password:   Copying database files  1% complete  3% complete  11% complete  18% complete  26% complete  37% complete  Creating and starting Oracle instance  40% complete  45% complete  50% complete  55% complete  56% complete  60% complete  62% complete  Completing Database Creation  66% complete  70% complete  73% complete  85% complete  96% complete  100% complete  Look at the log file "/home/oracle/app/cfgtoollogs/dbca/orcl/orcl.log" for further details.

2 Oracle11gR2手工建库

2.1.指定Oracle SID

[oracle@localhost ~]$ echo $ORACLE_SID  orcl

2.2.设置环境变量

[oracle@localhost ~]$ echo $ORACLE_HOME  /home/oracle/app/oracle/product/11.2.0/dbhome_1  [oracle@localhost ~]$ echo $ORACLE_BASE  /home/oracle/app   由于这些参数已经在安装oracle软件的时候写入了环境变量,这里就不再修改

2.3.选择认证方式,创建密码文件

[oracle@localhost ~]$ cd $ORACLE_HOME/dbs  [oracle@localhost dbs]$ orapwd file=/home/oracle/app/oracle/product/11.2.0/dbhome_1/dbs/orapworcl entries=30  Enter password for SYS:

2.4.创建参数文件

[oracle@localhost ~]$ cd $ORACLE_HOME/dbs[oracle@localhost dbs]$ cp init.ora initorcl.ora  [oracle@localhost dbs]$ ls  init.ora  initorcl.ora  orapworcl  [oracle@localhost dbs]$ vim initorcl.ora  # Change '
' to point to the oracle base (the one you specify at # install time) db_name='ORCL' memory_target=900m processes = 150 audit_file_dest='/home/oracle/app/admin/orcl/adump' audit_trail ='db' db_block_size=8192 db_domain='' db_recovery_file_dest='/home/oracle/app/flash_recovery_area' db_recovery_file_dest_size=2G diagnostic_dest='/home/oracle/app' dispatchers='(PROTOCOL=TCP) (SERVICE=ORCLXDB)' open_cursors=300 remote_login_passwordfile='EXCLUSIVE' undo_tablespace='UNDOTBS1' # You may want to ensure that control files are created on separate physical # devices control_files = ('/home/oracle/app/oradata/orcl/control01.ctl', '/home/oracle/app/oradata/orcl/control02.ctl') compatible ='11.2.0' "initorcl.ora" 66L, 2856C written #注:需要根据参数文件中的参数创建相应的目录,创建后重新赋一次权限[root@localhost ~]# mkdir -p /home/oracle/app/admin/orcl/adump [root@localhost ~]# mkdir -p /home/oracle/app/flash_recovery_area [root@localhost oradata]$ mkdir -p /home/oracle/app /oradata/orcl [root@localhost ~]# chown -R oracle:oinstall /home/oracle/app/ [root@localhost ~]# chmod -R 775 /home/oracle/app/

2.5.连接到数据库,启动到nomount状态

[oracle@localhost ~]$ cd $ORACLE_HOME/dbs[oracle@localhost dbs]$ sqlplus / as sysdba    SQL*Plus: Release 11.2.0.4.0 Production on Sat Nov 19 02:09:58 2016    Copyright (c) 1982, 2013, Oracle.  All rights reserved.    Connected to an idle instance.  SQL> startup nomount  ORACLE instance started.  Total System Global Area  939495424 bytes  Fixed Size                  2258840 bytes  Variable Size             595593320 bytes  Database Buffers          335544320 bytes  Redo Buffers

2.6. 执行建库脚本

SQL> CREATE DATABASE orcl    2     USER SYS IDENTIFIED BY oracle    3     USER SYSTEM IDENTIFIED BY oracle    4     LOGFILE GROUP 1 ('/home/oracle/app/oradata/orcl/redo01a.log','/home/oracle/app/oradata/orcl/redo01b.log') SIZE 100M BLOCKSIZE 512,    5             GROUP 2 ('/home/oracle/app/oradata/orcl/redo02a.log','/home/oracle/app/oradata/orcl/redo02b.log') SIZE 100M BLOCKSIZE 512,    6             GROUP 3 ('/home/oracle/app/oradata/orcl/redo03a.log','/home/oracle/app/oradata/orcl/redo03b.log') SIZE 100M BLOCKSIZE 512    7     MAXLOGFILES 5    8     MAXLOGMEMBERS 5    9     MAXLOGHISTORY 1   10     MAXDATAFILES 100   11     CHARACTER SET ZHS16GBK   12     NATIONAL CHARACTER SET AL16UTF16   13     EXTENT MANAGEMENT LOCAL   14     DATAFILE '/home/oracle/app/oradata/orcl/system01.dbf' SIZE 325M REUSE   15     SYSAUX DATAFILE '/home/oracle/app/oradata/orcl/sysaux01.dbf' SIZE 325M REUSE   16     DEFAULT TABLESPACE users   17        DATAFILE '/home/oracle/app/oradata/orcl/users01.dbf'   18        SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED   19     DEFAULT TEMPORARY TABLESPACE temp   20        TEMPFILE '/home/oracle/app/oradata/orcl/temp01.dbf'   21        SIZE 20M REUSE   22     UNDO TABLESPACE UNDOTBS1   23        DATAFILE '/home/oracle/app/oradata/orcl/undotbs01.dbf'   24        SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;  Database created.

2.7. 执行创建数据字典脚本

@?/rdbms/admin/catalog.sql  @?/rdbms/admin/catproc.sql  @?/sqlplus/admin/pupbld.sql #需使用system用户执行

转载于:https://www.cnblogs.com/chinesern/p/8707729.html

你可能感兴趣的文章
283. Move Zeroes把零放在最后面
查看>>
Visual Studio Code 打开.py代码报Linter pylint is not installed解决办法
查看>>
Python 数据类型
查看>>
17.树的子结构
查看>>
D - Mike and strings
查看>>
c#基础学习(0806)之抽象类实现多态
查看>>
S5PV210根文件系统的制作(一)
查看>>
51NOD 1244 莫比乌斯函数之和
查看>>
[bzoj1923]外星千足虫[高斯消元]
查看>>
centos下同时启动多个tomcat
查看>>
slab分配器
查看>>
分析 PHP大马-php_mof SHELL
查看>>
TCP/IP
查看>>
[推荐] 协同滤波 —— Collaborative Filtering (CF)
查看>>
python中使用中文
查看>>
数据清洗
查看>>
MVC5 + EF6 + Bootstrap3 (10) 数据查询页面
查看>>
【读书笔记】C#高级编程 第三章 对象和类型
查看>>
使用 Apache Pig 处理数据6
查看>>
supervisor之启动rabbitmq报错原因
查看>>