2026-03-12 20:51:59
This commit is contained in:
139
divers/oracle_autoupgrade_01.txt
Normal file
139
divers/oracle_autoupgrade_01.txt
Normal file
@@ -0,0 +1,139 @@
|
||||
export PATH=/app/oracle/product/21/jdk/bin:$PATH
|
||||
export JAVA_HOME=/app/oracle/product/21/jdk
|
||||
|
||||
java -jar $ORACLE_HOME/rdbms/admin/autoupgrade.jar -version
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
create spfile='/app/oracle/base/admin/WEDGEPRD/spfile/spfileWEDGEPRD.ora' from pfile='/app/oracle/base/admin/WEDGEPRD/pfile/initWEDGEPRD.ora';
|
||||
|
||||
startup nomount;
|
||||
|
||||
rman auxiliary /
|
||||
|
||||
run
|
||||
{
|
||||
allocate auxiliary channel aux01 device type disk;
|
||||
allocate auxiliary channel aux02 device type disk;
|
||||
allocate auxiliary channel aux03 device type disk;
|
||||
allocate auxiliary channel aux04 device type disk;
|
||||
allocate auxiliary channel aux05 device type disk;
|
||||
allocate auxiliary channel aux06 device type disk;
|
||||
allocate auxiliary channel aux07 device type disk;
|
||||
allocate auxiliary channel aux08 device type disk;
|
||||
allocate auxiliary channel aux09 device type disk;
|
||||
allocate auxiliary channel aux10 device type disk;
|
||||
duplicate target database to WEDGE backup location '/mnt/yavin4/tmp/_oracle_/orabackup/_keep_/Standalone/11.2.0.4/WEDGE/';
|
||||
}
|
||||
|
||||
|
||||
@$ORACLE_HOME/rdbms/admin/catbundle psu apply
|
||||
@$ORACLE_HOME/rdbms/admin/utlrp
|
||||
|
||||
java -jar /mnt/yavin4/tmp/autoupgrade.jar -version
|
||||
java -jar /mnt/yavin4/tmp/autoupgrade.jar -config /home/oracle/myconfig.cfg -clear_recovery_data
|
||||
java -jar /mnt/yavin4/tmp/autoupgrade.jar -config myconfig.cfg -mode analyze
|
||||
java -jar /mnt/yavin4/tmp/autoupgrade.jar -config myconfig.cfg -mode fixups
|
||||
java -jar /mnt/yavin4/tmp/autoupgrade.jar -config myconfig.cfg -mode deploy
|
||||
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
global.autoupg_log_dir=/home/oracle
|
||||
|
||||
upg1.sid=WEDGEPRD # ORACLE_SID of the source DB/CDB
|
||||
upg1.source_home=/app/oracle/product/11.2 # Path of the source ORACLE_HOME
|
||||
upg1.target_home=/app/oracle/product/19 # Path of the target ORACLE_HOME
|
||||
upg1.start_time=NOW # Optional. [NOW | +XhYm (X hours, Y minutes after launch) | dd/mm/yyyy hh:mm:ss]
|
||||
upg1.upgrade_node=taris.swgalaxy # Optional. To find out the name of your node, run the hostname utility. Default is 'localhost'
|
||||
upg1.run_utlrp=yes # Optional. Whether or not to run utlrp after upgrade
|
||||
upg1.timezone_upg=yes # Optional. Whether or not to run the timezone upgrade
|
||||
upg1.target_version=19 # Oracle version of the target ORACLE_HOME. Only required when the target Oracle database version is 12.2
|
||||
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
create spfile='/app/oracle/base/admin/ASTYPRD/spfile/spfileASTYPRD.ora' from pfile='/app/oracle/base/admin/ASTYPRD/pfile/initASTYPRD.ora';
|
||||
|
||||
startup nomount;
|
||||
|
||||
rman auxiliary /
|
||||
|
||||
run
|
||||
{
|
||||
allocate auxiliary channel aux01 device type disk;
|
||||
allocate auxiliary channel aux02 device type disk;
|
||||
allocate auxiliary channel aux03 device type disk;
|
||||
allocate auxiliary channel aux04 device type disk;
|
||||
allocate auxiliary channel aux05 device type disk;
|
||||
allocate auxiliary channel aux06 device type disk;
|
||||
allocate auxiliary channel aux07 device type disk;
|
||||
allocate auxiliary channel aux08 device type disk;
|
||||
allocate auxiliary channel aux09 device type disk;
|
||||
allocate auxiliary channel aux10 device type disk;
|
||||
duplicate target database to ASTY backup location '/mnt/yavin4/tmp/_oracle_/orabackup/_keep_/Standalone/19.11/ASTY/';
|
||||
}
|
||||
|
||||
|
||||
|
||||
cd $ORACLE_HOME/OPatch
|
||||
./datapatch
|
||||
|
||||
@$ORACLE_HOME/rdbms/admin/utlrp
|
||||
|
||||
|
||||
global.autoupg_log_dir=/home/oracle
|
||||
|
||||
#
|
||||
# Database number 3 - Noncdb to PDB upgrade
|
||||
#
|
||||
upg3.sid=WEDGEPRD
|
||||
upg3.source_home=/app/oracle/product/11.2
|
||||
upg3.target_cdb=ASTYPRD
|
||||
upg3.target_home=/app/oracle/product/19
|
||||
upg3.target_pdb_name=PDBWEDGEPRD
|
||||
upg3.start_time=NOW # Optional. 10 Minutes from now
|
||||
upg3.upgrade_node=localhost # Optional. To find out the name of your node, run the hostname utility. Default is 'localhost'
|
||||
upg3.run_utlrp=yes # Optional. Whether or not to run utlrp after upgrade
|
||||
upg3.timezone_upg=yes # Optional. Whether or not to run the timezone upgrade
|
||||
|
||||
|
||||
rman target /
|
||||
|
||||
run
|
||||
{
|
||||
set nocfau;
|
||||
allocate channel ch01 device type disk format '/mnt/yavin4/tmp/_oracle_/orabackup/temp/upgrade1/ASTYPRD/%d_%U_%s_%t.bck';
|
||||
allocate channel ch02 device type disk format '/mnt/yavin4/tmp/_oracle_/orabackup/temp/upgrade1/ASTYPRD/%d_%U_%s_%t.bck';
|
||||
allocate channel ch03 device type disk format '/mnt/yavin4/tmp/_oracle_/orabackup/temp/upgrade1/ASTYPRD/%d_%U_%s_%t.bck';
|
||||
allocate channel ch04 device type disk format '/mnt/yavin4/tmp/_oracle_/orabackup/temp/upgrade1/ASTYPRD/%d_%U_%s_%t.bck';
|
||||
backup as compressed backupset incremental level 0 database section size 2G include current controlfile plus archivelog delete input;
|
||||
release channel ch01;
|
||||
release channel ch02;
|
||||
release channel ch03;
|
||||
release channel ch04;
|
||||
allocate channel ch01 device type disk format '/mnt/yavin4/tmp/_oracle_/orabackup/temp/upgrade1/ASTYPRD/%d_%U_%s_%t.controlfile';
|
||||
backup current controlfile;
|
||||
release channel ch01;
|
||||
}
|
||||
|
||||
|
||||
run
|
||||
{
|
||||
set nocfau;
|
||||
allocate channel ch01 device type disk format '/mnt/yavin4/tmp/_oracle_/orabackup/temp/upgrade1/WEDGEPRD/%d_%U_%s_%t.bck';
|
||||
allocate channel ch02 device type disk format '/mnt/yavin4/tmp/_oracle_/orabackup/temp/upgrade1/WEDGEPRD/%d_%U_%s_%t.bck';
|
||||
allocate channel ch03 device type disk format '/mnt/yavin4/tmp/_oracle_/orabackup/temp/upgrade1/WEDGEPRD/%d_%U_%s_%t.bck';
|
||||
allocate channel ch04 device type disk format '/mnt/yavin4/tmp/_oracle_/orabackup/temp/upgrade1/WEDGEPRD/%d_%U_%s_%t.bck';
|
||||
backup as compressed backupset incremental level 0 database section size 2G include current controlfile plus archivelog delete input;
|
||||
release channel ch01;
|
||||
release channel ch02;
|
||||
release channel ch03;
|
||||
release channel ch04;
|
||||
allocate channel ch01 device type disk format '/mnt/yavin4/tmp/_oracle_/orabackup/temp/upgrade1/WEDGEPRD/%d_%U_%s_%t.controlfile';
|
||||
backup current controlfile;
|
||||
release channel ch01;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user