您的位置:首页 > 汽车 > 时评 > 个性化网站成功的案例_网络优化论文_新闻热搜榜 今日热点_西安seo经理

个性化网站成功的案例_网络优化论文_新闻热搜榜 今日热点_西安seo经理

2025/1/19 2:09:17 来源:https://blog.csdn.net/hf191850699/article/details/144092644  浏览:    关键词:个性化网站成功的案例_网络优化论文_新闻热搜榜 今日热点_西安seo经理
个性化网站成功的案例_网络优化论文_新闻热搜榜 今日热点_西安seo经理

Oracle 11g升级到Oracle12c

Oracle11g数据库环境准备与数据备份

环境:

oracle11.2.0.4 to oralce12.2.0.1

升级方案:

升级方案很多种,我们ORACLE培训课程第8阶段有所讲所有的升级方案,我们这里采用DBUA官方建议的方法

1、手工通过upgrade方式,执行大量的脚本去手工升级

2、dbua图形方式升级(官方推荐的)

oracle安装目录备份

修改主机名:

hostname hefeidb

vi /etc/hostname

停所有的数据库服务

oracle数据库备份

cd /backup

tar /cvf /backup/oracle.tar /oracle

停机时间长:启动mount状态,完整备份

不停机时间短:在线备份+归档

mkdir /backup/hferpdb

rman target / CONFIGURE CONTROLFILE AUTOBACKUP ON; 
run
{ 
allocate channel d1 type disk; 
allocate channel d2 type disk; 
backup format '/backup/hfhsdb/hferpdbfull_%U' database include current controlfile; 
release channel d1; 
release channel d2; 
} 

Oracle12c安装过程

用oracle用户,上传linuxx64_12201_database.zip,

su - oracle

mkdir -p /oracle/app/oracle/product/12.2.0/db_1

chown -R oracle:oinstall /oracle/app/oracle/product/12.2.0

chmod -R 775 /oracle/app/oracle/product/12.2.0

修改环境变量:

oracle@hefeidb:/home/oracle]$cp ~/.bash_profile ~/.bash_profile.bak

[oracle@hefeidb:/home/oracle]$vi ~/.bash_profile

\#export PATHPS1="[`whoami`@`hostname`:"'$PWD]$'
export PS1
export TMP=/tmp
export LANG=en_US
export TMPDIR=$TMP
export ORACLE_UNQNAME=hefeidb
ORACLE_SID=hefeidb; export ORACLE_SID
ORACLE_BASE=/oracle/app/oracle; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/12.2.0/db_1; export ORACLE_HOME
ORACLE_TERM=xterm; export ORACLE_TERM
NLS_DATE_FORMAT="yyyy-mm-dd HH24:MI:SS"; export NLS_DATE_FORMAT
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK;export NLS_LANG
PATH=.:$PATH:$HOME/.local/bin:$HOME/bin:$ORACLE_BASE/product/12.2.0/db_1/bin:$ORACLE_HOME/bin; export PATH
THREADS_FLAG=native; export THREADS_FLAG
umask=022

验证:

[root@hefeidb backup]# su - oracle

Last login: Sun Aug 27 16:11:11 CST 2023 on pts/1

[oracle@hefeidb:/home/oracle]$env |grep ORACLE

ORACLE_UNQNAME=hefeidb
ORACLE_SID=hefeidb
ORACLE_BASE=/oracle/app/oracle
ORACLE_TERM=xterm
ORACLE_HOME=/oracle/app/oracle/product/12.2.0/db_1

解压12c的安装软件

[oracle@hefeidb:/backup]$unzip linuxx64_12201_database.zip

运行vnc安装:

[oracle@hefeidb:/backup]$vncserver

[oracle@hefeidb:/backup/database] ./runInstaller

image-20241125145532863

image-20241125145539921

image-20241125145547186

image-20241125145553719

image-20241125145602054

image-20241125145608561

image-20241125145613520

安装监听:

监听端口改成1522,后面升级完后再改回1521.

netca

image-20241125145658822

image-20241125145705385

Oracle11g数据库升级检查与测试

[oracle@hefeidb:/home/oracle]$source ~/.bash_profile.bak

[oracle@hefeidb:/home/oracle]$env |grep ORACLE

ORACLE_UNQNAME=hefeidb

ORACLE_SID=hefeidb

ORACLE_BASE=/oracle/app/oracle

ORACLE_TERM=xterm

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

[oracle@hefeidb:/home/oracle]$which sqlplus

[oracle@hefeidb:/home/oracle]$source ~/.bash_profile.bak

[oracle@hefeidb:/home/oracle]$/oracle/app/oracle/product/11.2.0/db_1/bin/sqlplus “/as sysdba”

运行preupgrade.jar ,生产检查脚本

[oracle@hefeidb:/backup]$unzip preupgrade_12201_cbuild_20_lf.zip

[oracle@hefeidb:/backup]$source ~/.bash_profile.bak --【到之前的环境变量里面去】

[oracle@hefeidb:/backup]$java -jar preupgrade.jar

image-20241125145835897

[oracle@hefeidb:/oracle/app/oracle/product/12.2.0/db_1/rdbms/admin]$more /oracle/app/oracle/cfgtoollogs/hefeidb/preupgrade/preupgrade.log

数据库表空间修改

image-20241125150006069

[oracle@hefeidb:/backup]$/oracle/app/oracle/product/11.2.0/db_1/bin/sqlplus “/as sysdba”

SQL> select name from v$datafile;

SQL> alter database datafile ‘/oradata/hefeidb/system01.dbf’ resize 1010m;

em管理器修改

image-20241125150046649

[oracle@hefeidb:/oracle/app/oracle/product/12.2.0/db_1/rdbms/admin]$cp emremove.sql …/…/…/…/11.2.0/db_1/rdbms/admin/

[oracle@hefeidb:/oracle/app/oracle/product/12.2.0/db_1/rdbms/admin]$emctl stop dbconsole

[oracle@hefeidb:/oracle/app/oracle/product/12.2.0/db_1]$/oracle/app/oracle/product/11.2.0/db_1/bin/sqlplus “/as sysdba”

SQL> SET ECHO ON;

SQL> SET SERVEROUTPUT ON;

SQL> @?/rdbms/admin/emremove.sql

SQL> @/oracle/app/oracle/cfgtoollogs/hefeidb/preupgrade/preupgrade_fixups.sql

升级前收集信息

image-20241125150211166

检查无效对象

SQL> @$ORACLE_HOME/rdbms/admin/utlrp.sql

Oracle11g升级到Oracle12c过程

用vnc连接到oracle,要在12c的环境下面运行dbua进行升级

image-20241125150249378

image-20241125150255299

image-20241125150300620

image-20241125150307926

image-20241125150317085

Oracle11g到Oracle12c后期检查

升级后执行的脚本

再12c执行

/oracle/app/oracle/cfgtoollgs/hefeidb/preupgrade/postupgrade_fixups.sql

image-20241125150352575

image-20241125150358061

升级完成后的检查

dbupgdiag.sql

image-20241125150414643

对象检查

hcheck.sql

/etc/oratab

image-20241125150439751

show parameter compat

alter system set compatble=‘12.2.0.1.0’ scope=spfile;

show parameter list

alter system set local_listener=‘’;

启停数据库测试

image-20241125150533009

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com