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

Linux silently installs Oracle11g R2

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

Share

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

1 configure the basic environment

Make a comprehensive update to the operating system first.

# yum update

Install and upgrade the oracle dependency package

# yum-y install\

Binutils\

Compat-libcap1\

Compat-libstdc++-33\

Compat-libstdc++-33*.i686\

Elfutils-libelf-devel\

Gcc\

Gcc-c++\

Glibc*.i686\

Glibc\

Glibc-devel\

Glibc-devel*.i686\

Ksh\

Libgcc*.i686\

Libgcc\

Libstdc++\

Libstdc++*.i686\

Libstdc++-devel\

Libstdc++-devel*.i686\

Libaio\

Libaio*.i686\

Libaio-devel\

Libaio-devel*.i686\

Make\

Sysstat\

UnixODBC\

UnixODBC*.i686\

UnixODBC-devel\

UnixODBC-devel*.i686\

LibXp

Modify the hostname, edit the netework file, if the file is opened using vim or vi, save after modification (press ESC first, then enter ": wq", press ESC first if you don't want to save, then enter ": Q!")

# vi/etc/sysconfig/network

Modify the hostname to oracledb (can be changed according to the actual situation)

Restart takes effect (it will take a while to connect after reboot)

# reboot

Check the hostname and display oracledb. The change was successful.

# hostname

Add a record corresponding to the hostname and IP

# vi/etc/hosts

Add xx.xx.xx.xx oracledb and save after modification (press ESC first, then enter ": wq", enter)

Close selinux

# setenforce 0

Create the required operating system groups and users (here the group names are oinstall and dba, and the user name is oracle, which can be changed according to the actual situation)

# groupaddoinstall & & groupadd dba & & useradd-g oinstall-G dba oracle

Set the oracle user password (password self-defined, password security first)

# passwdoracle

Prepare the installation files

Create an installation directory (depending on the situation, select a directory with more space to create)

# mkdir-p / u01/app/

Upload the oracle installation file to / U01

Modify the oracle user rights under the / U01 directory

# chown-R oracle:oinstall / u01 oracle:oinstall & chmod-R 775 / u01/app/

Create a / etc/oraInst.loc file with the following contents (this file does not exist, just edit it)

# vi / etc/oraInst.loc add the following two lines

Inventory_loc=/u01/app/oracle/oraInventory

Inst_group=oinstall

Save after modification (press ESC first, then enter ": wq", enter)

Change the permissions of a file

Chown oracle:oinstall / etc/oraInst.loc&& chmod 664 / etc/oraInst.loc

Extract the oracle installation file (oracle user execution)

# su-oracle

Cd / u01

Unzip linux.x64_11gR2_database_1of2.zip

Unzip linux.x64_11gR2_database_2of2.zip

Set the oracle environment variable and edit the ~ / .bash_profile file

# vi ~ / .bash_profile

Add the following at the end

Export ORACLE_BASE=/u01/app/oracle

Export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1

ExportPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin$PATH:$ORACLE_HOME/bin

Export ORACLE_SID=orcl

Save after modification (press ESC first, then enter ": wq", enter)

Make the settings take effect

Source / .bash_profile

Copy template files for authorization

Cp / u01/database/response/db_install.rsp/u01/database

Chmod + x / u01/database/db_install.rsp

Three silently install Oracle

Modify the response file / u01/database/db_install.rsp for installing Oracle software

# vi / u01/database/db_install.rsp

Oracle.install.option=INSTALL_DB_SWONLY// installation type

ORACLE_HOSTNAME=oracledb / / Host name

UNIX_GROUP_NAME=oinstall / / installation group

INVENTORY_LOCATION=/u01/app/oracle/oraInventory// INVENTORY directory

SELECTED_LANGUAGES=en,zh_CN / / Select language

ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1// oracle_home

ORACLE_BASE=/u01/app/oracle / / oracle_base

Oracle.install.db.InstallEdition=EE / / oracle version

Oracle.install.db.EEOptionsSelection=true

Oracle.install.db.DBA_GROUP=dba / / dba user group

Oracle.install.db.OPER_GROUP=oinstall// oper user group

DECLINE_SECURITY_UPDATES=true

Oracle.installer.autoupdates.option = SKIP_UPDATES

Save after modification (press ESC first, then enter ": wq", enter)

Change to the database directory you just unzipped to install

# cd / u01/database

Check whether the files in the directory have db_install.rsp files.

# ls View

Start silent installation of oracle (view log after executing the command)

#. / runInstaller-silent-responsefile/u01/database/db_install.rsp-ignoresysprereqs-ignoreprereq

During installation, if you prompt [WARNING] to ignore it, the installer is still in progress, and if [FATAL] appears, the installer has stopped.

Check the installation log information to understand the installation progress

Tail-f$ORACLE_BASE/oraInventory/logs/installActions*.log

A prompt similar to the following indicates that the installation is complete:

#-

...

/ u01/app/oracle/product/11.2.0/db_1/root.sh

To executethe configuration scripts:

1. Open aterminal window

2. Log in as "root"

3. Run thescripts

4. Return tothis window and hit "Enter" key to continue

SuccessfullySetup Software.

#-

To execute the script file, you need to use the root user to execute root.sh

# su-root

# / u01/app/oracle/product/11.2.0/db_1/root.sh

Fourth, install the database

Set up a database (be sure to read the instructions for using the parameters before installation and change the parameters according to your actual situation)

# dbca-h / / View help

# / u01/app/oracle/product/11.2.0/db_1/assistants/dbca/templates/General_Purpose.dbc-gdbName orcl-sid orcl-sysPassword xxxxx- systemPassword xxxxx- emConfiguration xxxxx- dbsnmpPassword xxxxxx-sysmanPassword xxxxx- characterSet AL32UTF8

Description of using parameters:

-silent refers to the silent execution of dbca commands

-createDatabase means to use dbca

-templateName specifies the name of the template used to create the database, which is specified here as / u01/app/oracle/product/11.2.0/db_1/assistants/dbca/templates/General_Purpose.dbc, that is, the general-purpose database template

-gdbName specifies the name of the global database created. Here, the name is orcl.

-sid specifies the database system identifier, which is specified here as orcl, which has the same name as the database

-sysPassword SYS user password is set to oracle

-systemPassword SYSTEM user password is set to oracle

-emConfiguration specifies the management options for Enterprise Management. LOCAL indicates that the database is managed locally by Enterprise Manager

-dbsnmpPassword DBSNMP user password is set to oracle

-sysmanPassword SYSMAN user password is set to oracle

-characterSet specifies the character set used by the database, which is specified here as al32utf8

Execute the command, check the installation, and display as follows: (100% progress is very fast, the installation may fail)

/ / start installation

Copyingdatabase files

1% complete

37% complete

Creating andstarting Oracle instance

40% complete

62% complete

CompletingDatabase Creation

66% complete

100% complete

Look at thelog file "/ u01/app/oracle/cfgtoollogs/dbca/orcl/orcl.log" for furtherdetails.// installation completed

# check the installation

# lsnrctlstatus

If the installation is successful, it will eventually display: The command completed successfully

Modify oracle startup configuration file

# vi/etc/oratab

Racl:/u01/app/oracle/product/11.2.0/db_1:Y// changed "N" to "Y"

$ORACLE_SID:$ORACLE_HOME:Y:

Set Y to launch this instance through dbstart, the listener.

The first startup method:

Start all oracle processes and start the listener. (open database)

Dbstart$ORACLE_HOME

Close all oracle processes and stop the listener. (close database)

Dbshut$ORACLE_HOME

The second startup method:

# lsnrctlstatus to view listener status

# lsnrctl stop stops listening

# sqlplus / assysdba enter the database

# SQL > shutdown immediate; stop the database

# SQL > exit exit the database

# lsnrctlstart enables listening

# sqlplus / assysdba enter the database

# SQL > startup; start the database

# SQL > select open_mode from vault database; query instance status

OPEN_MODE

-

READ WRITE

Show READ WRITE

Oracle database started successfully!

5. Create a connection user.

/ / create a user (the user created here will be used in the database connection file of the application, remember! )

SQL > createuser user identifiedby password

/ / authorize the user

SQL > grantconnect,dba,resource to user

Six-file inspection

Sqlplus / as sysdba

SQL > shutdown immediate

SQL > startup mount

SQL > alter database archivelog

SQL > alter database flashback on; (execute if you want to enable database flashback)

SQL > alter database open

SQL > execute utl_recomp.recomp_serial (); (recompile all objects that may fail)

SQL > alter system archive log current; (manually archived tests)

7. Import of data

/

# Import data start#

Export the table using expdp (note that if the data exported using expdp can only be imported using impdp, the user password used below varies according to the actual situation)

Create an export directory

# mkdir / home/oracle/dump/utrmdb

SQL > create directory dump_utrm as'/ home/oracle/dump/utrmdb/'

SQL > select * from dba_directories

SQL > grantread,write on directory dump_utrm to user

Expdp user / password directory=dump_utrm dumpfile= file name. Dmp logfile= file name. Log

Import tables using impdp

Mkdir/u01/utrm

Chmod + x/u01/utrm/dump_201612131650.dmp

SQL > create directory dump_ut as'/ u01amp Utrmdb'

SQL > select * from dba_directories

SQL > grantread,write on directory dump_ut to user

Impdp user / password _ db directory=dump_ut dumpfile= file name. Dmp logfile= file name. Log full=y

# Import data stop#

/

8. Check the monitoring status

# lsnrctl status

# #

-

Alias LISTENER

Version TNSLSNR for Linux: Version 11.2.0.1.0-Production

Start Date 28-OCT-2016 18:12:21

Uptime 51 days 16 hr. 8 min. 45 sec

Trace Level off

Security ON: Local OS Authentication

SNMP OFF

Listener Parameter File / oracle/product/11g/db_1/network/admin/listener.ora

Listener Log File / oracle/diag/tnslsnr/master/listener/alert/log.xml

Listening Endpoints Summary...

(DESCRIPTION= (ADDRESS= (PROTOCOL=tcp) (HOST=master) (PORT=1521))

Services Summary...

Service "orcl" has 1 instance (s).

Instance "orcl", status READY, has 1 handler (s) for this service...

Service "orclXDB" has 1 instance (s).

Instance "orcl", status READY, has 1 handler (s) for this service...

The command completed successfully

# #

Display words similar to the above points and you are done!

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