Как сменить oracle home

Обновлено: 05.07.2024

1. Убедитесь, что ваш оракул может быть подключен к SQL / PLUS; 2. вПеременная окруженияСредний, конфигурациябаза данных оракулаСледующие значения в: имя переменной: ORACLE_SID, значение переменной: имя экземпляра Oracle имя переменной: NLS_LANG, значение переменной: AMERICAN_AMERICA. ZHS16GBK, вы можете выбрать имя переменной набора символов в соответствии с вашими потребностями: TNS_ADMIN, значение переменной: D: \ app \ Andreas \ product \ 11.2.0 \ dbhome_1 \ NETWORK \ ADMIN, мой оракул установлен в D: \ app \ Under справочник Андреаса. 3. Откройте PL / SQL и подключитесь к базе данных. В это время будет сообщено об ошибке инициализации. Оставьте это в покое, нажмите ОК. Через три раза подряд вы можете войти в PL / SQL без входа в систему. В Tool-> Connection есть две записи: Oracle Home (пусто - автоматическое определение) и OCI Library (пусто - автоматическое определение), соответственно, заполните каталог установки Oracle и каталог распаковки 32-битного клиента, например: Oracle Home D: \ app \ Andreas \ product \ 11.2.0 Мой оракул установлен в каталоге D: \ app \ Andreas. Библиотека OCI D: \ app \ Andreas \ instantclient_11_2 \ oci. DLL моего клиента распакована в каталог D: \ app \ Andreas. 4. Закройте PL / SQL, затем снова откройте его, вы можете войти в систему

установка oracle11gПеременная окруженияШаги настройки:

1. Первый - ORACLE_HOME. Эта конфигурация среды аналогична обучению среды java. Как показано на рисунке ниже, щелкните правой кнопкой мыши на компьютере - «Дополнительные параметры системы -» Дополнительно - «Переменные среды» - «Создать новую в системные переменные:

Имя переменной ORACLE_HOME

Значение переменной E: \ Oracle \ product \ 11.2.0 \ dbhome_1



2. Во-вторых, настройте TNS_ADMIN

Имя переменной TNS_ADMIN

Значение переменной E: \ Oracle \ product \ 11.2.0 \ dbhome_1 \ NETWORK \ ADMIN

The Oracle Universal Installer supports the installation of several active Oracle homes on the same host. An Oracle home is a directory into which all Oracle software is installed. This is pointed to by an environment variable. The Oracle home consists of the following:

Directory location where the products are installed

Corresponding system path setup

Program groups associated with the products installed in the home (where applicable)

Services running from the home

Introduction to Oracle Base

The Oracle base location is the location where Oracle Database binaries are stored. During installation, you are prompted for the Oracle base path. Typically, an Oracle base path for the database is created during Oracle Grid Infrastructure installation.

To prepare for installation, Oracle recommends that you only set the ORACLE_BASE environment variable to define paths for Oracle binaries and configuration files. Oracle Universal Installer (OUI) creates other necessary paths and environment variables in accordance with the Optimal Flexible Architecture (OFA) rules for well-structured Oracle software environments.

For example, with Oracle Database 11g, Oracle recommends that you do not set an Oracle home environment variable allow OUI to create it instead. If the Oracle base path is /u01/app/oracle, then by default, OUI creates the following Oracle home path:

Ensure that the paths you select for Oracle software, such as Oracle home paths and the Oracle base path, use only ASCII characters. Because installation owner names are used by default for some paths, this ASCII character restriction applies to user names, file names, and directory names.

Installing an Oracle Product

When you install an Oracle product, an Oracle home is created.

To install the product and create the Oracle home, perform the following steps:

Run Oracle Universal Installer.

In the Specify Home Details page, enter the Oracle home settings for the installation session. See Table 2-1 for a description of the fields in this section of the screen.

Continue with your installation. See Chapter 4, "Installing Products" for detailed information.

Table 2-1 Oracle Installation Settings for Specify Home Details page

