This article provides a brief introduction to Creating an Oracle with the OFA specification through the CREATE DATABASE command database.
1 Setting environment variables (vi. bash_profile or saving as an executable file for creation)
Oracle_base=/u01/app
Oracle_home= $ORACLE _home/oracle
Oracle_sid=hsj
Path= $ORACLE _home/bin: $PATH
Ld_library_path= $ORACLE _home/lib: $LD _library_path
display==192.168.138.1:0.0
Export oracle_base oracle_home oracle_sid PATH ld_library_path DISPLAY
2 Create some directories (log directory, data file directory, control file directory, archive directory)
Mkdir-p/U01/APP/FLASH_RECOVERY_AREA/HSJ
Mkdir-p/U01/APP/DIAG/RDBMS/HSJ # for storing alert trace trace logs
Mkdir-p/u01/app/oradata/hsj/archive # is used to store archived logs, which are used to store control files and data files, online log files
Mkdir-p/u01/app/admin/hsj/adump
Mkdir-p/u01/app/admin/hsj/dpdump
Mkdir-p/u01/app/admin/hsj/pfile
Mkdir-p/u01/app/admin/hsj/scripts
3 Create the parameter file Inithsj.ora, and Create the spfilethrough Inithsj.ora, The SPFile file must be stored under the $ORACLE _home/dbs/ directory
Mkdir
Inithsj.ora File class capacity (some parameters need to be modified according to the actual environment)
V Inithsj.ora
hsj.__db_cache_size=327155712
hsj.__java_pool_size=4194304
hsj.__large_pool_size=4194304
Hsj.__oracle_base= '/u01/app ' #ORACLE_BASE set from environment
hsj.__pga_aggregate_target=331350016
hsj.__sga_target=490733568
Hsj.__shared_io_pool_size=0
hsj.__shared_pool_size=146800640
Hsj.__streams_pool_size=0
Audit_file_dest= '/u01/app/admin/hsj/adump '
Audit_trail= ' DB '
Compatible= ' 11.2.0.0.0 '
Control_files= '/u01/app/oradata/hsj/control01.ctl ', '/u01/app/flash_recovery_area/hsj/control02.ctl '
db_block_size=8192
Db_domain= "
Db_name= ' HSJ '
Db_recovery_file_dest= '/u01/app/flash_recovery_area '
db_recovery_file_dest_size=4039114752
Diagnostic_dest= '/u01/app '
Dispatchers= ' (protocol=tcp) (SERVICE=HSJXDB) '
log_archive_format= '%t_%s_%r.dbf '
memory_target=818937856
Nls_language= ' AMERICAN '
open_cursors=300
Remote_login_passwordfile= ' EXCLUSIVE '
Undo_tablespace= 'UNDOTBS1'
Sqlplus/as SYSDBA
Create SPFile from Pfile # need to be sure it is in the dbs directory, otherwise you need to specify a specific pfile file path and name
4 Starting the database to the nomount State
Startup Nomount;
5 Creating a database script createdb.sql
Spool Createdb.log
Create DATABASE HSJ
User Sys identified by root
User system identified by root
LogFile Group 1
('/u01/app/oradata/hsj/redo01.log ') size 50M blocksize 512,
Group 2
('/u01/app/oradata/hsj/redo02.log ') size 50M blocksize 512,
Group 3
('/u01/app/oradata/hsj/redo03.log ') size 50M blocksize 512
Maxlogfiles 30
Maxlogmembers 5
Maxloghistory 1
Maxdatafiles 100
Character Set Al32utf8
National Character Set Al16utf16
Extent Management Local
DataFile '/u01/app/oradata/hsj/system01.dbf ' size 300M reuse
Sysaux datafile '/u01/app/oradata/hsj/sysaux01.dbf ' size 300M reuse
Default Tablespace users
DataFile '/u01/app/oradata/hsj/users01.dbf ' size 300M reuse
Autoextend on MaxSize Unlimited
Default temporary tablespace tempts1
Tempfile '/u01/app/oradata/hsj/temp01.dbf ' size 20M reuse
Undo Tablespace UNDOTBS1
DataFile '/u01/app/oradata/hsj/undotbs01.dbf '
Size 200M reuse autoextend on MaxSize Unlimited;
Spool off
6 go to sqlplus Execute the script to create the database
@createdb. sql
7 If there is an error, please check the createdb.log alert log and trace log
8 go to the $ORACLE _home/rdbms/admin directory, execute the SQL that created the data dictionary and create the System Package
@catalog. sql
@catproc. sql
Create a oracle11g database from a command