标签:justify oracle 数据库 linux style
Oracle 11g,Linux平台
有些情况下无法提供GUI环境。需要手动建库
前提:操作系统已经安装了必须的包和ORACLE软件
手动建库大致步骤
设置环境变量.bash_profile
创建参数文件(位置:$ORACLE_HOME/dbs)
创建目录结构
执行建库脚本
$cat .bash_profile
ORACLE_SID=sdzy
ORACLE_BASE=/db/oracle
ORACLE_HOME=$ORACLE_BASE/product/11.1.0/db_1
export ORACLE_SID ORACLE_BASE ORACLE_HOME
PATH=$PATH:/$ORACLE_HOME/bin:$HOME/bin
export PATH
$cat $ORACLE_HOME/dbs/initsdzy.ora
db_name=‘sdzy‘
memory_target=2500M
processes = 1500
sga_max_size=2000M
shared_pool_size = 652428800
large_pool_size = 778643200
java_pool_size = 420971520
audit_file_dest=‘/db/oracle/admin/adump‘
db_block_size=8192
db_recovery_file_dest=‘/db/oracle/flash_recovery_area/sdzy‘
db_recovery_file_dest_size=2G
dispatchers=‘(PROTOCOL=TCP) (SERVICE=ORCLXDB)‘
open_cursors=300
remote_login_passwordfile=‘EXCLUSIVE‘
undo_tablespace=‘UNDOTBS1‘
control_files = (‘/db/oracle/oradata/control01.ctl‘,‘/db/oracle/oradata/control02.ctl‘,‘/db/oracle/oradata/control03.ctl‘)
compatible =‘11.2.0‘
$ mkdir -p /db/oracle/admin/adump
$ mkdir -p /db/oracle/flash_recovery_area/sdzy
$ mkdir -p /db/oracle/oradata
SQL> startup nomount pfile=‘/db/oracle/product/11.1.0/db_1/dbs/initsdzy.ora‘;
ORACLE instance started.
Total System Global Area 2087780352 bytes
Fixed Size 2214936 bytes
Variable Size 2063598568 bytes
Database Buffers 16777216 bytes
Redo Buffers 5189632 bytes
$ cat create_db.sql
create database sdzy
USER SYS IDENTIFIED BY change_on_install
USER SYSTEM IDENTIFIED BY manager
LOGFILE
GROUP 1 (‘/db/oracle/oradata/redo01.dbf‘) SIZE 100M,
GROUP 2 (‘/db/oracle/oradata/redo02.dbf‘) SIZE 100M,
GROUP 3 (‘/db/oracle/oradata/redo03.dbf‘) SIZE 100M
maxlogfiles 15
maxlogmembers 5
maxdatafiles 100
maxinstances 1
datafile ‘/db/oracle/oradata/system01.dbf‘ size 100m reuse
sysaux datafile ‘/db/oracle/oradata/sysaux01.dbf‘ size 100m
default tablespace users datafile ‘/db/oracle/oradata/user01.dbf‘ size 100m
undo tablespace undotbs1 datafile ‘/db/oracle/oradata/undo01.dbf‘ size 100m
default temporary tablespace temp tempfile ‘/db/oracle/oradata/temp01.dbf‘ size 100m reuse
character set al32utf8
;
SQL> @/db/oracle/create_db.sql;
Database created.
SQL> select status from v$instance;
STATUS
------------
OPEN
控制文件、数据文件、日志文件在该脚本执行时生成
创建数据字典视图
SQL>@/db/oracle/product/11.1.0/db_1/rdbms/admin/catalog.sql;
创建ORACLE存储过程和包
SQL>@/db/oracle/product/11.1.0/db_1/rdbms/admin/catproc.sql;
创建需要使用PL/ SQL加密工具的接口
SQL> @/db/oracle/product/11.1.0/db_1/rdbms/admin/catoctk.sql;
创建ORACLE中一些锁机制相关的视图
SQL> @/db/oracle/product/11.1.0/db_1/rdbms/admin/catblock.sql:
标签:justify oracle 数据库 linux style
原文地址:http://12865902.blog.51cto.com/12855902/1921092