- Запустить oracle на linux
- Installing Oracle Database XE Using RPM Packages
- Performing a Silent Installation
- Setting the Oracle Database XE Environment Variables
- Запустить oracle на linux
- Русские Блоги
- 2.3. Войдите в Oracle как пользователь SYS
- 2.4. Запустите экземпляр с помощью команды запуска
- В-третьих, закройте Oracle под Linux
- 1. Закройте экземпляр базы данных.
- 2. Закройте слушатель
Запустить oracle на linux
You can install Oracle Database Express Edition using RPM packages.
An RPM-based installation performs preinstallation checks, extracts the database software, reassigns ownership of the extracted software to the preconfigured user and groups, maintains the Oracle inventory, and executes all root operations required to configure the Oracle Database software for a single-instance Oracle Database creation and configuration.
The RPM–based installation process detects when the minimum requirements for an installation are not met and prompts you to finish these minimum preinstallation requirements.
This section covers the following topics:
Installing Oracle Database XE Using RPM Packages
Perform the following steps to install and configure Oracle Database XE using RPM packages.
Before attempting to install Oracle Database XE 21c, uninstall any existing Oracle Database XE or database with the SID XE from the target system.
An Oracle Database XE installation will consume around 9 gigabytes of disk space under /opt . If this disk partition does not have the required disk space available, you must add space or mount an alternative partition as /opt/oracle . This disk partition is the defined Oracle Base where the software and database will reside.
The Oracle Database XE installation does not support usage of symbolic links (symlink) for that disk.
Installing Oracle Database XE RPM
- Use sudo to log in as root .
# dnf -y install oracle-database-preinstall-21c
# yum -y install oracle-database-preinstall-21c
# curl -o oracle-database-preinstall-21c-1.0-1.el7.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-21c-1.0-1.el7.x86_64.rpm # yum -y localinstall oracle-database-preinstall-21c-1.0-1.el7.x86_64.rpm
# curl -o oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm https://yum.oracle.com/repo/OracleLinux/OL8/appstream/x86_64/getPackage/oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm # dnf -y localinstall oracle-database-preinstall-21c-1.0-1.el8.x86_64.rpm
- The Oracle Database Preinstallation RPM automatically creates Oracle installation owner and groups. It also sets up other kernel configuration settings required for Oracle installations. If you plan to use job-role separation, then create the extended set of database users and groups depending on your requirements.
- Use the -y option if you want yum to skip the package confirmation prompt.
- The yum command that is provided with Oracle Linux 8 is a symbolic link to the dnf command. The yum and dnf commands are completely interchangeable. However, the dnf command provides significant improvements in functionality and performance when compared to the yum command.
- See, About DNF for more information about the dnf command.
- For Oracle Linux 7: oracle-database-xe-21c-1.0-1.ol7.x86_64.rpm
- For Oracle Linux 8: oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm
# yum -y localinstall oracle-database-xe-21c-1.0-1.ol7.x86_64.rpm
# dnf -y localinstall oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm
Check the RPM log file to review the system configuration changes. For example, review this file for latest changes: /var/log/oracle-database-preinstall-21c/results/orakernel.log .
The installation of Oracle Database software is now complete.
Creating and Configuring an Oracle Database
The configuration script creates a container database ( XE ) with one pluggable database ( XEPDB1 ) and configures the listener at the default port (1521) and Enterprise Manager Express on port 5500.
You can modify the configuration parameters by editing the /etc/sysconfig/oracle—xe–21c.conf file.
The parameters set in this file are explained in more details in the silent mode installation procedure: Performing a Silent Installation.
To create the Oracle XE database with the default settings, perform the following steps:
- Execute as user root using sudo .
# /etc/init.d/oracle-xe-21c configure
At the prompt, specify a password for the SYS , SYSTEM , and PDBADMIN administrative user accounts. Oracle recommends that the password entered should be at least 8 characters in length, contain at least 1 uppercase character, 1 lower case character and 1 digit 7.
See Also: The same password will be used for these accounts. The password should conform to the Oracle recommended standards. See Oracle Database Security Guide for more information about guidelines for securing passwords
Configuration, Database Files and Logs Location
Table 5-1 Configuration, Database Files and Logs Location
Oracle Base. This is the root of the Oracle Database XE directory tree.
Oracle Home. This home is where the Oracle Database XE is installed. It contains the directories of the Oracle Database XE executables and network files.
Diagnostic logs. The database alert log is /opt/oracle/diag/rdbms/xe/XE/trace/alert_XE.log
Database creation logs. The XE.log file contains the results of the database creation script execution.
Configuration default parameters.
Configuration and services script.
If a host does not have any IP address other than loop back address assigned (typically in a docker or in an another container environment), Oracle Net Configuration Assistant (Oracle NETCA) may fail during the installation with the error No valid IP Address returned for the host hostname in the netca trace log. Please assign an IP address and retry the installation.
Performing a Silent Installation
You can install Oracle Express Edition using the silent mode. This mode can be used for embedded install of XE (with your application) or unattended operation.
To perform a silent installation, a password for the administrative accounts must be provided as a parameter to the script, or specified in the configuration file.
- Create a wrapper shell script to perform the silent installation. It should contain commands similar to the following: For Oracle Linux 7 :
#!/bin/bash yum -y localinstall /downloads/oracle-database-xe-21c-1.0-1.ol7.x86_64.rpm > /xe_logs/XEsilentinstall.log 2>&1 /etc/init.d/oracle-xe-21c configure >> /xe_logs/XEsilentinstall.log 2>&1
#!/bin/bash yum -y localinstall /downloads/oracle-database-xe-21c-1.0-1.ol8.x86_64.rpm > /xe_logs/XEsilentinstall.log 2>&1 /etc/init.d/oracle-xe-21c configure >> /xe_logs/XEsilentinstall.log 2>&1
(echo "password"; echo "password";) | /etc/init.d/oracle-xe-21c configure >> /xe_logs/XEsilentinstall.log 2>&1
The XE database is configured with default settings. It is not necessary to modify these parameters unless you have specific requirements. Make a copy of the configuration file /etc/sysconfig/oracle-xe-21c.conf before modifying it. Make your modifications after the RPM install and before configuring the database.
The provided configuration file /etc/sysconfig/oracle-xe-21c.conf sets the following:
- LISTENER_PORT : A valid listener numeric port value for the database listener. Do not specify for automatic port assignment.
- EM_EXPRESS_PORT : A valid port numeric value for Oracle Enterprise Manager (EM) Express listener. This is set to port 5500.
- CHARSET : Character set of the database. This is set to AL32UTF8 .
- DBFILE_DEST Database file directory. By default, the database files are stored in the Oracle Base /opt/oracle/oradata subdirectory. You can also create your own database file directory. However, the permissions for this file path should be owned by oracle user .
- SKIP_VALIDATIONS : Skip validation for memory and disk space. Default: false.
When you modify and save a file containing plain text password, ownership of the file should be given to the Oracle software installation owner only, and permissions on the file should be changed to 600. Oracle strongly recommends that database administrators or other administrators delete or secure such files containing plain text passwords when they are not in use.
The password should conform to the Oracle recommended standards. See Oracle Database Security Guide for more information about guidelines for securing passwords
You can find the database creation logs under the Oracle Base /opt/oracle/cfgtoollogs/dbca/ subdirectory.
Configuration, Database Files and Logs Location for a summary of important files and their locations
Setting the Oracle Database XE Environment Variables
After you have installed and configured Oracle Database XE, you must set the environment before using Oracle Database XE.
The oraenv and coraenv scripts can be used to set your environment variables.
For example, to set your environment variables in Bourne, Bash, or Korn shell without being prompted by the script:
$ export ORACLE_SID=XE $ export ORAENV_ASK=NO $ . /opt/oracle/product/21c/dbhomeXE/bin/oraenv ORACLE_HOME = [] ? /opt/oracle/product/21c/dbhomeXE The Oracle base has been set to /opt/oracle
$ setenv ORACLE_SID XE $ setenv ORACLEENV_ASK NO $ source /opt/oracle/product/21c/dbhomeXE/bin/coraenv
Запустить oracle на linux
You can start and stop the database manually, set it to automatically after the system shuts down and starts, or using Enterprise Manager.
Shutting Down and Starting Up Using the Configuration Services Script
Execute these commands as root using sudo .
You can start and stop the database using the /etc/init.d/oracle-xe-18c script.
Run the following command to start the listener and database:
# /etc/init.d/oracle-xe-18c start
Run the following command to stop the database and the listener:
Run the following command to stop and start the listener and database:
# /etc/init.d/oracle-xe-18c restart
Run the following command to start the listener and database:
# systemctl start oracle-xe-18c
Run the following command to stop the database and the listener:
# systemctl stop oracle-xe-18c
Run the following command to stop and start the listener and database:
# systemctl restart oracle-xe-18c
Shutting Down and Starting Up Using SQL*Plus
You can shut down and start the database using SQL*Plus.
To shutdown the database, login to the oracle user with its environment variables set for access to the XE database, and issue the following SQL*Plus command:
$ sqlplus / as sysdba SQL> SHUTDOWN IMMEDIATE
To start the database, issue the commands:
SQL> STARTUP SQL> ALTER PLUGGABLE DATABASE ALL OPEN;
- Oracle Database 2 Day DBA for general information about managing a database
- Oracle Multitenant Administration Guide for more information about shutting down and starting a PDB
Automating Shutdown and Startup
Oracle recommends that you configure the system to automatically start Oracle Database when the system starts, and to automatically shut it down when the system shuts down. Automating database shutdown guards against incorrect database shutdown.
To automate the startup and shutdown of the listener and database, execute the following commands as root :
For Oracle Linux 6, run these commands:
# /sbin/chkconfig oracle-xe-18c on # /sbin/service oracle-xe-18c start
# systemctl daemon-reload # systemctl enable oracle-xe-18c
Русские Блоги
Перед общей работой я обычно проверяю статус работы службы
2.3. Войдите в Oracle как пользователь SYS
[[email protected] ~]$ sqlplus /nolog SQL*Plus: Release 11.2.0.1.0 Production on Fri Dec 1 23:29:19 2017 Copyright (c) 1982, 2009, Oracle. All rights reserved. SQL> conn /as sysdba Connected to an idle instance.
Сменить пользователя:
Имя пользователя / пароль CONN [AS SYSDBA], если вы являетесь пользователем sys, вы должны написать AS SYSDBA
2.4. Запустите экземпляр с помощью команды запуска
SQL> startup ORACLE instance started. Total System . . Database mounted. Database opened. SQL>
В-третьих, закройте Oracle под Linux
1. Закройте экземпляр базы данных.
SQL> shutdown Database closed. Database dismounted. ORACLE instance shut down. SQL> quit Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production With the Partitioning, OLAP, Data Mining and Real Application Testing options
2. Закройте слушатель
Вставьте здесь фрагмент кода