当前位置:Gxlcms > mysql > 手动创建Oracle数据库实例

手动创建Oracle数据库实例

时间:2021-07-01 10:21:17 帮助过:96人阅读

1、首先设置Oracle_SID=manual2、创建密码文件进入/u01/app/oracle/product/10.2.0/db_1/dbs目录下,执行命令创建数据库密码文件

1、首先设置Oracle_SID=manual
2、创建密码文件
进入/u01/app/oracle/product/10.2.0/db_1/dbs目录下,执行命令创建数据库密码文件
[oracle@myorcl dbs]$ orapwd file=orapmanual password=oracle
3、创建所需的目录结构
[oracle@myorcl dbs]$ cd /u01/app/oracle/admin/
[oracle@myorcl admin]$ mkdir manual
然后进入manual目录创建一下文件
[oracle@myorcl manual]$ ls
adumpbdumpcdumppfileudump
4、创建所需的参数文件
[oracle@myorcl ~]$ cd /u01/app/oracle/admin/manual/pfile/
[oracle@myorcl pfile]$ vi init.ora
db_name=manual
db_domain=""
sga_target=285212672
pga_aggregate_target=94371840
db_block_size=8192
db_file_multiblock_read_count=16
open_cursors=300
processes=150
background_dump_dest=/u01/app/oracle/admin/manual/bdump
core_dump_dest=/u01/app/oracle/admin/manual/cdump
user_dump_dest=/u01/app/oracle/admin/manual/udump
audit_file_dest=/u01/app/oracle/admin/manual/adump
control_files=("/u01/app/oracle/oradata/manual/control01.ctl",/u01/app/oracle/oradata/manual/control02.ctl)
db_recovery_file_dest=/u01/app/oracle/flash_recovery_area/manual/
db_recovery_file_dest_size=2147483648
log_archive_format=%t_%s_%r.dbf
compatible=10.2.0.1.0
remote_login_passwordfile=EXCLUSIVE
undo_management=AUTO
undo_tablespace=UNDOTBS1
5、使用已创建的参数文件启动数据库实例到nomount状态
SQL>startup nomount pfile=/u01/app/oracle/admin/manual/pfile/init.ora
ORACLE instance started.
Total System Global Area285212672 bytes
Fixed Size1218992 bytes
Variable Size92276304 bytes
Database Buffers188743680 bytes
Redo Buffers2973696 bytes
6、然后执行SQL语句创建数据库
SQL> create database manual
2datafile '/u01/app/oracle/oradata/manual/system01.dbf' size 300m reuse
3autoextend on next 10240K maxsize unlimited
4extent management local
5sysaux datafile '/u01/app/oracle/oradata/manual/sysaux01.dbf' size 120m reuse
6autoextend on next 1024k maxsize unlimited
7smallfile default temporary tablespace
8temp tempfile '/u01/app/oracle/oradata/manual/temp01.dbf' size 20m reuse
9autoextend on next 640k maxsize unlimited
smallfile undo tablespace "UNDOTBS1"datafile '/u01/app/oracle/oradata/manual/undotbs01.dbf' size 200m reuse autoextend on next 5120k maxsize unlimited
11character set ZHS16GBK
12NATIONAL CHARACTER SET AL16UTF16
13logfile group 1('/u01/app/oracle/oradata/manual/redo01.log') size 51200k,
14group 2('/u01/app/oracle/oradata/manual/redo02.log') size 51200k,
15group 3('/u01/app/oracle/oradata/manual/redo03.log') size 51200k
16user sys identified by oracle
17user system identified by oracle;
Database created.
7、创建用户默认表空间users
SQL> create smallfile tablespace users logging datafile '/u01/app/oracle/oradata/manual/user01.dbf' size 5M reuse autoextend on next 1280K maxsize unlimited extent management local segment space management auto;
8、指定用户默认表空间为users
SQL> alter database default tablespace users;
9、安装数据字典
SQL> @/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/catalog.sql
SQL> @/u01/app/oracle/product/10.2.0/db_1/rdbms/admin/catproc.sql
10、以system用户创建PL/SQL资源集
SQL> connect system/oracle
Connected.
SQL> @/u01/app/oracle/product/10.2.0/db_1/sqlplus/admin/pupbld.sql
SQL> @/u01/app/oracle/product/10.2.0/db_1/sqlplus/admin/help/hlpbld.sql helpus.sql
一个简化版的数据库创建完成
SQL> select status from v$instance;
STATUS
------------------------------------
OPEN
[oracle@myorcl ~]$ lsnrctl status
LSNRCTL for Linux: Version 10.2.0.1.0 - Production on 05-JUL-2013 00:30:43
Copyright (c) 1991, 2005, Oracle.All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1)))
STATUS of the LISTENER
------------------------
AliasLISTENER
VersionTNSLSNR for Linux: Version 10.2.0.1.0 - Production
Start Date04-JUL-2013 19:58:59
Uptime0 days 4 hr. 31 min. 44 sec
Trace Leveloff
SecurityON: Local OS Authentication
SNMPOFF
Listener Parameter File/u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
Listener Log File/u01/app/oracle/product/10.2.0/db_1/network/log/listener.log
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=myorcl.oracle.com)(PORT=1521)))
Services Summary...
Service "PLSExtProc" has 1 instance(s).
Instance "PLSExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "manual" has 1 instance(s).
Instance "manualorcl", status READY, has 1 handler(s) for this service...
Service "manual_XPT" has 1 instance(s).
Instance "manualorcl", status READY, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orcl_XPT" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully

linux

人气教程排行