Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Oracle command how to create a database

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the oracle command how to create a database, the article is very detailed, has a certain reference value, interested friends must read it!

Oracle command (manual) to create a database

Sometimes because there is no graphical interface, it is necessary to transfer the command, query the information on the Internet, and after summarizing, write their own command to create the experience of the database.

1 add environment variable

Export PATH

Export ORACLE_BASE=/u01

Export ORACLE_HOME=$ORACLE_BASE/product/10.2.0.4/db_1

Export ORACLE_SID=dbtest

Export PATH=$ORACLE_HOME/bin:$PATH

Export LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/usr/lib64:$LD_LIBRARY_PATH

Umask 022

Unset USERNAME

2 system Planning db_name=dbtest oracle_sid=dbtest

3 create the catalog by hand

Mkdir-p / u01/app/oracle/admin/dbtest/adump

Mkdir-p / u01/app/oracle/admin/dbtest/bdump

Mkdir-p / u01/app/oracle/admin/dbtest/cdump

Mkdir-p / u01/app/oracle/admin/dbtest/udump

4. Establish a password file:

Orapwd file=/u01/product/10.2.0.4/db_1/dbs/orapwdbtest password=123456

5Murray-modify the parameter file:

* .audit_file_dest='/u01/admin/dbtest/adump'

* .background_dump_dest='/u01/admin/dbtest/bdump'

* .compatible='10.2.0.3.0'

* .control_files='/u01/oradata/dbtest/control01.ctl','/u01/oradata/dbtest/control02.ctl','/u01/oradata/dbtest/control03.ctl'

* .core_dump_dest='/u01/admin/dbtest/cdump'

* .db_block_size=8192

* .db_domain=''

* .db_file_multiblock_read_count=16

* .db_name='dbtest'

* .db_recovery_file_dest='/u01/flash_recovery_area'

* .db_recovery_file_dest_size=2147483648

* .job_queue_processes=10

* .log_archive_dest_1='location=/u01/arch'

* .log_archive_dest_2=''

* .open_cursors=300

* .pga_aggregate_target=545489408

* .processes=1500

* .recyclebin='OFF'

* .remote_login_passwordfile='EXCLUSIVE'

* .sga_target=1210612736

* .undo_management='AUTO'

* .undo_tablespace='UNDOTBS1'

* .user_dump_dest='/u01/admin/dbtest/udump'

You can copy this file to:

6Murray-log in to oracle:

> sqlplus / as sysdba

7Murray-launch an example:

SQL > startup nomount pfile=/u01/product/10.2.0.4/db_1/dbs/initdbtest.ora

8Murray-script to create the database:

CREATE DATABASE dbtest

LOGFILE

GROUP 1 ('/ u01qoradata size size 500m reuse)

GROUP 2 ('/ u01qoradata size) size 500m reuse

GROUP 3 ('/ u01qoradata size) size 500m reuse

MAXLOGFILES 50

MAXLOGMEMBERS 5

MAXLOGHISTORY 200

MAXDATAFILES 500

MAXINSTANCES 5

ARCHIVELOG

CHARACTER SET ZHS16GBK

NATIONAL CHARACTER SET AL16UTF16

DATAFILE'/ u01 SIZE oradata EXTENT MANAGEMENT LOCAL

SYSAUX DATAFILE'/ u01 SIZE oradata SIZE 1000m

UNDO TABLESPACE UNDOTBS1 DATAFILE'/ u01 SIZE oradata SIZE 500m

DEFAULT TEMPORARY TABLESPACE TEMP TEMPFILE'/ u01qoradata SIZE DbtestUniverse temp01.dbf'Universe 500m

9Murray-run the following files (in the following order):

Sql > @ $ORACLE_HOME/rdbms/admin/catalog.sql

Sql > @ $ORACLE_HOME/rdbms/admin/catproc.sql

Sql > conn system/manager

Sql > @ $ORACLE_HOME/sqlplus/admin/pupbld.sql

10Murray-create related tablespaces with users:

Create tablespace testnew datafile'/ u01 size oradata size 2g

Create user testnew identified by testnew default tablespace testnew

Grant connect,resource to testnew

The above is all the contents of the article "how to create a database with oracle commands". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report