Enter a name for the Oracle home. This name identifies the program group associated with a particular home and the Oracle services installed on this home. The Oracle home name must be between 1 to 127 characters long, and can include only alphanumeric characters and underscores.

Enter the full path to an Oracle home, or select an Oracle home from the drop-down list of existing Oracle homes. The Oracle home location is the directory where products are installed.

Data files may or may not be installed within an Oracle home. You can use the Browse button to choose a directory to install your product.

For Windows platforms, you must provide a valid path that is not in the Windows directory. Different homes cannot share the same location.

Oracle recommends that you designate an Oracle home location that is an empty or non-existing directory. If you select a directory for the Oracle home location that is not empty or already exists, you will be warned and asked if you want to proceed.

For silent installations, if a non-empty, existing directory is specified, an error is logged in the console and in the installActions<timestamp>.log file. Also, the Oracle Universal Installer aborts. To override this condition, use the -force flag on the command line. The effect of using the -force flag is the same as selecting Yes while installing in interactive mode. You receive a warning message, but the installation continues.

Removing Oracle Homes

To remove or deinstall Oracle homes, you can either use the Deinstall tool included with the Shiphome, or use the Deinstall utility available as part of the Oracle home.

To use the Deinstall tool, do the following to remove the Oracle home:

cd to DeinstallTool.

Run deinstall -home <OracleHome>.

To use the Deinstall utility, do the following to remove the Oracle home:

cd to $Oracle_Home/deinstall.

Determining the Default Oracle Home

By default, when you start Oracle Universal Installer, the software searches your system to determine the default Oracle home where Oracle software should be installed.

In all cases, the ORACLE_HOME name is taken first from the command line if it is specified, or else from the response file if specified. If not specified, the value of DEFAULT_ORACLE_HOME_NAME in oraparam.ini is examined. Typically, the following convention is used for the name:

Where <short_marketing_name_in oraparam.ini> is the short product marketing name as specified in the oraparam.ini file; for example, "Db11g", and <home_identifier> is a counter derived from the Central Inventory. For example, the ORACLE_HOME name could be OraDb11g_1 .

The ORACLE_HOME path is taken first from the command line if specified, or else from the response file if specified. If not, the ORACLE_HOME environment variable is used. If neither is specified, the following conventions are used for the path:

If ORACLE_BASE has been specified in the environment:

For example: $ORACLE_BASE/product/11.2.0/Db_1 .

If ORACLE_BASE has not been specified in the environment:

Where <short_name> is the short product name; for example, "Db", and <counter> is picked up based on the existence of the files. For example, the ORACLE_HOME path could be $HOME/product/11.2.0/Db_1 .

The instance-related directory location is accepted first from the response file, if specified. If not, the oradata , flash_recovery_area , admin , and doc directories are created under ORACLE_BASE . If ORACLE_BASE has not been specified, the default is the $ORACLE_HOME/oradata directory. If the parent directory of the Oracle home is writable, these directories are created in the parent directory of the Oracle home.

Multiple Oracle Homes

Oracle Universal Installer supports the installation of several active Oracle homes on the same host as long as the products support this at run-time. Multiple versions of the same product or different products can run from different Oracle homes concurrently. Products installed in one home do not conflict or interact with products installed on another home. You can update software in any home at any time, assuming all Oracle applications, services, and processes installed on the target home are shut down. Processes from other homes may still be running.

Target Home

The Oracle home currently accessed by Oracle Universal Installer for installation or deinstallation is the target home. To upgrade or remove products from the target homes, these products must be shut down or stopped.

Oracle Universal Installer Inventory

The Oracle Universal Installer inventory stores information about all Oracle software products installed in all Oracle homes on a host, provided the product was installed using Oracle Universal Installer.

Inventory information is stored in Extensible Markup Language (XML) format. The XML format enables easier diagnosis of problems and faster loading of data. Any secure information is not stored directly in the inventory. As a result, during removal of some products, you may be prompted to enter the required credentials for validation.

Oracle recommends placing the central inventory on a local file system that is not shared by other systems, since the central inventory is a system-specific inventory of the installations on this system. It is strongly recommended that you place the central inventory on a local disk so that installations from other systems do not corrupt the inventory. You should not place the central inventory in the Oracle Base.

