Home Database Mysql Tutorial Oracle 11gR2单实例数据库补丁升级记录

Oracle 11gR2单实例数据库补丁升级记录

Jun 07, 2016 pm 03:10 PM
oracle

Oracle 11gR2是目前新系统应用比较广泛的Oracle版本,根据官方路线图,11.2.0.4是11g末期的一个版本。应该说,11gR2之后,Oracle

Oracle 11gR2是目前新系统应用比较广泛的Oracle版本,根据官方路线图,11.2.0.4是11g末期的一个版本。应该说,11gR2之后,Oracle直接提供了完整升级版本,可以直接安装高版本的数据库系统,不需要从基础版本逐步升级。

本篇主要记录以11.2.0.4为基础,单实例条件下Oracle补丁安装过程。

1、补丁包和环境介绍

首先确定数据库版本,笔者以一台全新安装Oracle 11gR2单实例进行安装,具体版本为11.2.0.4。

SQL> select * from v$version;

BANNER

--------------------------------------------------------------------------------

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

PL/SQL Release 11.2.0.4.0 - Production

CORE    11.2.0.4.0      Production

TNS for Linux: Version 11.2.0.4.0 - Production

NLSRTL Version 11.2.0.4.0 – Production

进行操作的补丁文件如下:

[root@XXX-PROD-DB upload]# cd patch/

[root@XXX-PROD-DB patch]# ls -l

total 282772

-rw-r--r--. 1 root root    407030 Jul 15 09:03 p19852360_112040_Generic.zip

-rw-r--r--. 1 root root  71580583 Jul 15 09:03 p20299013_112040_Linux-x86-64.zip

-rw-r--r--. 1 root root  12335412 Jul 15 09:03 p20299015_112040_Linux-x86-64.zip

-rw-r--r--. 1 root root  40486165 Jul 15 09:03 p20406239_112040_Linux-x86-64.zip

-rw-r--r--. 1 root root 112087303 Jul 15 09:02 p20834611_112040_Linux-x86-64.zip

-rw-r--r--. 1 root root  52648436 Jul 15 09:02 p6880880_112000_Linux-x86-64.zip

注意:其中p6880880_112000_Linux-x86-64.zip是新版本OPatch,一般而言打补丁都需要更新最新的OPatch。

2、升级OPatch组件

首先需要以覆盖方式升级OPatch组件。

[oracle@XXX-PROD-DB ~]$ cd $ORACLE_HOME

[oracle@XXX-PROD-DB dbhome_1]$ ls -l | grep OPatch

drwxr-xr-x.  8 oracle oinstall  4096 Jul 16 10:08 OPatch

备份OPatch目录,并用解压zip文件替换。

[oracle@XXX-PROD-DB dbhome_1]$ cp /upload/patch/p6880880_112000_Linux-x86-64.zip $ORACLE_HOME

[oracle@XXX-PROD-DB dbhome_1]$ ls -l | grep p6880880_112000_Linux-x86-64.zip 

-rw-r--r--.  1 oracle oinstall 52648436 Aug  4 08:42 p6880880_112000_Linux-x86-64.zip

[oracle@XXX-PROD-DB dbhome_1]$ mv OPatch OPatch_BK

[oracle@XXX-PROD-DB dbhome_1]$ ls -l | grep OPatch

drwxr-xr-x.  8 oracle oinstall    4096 Jul 16 10:08 OPatch_BK

解压OPatch文件。

[root@XXX-PROD-DB ~]# cd /u01/app/oracle/product/11.2.0/dbhome_1

[root@XXX-PROD-DB dbhome_1]# ls -l | grep p6880880_112000_Linux-x86-64.zip 

-rw-r--r--.  1 oracle oinstall 52648436 Aug  4 08:42 p6880880_112000_Linux-x86-64.zip

[root@XXX-PROD-DB dbhome_1]# unzip p6880880_112000_Linux-x86-64.zip

[root@XXX-PROD-DB dbhome_1]# ls -l | grep OPatch

drwxr-x---. 10 root  root        4096 Mar 31 17:10 OPatch

drwxr-xr-x.  8 oracle oinstall    4096 Jul 16 10:08 OPatch_BK

