当前位置:网站首页>1.手动创建Oracle数据库
1.手动创建Oracle数据库
2022-07-05 06:20:00 【寒叶飘逸_】
毕业了,整理下本科期间自己记的笔记。
这个是之前上Oracle数据库的课的时候老师交给我们的任务,每个人都必须按照步骤手动创建数据库
手动创建Oracle数据库的步骤如下:
1、设置数据库名称和实例名称
2、创建相关目录
3、创建参数文件(修改)
4、创建实例
oradim -new -sid test -intpwd test -srvcstart system/demand
oradim -delete -sid test
5、连接Oracle实例
6、启动实例
7、使用create database创建数据库
8、创建服务器参数文件
1、设置数据库名称和实例名称
set oracle_sid=test
2、创建相关目录
d:
cd D:\app\Snakewood\admin
mkdir testdba
cd testdba
mkdir adump
mkdir bdump
mkdir cdump
mkdir udump
mkdir pfile //存放追踪文件
cd..
cd..
cd oradata
mkdir testdba //存放控制文件、数据文件重做日志文件
3、创建参数文件(修改)
到 D:\app\Snakewood\product\11.2.0\dbhome_1\dbs 这个目录下复制init.ora文件到桌面,按照下图修改后拷贝到
D:\app\Snakewood\product\11.2.0\dbhome_1\database
新建文本文件内容如下:
create database test
datafile 'D:/app/Snakewood/product/11.2.0/dbhome_1/oradata/test/system0.dbf' size 300M reuse autoextend on next 10240K maxsize unlimited extent management local
sysaux datafile 'D:/app/Snakewood/product/11.2.0/dbhome_1/oradata/test/sysaux01.dbf' size 120M reuse autoextend on next 10240K maxsize unlimited
default temporary tablespace temp
tempfile 'D:/app/Snakewood/product/11.2.0/dbhome_1/oradata/test/temp01.dbf' size 20M reuse autoextend on next 640K maxsize unlimited
undo tablespace "UNDOTBS1"
datafile 'D:/app/Snakewood/product/11.2.0/dbhome_1/oradata/test/undotbs1.dbf' size 20M reuse autoextend on next 5120K maxsize unlimited
logfile
group 1 ('D:/app/Snakewood/product/11.2.0/dbhome_1/oradata/test/redo01.log') size 10M,
group 2 ('D:/app/Snakewood/product/11.2.0/dbhome_1/oradata/test/redo02.log') size 10M,
group 3 ('D:/app/Snakewood/product/11.2.0/dbhome_1/oradata/test/redo03.log') size 10M;
另存为test.sql
4、创建实例
oradim -new -sid test -intpwd test -srvcstart system/demand
oradim -delete -sid test
oradim -new -sid test -intpwd test -srvcstart demand //创建实例同时创建口令文件
oradim -delete -sid test //删除实例
手动创建口令文件
orapwd file=D:/app/Snakewood/product/11.2.0\dbhome_1\database\PWDtest.ora password=test entries=2
5、连接Oracle实例
sqlplus
sys as sysdba
提示已连接到空闲例程说明数据库还未启动
6、启动实例
因为现在只创建了参数文件,控制文件、数据文件和重做日志文件都没有,因此只能进入nomount状态
startup nomount pfile='D:\app\Snakewood\admin\mydba\pfile\initmydba.ora'
7、使用create database创建数据库
8、创建服务器参数文件
create spfile from pfile='D:\app\Snakewood\admin\testdba\pfile\inittestdba.ora'
小结
Oracle11g的路径和Oracle10g的路径不同,
11g是在D:\app\Snakewood…下
10g是在D:\app\Snakewood\product\11.2.0\dbhome_1…下
Set oracle_sid = xxx如果没有修改成功,可以去注册表中找oracle_sid并修改对应的值
边栏推荐
- 1040 Longest Symmetric String
- 栈 AcWing 3302. 表达式求值
- 博弈论 AcWing 893. 集合-Nim游戏
- 开源存储这么香,为何我们还要坚持自研?
- Erreur de connexion Navicat à la base de données Oracle Ora - 28547 ou Ora - 03135
- Leetcode-556: the next larger element III
- Record the process of configuring nccl and horovod in these two days (original)
- MIT-6874-Deep Learning in the Life Sciences Week 7
- 博弈论 AcWing 892. 台阶-Nim游戏
- 2022-5-第四周日报
猜你喜欢
MySQL怎么运行的系列(八)14张图说明白MySQL事务原子性和undo日志原理
WordPress switches the page, and the domain name changes back to the IP address
博弈论 AcWing 894. 拆分-Nim游戏
MySQL advanced part 2: MySQL architecture
开源存储这么香,为何我们还要坚持自研?
SQLMAP使用教程(一)
背包问题 AcWing 9. 分组背包问题
阿里新成员「瓴羊」正式亮相,由阿里副总裁朋新宇带队,集结多个核心部门技术团队
Simple selection sort of selection sort
1.13 - RISC/CISC
随机推荐
高斯消元 AcWing 884. 高斯消元解异或線性方程組
[rust notes] 16 input and output (Part 1)
Leetcode recursion
求组合数 AcWing 889. 满足条件的01序列
Suppose a bank's ATM machine, which allows users to deposit and withdraw money. Now there is 200 yuan in an account, and both user a and user B have the right to deposit and withdraw money from this a
[rust notes] 16 input and output (Part 2)
Leetcode-6109: number of people who know secrets
Open source storage is so popular, why do we insist on self-development?
C Primer Plus Chapter 15 (bit operation)
There are three kinds of SQL connections: internal connection, external connection and cross connection
Chart. JS - Format Y axis - chart js - Formatting Y axis
博弈论 AcWing 892. 台阶-Nim游戏
1039 Course List for Student
LeetCode 0108. Convert an ordered array into a binary search tree - the median of the array is the root, and the left and right of the median are the left and right subtrees respectively
NotImplementedError: Cannot convert a symbolic Tensor (yolo_boxes_0/meshgrid/Size_1:0) to a numpy ar
Bash exercise 17 writing scripts to install the server side of FRP reverse proxy software
liunx启动redis
MIT-6874-Deep Learning in the Life Sciences Week 7
Leetcode-6110: number of incremental paths in the grid graph
One question per day 1020 Number of enclaves