当前位置:首页 > 开发 > 数据库 > 正文

详解create database命令

发表于: 2014-10-14   作者:czmmiao   来源:转载   浏览:
摘要: 完整命令 CREATE DATABASE mynewdb   USER SYS IDENTIFIED BY sys_password   USER SYSTEM IDENTIFIED BY system_password   LOGFILE GROUP 1 ('/u01/logs/my/redo01a.log','/u02/logs/m

完整命令

CREATE DATABASE mynewdb
   USER SYS IDENTIFIED BY sys_password
   USER SYSTEM IDENTIFIED BY system_password
   LOGFILE GROUP 1 ('/u01/logs/my/redo01a.log','/u02/logs/my/redo01b.log') SIZE 100M BLOCKSIZE 512,
           GROUP 2 ('/u01/logs/my/redo02a.log','/u02/logs/my/redo02b.log') SIZE 100M BLOCKSIZE 512,
           GROUP 3 ('/u01/logs/my/redo03a.log','/u02/logs/my/redo03b.log') SIZE 100M BLOCKSIZE 512
   MAXLOGFILES 5
   MAXLOGMEMBERS 5
   MAXLOGHISTORY 1
   MAXDATAFILES 100
   CHARACTER SET AL32UTF8
   NATIONAL CHARACTER SET AL16UTF16
   EXTENT MANAGEMENT LOCAL
   DATAFILE '/u01/app/oracle/oradata/mynewdb/system01.dbf' SIZE 325M REUSE
   SYSAUX DATAFILE '/u01/app/oracle/oradata/mynewdb/sysaux01.dbf' SIZE 325M REUSE
   DEFAULT TABLESPACE users
      DATAFILE '/u01/app/oracle/oradata/mynewdb/users01.dbf'
      SIZE 500M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED
   DEFAULT TEMPORARY TABLESPACE tempts1
      TEMPFILE '/u01/app/oracle/oradata/mynewdb/temp01.dbf'
      SIZE 20M REUSE
   UNDO TABLESPACE undotbs
      DATAFILE '/u01/app/oracle/oradata/mynewdb/undotbs01.dbf'
      SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
参数:

MAXLOGFILES
Specify the maximum number of online redo log file groups that can ever be created for the database. Oracle Database uses this value to determine how much space to allocate in the control file for the names of redo log files. The default and maximum values depend on your operating system. The value that you specify should not be less than the greatest GROUP value for any redo log file group.
MAXLOGMEMBERS
Specify the maximum number of members, or identical copies, for a redo log file group. Oracle Database uses this value to determine how much space to allocate in the control file for the names of redo log files. The minimum value is 1. The maximum and default values depend on your operating system.
MAXLOGHISTORY
This parameter is useful only if you are using Oracle Database in ARCHIVELOG mode. Specify your current estimate of the maximum number of archived redo log file groups needed for automatic media recovery of the database. The database uses this value to determine how much space to allocate in the control file for the names of archived redo log files.
The minimum value is 0. The default value is a multiple of the MAXINSTANCES value and depends on your operating system. The maximum value is limited only by the maximum size of the control file. The database will continue to add additional space to the appropriate section of the control file as needed, so that you do not need to re-create the control file if your your original configuration is no longer adequate. As a result, the actual value of this parameter can eventually exceed the value you specify.
MAXDATAFILES
Specify the initial sizing of the data files section of the control file at CREATE DATABASE or CREATE CONTROLFILE time. An attempt to add a file whose number is greater than MAXDATAFILES, but less than or equal to DB_FILES, causes the control file to expand automatically so that the data files section can accommodate more files.
The number of data files accessible to your instance is also limited by the initialization parameter DB_FILES.

有人问当我们创建控制文件时指定的以下这些参数,是否可以从数据库的字典表中查询得到?
MAXLOGFILES
MAXLOGMEMBERS
MAXDATAFILES
MAXINSTANCES
MAXLOGHISTORY
答案是除了MAXLOGMEMBERS以外,其他的都不可以。
MAXLOGMEMBERS可以从X$KCCDI.DIMLM得到。
X$KCCDI---[K]ernel [C]ache [C]ontrolfile management [D]atabase [I]nformation
其中DIMLM的含义为:Maximum number of log file members allowed
SQL> select dimlm from x$kccdi;
     DIMLM
----------
         3
如果想获得其他参数信息,那么只能通过转储控制文件的方式获得:
alter database backup controlfile to trace;

参考至:http://www.eygle.com/archives/2005/08/where_are_the_c.html

                http://docs.oracle.com/cd/E11882_01/server.112/e25494/create.htm#ADMIN11081

                http://docs.oracle.com/cd/E11882_01/server.112/e41084/statements_5003.htm#SQLRF53832

本文原创,转载请注明出处、作者

如有错误,欢迎指正

邮箱:czmcj@163.com

详解create database命令

  • 0

    开心

    开心

  • 0

    板砖

    板砖

  • 0

    感动

    感动

  • 0

    有用

    有用

  • 0

    疑问

    疑问

  • 0

    难过

    难过

  • 0

    无聊

    无聊

  • 0

    震惊

    震惊

编辑推荐
http://wayfarer.iteye.com/blog/478817 Most applications include two kinds of human-computer i
http://wayfarer.iteye.com/blog/478817 Most applications include two kinds of human-computer i
http://wayfarer.iteye.com/blog/478817 Most applications include two kinds of human-computer i
--创建 CREATE public database link test_link CONNECT TO scott IDENTIFIED BY tiger using '(DES
stsadm.exe -o createsiteinnewdb -url <url> -ownerlogin <DOMAIN\username> -ownerema
原文地址: http://www.notsosecure.com/blog/2014/07/08/abusing-oracles-create-database-link-pri
题记:写这篇博客要主是加深自己对用户、补丁-的认识和总结实现算法时的一些验经和训教,如果有错误
从微软官网下载jdbc驱动包sqljdbc4,运行sqljdbc_4.0.2206.100_chs.exe,将驱动包解压到了Microsoft
最近经常碰到这个问题,当使用ArcGIS10.2(可能跟版本无关)连接SDE时,会碰到一个错误: unable to
OS版本是Oracle Linux5.8 x86_64,Oracle Database和Grid Infrastructure版本是11.2.0.3,双节点RAC。
版权所有 IT知识库 CopyRight © 2009-2015 IT知识库 IT610.com , All Rights Reserved. 京ICP备09083238号