[root@XXX-PROD-DB dbhome_1]# chown -R oracle:oinstall OPatch

[root@XXX-PROD-DB dbhome_1]# ls -l | grep OPatch

drwxr-x---. 10 oracle oinstall    4096 Mar 31 17:10 OPatch

drwxr-xr-x.  8 oracle oinstall    4096 Jul 16 10:08 OPatch_BK

OPatch是一个命令脚本工具,为方便起见,可以将其加入到PATH环境变量中。

[oracle@XXX-PROD-DB dbhome_1]$ cd ~

[oracle@XXX-PROD-DB ~]$ vi .bash_profile 

(篇幅原因,有省略……)

ORACLE_SID=XXXCDB

ORACLE_BASE=/u01/app/oracle

ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1

PATH=$PATH:$ORACLE_HOME/bin:/u01/app/oracle/product/11.2.0/dbhome_1/OPatch

export ORACLE_SID

export ORACLE_BASE

export ORACLE_HOME

export PATH

".bash_profile" 23L, 409C written 

查看OPatch版本。

[oracle@XXX-PROD-DB ~]$ opatch version

OPatch Version: 11.2.0.3.10

OPatch succeeded.

2、补丁19852360_112040

补丁19852360_112040是一个简单的补丁,主要是针对JDBC相关的补丁类型。原则上,不需要进行关库操作。

[root@XXX-PROD-DB patch]# unzip p19852360_112040_Generic.zip 

Archive:  p19852360_112040_Generic.zip

  creating: 19852360/

  inflating: 19852360/README.txt     

  creating: 19852360/files/

  creating: 19852360/files/jdbc/

(篇幅原因,有省略……)

  inflating: 19852360/etc/xml/GenericActions.xml 

  inflating: 19852360/etc/xml/ShiphomeDirectoryStructure.xml 

进入解压目录,注意:要确保补丁文件的文件权限设置。

[oracle@XXX-PROD-DB ~]$ cd /upload/patch/

[oracle@XXX-PROD-DB patch]$ ls -l

total 282776

drwxr-xr-x. 4 oracle oinstall      4096 Oct 20  2014 19852360

-rw-r--r--. 1 root  root        407030 Jul 15 09:03 p19852360_112040_Generic.zip

[oracle@XXX-PROD-DB patch]$ cd 19852360/

[oracle@XXX-PROD-DB 19852360]$ ls -l

total 20

drwxr-xr-x. 4 oracle oinstall  4096 Oct 20  2014 etc

drwxr-xr-x. 3 oracle oinstall  4096 Oct 20  2014 files

-rw-rw-r--. 1 oracle oinstall 10858 Oct 28  2014 README.txt

[oracle@XXX-PROD-DB 19852360]$

注意:无论DBA经验多丰富,在进行补丁的时候,一定要参考每个补丁的readme.txt文件,遵循官方步骤进行操作。用成熟技术、用官方步骤是我们确保成功的重要原则。

首先,进行补丁先决条件检查。

[oracle@XXX-PROD-DB 19852360]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./

Oracle Interim Patch Installer version 11.2.0.3.10

Copyright (c) 2015, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home      : /u01/app/oracle/product/11.2.0/dbhome_1

Central Inventory : /u01/app/oraInventory

  from          : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc

OPatch version    : 11.2.0.3.10

OUI version      : 11.2.0.4.0

Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-08-04_10-22-39AM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.

没有发现问题,,可以直接进行补丁。

[oracle@XXX-PROD-DB 19852360]$ opatch apply

Oracle Interim Patch Installer version 11.2.0.3.10

Copyright (c) 2015, Oracle Corporation.  All rights reserved.

Oracle Home      : /u01/app/oracle/product/11.2.0/dbhome_1

Central Inventory : /u01/app/oraInventory

  from          : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc

OPatch version    : 11.2.0.3.10

OUI version      : 11.2.0.4.0

Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/19852360_Aug_04_2015_10_21_09/apply2015-08-04_10-21-09AM_1.log

Applying interim patch '19852360' to OH '/u01/app/oracle/product/11.2.0/dbhome_1'

