oracle 11g 手工建库
1.环境变量设置[oracle]$
cat >> /home/oracle/.bash_profile <<eof
export oracle_base=/u01/app/oracle
export oracle_home=/u01/app/oracle/product/11.2.0/db_1
export oracle_sid=std1
export path=$oracle_home/bin:/sbin:/usr/sbin:$path
eof
source /home/oracle/.bash_profile
cat >> /home/oracle/.bashrc <<eof
alias dbn='cd $oracle_home/network/admin'
alias dbs='cd $oracle_home/dbs'
alias sql='sqlplus / as sysdba'
eof
source /home/oracle/.bashrc
cat >> $oracle_home/sqlplus/admin/glogin.sql <<eof
define _editor='vi'
set sqlprompt "_user'@'_connect_identifier> "
set time on
set timing on
set pagesize 40
set linesize 120
eof
2.创建所需目录[oracle]$
mkdir -p $oracle_base/admin/std1/adump && mkdir -p $oracle_base/oradata/std1 && mkdir -p $oracle_base/flash_recovery_area
3.生成密码文件[oracle]$
dbs
orapwd file=orapwstd1 password=oracle entries=30
4.创建pfile参数文件[oracle]$
cat init.ora | grep -v ^# | grep -v ^$ > initstd1.ora
%s/orcl/std1/g
%s/orcl/std1/g
%s#<oracle_base>#$oracle_base#g
%s#ora_control1#/u01/app/oracle/oradata/std1/ora_control1.ctl#g
%s#ora_control2#/u01/app/oracle/oradata/std1/ora_control2.ctl#g
db_name='std1'
memory_target=1g
processes = 150
audit_file_dest='$oracle_base/admin/std1/adump'
audit_trail ='db'
db_block_size=8192
db_domain=''
db_recovery_file_dest='$oracle_base/flash_recovery_area'
db_recovery_file_dest_size=2g
diagnostic_dest='$oracle_base'
dispatchers='(protocol=tcp) (service=std1xdb)'
open_cursors=300
remote_login_passwordfile='exclusive'
undo_tablespace='undotbs1'
control_files = (/u01/app/oracle/oradata/std1/ora_control1.ctl,/u01/app/oracle/oradata/std1/ora_control2.ctl)
compatible ='11.2.0'
5.生成spfile参数文件[oracle]$
mount -o remount,size=4g /dev/shm
sqlplus / as sysdba
startup nomount
create spfile from pfile;
6.执行创建数据库语句[oracle]$
vi crtdb.sql
create database std1
user sys identified by oracle
user system identified by oracle
logfile group 1 ('/u01/app/oracle/oradata/std1/redo01a.log','/u01/app/oracle/oradata/std1/redo01b.log') size 100m blocksize 512,
group 2 ('/u01/app/oracle/oradata/std1/redo02a.log','/u01/app/oracle/oradata/std1/redo02b.log') size 100m blocksize 512
maxlogfiles 5
maxlogmembers 5
maxloghistory 1
maxdatafiles 100
character set us7ascii
national character set al16utf16
extent management local
datafile '/u01/app/oracle/oradata/std1/system01.dbf' size 325m reuse
sysaux datafile '/u01/app/oracle/oradata/std1/sysaux01.dbf' size 325m reuse
default tablespace users
datafile '/u01/app/oracle/oradata/std1/users01.dbf'
size 500m reuse autoextend on maxsize unlimited
default temporary tablespace tempts1
tempfile '/u01/app/oracle/oradata/std1/temp01.dbf'
size 20m reuse
undo tablespace undotbs1
datafile '/u01/app/oracle/oradata/std1/undotbs01.dbf' size 200m reuse autoextend on maxsize unlimited;
@crtdb.sql
7.生成数据字典[oracle]$
vi crtdic.sql
@?/rdbms/admin/catalog.sql
@?/rdbms/admin/catproc.sql
conn system/oracle
@?/sqlplus/admin/pupbld.sql
exit
@crtdic.sql
8.检查一哈
select * from v$version;
ps:
手工创建scott方案
@?/rdbms/admin/utlsampl.sql
alter user scott account unlock identified by tiger;
上一篇: js关于函数的原型与原型链
下一篇: Golang断言判断值类型的实现方法
推荐阅读
-
使用instantclient_11_2 和PL/SQL Developer工具包连接oracle 11g远程数据库
-
Oracle 11g数据库安装与卸载的方法图解
-
Windows 64位下装安装Oracle 11g,PLSQL Developer的配置问题,数据库显示空白的完美解决方案(图文教程)
-
Windows系统安装Oracle 11g 数据库图文教程
-
Linux:oracle11.2.0dbca静默建库
-
在 Oracle Linux 6.5 上安装 Oracle 11g 单实例数据库
-
oracle 11g配置 解决启动连接数据库出现的ora错误
-
Oracle 11g数据库详细安装图文教程
-
[oracle部署实施]基于centos7.5、oracle11g r2手工建库过程
-
详解PL/SQL Developer连接本地Oracle 11g 64位数据库