Get the App
SLTechnology News&Howtos  ›  Database  › 

[Oracle] script to create DB

Shulou Source: shulou.com Published: 2022-06-01 07:39:49 10月04日 Update

C:\ Users\ Admin > set ORACLE_HOME=E:\ oracle11g\ product\ 11.2.0\ dbhome_1

C:\ Users\ Admin > set ORACLE_SID=bruce

C:\ Users\ Admin > oradim-new-sid bruce

Instance created.

Initialization parameter file contents (11g):

Db_name=bruce

Audit_file_dest=E:\ oracle11g

Audit_trail = db

Db_block_size=8192

Control_files = ('E:\ oracle11g\ oradata\ control01.ctl','E:\ oracle11g\ oradata\ control02.ctl','E:\ oracle11g\ oradata\ control03.ctl')

Compatible = 11.2.0

Initialization parameter file contents (10g):

Db_name=bruce10g

Audit_trail = db

Db_block_size=8192

Control_files = ('E:\ oracle\ product\ oradata\ control01.ctl','E:\ oracle\ product\ oradata\ control02.ctl','E:\ oracle\ product\ oradata\ control03.ctl')

Compatible = 10.2.0

Undo_management=auto

Undo_tablespace=undotbs1

Background_dump_dest='E:\ oracle\ product\ 10.2.0\ admin\ bruce10g\ bdump'

Sga_target=419430400 # will report if this parameter is not added

C:\ Users\ Admin > sqlplus / as sysdba

SQL*Plus: Release 11.2.0.1.0 Production on Tue May 23 13:47:12 2017

Copyright (c) 1982, 2010, Oracle. All rights reserved.

Connected to an idle instance.

SQL > startup nomount

ORACLE instance started.

Total System Global Area 150667264 bytes

Fixed Size 1373152 bytes

Variable Size 92277792 bytes

Database Buffers 50331648 bytes

Redo Buffers 6684672 bytes

Then execute the following script:

Create database bruce

Maxlogfiles 5

Maxlogmembers 5

Maxdatafiles 100

Maxinstances 1

Logfile

Group 1 ('E:\ oracle11g\ oradata\ redo1.log') size 10m

Group 2 ('E:\ oracle11g\ oradata\ redo2.log') size 10m

Group 3 ('E:\ oracle11g\ oradata\ redo3.log') size 10m

Datafile'e:\ oracle11g\ oradata\ system.dbf' size 200m reuse

Sysaux datafile'e:\ oracle11g\ oradata\ sysaux.dbf' size 100m

Default tablespace users

Datafile'e:\ oracle11g\ oradata\ userdata.dbf' size 100m

Undo tablespace undotbs1 datafile'e:\ oracle11g\ oradata\ undotbs1.dbf' size 100m

Default temporary tablespace temp

Tempfile'e:\ oracle11g\ oradata\ temp01.dbf' size 100m reuse

Character set al32utf8

After completion

SQL > select status from v$instance

STATUS

-

OPEN

When you are finished, execute the following three scripts:

@ $ORACLE_HOME/rdbms/admin/catalog.sql

@ $ORACLE_HOME/rdbms/admin/catproc.sql

Conn system/manager

@ $ORACLE_HOME/sqlplus/admin/pupbld.sql

Tags: Parameters scripts content files three will be reported Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno macOS Shulou Tech Info Docker vpn MySQL