Verifying environment and performing prerequisite checks...

All checks passed.

Provide your email address to be informed of security issues, install and

initiate Oracle Configuration Manager. Easier for you if you use your My

Oracle Support Email address/User Name.

Visit for details.

Email address/User Name: 

You have not provided an email address for notification of security issues.

Do you wish to remain uninformed of security issues ([Y]es, [N]o) [N]:  Y

Backing up files...

Patching component oracle.dbjava.jdbc, 11.2.0.4.0...

Patching component oracle.dbjava.ic, 11.2.0.4.0...

Verifying the update...

Patch 19852360 successfully applied

Log file location: /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/19852360_Aug_04_2015_10_21_09/apply2015-08-04_10-21-09AM_1.log

OPatch succeeded.

3、补丁20299013_112040

解压补丁文件:

[root@XXX-PROD-DB patch]# unzip p20299013_112040_Linux-x86-64.zip 

  inflating: 20299013/18522509/files/lib/libserver11.a/qerel.o 

  inflating: 20299013/18522509/files/lib/libserver11.a/knahs.o 

(篇幅原因,有省略……) 

  inflating: 20299013/18522509/etc/config/actions.xml 

  inflating: 20299013/18522509/etc/config/inventory.xml 

  inflating: PatchSearch.xml

设置owner权限。

[root@XXX-PROD-DB patch]# chown -R oracle:oinstall 20299013/

[root@XXX-PROD-DB patch]# ls -l

total 282840

drwxr-xr-x. 4 oracle oinstall      4096 Oct 20  2014 19852360

drwxrwxr-x. 8 oracle oinstall      4096 Mar  4 18:30 20299013

补丁20299013_112040是一个补丁集合,多个经过验证的安全补丁集合防止,是可以统一进行补丁操作的。

[oracle@XXX-PROD-DB 20299013]$ ls -l

total 88

drwxr-xr-x. 4 oracle oinstall  4096 Mar  4 18:30 17478514

drwxr-xr-x. 4 oracle oinstall  4096 Mar  4 18:30 18031668

drwxr-xr-x. 4 oracle oinstall  4096 Mar  4 18:30 18522509

drwxr-xr-x. 4 oracle oinstall  4096 Mar  4 18:30 19121551

drwxrwxr-x. 4 oracle oinstall  4096 Mar  4 18:30 19769489

drwxrwxr-x. 4 oracle oinstall  4096 Mar  4 18:30 20299013

-rw-r--r--. 1 oracle oinstall  3068 Mar  4 18:30 patchmd.xml

-rw-rw-r--. 1 oracle oinstall 54747 Apr 12 10:40 README.html

-rw-r--r--. 1 oracle oinstall    21 Mar  4 18:30 README.txt

进行先决性检查。

[oracle@XXX-PROD-DB 20299013]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./

Oracle Interim Patch Installer version 11.2.0.3.10

Copyright (c) 2015, Oracle Corporation.  All rights reserved.

PREREQ session

Oracle Home      : /u01/app/oracle/product/11.2.0/dbhome_1

Central Inventory : /u01/app/oraInventory

  from          : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc

OPatch version    : 11.2.0.3.10

OUI version      : 11.2.0.4.0

Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-08-04_10-28-53AM_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.

验证通过,说明当前系统安装补丁和将要安装补丁之间没有冲突。但是,执行apply的时候就有问题。

[oracle@XXX-PROD-DB 20299013]$ opatch apply

Oracle Interim Patch Installer version 11.2.0.3.10

Copyright (c) 2015, Oracle Corporation.  All rights reserved.

Oracle Home      : /u01/app/oracle/product/11.2.0/dbhome_1

Central Inventory : /u01/app/oraInventory

  from          : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc

OPatch version    : 11.2.0.3.10

OUI version      : 11.2.0.4.0

Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-08-04_10-29-25AM_1.log

Verifying environment and performing prerequisite checks...

Prerequisite check "CheckActiveFilesAndExecutables" failed.

The details are:

Following executables are active :

/u01/app/oracle/product/11.2.0/dbhome_1/bin/oracle

/u01/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1