Structure of the Oracle Universal Installer Inventory

Central Inventory Pointer File

Every Oracle software installation has an associated Central Inventory where the details of all the Oracle products installed on a host are registered. The Central Inventory is located in the directory that the inventory pointer file specifies. Each Oracle software installation has its own Central Inventory pointer file that is unknown to another Oracle software installation.

For Oracle homes sharing the same Central Inventory, the Oracle Universal Installer components perform all read and write operations on the inventory. The operations on the Central Inventory are performed through a locking mechanism. This implies that when an operation such as installation, upgrade, or patching occurs on an Oracle home, these operations become blocked on other Oracle homes that share the same Central Inventory.

Table 2–2 shows the location of the default inventory pointer file for various platforms:

Table 2-2 Default Inventory Pointer File Locations

Linux Linux.PPC64 AIX

Solaris.SPARC Solaris.X64 HPUX HPIA HP.TRU64 Linux.IA64 Linux.xSeries

Windows Windows.X64 Windows.IA64

The following string shows an example of the path for the oraInst.loc file:

In UNIX, if you do not want to use the Central Inventory located in the directory specified by the inventory pointer file, you can use the -invPtrLoc flag to specify another inventory pointer file. The syntax is as follows:

If the contents of the oraInst.loc file is empty, Oracle Universal Installer prompts you to create a new inventory.

Central Inventory

The Central Inventory contains the information relating to all Oracle products installed on a host. It contains the following files and folders:

Inventory File

This file lists all the Oracle homes installed on the node. For each Oracle home, it also lists the Oracle home name, home index, and nodes on which the home is installed. It also mentions if the home is an Oracle Clusterware home or a removed Oracle home. It can only detect removed Oracle homes created using Oracle Universal Installer version 11.2 and later. This file is present in the following location:

The following code shows a sample inventory.xml file:

Oracle recommends that you do not remove or manually edit this file as it could affect installation and patching.

Logs Directory

The Central Inventory contains installation logs in the following location:

The logs directory contains the logs corresponding to all installations performed on a particular node. You can also find a copy of the installation log in the $ORACLE_HOME/cfgtoollogs directory.The installation logs for an installation are identified by the timestamp associated with the log files. These files are generally saved in the following format:

For example, consider an attachHome operation performed on 17th, May, 2009 at 6.45AM. The associated log file would be created as follows:

Oracle Home Inventory

Oracle home inventory or local inventory is present inside each Oracle home. It only contains information relevant to a particular Oracle home. This file is located in the following location:

It contains the following files and folders:

Components File

For an example of the components file, see "Sample Components File".

Home Properties File

This file contains the details about the node list, the local node name, and the Oracle Clusterware flag for the Oracle home. In a shared Oracle home, the local node information is not present. This file also contains the following information:

GUID — Unique global ID for the Oracle home

ARU ID — Unique platform ID. The patching and patchset application depends on this ID.

ORACLE_BASE: Основа структуры каталогов Oracle. Рекомендуется установить ее перед установкой.

ORACLE_HOME: Среда, в которой работают продукты Oracle. Не требуется перед установкой, если установлена ORACLE_BASE .

ORACLE_SID: Не требуется перед установкой, но полезна впоследствии для простоты взаимодействия с определенным экземпляром

NLS_LANG: Дополнительная переменная окружения, которая управляет языком, территорией, и клиентскими настройками набора символов

Есть множество переменных окружения Oracle, включенных в каждую среду Oracle. Упомянутые здесь важны для успешной установки и использования базы данных Oracle. Ни одна из них не обязана быть установленной, но можно избежать будущих проблем, если установить эти переменные.

ORACLE_BASE: Определяет основу структуры каталогов Oracle для Оптимальной Гибкой Архитектуры (OFA), которая рекомендуется Oracle Support. Использование является опциональным; если используется, это может облегчить будущие установки и обновления. Это - путь к каталогу, как показано в следующем примере:

