建立 createDB.sql:
CREATE DATABASE win USER SYS IDENTIFIED BY mypass USER SYSTEM IDENTIFIED BY mypass LOGFILE GROUP 1 ('/opt/oracle/oradata/win/redo01.log') SIZE 100M, GROUP 2 ('/opt/oracle/oradata/win/redo02.log') SIZE 100M, GROUP 3 ('/opt/oracle/oradata/win/redo03.log') SIZE 100M MAXLOGFILES 5 MAXLOGMEMBERS 5 MAXLOGHISTORY 1 MAXDATAFILES 100 MAXINSTANCES 1 CHARACTER SET AL32UTF8 NATIONAL CHARACTER SET AL16UTF16 DATAFILE '/opt/oracle/oradata/win/system01.dbf' SIZE 325M REUSE EXTENT MANAGEMENT LOCAL SYSAUX DATAFILE '/opt/oracle/oradata/win/sysaux01.dbf' SIZE 325M REUSE DEFAULT TEMPORARY TABLESPACE temp TEMPFILE '/opt/oracle/oradata/win/temp01.dbf' SIZE 500M REUSE AUTOEXTEND ON MAXSIZE 2048M UNDO TABLESPACE undotbs1 DATAFILE '/opt/oracle/oradata/win/undotbs01.dbf' SIZE 200M REUSE AUTOEXTEND ON MAXSIZE UNLIMITED;
開始建立
$ echo $ORACLE_SID win $ sqlplus /nolog SQL> connect / as sysdba SQL> startup nomount SQL> @createDB.sql
$ export ORACLE_SID=<my_SID> $ sqlplus / as sysdba SQL> shutdown immediate Database closed. Database dismounted. ORACLE instance shut down. SQL> startup mount exclusive restrict ORACLE instance started. Total System Global Area 281018368 bytes Fixed Size 2095672 bytes Variable Size 109053384 bytes Database Buffers 163577856 bytes Redo Buffers 6291456 bytes Database mounted. SQL> drop database; Database dropped.