UtilSession failed: Prerequisite check "CheckActiveFilesAndExecutables" failed.

Log file location: /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-08-04_10-29-25AM_1.log

OPatch failed with error code 73

报错信息中包括了日志内容,一旦出现Oracle错误,各种日志是进行诊断的最好方法。

[root@XXX-PROD-DB patch]# cd /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/

[root@XXX-PROD-DB opatch]# ls -l 

total 36

drwxr-xr-x. 2 oracle oinstall  4096 Aug  4 10:21 19852360_Aug_04_2015_10_21_09

drwxr-xr-x. 2 oracle oinstall  4096 Aug  4 10:06 lsinv

-rw-r--r--. 1 oracle oinstall  2050 Aug  4 10:06 opatch2015-08-04_10-06-22AM_1.log

-rw-r--r--. 1 oracle oinstall  1665 Aug  4 10:22 opatch2015-08-04_10-22-39AM_1.log

-rw-r--r--. 1 oracle oinstall  2021 Aug  4 10:28 opatch2015-08-04_10-28-53AM_1.log

-rw-r--r--. 1 oracle oinstall 10540 Aug  4 10:29 opatch2015-08-04_10-29-25AM_1.log

-rw-r--r--. 1 oracle oinstall  1872 Aug  4 10:29 opatch_history.txt

[root@INTCTL-PROD-DB opatch]# ls -l | grep 2015-08-04_10-29-25

-rw-r--r--. 1 oracle oinstall 10540 Aug  4 10:29 opatch2015-08-04_10-29-25AM_1.log

--日志片段:

[Aug 4, 2015 10:29:31 AM]    Finish fuser command /sbin/fuser /u01/app/oracle/product/11.2.0/dbhome_1/bin/proc at Tue Aug 04 10:29:31 CST 2015

[Aug 4, 2015 10:29:31 AM]    Start fuser command /sbin/fuser /u01/app/oracle/product/11.2.0/dbhome_1/lib/liborasdkbase.so.11.1 at Tue Aug 04 10:29:31 CST 2015

[Aug 4, 2015 10:29:31 AM]    Finish fuser command /sbin/fuser /u01/app/oracle/product/11.2.0/dbhome_1/lib/liborasdkbase.so.11.1 at Tue Aug 04 10:29:31 CST 2015

[Aug 4, 2015 10:29:31 AM]    Start fuser command /sbin/fuser /u01/app/oracle/product/11.2.0/dbhome_1/bin/wrap at Tue Aug 04 10:29:31 CST 2015

[Aug 4, 2015 10:29:31 AM]    Finish fuser command /sbin/fuser /u01/app/oracle/product/11.2.0/dbhome_1/bin/wrap at Tue Aug 04 10:29:31 CST 2015

[Aug 4, 2015 10:29:31 AM]    Start fuser command /sbin/fuser /u01/app/oracle/product/11.2.0/dbhome_1/bin/e2eme at Tue Aug 04 10:29:31 CST 2015

[Aug 4, 2015 10:29:31 AM]    Finish fuser command /sbin/fuser /u01/app/oracle/product/11.2.0/dbhome_1/bin/e2eme at Tue Aug 04 10:29:31 CST 2015

[Aug 4, 2015 10:29:31 AM]    OUI-67073:UtilSession failed: Prerequisite check "CheckActiveFilesAndExecutables" failed.

[Aug 4, 2015 10:29:31 AM]    Finishing UtilSession at Tue Aug 04 10:29:31 CST 2015

[Aug 4, 2015 10:29:31 AM]    Log file location: /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-08-04_10-29-25AM_1.log

[Aug 4, 2015 10:29:31 AM]    Stack Description: java.lang.RuntimeException: Prerequisite check "CheckActiveFilesAndExecutables" failed.

[Aug 4, 2015 10:29:31 AM]    StackTrace: oracle.opatch.OPatchSessionHelper.runApplyPrereqs(OPatchSessionHelper.java:5717)

[Aug 4, 2015 10:29:31 AM]    StackTrace: oracle.opatch.opatchutil.NApply.process(NApply.java:697)