ORACLE_HOME: Среда, в которой работают продукты Oracle. Не обязательна перед установкой, если установлена ORACLE_BASE. OUI может использовать ORACLE_BASE, чтобы определить рекомендуемый ORACLE_HOME для Вашей установки. Наличие этой переменной окружения облегчает обслуживание и управление программным обеспечением Oracle. Это - путь к каталогу, как показано в следующем примере:

ORACLE_SID: системный идентификатор для экземпляра Oracle, такого как orcl для базы данных или +ASM для экземпляра ASM. Не требуется перед установкой, но полезен впоследствии для простоты взаимодействия с определенным экземпляром.

NLS_LANG: Дополнительная переменная окружения, которая управляет языком, территорией, и клиентскими настройками набора символов как в следующем примере:

Для получения дополнительной информации о допустимых языках, территориях, наборы символов, и поддержка языка, см. Oracle Database Globalization Support Guide.

Oracle: Сводка переменных среды, конфигурация Toad об OCI, PLSQL и других конфигурациях


Среди переменных среды допустимыми являются следующие переменные среды

  • ORACLE_HOME
  • ORACLE_SID
  • SQLPATH
  • TNS_ADMIN
  • NLS_LANG

Переменная среды ORACLE_HOME может указывать на несколько мгновенных клиентов. Следует отметить, что для plsql лучше указать один, поскольку, если указано несколько, вам необходимо перенастроить Oracle_home в переменной среды, в противном случае Plsql Вместо этого он не сможет определить, какую переменную среды следует использовать в качестве стандарта. Что касается того, как настроены переменные среды, они будут объяснены позже.

Следующий код представляет собой пакетную команду, которая устанавливает некоторые переменные среды. Если вы хотите использовать режим конфигурации системы вместо режима сценария bat, вам нужно настроить его только в конфигурации переменных среды Windows. Удалите множество, слева и справа от знака равенства находятся ключ и значение, то есть имя переменной и значение переменной. Для каждой версии Linux обратите внимание на переменные среды, экспортируемые после файла .bash. Не перезаписывайте исходные переменные среды напрямую во время экспорта, то есть используйте export A=$A:$ORACLE_HOME Настройте этот способ.

Здесь нужно отметить одну вещь: вам необходимо настроить переменную среды Oracle_home в переменную среды Path. В противном случае это не вступит в силу. Нераспознанная проблема. запомнить


Верхняя часть изображения креветок - это конфигурация, а нижний регистр - это эффект соответствующей конфигурации.

Дополнительное описание. На самом деле на шаге выше
TNS_ADMINЭта переменная среды указывает на файл конфигурации tnsnames.ora и каталог, в котором находится файл sqlnet.ora. Это можно настроить или нет. Не влияет на работу. Но если вы используете Toad, вы можете изменить его легче после настройки.
SQLPATHПеременная окружения влияет на каталог, где исполняемый файл сценария выполняется заранее при запуске sqlplus. Используется для начальной настройки sqlplus.
NLS_LANGУкажите версию кодировки для использования. Нужно унифицировать с сервером Oracle. Если это значение не установлено должным образом, оно может повлиять на imp, dmp, искаженный или неудачный импорт или экспорт базы данных.

Теоретически нам нужно настроить только один Oracle_home для машины, но чтобы глубже понять его принцип, мы вводим метод реестра.
Введите следующий каталог
regedit

Измените следующий файл на суффикс reg, и каталог измененной детали будет указывать на ваш каталог.


Измените, пожалуйста, увидеть эту картину

Единственное, что нужно заявить, это уровень приоритета: переменные среды> реестр.
Во-вторых, ORACLE_HOME_NAME действует только в реестре.
Во-вторых, TNS_ADMIN допустим только в переменных среды. Другое самотестирование.
где ORACLE_HOME_NAME - это просто идентификатор, используемый для различения нескольких элементов регистрации. Это работает под жабой. Смотрите рисунок ниже. Эффект после применения реестра.

Причиной, по которой существует несколько Oracle_home, является ORACLE_HOME

Читайте также: