《2022年手工创建数据库资料》由会员分享,可在线阅读,更多相关《2022年手工创建数据库资料(3页珍藏版)》请在金锄头文库上搜索。
1、1、创建目录:D:appAdministratororadatamyoraD:appAdministratoradminmyora(adump,dpdump,pfile ,scripts)2、创建初始化参数文件:把这个路径下的D:appAdministratoradminxbcpfile叫“ init.ora.10252011111850”的文件拷贝,然后后改名为“initmyora.ora”打开后修改以下内容:1、audit_file_dest=D:appAdministratoradminmyoraadump2、db_name=myoracontrol_files=(D:appAdmini
2、stratororadatamyoracontrol01.ctl, D:appAdministratororadatamyoracontrol02.ctl, D:appAdministratororadatamyoracontrol03.ctl)4、undo_tablespace=UNDOTBS1其它都不用改了3、设置环境变量:C:set oracle_sid=myora4、创建服务:C:oradim -new -sid myora实例已创建。C:5、启动数据库:C:sqlplus / as sysdbaSQL*Plus: Release 11.1.0.6.0 - Production on
3、星期二 11月 29 18:17:05 2011Copyright (c) 1982, 2007, Oracle. All rights reserved.已连接到空闲例程。SQL startup nomountORACLE 例程已经启动。Total System Global Area 560771072 bytesFixed Size 1334548 bytesVariable Size 155189996 bytesDatabase Buffers 398458880 bytesRedo Buffers 5787648 bytesSQL start C:11名师资料总结 - - -精品资
4、料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 1 页,共 3 页 - - - - - - - - - 数据库已创建。SQL其中 11.sql 的内容为:create database myoradatafile D:appAdministratororadatamyorasystem01.dbf size 350m autoextend on next 10240k extent management localsysaux datafile D:appAdministratororadatamyorasysa
5、ux01.dbf size 120mundo tablespace undotbs1datafile D:appAdministratororadatamyoraundotbs1.dbf size 200mdefault temporary tablespace temptbs1tempfile D:appAdministratororadatamyoratemp01.dbf size 20mlogfile group 1(D:appAdministratororadatamyoraredo01.log) size 100m,group 2(D:appAdministratororadatam
6、yoraredo02.log) size 100m,group 3(D:appAdministratororadatamyoraredo03.log) size 100m;6 创建数据字典:SQL start D:appAdministratorproduct11.1.0db_1RDBMSADMINcatalog.sql7、执行 catproc 创建包:SQL start D:appAdministratorproduct11.1.0db_1RDBMSADMINcatproc.sql8、执行 pupbld.sql 脚本文件:SQL conn system/manager已连接。SQL star
7、t D:appAdministratorproduct11.1.0db_1sqlplusadminpupbld.sql9、创建 spfile:SQL create spfile from pfile2 /文件已创建。SQL10、执行 scott 脚本创建 scott 模式:SQL start D:appAdministratorproduct11.1.0db_1RDBMSADMINscott.sql名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 2 页,共 3 页 - - - - -
8、 - - - - 11、测试新建数据库:SQL set linesize 300SQL set pagesize 3000SQL conn scott/tigerSQL select * from dept2 /DEPTNO DNAME LOC- - -10 ACCOUNTING NEW YORK20RESEARCH DALLAS30 SALES CHICAGO40 OPERATIONS BOSTON已选择 4 行。SQLSQL conn / as sysdba已连接。SQL show parameter db_nameNAME TYPE V ALUE- - -db_name string myoraSQL名师资料总结 - - -精品资料欢迎下载 - - - - - - - - - - - - - - - - - - 名师精心整理 - - - - - - - 第 3 页,共 3 页 - - - - - - - - -