[Aug 4, 2015 10:29:31 AM]    StackTrace: oracle.opatch.opatchutil.OUSession.napply(OUSession.java:1082)

[Aug 4, 2015 10:29:31 AM]    StackTrace: sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

[Aug 4, 2015 10:29:31 AM]    StackTrace: sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

[Aug 4, 2015 10:29:31 AM]    StackTrace: sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

[Aug 4, 2015 10:29:31 AM]    StackTrace: java.lang.reflect.Method.invoke(Method.java:592)

[Aug 4, 2015 10:29:31 AM]    StackTrace: oracle.opatch.UtilSession.process(UtilSession.java:317)

[Aug 4, 2015 10:29:31 AM]    StackTrace: oracle.opatch.OPatchSession.main(OPatchSession.java:2575)

[Aug 4, 2015 10:29:31 AM]    StackTrace: oracle.opatch.OPatch.main(OPatch.java:626)

经过分析,认为是Oracle数据库和监听器启动状态。安装补丁的时候,最好还是能够停机进行。

[oracle@XXX-PROD-DB 20299013]$ lsnrctl stop

LSNRCTL for Linux: Version 11.2.0.4.0 - Production on 04-AUG-2015 10:37:25

Copyright (c) 1991, 2013, Oracle.  All rights reserved.

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))

The command completed successfully

[oracle@INTCTL-PROD-DB 20299013]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Tue Aug 4 10:37:32 2015

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

SQL> conn / as sysdba

Connected.

SQL> shutdown immediate;

Database closed.

Database dismounted.

ORACLE instance shut down.

SQL> quit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

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

进行OPatch Apply操作。

[oracle@XXX-PROD-DB 20299013]$ opatch apply

Oracle Interim Patch Installer version 11.2.0.3.10

Copyright (c) 2015, Oracle Corporation.  All rights reserved.

Oracle Home      : /u01/app/oracle/product/11.2.0/dbhome_1

Central Inventory : /u01/app/oraInventory

  from          : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc

OPatch version    : 11.2.0.3.10

OUI version      : 11.2.0.4.0

Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-08-04_10-38-47AM_1.log

Verifying environment and performing prerequisite checks...

OPatch continues with these patches:  17478514  18031668  18522509  19121551  19769489  20299013 

(篇幅原因,有省略……)

Composite patch 20299013 successfully applied.

Log file location: /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-08-04_10-38-47AM_1.log

OPatch succeeded.

补丁成功。

注意:此时完成的是数据库软件、数据库实例的升级。但是数据库对象却没有升级。之后重启数据库,要进行脚本升级执行。

[oracle@XXX-PROD-DB 20299013]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.4.0 Production on Tue Aug 4 10:41:37 2015

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

SQL> conn / as sysdba

Connected to an idle instance.

SQL> startup

ORACLE instance started.

Total System Global Area 5227814912 bytes

Fixed Size                  2262368 bytes

Variable Size            1140853408 bytes

Database Buffers        4076863488 bytes

Redo Buffers                7835648 bytes

Database mounted.

Database opened.

执行脚本。

SQL> @?/rdbms/admin/catbundle.sql psu apply

SQL> COMMIT;

Commit complete.

SQL> SPOOL off

SQL> SET echo off

Check the following log file for errors:

/u01/app/oracle/cfgtoollogs/catbundle/catbundle_PSU_INTCDB_APPLY_2015Aug04_10_42_39.log

查看补丁内容信息:

[oracle@XXX-PROD-DB 20299013]$ opatch lsinventory

Oracle Interim Patch Installer version 11.2.0.3.10

Copyright (c) 2015, Oracle Corporation.  All rights reserved.

Oracle Home      : /u01/app/oracle/product/11.2.0/dbhome_1

Central Inventory : /u01/app/oraInventory

  from          : /u01/app/oracle/product/11.2.0/dbhome_1/oraInst.loc

OPatch version    : 11.2.0.3.10

OUI version      : 11.2.0.4.0

Log file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/opatch2015-08-04_10-45-21AM_1.log

Lsinventory Output file location : /u01/app/oracle/product/11.2.0/dbhome_1/cfgtoollogs/opatch/lsinv/lsinventory2015-08-04_10-45-21AM.txt

