Oracle 11g,Linux平臺
創(chuàng)新互聯(lián)主要從事成都網(wǎng)站設(shè)計、成都網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)市中,10多年網(wǎng)站建設(shè)經(jīng)驗,價格優(yōu)惠、服務(wù)專業(yè),歡迎來電咨詢建站服務(wù):13518219792
有些情況下無法提供GUI環(huán)境。需要手動建庫
前提:操作系統(tǒng)已經(jīng)安裝了必須的包和ORACLE軟件
手動建庫大致步驟
設(shè)置環(huán)境變量.bash_profile
創(chuàng)建參數(shù)文件(位置:$ORACLE_HOME/dbs)
創(chuàng)建目錄結(jié)構(gòu)
執(zhí)行建庫腳本
$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
控制文件、數(shù)據(jù)文件、日志文件在該腳本執(zhí)行時生成
創(chuàng)建數(shù)據(jù)字典視圖
SQL>@/db/oracle/product/11.1.0/db_1/rdbms/admin/catalog.sql;
創(chuàng)建ORACLE存儲過程和包
SQL>@/db/oracle/product/11.1.0/db_1/rdbms/admin/catproc.sql;
創(chuàng)建需要使用PL/ SQL加密工具的接口
SQL> @/db/oracle/product/11.1.0/db_1/rdbms/admin/catoctk.sql;
創(chuàng)建ORACLE中一些鎖機制相關(guān)的視圖
SQL> @/db/oracle/product/11.1.0/db_1/rdbms/admin/catblock.sql: