当前位置:  数据库>oracle

手动创建Oracle数据库实例

    来源: 互联网  发布时间:2017-05-24

    本文导语: 1、首先设置Oracle_SID=manual2、创建密码文件进入/u01/app/oracle/product/10.2.0/db_1/dbs目录下,执行命令创建数据库密码文件[oracle@myorcl dbs]$ orapwd file=orapmanual password=oracle3、创建所需的目录结构[oracle@myorcl dbs]$ cd /u01/app/oracle/admin/[oracle@myorc...

1、首先设置Oracle_SID=manual
2、创建密码文件
进入/u01/app/oracle/product/10.2.0/db_1/dbs目录下,执行命令创建数据库密码文件
[oracle@myorcl dbs]$ orapwd file=orapmanual password=oracle
3、创建所需的目录结构
[oracle@myorcl dbs]$ cd /u01/app/oracle/admin/
[oracle@myorcl admin]$ mkdir manual
然后进入manual目录创建一下文件
[oracle@myorcl manual]$ ls
adumpbdumpcdumppfileudump
4、创建所需的参数文件
[oracle@myorcl ~]$ cd /u01/app/oracle/admin/manual/pfile/
[oracle@myorcl pfile]$ vi init.ora
db_name=manual
db_domain=""
sga_target=285212672
pga_aggregate_target=94371840
db_block_size=8192
db_file_multiblock_read_count=16
open_cursors=300
processes=150
background_dump_dest=/u01/app/oracle/admin/manual/bdump
core_dump_dest=/u01/app/oracle/admin/manual/cdump
user_dump_dest=/u01/app/oracle/admin/manual/udump
audit_file_dest=/u01/app/oracle/admin/manual/adump
control_files=("/u01/app/oracle/oradata/manual/control01.ctl",/u01/app/oracle/oradata/manual/control02.ctl)
db_recovery_file_dest=/u01/app/oracle/flash_recovery_area/manual/
db_recovery_file_dest_size=2147483648
log_archive_format=%t_%s_%r.dbf
compatible=10.2.0.1.0
remote_login_passwordfile=EXCLUSIVE
undo_management=AUTO
undo_tablespace=UNDOTBS1
5、使用已创建的参数文件启动数据库实例到nomount状态
SQL>startup nomount pfile=/u01/app/oracle/admin/manual/pfile/init.ora
ORACLE instance started.
Total System Global Area285212672 bytes
Fixed Size1218992 bytes
Variable Size92276304 bytes
Database Buffers188743680 bytes
Redo Buffers2973696 bytes
6、然后执行SQL语句创建数据库
SQL> create database manual
2datafile '/u01/app/oracle/oradata/manual/system01.dbf' size 300m reuse
3autoextend on next 10240K maxsize unlimited
4extent management local
5sysaux datafile '/u01/app/oracle/oradata/manual/sysaux01.dbf' size 120m reuse
6autoextend on next 1024k maxsize unlimited
7smallfile default temporary tablespace
8temp tempfile '/u01/app/oracle/oradata/manual/temp01.dbf' size 20m reuse
9autoextend on next 640k maxsize unlimited
smallfile undo tablespace "UNDOTBS1"datafile '/u01/app/oracle/oradata/manual/undotbs01.dbf' size 200m reuse autoextend on next 5120k maxsize unlimited
11character set ZHS16GBK
12NATIONAL CHARACTER SET AL16UTF16
13logfile group 1('/u01/app/oracle/oradata/manual/redo01.log') size 51200k,
14group 2('/u01/app/oracle/oradata/manual/redo02.log') size 51200k,
15group 3('/u01/app/oracle/oradata/manual/redo03.log') size 51200k
16user sys identified by oracle
17user system identified by oracle;
Database created.
7、创建用户默认表空间users
SQL> create smallfile tablespace users logging datafile '/u01/app/oracle/oradata/manual/user01.dbf' size 5M reuse autoextend on next 1280K maxsize unlimited extent management local segment space management auto;
8、指定用户默认表空间为users
SQL> alter database default tablespace users;
9、安装数据字典
SQL> @/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/catalog.sql
SQL> @/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/catproc.sql
10、以system用户创建PL/SQL资源集
SQL> connect system/oracle
Connected.
SQL> @/u01/app/oracle/product/10.2.0/db_1/sqlplus/admin/pupbld.sql
SQL> @/u01/app/oracle/product/10.2.0/db_1/sqlplus/admin/help/hlpbld.sql helpus.sql
一个简化版的数据库创建完成
SQL> select status from v$instance;
STATUS
------------------------------------
OPEN
[oracle@myorcl ~]$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 05-JUL-2013 00:30:43
Copyright (c) 1991, 2005, Oracle.All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
AliasLISTENER
VersionTNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date04-JUL-2013 19:58:59
Uptime0 days 4 hr. 31 min. 44 sec
Trace Leveloff
SecurityON: Local OS Authentication
SNMPOFF
Listener Parameter File/u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File/u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=myorcl.oracle.com)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "manual" has 1 instance(s).
Instance "manualorcl", status READY, has 1 handler(s) for this service...
Service "manual_XPT" has 1 instance(s).
Instance "manualorcl", status READY, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orcl_XPT" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully


    
 
 
 
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。












  • 相关文章推荐
  • 如何手动调整网卡的half duplex & full duplex ?如何手动调整网卡的10/100M速度?
  • shell 脚本 date 手动执行 和 放在init.d中自动执行的时间不一样
  • FileUpload 控件禁止手动输入
  • Linux打开的文件描述符必须手动close吗
  • 如何手动清除一个对象
  • 请问,怎么手动启动Apache?? 在线等候
  • 关于shell脚本手动运行和自动运行的区别
  • 怎样手动清除磁盘高速缓冲?
  • 手动改写了lilo.conf,启动时无法进入linux了,怎么解决?
  • 如何手动控制wu-ftp的启动(100分)
  • 用什么命令可以知道,哪些软件包是自己手动安装的?
  • 2000下怎样手动更改JSWDK 的缺省IP和 缺省端口?
  • 在安装linux7.2时忘了选择FTP,怎样手动安装FTP?
  • 机子的内存需要手动配置吗,请指教!
  • 如何在linux shell 下启动/停止samba共享服务,如何手动配置?
  • 不能识别猫,如何手动配置?
  • 问一个crontab中不能运行手动可以运行的问题
  • linux中手动启动进程
  • 红帽企业Linux.5.4的手动安装
  • 如何在redhat系统中手动断开一个TCP连接


  • 站内导航:


    特别声明:169IT网站部分信息来自互联网,如果侵犯您的权利,请及时告知,本站将立即删除!

    ©2012-2021,