--------------------------------------------------------------------------------

Local Machine Information::

Hostname: localhost

ARU platform id: 226

ARU platform description:: Linux x86-64

Installed Top-level Products (1): 

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Best Graphic Settings
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. How to Fix Audio if You Can't Hear Anyone
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O. Chat Commands and How to Use Them
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

How to check tablespace size of oracle How to check tablespace size of oracle Apr 11, 2025 pm 08:15 PM

To query the Oracle tablespace size, follow the following steps: Determine the tablespace name by running the query: SELECT tablespace_name FROM dba_tablespaces; Query the tablespace size by running the query: SELECT sum(bytes) AS total_size, sum(bytes_free) AS available_space, sum(bytes) - sum(bytes_free) AS used_space FROM dba_data_files WHERE tablespace_

How to encrypt oracle view How to encrypt oracle view Apr 11, 2025 pm 08:30 PM

Oracle View Encryption allows you to encrypt data in the view, thereby enhancing the security of sensitive information. The steps include: 1) creating the master encryption key (MEk); 2) creating an encrypted view, specifying the view and MEk to be encrypted; 3) authorizing users to access the encrypted view. How encrypted views work: When a user querys for an encrypted view, Oracle uses MEk to decrypt data, ensuring that only authorized users can access readable data.

How to import oracle database How to import oracle database Apr 11, 2025 pm 08:06 PM

Data import method: 1. Use the SQLLoader utility: prepare data files, create control files, and run SQLLoader; 2. Use the IMP/EXP tool: export data, import data. Tip: 1. Recommended SQL*Loader for big data sets; 2. The target table should exist and the column definition matches; 3. After importing, data integrity needs to be verified.

How to view instance name of oracle How to view instance name of oracle Apr 11, 2025 pm 08:18 PM

There are three ways to view instance names in Oracle: use the "sqlplus" and "select instance_name from v$instance;" commands on the command line. Use the "show instance_name;" command in SQL*Plus. Check environment variables (ORACLE_SID on Linux) through the operating system's Task Manager, Oracle Enterprise Manager, or through the operating system.

How to uninstall Oracle installation failed How to uninstall Oracle installation failed Apr 11, 2025 pm 08:24 PM

Uninstall method for Oracle installation failure: Close Oracle service, delete Oracle program files and registry keys, uninstall Oracle environment variables, and restart the computer. If the uninstall fails, you can uninstall manually using the Oracle Universal Uninstall Tool.

How to get time in oracle How to get time in oracle Apr 11, 2025 pm 08:09 PM

There are the following methods to get time in Oracle: CURRENT_TIMESTAMP: Returns the current system time, accurate to seconds. SYSTIMESTAMP: More accurate than CURRENT_TIMESTAMP, to nanoseconds. SYSDATE: Returns the current system date, excluding the time part. TO_CHAR(SYSDATE, 'YYY-MM-DD HH24:MI:SS'): Converts the current system date and time to a specific format. EXTRACT: Extracts a specific part from a time value, such as a year, month, or hour.

How to create oracle dynamic sql How to create oracle dynamic sql Apr 12, 2025 am 06:06 AM

SQL statements can be created and executed based on runtime input by using Oracle's dynamic SQL. The steps include: preparing an empty string variable to store dynamically generated SQL statements. Use the EXECUTE IMMEDIATE or PREPARE statement to compile and execute dynamic SQL statements. Use bind variable to pass user input or other dynamic values ​​to dynamic SQL. Use EXECUTE IMMEDIATE or EXECUTE to execute dynamic SQL statements.

How to read the oracle awr report How to read the oracle awr report Apr 11, 2025 pm 09:45 PM

An AWR report is a report that displays database performance and activity snapshots. The interpretation steps include: identifying the date and time of the activity snapshot. View an overview of activities and resource consumption. Analyze session activities to find session types, resource consumption, and waiting events. Find potential performance bottlenecks such as slow SQL statements, resource contention, and I/O issues. View waiting events, identify and resolve them for performance. Analyze latch and memory usage patterns to identify memory issues that are causing performance issues.

See all articles