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

Oracle11g builds the library manually

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

Share

Shulou(Shulou.com)06/01 Report--

1. Set environment variabl

[oracle@HE3~] $vi .bash _ profile

ExportPATHexportEDITOR=viexportORACLE_SID=orclexportORACLE_BASE=/u01/app/oracleexportORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1exportnls_date_format= "yyyy-mm-dd hh34:mi:ss" exportPATH=/u01/app/oracle/product/11.2.0/dbhome_1/bin:$PATHexportLD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib#aliassqlplus='rlwrap sqlplus'#aliasrman='rlwrap rman'exportNLS_LANG=AMERICAN_AMERICA.ZHS16GBK

[oracle@HE3 ~] $source .bash _ profile

two。 Prepare password file and initialize parameter file and create database script

[oracle@HE3~] $cd $ORACLE_HOME/dbs

[oracle@HE3dbs] $ls

Hc_orcl.dat init.ora initorcl.ora lkORCL

[oracle@HE3dbs] $orapwd file=orapwdorcl password=oracle entries=30

[oracle@HE3dbs] $ls

Hc_orcl.dat init.ora initorcl.ora lkORCL orapwdorcl

[oracle@HE3 dbs] $vi initorcl.ora

Diagnostic_dest='/u01/app/oracle' db_name='orcl' memory_target=512M processes= 150 audit_file_dest='/u01/app/oracle/admin/orcl/adump' audit_trail='db' db_block_size=8192 db_domain='' db_recovery_file_dest='/u01/app/oracle/flash_recovery_area' db_recovery_file_dest_size=512M diagnostic_dest='/u01/app/oracle' open_cursors=300 remote_login_passwordfile='EXCLUSIVE' undo_tablespace='UNDOTBS1' control_files= (/ U01/app/oracle/oradata/orcl/control01.ctl / u01/app/oracle/oradata/orcl/control02.ctl) compatible='11.2.0'

3. Prepare the relevant directories needed to create the database

[oracle@HE3dbs] $mkdir-p / u01/app/oracle/admin/orcl/adump/

[oracle@HE3dbs] $mkdir-p / u01/app/oracle/flash_recovery_area

[oracle@HE3dbs] $mkdir-p / u01/app/oracle/oradata/orcl

[oracle@HE3dbs] $ls

Hc_orcl.dat init.ora initorcl.ora lkORCL orapwdorcl

4. Start to build the library by hand

[oracle@ENMOEDU ENMOEDU] $sqlplus / as sysdba

SQL*Plus: Release 11.2.0.3.0 Production on Mon Feb 10 00:39:10 2014

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

SQL > startup nomount

ORACLE instance started.

Total System Global Area 1071333376 bytes

Fixed Size 1349732 bytes

Variable Size 620758940 bytes

Database Buffers 444596224 bytes

Redo Buffers 4628480 bytes

[oracle@HE3~] $vi create_db.sql

CREATEDATABASE orcl USER SYS IDENTIFIED BY oracle USER SYSTEM IDENTIFIED BY oracle LOGFILE GROUP 1 ('/ u01 BLOCKSIZE) SIZE 50m BLOCKSIZE 512, GROUP 2 ('/ u01 BLOCKSIZE BLOCKSIZE 512) GROUP 3 ('/ u01qqappActionoradata'orclscarp redo03a.log' SIZE 50m BLOCKSIZE 512 MAXLOGFILES 5 MAXLOGMEMBERS 5 MAXLOGHISTORY 1 MAXDATAFILES 100 CHARACTER SET ZHS16GBK NATIONAL CHARACTER SET AL16UTF16 EXTENT MANAGEMENT LOCAL DATAFILE'/u01/app/oracle/oradata/orcl/system01.dbf' SIZE 325M REUSE SYSAUX DATAFILE'/u01/app/oracle/oradata/orcl/sysaux01.dbf' SIZE 325M REUSE DEFAULT TABLESPACE users DATAFILE'/u01/app/oracle/oradata/orcl/users01.dbf' SIZE 500M REUSE AUTOEXTEND ON MAXSIZEUNLIMITED DEFAULT TEMPORARY TABLESPACE tempts1 TEMPFILE'/u01/app/oracle/oradata/orcl/temp01.dbf' SIZE 20M REUSE UNDO TABLESPACE undotbs1 DATAFILE'/u01/app/oracle/oradata/orcl/undotbs01.dbf' SIZE 200M REUSE AUTOEXTEND ON MAXSIZEUNLIMITED

[oracle@HE3~] $tail-100f / u01/app/oracle/diag/rdbms/orcl/orcl/trace/alert_orcl.log

SQL > @ / home/oracle/create_db.sql

Databasecreated.

SQL > @? / rdbms/admin/catalog.sql-create a data dictionary

……

PL/SQLprocedure successfully completed.

TIMESTAMP

COMP_TIMESTAMPCATALOG 2016-01-26 00:07:42

SQL > @? / rdbms/admin/catproc.sql-- creates packages for stored procedures and databases

.

SQL >

SQL > SELECT dbms_registry_sys.time_stamp ('CATPROC') AS timestamp FROM DUAL

TIMESTAMP

COMP_TIMESTAMP CATPROC 2014-02-10 01:25:21

1 row selected.

SQL >

SQL > SET SERVEROUTPUT OFF

SQL >

SQL >

SQL > select status from v$instance

STATUS

-

OPEN

1 row selected.

SQL > quit

5. Complete the manual construction of the database

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