Linux怎么创建date文件,Linux下手工创建oracle database
首先需要安裝oracle軟件。
[oracle@ora01 admin]$ uname -a
Linux ora01 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:35 EDT 2010 i686 i686 i386 GNU/Linux
1.設置環境變量:
[oracle@ora01 admin]export ORACLE_SID=mydb
[oracle@ora01 admin]export ORACLE_BASE=/u02
[oracle@ora01 admin]export ORACLE_HOME=/u02/oracle
2.創建oracle相關目錄:
1)創建dump目錄:
[oracle@ora01 admin]mkdir -p $ORACLE_BASE/admin/mydb/adump
[oracle@ora01 admin]mkdir -p $ORACLE_BASE/admin/mydb/bdump
[oracle@ora01 admin]mkdir -p $ORACLE_BASE/admin/mydb/cdump
[oracle@ora01 admin]mkdir -p $ORACLE_BASE/admin/mydb/udump
[oracle@ora01 admin]mkdir -p $ORACLE_BASE/admin/mydb/pfile[@more@]
2)創建oracle文件目錄:
[oracle@ora01 admin]mkdir -p $ORACLE_BASE/oradata/mydb
3.創建密碼文件:
[oracle@ora01 admin]orapwd file=$ORACLE_HOME/dbs/orpwdmydb.ora password=manager
4.創建oracle參數文件:
[oracle@ora01 admin]mkdir -p $ORACLE_HOME/dbs
[oracle@ora01 admin]echo "aq_tm_processes=0
audit_file_dest=/u02/admin/mydb/adump
background_dump_dest=/u02/admin/mydb/bdump
compatible=10.2.0.1.0
control_files=/u02/oradata/mydb/control01.ctl, /u02/oradata/mydb/control02.ctl, /u02/oradata/mydb/control03.ctl
core_dump_dest=/u02/admin/mydb/cdump
db_block_size=8192
db_domain=""
db_file_multiblock_read_count=16
db_name=mydb
instance_name=mydb
dispatchers="(PROTOCOL=TCP) (SERVICE=mydbXDB)"
job_queue_processes=10
nls_length_semantics=BYTE
open_cursors=300
pga_aggregate_target=94371840
processes=150
remote_login_passwordfile=EXCLUSIVE
resource_manager_plan=""
sessions=170
sga_target=285212672
undo_management=AUTO
undo_retention=900
undo_tablespace=UNDOTBS1
user_dump_dest=/u02/admin/mydb/udump" >$ORACLE_HOME/dbs/initmydb.ora
4.創建createdb.sql腳本,用來創建數據庫:
[oracle@ora01 admin]echo "create database mydb
LOGFILE
GROUP 1 ('/u02/oradata/mydb/redo01.log') size 10m reuse,
GROUP 2 ('/u02/oradata/mydb/redo02.log') size 10m reuse,
GROUP 3 ('/u02/oradata/mydb/redo03.log') size 10m reuse
MAXLOGFILES 50
MAXLOGMEMBERS 5
MAXLOGHISTORY 200
MAXDATAFILES 500
MAXINSTANCES 5
ARCHIVELOG
CHARACTER SET ZHS16GBK
NATIONAL CHARACTER SET UTF8
DATAFILE '/u02/oradata/mydb/system01.dbf' SIZE 100M reuse autoextend on next 10m maxsize unlimited extent management local
SYSAUX DATAFILE '/u02/oradata/mydb/sysaux01.dbf' SIZE 100M reuse autoextend on next 10m maxsize unlimited
UNDO TABLESPACE UNDOTBS1 DATAFILE '/u02/oradata/mydb/undo.dbf' SIZE 50M reuse autoextend on next 5M maxsize unlimited
DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE '/u02/oradata/mydb/temp.dbf' SIZE 50M reuse autoextend on next 5M maxsize unlimited;
" >createdb.sql
5.進入sqlplus,創建數據庫,創建數據字典:
SQL> startup nomount pfile=initmydb.ora
ORACLE instance started.
Total System Global Area 285212672 bytes
Fixed Size 1218992 bytes
Variable Size 92276304 bytes
Database Buffers 188743680 bytes
Redo Buffers 2973696 bytes
SQL> @createdb.sql
Database created.
SQL>@$ORACLE_HOME/rdbms/admin/catalog.sql;
SQL>@$ORACLE_HOME/rdbms/admin/catproc.sql;
6.創建users表空間,并且將其設置為默認表空間:
SQL>create tablespace users logging datafile '$ORACLE_BASE/oradata/mydb/users.dbf' size 5M autoextend on next 1280k maxsize unlimited extent management local segment space management auto;
SQL>alter database default tablespace users;
總結
以上是生活随笔為你收集整理的Linux怎么创建date文件,Linux下手工创建oracle database的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 织梦php调用字段,织梦dedecms搜
- 下一篇: lua linux获取文件夹,Linux