首页 > 开发 > 综合 > 正文

Listen Software解决方案 "How To" 系列4:创建数据库

2024-07-21 02:08:46
字体:
来源:转载
供稿:网友

listen software解决方案 “how to” 系列4:创建数据库

计划数据库文件位置

       三组重演日志文件,每组有两个成员文件

       创建数据文件的文件结构


       手工创建数据库

1.设定唯一的实例名和数据库字符集

2.设置操作系统变量

            (unix)
                 oracle_home
                 oracle_sid
                 oracle_base
                 ora_nls33
                 path

            (nt)
                 oradim80 -new -sid u16
                 -intpwd password -startmode auto
                 -pfile oracle_home/database/initu16.ora

                 you must decide the sid, password, and
                 create the parameter
                 file (initu16.ora)
                 set oracle_sid=u16
                 set local=2:u16
                     

                     语句1:使u16成为当前sid

                     语句2: 覆盖local环境变量
        

3.     准备参数文件

      使用init.ora作为参数文件模板

      db_name=数据库标识符(最多为8个字符)

      control_files=三个控制文件的位置

      db_block_size=数据库块的大小(数据库创建后不能修改)

4.     创建密码文件

5.     启动实例

      startup nomount pfile=initu16.ora

6.     创建数据库

             从server manager上手工创建

                     create database "u16"
                            maxlogfiles 6
                            maxlogmembers 6
                            maxdatafiles 30
                            maxloghistory 100
                            archivelog
                     logfile
                            group 1
                                'e:/data/u16/group1/log1a.rdo'      size 200k,
                                'e:/data/u16/group1/log1b.rdo'      size 200k
                            group 2
                                'e:/data/u16/group2/log2a.rdo'      size 200k,
                                'e:/data/u16/group2/log2b.rdo'      size 200k
                            group 3
                                'e:/data/u16/group3/log3a.rdo'      size 200k,
                                'e:/data/u16/group3/log3b.rdo'      size 200k
                             datafile
                            'e:/data/u16/datafiles ystem01.dbf'
                            size 30m
                            character set we8iso8859p1;
      
                            查看数据库状态
                            select name,created,log_mode from  v$database;

                            查看线程
                            select status, instance from v$thread;

                            查看数据文件
                            select name from v$datafile;

                            查看日志文件
                            select member from v$logfile;

                            查看控制文件
                            select name from v$controlfile;

                             检验系统创建状态
                            select file_name from dba_data_files
                            where tablespace_name='system';

                            查看数据库用户
                            select username, created from dba_users;

7.运行脚本生成数据词典,完成以前创建步骤

                            创建数据词典
                            catalog.sql

                           生成pl/sql使用的对象
                            catproc.sql
8.维护重演日志文件

                确定归档状态
                select log_mode from v$database;

                 确定自动归档可用
                 select archiver from v$instance;

                 添加新的日志文件组
                 alter database add logfile
                (          
                    'c:/data/log3a.rdo',       
                    'e:/data/log3b.rdo'
                ) size 200k;

               查看日志文件信息
                select * from v$log_file;

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表