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

Install Oracle11gR2- to build the library manually on Linux

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

1. Modify oracle user environment variables

[oracle@oracle] $su-oracle [oracle@oracle ~] $vim .bash _ profile# .bash _ profile# Get the aliases and functionsif [- f ~ / .bashrc]; then. ~ / .bashrcfi # User specific environment and startup programsexport ORACLE_BASE=/u01/app/oracleexport ORACLE_HOME=$ORACLE_BASE/product/11.2.0.4/dbhome_1export ORACLE_SID=ORACLEDBexport LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/libexport CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlibPATH=$PATH:$HOME/.local/bin:$HOME/bin:$ORACLE_HOME/binexport PATH [oracle@oracle ~] $source .bash _ profile

2. Initiate monitoring

[oracle@oracle ~] $lsnrctl start

Third, build the database by hand

1. Create an Oracle data directory:

1: [oracle@oracle ~] $mkdir-p $ORACLE_BASE/oradata/ORACLEDB 2: [oracle@oracle ~] $mkdir-p $ORACLE_BASE/admin/ORACLEDB 3: [oracle@oracle ~] $mkdir-p $ORACLE_BASE/flash_recovery_area

2. Create password authentication for Oracle

[oracle@oracle ~] $cd $ORACLE_HOME/dbs 2: [oracle@oracle dbs] $orapwd file=orapwORACLEDB password=oracle entries=30

3. Create initialization parameter file

A. Create an initialization parameter file using the official parameter file as a template

1: [oracle@oracle ~] cd $ORACLE_HOME/dbs 2: [oracle@oracle ~] cat init.ora | grep-v ^ # | grep-v ^ $> initORACLEDB.ora

B. Modify the initialization parameter file

Before modification:

Db_name='ORCL' memory_target=1G processes = 150audit_file_dest='/admin/orcl/adump' audit_trail = 'db' db_block_size=8192 db_domain='' db_recovery_file_dest='/flash_recovery_area' db_recovery_file_dest_size=2G diagnostic_dest='' dispatchers=' (PROTOCOL=TCP) (SERVICE=ORCLXDB)' open_cursors=300 remote_login_passwordfile='EXCLUSIVE' undo_tablespace='UNDOTBS1' # You may want to ensure that control files are created on separate Physical # devices control_files = (ora_control1 Ora_control2) compatible = '11.2.0'

Enter in the edit status of the last line command of vim

The string of orcl replaced in 1::% s#orcl#ORACLEDB#gi. Where the I command is not case sensitive. 2::% s#ora_control1#/u01/app/oracle/oradata/ORACLEDB/control01.ctl#g replaces the string of ora_control1. 3::% s#ora_control2#/u01/app/oracle/oradata/ORACLEDB/control02.ctl#g replaces the string of ora_control2. The string replaced by 4::% s##/u01/app/oracle#g. The 5:: wq command saves the configuration

After modification:

Db_name='ORACLEDB' memory_target=1G processes = 150audit_file_dest='/u01/app/oracle/admin/ORACLEDB/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=2Gdiagnostic_dest='/u01/app/oracle'dispatchers=' (PROTOCOL=TCP) (SERVICE=ORACLEDBXDB)' open_cursors=300remote_login_passwordfile='EXCLUSIVE'undo_tablespace='UNDOTBS1'# You may want to ensure that control files are created on separate physical# devicescontrol_files = (/ u01/app/oracle/oradata/ORACLEDB/control01.ctl) / u01/app/oracle/oradata/ORACLEDB/control02.ctl) compatible = '11.2.0'

4. Connect to the database instance

Command file connection: 2: [oracle@oracle ~] sqlplus sys/oracle as sysdba 3: SYS@ > create spfile from pfile

5. Start the instance

1: SYS@ > startup nomount

6. Create a create database statement in the current directory to create a database

CREATE DATABASE ORACLEDBUSER SYS IDENTIFIED BY oracleUSER SYSTEM IDENTIFIED BY oracleLOGFILE GROUP 1 ('/ u01) SIZE BLOCKSIZE 512 SIZE group 2 ('/ u01 UK) SIZE 100m BLOCKSIZE 512 group 2 ('/ u01andr) oradataoradataandredo02a.logalog') SIZE 100M oracleDB 512 oradataoradataoradataoradataoradataoradataoradataoradataoradataoradataoradataoradataoracleoradataororadataororadataororadataororadataorandre0a.3log' '/ u01 BLOCKSIZE 512MAXLOGFILES 5MAXLOGMEMBERS 5MAXLOGHISTORY 1MAXDATAFILES 100CHARACTER SET AL32UTF8NATIONAL CHARACTER SET AL16UTF16EXTENT MANAGEMENT LOCALDATAFILE BLOCKSIZE 512MAXLOGFILES 5MAXLOGMEMBERS 5MAXLOGHISTORY 1MAXDATAFILES 100CHARACTER SET AL32UTF8NATIONAL CHARACTER SET AL16UTF16EXTENT MANAGEMENT LOCALDATAFILE redo03b.log') Oracle 100m BLOCKSIZE 512MAXLOGFILES 5MAXLOGMEMBERS 5MAXLOGHISTORY 1MAXDATAFILES 100CHARACTER SET AL32UTF8NATIONAL CHARACTER SET AL16UTF16EXTENT MANAGEMENT LOCALDATAFILE' / u01 REUSE AUTOEXTEND ON MAXSIZE UNLIMITEDDEFAULT TEMPORARY TABLESPACE tempts1TEMPFILE'/ u01/app/oracle/oradata/ORACLEDB/temp01.dbf'SIZE 20m REUSEUNDO TABLESPACE undotbs1DATAFILE'/ u01/app/oracle/oradata/ORACLEDB/temp01.dbf'SIZE 20m REUSEUNDO TABLESPACE undotbs1DATAFILE '/ u01/app/oracle/oradata/ORACLEDB/undotbs01.dbf'SIZE 200m REUSE AUTOEXTEND ON MAXSIZE UNLIMITED

Grant permissions to the file and execute the script:

[oracle@oracle dbs] chmod 755 create_database.sql 2: [oracle@oracle dbs] sqlplus / as sysdba 3: SYS@ > @ create_database.sql 4: Database created.

7. execute the script and build the data dictionary view

1: [oracle@oracle ~] sqlplus / as sysdba 2: SYS@ > @? / rdbms/admin/catalog.sql 3: SYS@ > @? / rdbms/admin/catproc.sql 4: SYS@ > @? / rdbms/admin/utlrp.sql

8. Log in with system user and execute script

[oracle@oracle ~] sqlplus system/oracle 2: SYSTEM@ > @? / sqlplus/admin/pupbld.sql

4. Verify whether the database is normal:

1: [oracle@oracle ~] sqlplus / as sysdba2:SYS@ > select INSTANCE_NAME,STATUS from vogue instance; INSTANCE_NAME STATUS-- OEACLEDB OPEN

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