Chapter 4 Creating a Database and Data Dictionary

本文介绍如何配置资源并使用Oracle创建数据库,包括调整Unix平台上的共享内存参数、定义初始化参数文件中的关键设置,以及通过CREATEDATABASE命令指定数据库的各项属性。

Creating a Database

Preparing Resources

  Depending on the operating system, you may have to adjust certain configuration parameters. For example, on Unix platforms, you must configure the shared memory parameters.

The following list itemizes the Unix kernel parameters and describes their purposes. The super-user administers these kernel parameters.
SHMMAX    The maximum size of a shared memory segment

SHMMNI The maximum number of shared memory identifiers in the system

SHMSEG The maximum number of shared memory segments to which a user process can attach

SEMMNI  The maximum number of semaphore identifiers in the system.

SHMMAX * SHMSEG The total maximum shared memory that can be allocated

 

Parameters

Oracle uses the parameter file to start up the instance before creating the database. You specify some database configuration values via the parameter file.The following parameters affect database configuration and creation:

CONTROL_FILES    Specifies the control file location(s) for the new database with the full pathname. Specify at least two control files on different disks. You can specify a maximum of eight control file names. Oracle creates these control files when the database is created. Be careful when specifying the control file; if you specify the control file name of an existing database, Oracle could overwrite the control file, which will damage the existing database. If you do not use this parameter, Oracle
uses the default filename, which is operating system dependent. For example:

control_files                      d:\Oracle\oradata\OEMREP\CONTROL01.CTL, d:\Oracle\oradata\OEMREP\CONTROL02.CTL, d:\Oracle\oradata\OEMREP\CONTROL03.CTL

 

 

DB_BLOCK_SIZE Specifies the database block size as a multiple of the operating system block size this value cannot be changed after the database is created. The default block size is 4KB on most platforms. Oracle allows block sizes from 2KB to 32KB, depending on the operating system.


DB_NAME Specifies the database name—the name cannot be changed easily after the database is created (you must re-create the control file ).The DB_NAME value can be a maximum of eight characters. You can use alphabetic characters, numbers, the underscore (_), the pound symbol (#), and the dollar symbol ($) in the name. No other characters are valid. The first character should be an alphabetic character. Oracle removes double quotation marks before processing the database name. During database creation, the DB_NAME value is recorded in the data files, redo log files, and
control file of the database.
You must at least define the DB_CACHE_SIZE,LOG_BUFFER and SHARED_POOL_SIZE to calculate the SGA, which must fit into real, not virtual, memory.

 

The CREATE DATABASE Command

You create the database using the CREATE DATABASE command. You must start up the instance (with STARTUP NOMOUNT PFILE=) before issuing the command.

CREATE DATABASE “PROD01”
CONTROLFILE REUSE
LOGFILE GROUP 1
(‘/oradata02/PROD01/redo0101.log’,
‘/oradata03/PROD01/redo0102.log) SIZE 5M REUSE,
GROUP 2
(‘/oradata02/PROD01/redo0201.log’,
‘/oradata03/PROD01/redo0202.log) SIZE 5M REUSE
MAXLOGFILES 4
MAXLOGMEMBERS 2
MAXLOGHISTORY 0
MAXDATAFILES 254
MAXINSTANCES 1
NOARCHIVELOG
CHARACTER SET “WE8MSWIN1252”
NATIONAL CHARACTER SET “AL16UTF16”
DATAFILE ‘/oradata01/PROD01/system01.dbf’ SIZE 80M
AUTOEXTEND ON NEXT 5M MAXSIZE UNLIMITED
UNDO TABLESPACE UNDOTBS
DATAFILE ‘/oradata04/PROD01/undo01.dbf’ SIZE 35M
DEFAULT TEMPORARY TABLESPACE TEMP
TEMPFILE ‘/oradata05/PROD01/temp01.dbf’ SIZE 20M;

 The only mandatory portion in this command is the CREATE DATABASE clause.
 If you omit the database name, Oracle takes the default value from the parameter DB_NAME defined in the initialization parameter file. But the value specified in the parameter file and the database name in this command should be the same.

 

The CONTROLFILE REUSE clause overwrites an existing control file. Normally you use this clause only when re-creating a database. If you omit this clause, and any of the files specified by the CONTROL_FILES parameter exist, Oracle returns an error .

 

The LOGFILE clause specifies the location of the online redo log files . If you omit the GROUP clause, Oracle creates the files specified in separate groups with one member in each. A database must have at least two redo groups. In the example, Oracle creates two redo log groups with two members in each. It is recommended that all redo log groups be the same size. The REUSE clause overwrites an

existing file, if any, provided the sizes are the same.

 

The next five clauses specify limits for the database. The control file size depends on these limits, because Oracle pre-allocates space in the control file. MAXLOGFILES specifies the maximum number of redo log groups that can ever be created in the database . MAXLOGMEMBERS specifies the maximum
number or redo log members (copies of redo log files) for each redo log group. The MAXLOGHISTORY specifies the maximum number of archived redo log files for automatic media recovery.MAXDATAFILES specifies the maximum number of data files that can be created in this database
. Data files are created when you create a tablespace or add more space to a tablespace by adding a data file . MAXINSTANCES specifies the maximum number of instances that can simultaneously mount and open this database.   If you want to change any of these limits after the database is created, you must
re-create the control file.

 

The initialization parameter DB_FILES specifies the maximum number of data files accessible to the instance. The MAXDATAFILES clause in the CREATE DATABASE command specifies the maximum number of data files allowed for the database. The DB_FILES parameter cannot specify a value larger than MAXDATAFILES.

 

You can specify NOARCHIVELOG or ARCHIVELOG to configure the redo log archiving. The default is NOARCHIVELOG; you can change the database to ARCHIVELOG mode by using the ALTER DATABASE command after the database is created.

 

The CHARACTER SET clause specifies the character set used to store data. The default is WE8MSWIN1252 on Windows platforms. The character set cannot be changed after database creation. The NATIONAL CHARACTER SET clause specifies the national character set used to store data in columns specifically defined as NCHAR, NCLOB, or NVARCHAR2 . If not specified, the national character set defaults to the database character set.

 

The DEFAULT TEMPORARY TABLESPACE clause defines the tablespace location for all temporary segments. If you create a user without specifying a temporary tablespace, this one is used.

 

Using OMF to Create a Database

 

【无人机】基于改进粒子群算法的无人机路径规划研究[和遗传算法、粒子群算法进行比较](Matlab代码实现)内容概要:本文围绕基于改进粒子群算法的无人机路径规划展开研究,重点探讨了在复杂环境中利用改进粒子群算法(PSO)实现无人机三维路径规划的方法,并将其与遗传算法(GA)、标准粒子群算法等传统优化算法进行对比分析。研究内容涵盖路径规划的多目标优化、避障策略、航路点约束以及算法收敛性和寻优能力的评估,所有实验均通过Matlab代码实现,提供了完整的仿真验证流程。文章还提到了多种智能优化算法在无人机路径规划中的应用比较,突出了改进PSO在收敛速度和全局寻优方面的优势。; 适合人群:具备一定Matlab编程基础和优化算法知识的研究生、科研人员及从事无人机路径规划、智能优化算法研究的相关技术人员。; 使用场景及目标:①用于无人机在复杂地形或动态环境下的三维路径规划仿真研究;②比较不同智能优化算法(如PSO、GA、蚁群算法、RRT等)在路径规划中的性能差异;③为多目标优化问题提供算法选型和改进思路。; 阅读建议:建议读者结合文中提供的Matlab代码进行实践操作,重点关注算法的参数设置、适应度函数设计及路径约束处理方式,同时可参考文中提到的多种算法对比思路,拓展到其他智能优化算法的研究与改进中。
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值