admin
admin
韬光养晦,厚积薄发!

注册于 4 years ago

回答
13
文章
0
关注者
1

关闭mysql:

service mysqld stop

停止 mysqld: [确定]

以非认证方式启动MYSQL:

# mysqld_safe --user=mysql --skip-grant-tables --skip-networking &

执行下面命令修改密码:

alter user 'root'@'localhost' identified by 'maywide';

执行这句时候错误:

mysql> alter user 'root'@'localhost' identified by 'maywide';
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement

这个时候我们只需要

flush privileges

一把,在执行就OK了,

mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)

mysql> alter user 'root'@'localhost' identified by 'maywide';
Query OK, 0 rows affected (0.00 sec)

mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

最后重启mysql 服务即可

service mysqld restart

--1先做数据库完整备份还原,还原到临时库:

USE [master]
RESTORE DATABASE [hotel_bak] FROM DISK = N'D:\BackupDB\Hotel\Hotel_2018_04_21_0213.bak' 
WITH FILE = 1, MOVE N'Hotel' TO N'E:\Database2\hotel_bak.mdf', MOVE N'Hotel_log' TO N'E:\Database2\hotel_bak_log.ldf', 
NORECOVERY, NOUNLOAD, REPLACE, STATS = 5
GO

--2还原数据库事务日志,按顺序逐一应用:

RESTORE LOG [hotel_bak] FROM DISK = N'E:\BackupLog\Hotel\Hotel_2018_04_22_0021.trn' 
WITH FILE = 1, NORECOVERY, NOUNLOAD, STATS = 10
GO
RESTORE LOG [hotel_bak] FROM DISK = N'E:\BackupLog\Hotel\Hotel_2018_04_23_0021.trn' 
WITH FILE = 1, NORECOVERY, NOUNLOAD, STATS = 10
GO
RESTORE LOG [hotel_bak] FROM DISK = N'E:\BackupLog\Hotel\Hotel_2018_04_24_0021.trn' 
WITH FILE = 1, NORECOVERY, NOUNLOAD, STATS = 10
GO
RESTORE LOG [hotel_bak] FROM DISK = N'E:\BackupLog\Hotel\Hotel_2018_04_25_0021.trn' 
WITH FILE = 1, NORECOVERY, NOUNLOAD, STATS = 10
GO

--记得最后一次日志应用选择RECOVERY,代表还原结束:

RESTORE LOG [hotel_bak] FROM DISK = N'E:\BackupLog\Hotel\Hotel_2018_04_26_0021.trn' 
WITH FILE = 1, RECOVERY, NOUNLOAD, STATS = 10
GO

--3最后提取数据到正式表:

insert into [hotel].[dbo].[NightlyRate]
SELECT [hotelId]
,[roomTypeId]
,[ratePlanId]
,[date]
,[cost]
,[status]
,[instantConfirmation]
,[instantConfirmCount]
,[availableRooms]
,[salePrice]
,[marketPrice]
,[ClientID] 
FROM [hotel_bak].[dbo].[NightlyRate]

1、修改数据库为紧急模式 1 ALTER DATABASE Sharepoint_Config SET EMERGENCY

2、使数据库变为单用户模式

 ALTER DATABASE Sharepoint_Config SET SINGLE_USER

3、调用CheckDB包:

DBCC CheckDB (Sharepoint_Config , REPAIR_ALLOW_DATA_LOSS)

4、使数据库变回为多用户模式

ALTER DATABASE Sharepoint_Config SET MULTI_USER

5、开始->运行->输入cmd->打开DOS命令窗口,

输入以下命令重启数据库服务 
--停止服务

Net stop mssqlserver 

--启动服务 

Net start mssqlserver 

再次,

打开Sql Server 2008时被标记为“可疑”的数据库已恢复正常状态。

可以采用下面脚本实现:

SELECT bs.database_name AS 'Database Name',
bs.backup_start_date AS 'Backup Start',
bs.backup_finish_date AS 'Backup Finished',
DATEDIFF(MINUTE, bs.backup_start_date, bs.backup_finish_date) AS 'Duration (min)',
'restore '+ 
CASE bs.[type] 
WHEN 'D' THEN 'database ' 
else 'log ' 
end
+bs.database_name +' from disk='''+ bmf.physical_device_name + ''' with norecovery;' AS 'Backup File',
CASE
WHEN bs.[type] = 'D' THEN 'Full Backup'
WHEN bs.[type] = 'I' THEN 'Differential Database'
WHEN bs.[type] = 'L' THEN 'Log'
WHEN bs.[type] = 'F' THEN 'File/Filegroup'
WHEN bs.[type] = 'G' THEN 'Differential File'
WHEN bs.[type] = 'P' THEN 'Partial'
WHEN bs.[type] = 'Q' THEN 'Differential partial'
END AS 'Backup Type'
FROM msdb.dbo.backupmediafamily bmf WITH(NOLOCK)
INNER JOIN msdb..backupset bs WITH(NOLOCK)
ON bmf.media_set_id = bs.media_set_id
WHERE bs.database_name = 'test' --请输入要还原的库名
and bs.backup_start_date>='2019-04-01 04:00:00.000' --请输入要还原的起始时间
and bs.backup_finish_date <= '2019-09-01 18:16:03.000' --请输入要还原的结束时间
ORDER BY bs.backup_start_date asc

图中时间可以自定义还原的范围,用上述SQL先查出结果后,执行复制到SQL窗口执行即可,但这里要注意后面部分,即最后一个日志要加上recovery结尾,表示还原结束。

可以参考详细步骤:

1.卸载

#touch /opt/test.txt -->写入一些文件

#umount /opt

2.文件系统检查

# fsck -f /dev/mapper/VolGroup00-LogVol00_opt

fsck 1.39 (29-May-2006)

e2fsck 1.39 (29-May-2006)

Pass 1: Checking inodes, blocks, and sizes

Pass 2: Checking directory structure

Pass 3: Checking directory connectivity

Pass 4: Checking reference counts

Pass 5: Checking group summary information

/dev/mapper/VolGroup00-LogVol00_opt: 41641/135479296 files (0.7% non-contiguous), 31756336/270958592 blocks

3.调整文件系统的大小

# resize2fs /dev/mapper/VolGroup00-LogVol00_opt 500G -->将VolGroup00-LogVol00_opt瘦小到500G

resize2fs 1.39 (29-May-2006)

Resizing the filesystem on /dev/mapper/VolGroup00-LogVol00_opt to 131072000 (4k) blocks.

The filesystem on /dev/mapper/VolGroup00-LogVol00_opt is now 131072000 blocks long.

4.裁减逻辑卷

# lvreduce -L 500G /dev/mapper/VolGroup00-LogVol00_opt

  WARNING: Reducing active logical volume to 500.00 GB

  THIS MAY DESTROY YOUR DATA (filesystem etc.)

Do you really want to reduce LogVol00_opt? [y/n]: y

  Reducing logical volume LogVol00_opt to 500.00 GB

  Logical volume LogVol00_opt successfully resized

5.再次检查文件系统是否出现错误

# fsck -f /dev/mapper/VolGroup00-LogVol00_opt

fsck 1.39 (29-May-2006)

e2fsck 1.39 (29-May-2006)

Pass 1: Checking inodes, blocks, and sizes

Pass 2: Checking directory structure

Pass 3: Checking directory connectivity

Pass 4: Checking reference counts

Pass 5: Chaaaaecking group summary information

/dev/mapper/VolGroup00-LogVol00_opt: 41641/65536000 files (0.7% non-contiguous), 29561045/131072000 blocks

6.挂载

# mount -t ext3 /dev/mapper/VolGroup00-LogVol00_opt /opt

# df -h

/dev/mapper/VolGroup00-LogVol00_orabak 493G 198M 467G 1% /orabak

Yau's 10:44:54

增加:lvextend -n /dev/mapper/VolGroup00-orabak -L +100G

resize2fs /dev/mapper/VolGroup00-orabak

可以尝试解决方案:

分别进入msdb master模式,运行孤立用户修复:

EXEC sp_change_users_login 'Report'

exec sp_change_users_login 'AUTO_FIX','##MS_PolicyEventProcessingLogin##'

exec sp_change_users_login 'UPDATE_ONE','##MS_PolicyEventProcessingLogin##','##MS_PolicyEventProcessingLogin##'

最终验证即可。

可以上传补丁集到Oracle服务器

su - Oracle

创建临时目录:

mdir /tmp/psu

移动补丁集至该临时目录:

mv p29913194_112040_Linux-x86-64.zip /tmp/psu
chown oracle.oinstall /tmp/psu -R

查看当前数据库的补丁情况

[oracle@localhost ~]$ $ORACLE_HOME/OPatch/opatch version
OPatch Version: 11.2.0.3.4

把OPatch替换原ORACLE_HOME里的OPatch目录,配置OPatch的环境变量

[oracle@localhost ~]$ cd $ORACLE_HOME
[oracle@localhost db_1]$ mv OPatch OPatchbak
[oracle@localhost db_1]$ mv  /tmp/psu/OPatch/ ./
[oracle@localhost db_1]$ OPatch/opatch version 
OPatch Version: 11.2.0.3.19

OPatch succeeded.
[oracle@localhost db_1]$ vi ~/.bash_profile 
export PATH=$ORACLE_HOME/bin/:$PATH:$ORACLE_HOME/OPatch
[oracle@localhost db_1]$ source ~/.bash_profile 
[oracle@localhost db_1]$ which  opatch
/u01/app/oracle/product/db_1/OPatch/opatch

查看当前数据库的补丁情况

[oracle@localhost db_1]$ opatch lsinventory

Oracle 中间补丁程序安装程序版本 11.2.0.3.19
版权所有 (c) 2018, Oracle Corporation。保留所有权利。


Oracle Home      : /u01/app/oracle/product/db_1
Central Inventory : /u01/app
  from          : /u01/app/oracle/product/db_1/oraInst.loc
OPatch version    : 11.2.0.3.19
OUI version      : 11.2.0.4.0
Log file location : /u01/app/oracle/product/db_1/cfgtoollogs/opatch/opatch2018-11-08_11-29-25上午_1.log


 
Lsinventory Output file location : /u01/app/oracle/product/db_1/cfgtoollogs/opatch/lsinv/lsinventory2018-11-08_11-29-25上午.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: localhost
ARU platform id: 226
ARU platform description:: Linux x86-64

已安装的顶级产品 (1):

Oracle Database 11g                                                  11.2.0.4.0
此 Oracle 主目录中已安装 1 个产品。


此 Oracle 主目录中未安装任何中间补丁程序。


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

OPatch succeeded.

升级前检查是否有冲突

[oracle@localhost db_1]$ cd /tmp/psu/29913194/
[oracle@localhost 29913194]$ opatch prereq CheckConflictAgainstOHWithDetail -ph ./

Oracle 中间补丁程序安装程序版本 11.2.0.3.19
版权所有 (c) 2018, Oracle Corporation。保留所有权利。

PREREQ session

Oracle Home      : /u01/app/oracle/product/db_1
Central Inventory : /u01/app
  from          : /u01/app/oracle/product/db_1/oraInst.loc
OPatch version    : 11.2.0.3.19
OUI version      : 11.2.0.4.0
Log file location : /u01/app/oracle/product/db_1/cfgtoollogs/opatch/opatch2018-11-08_11-30-54上午_1.log

Invoking prereq "checkconflictagainstohwithdetail"

Prereq "checkConflictAgainstOHWithDetail" passed.

OPatch succeeded.

保证数据库及监听都关闭,开始安装Patch包

[oracle@localhost 29913194]$ opatch apply

Oracle 中间补丁程序安装程序版本 11.2.0.3.19
版权所有 (c) 2018, Oracle Corporation。保留所有权利。


Oracle Home      : /u01/app/oracle/product/db_1
Central Inventory : /u01/app
  from          : /u01/app/oracle/product/db_1/oraInst.loc
OPatch version    : 11.2.0.3.19
OUI version      : 11.2.0.4.0
Log file location : /u01/app/oracle/product/db_1/cfgtoollogs/opatch/opatch2018-11-08_11-33-06上午_1.log


 
Verifying environment and performing prerequisite checks...
OPatch continues with these patches:  17478514  18031668  18522509  19121551  19769489  20299013  20760982  21352635  21948347  22502456  23054359  24006111  24732075  25869727  26609445  26392168  26925576  27338049  29913194 

是否继续? [y|n]
y
User Responded with: Y
All checks passed.
提供电子邮件地址以用于接收有关安全问题的通知, 安装 Oracle Configuration Manager 并启动它。如果您使用 My Oracle
Support 电子邮件地址/用户名, 操作将更简单。
有关详细信息, 请访问 http://www.oracle.com/support/policies.html。
电子邮件地址/用户名:

尚未提供电子邮件地址以接收有关安全问题的通知。
是否不希望收到有关安全问题 (是 [Y], 否 [N]) [N] 的通知:  y

 

请关闭本地系统上在此 ORACLE_HOME 之外运行的 Oracle 实例。
(Oracle 主目录 = '/u01/app/oracle/product/db_1')


本地系统是否已准备打补丁? [y|n]
y
User Responded with: Y
Backing up files...
Applying sub-patch '17478514' to OH '/u01/app/oracle/product/db_1'

......

Composite patch 29913194 successfully applied.
Log file location: /u01/app/oracle/product/db_1/cfgtoollogs/opatch/opatch2018-11-08_11-33-06上午_1.log

OPatch succeeded.

升级数据字典并重新编译无效对象

[oracle@localhost 29913194]$ sqlplus / as sysdba

SQL*Plus: Release 11.2.0.4.0 Production on Thu Nov 8 11:37:04 2018

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

Connected to an idle instance.

idle>startup

idle>@?/rdbms/admin/catbundle.sql psu apply
检查日志没有报错
编译失效对象
sys@YDTEST>@?/rdbms/admin/utlrp.sql
检查升级情况

sys@YDTEST> select * from dba_registry_history

ACTION_TIME                                    ACTION              NAMESPACE
--------------------------------------------------------------------------- ------------------------------ ------------------------------
VERSION                    ID BUNDLE_SERIES
------------------------------ ---------- ------------------------------
COMMENTS
-------------
24-AUG-13 12.03.45.119862 PM                            APPLY              SERVER
11.2.0.4                0 PSU
Patchset 11.2.0.2.0

17-JUL-18 09.35.53.845994 AM                            APPLY              SERVER
11.2.0.4                0 PSU
Patchset 11.2.0.2.0


 
08-NOV-18 11.38.31.692426 AM                            APPLY              SERVER
11.2.0.4              180717 PSU
PSU 11.2.0.4.180717
[oracle@localhost 29913194]$ opatch lsinventory

Oracle 中间补丁程序安装程序版本 11.2.0.3.19
版权所有 (c) 2018, Oracle Corporation。保留所有权利。


Oracle Home      : /u01/app/oracle/product/db_1
Central Inventory : /u01/app
  from          : /u01/app/oracle/product/db_1/oraInst.loc
OPatch version    : 11.2.0.3.19
OUI version      : 11.2.0.4.0
Log file location : /u01/app/oracle/product/db_1/cfgtoollogs/opatch/opatch2018-11-08_11-42-25上午_1.log

Lsinventory Output file location : /u01/app/oracle/product/db_1/cfgtoollogs/opatch/lsinv/lsinventory2018-11-08_11-42-25上午.txt

--------------------------------------------------------------------------------
Local Machine Information::
Hostname: localhost
ARU platform id: 226
ARU platform description:: Linux x86-64

已安装的顶级产品 (1):

Oracle Database 11g                                                  11.2.0.4.0
此 Oracle 主目录中已安装 1 个产品。


中间补丁程序 (1) :

Patch  29913194    : applied on Thu Nov 08 11:36:07 CST 2018
Unique Patch ID:  22229176
Patch description:  "Database Patch Set Update : 11.2.0.4.180717 (29913194)"
  Created on 31 May 2018, 01:37:49 hrs PST8PDT
Sub-patch  27338049; "Database Patch Set Update : 11.2.0.4.180417 (27338049)"
Sub-patch  26925576; "Database Patch Set Update : 11.2.0.4.180116 (26925576)"
Sub-patch  26392168; "Database Patch Set Update : 11.2.0.4.171017 (26392168)"
Sub-patch  26609445; "Database Patch Set Update : 11.2.0.4.170814 (26609445)"
Sub-patch  25869727; "Database Patch Set Update : 11.2.0.4.170718 (25869727)"
Sub-patch  24732075; "Database Patch Set Update : 11.2.0.4.170418 (24732075)"
Sub-patch  24006111; "Database Patch Set Update : 11.2.0.4.161018 (24006111)"
Sub-patch  23054359; "Database Patch Set Update : 11.2.0.4.160719 (23054359)"
Sub-patch  22502456; "Database Patch Set Update : 11.2.0.4.160419 (22502456)"
Sub-patch  21948347; "Database Patch Set Update : 11.2.0.4.160119 (21948347)"
Sub-patch  21352635; "Database Patch Set Update : 11.2.0.4.8 (21352635)"
Sub-patch  20760982; "Database Patch Set Update : 11.2.0.4.7 (20760982)"
Sub-patch  20299013; "Database Patch Set Update : 11.2.0.4.6 (20299013)"
Sub-patch  19769489; "Database Patch Set Update : 11.2.0.4.5 (19769489)"
Sub-patch  19121551; "Database Patch Set Update : 11.2.0.4.4 (19121551)"
Sub-patch  18522509; "Database Patch Set Update : 11.2.0.4.3 (18522509)"
Sub-patch  18031668; "Database Patch Set Update : 11.2.0.4.2 (18031668)"
Sub-patch  17478514; "Database Patch Set Update : 11.2.0.4.1 (17478514)"
  Bugs fixed:
    21174504, 17184721, 21538558, 16091637, 18092127, 17381384, 15979965
    20671094, 16731148, 16314254, 13837378, 18441944, 17835048, 13558557
    17008068, 17201159, 25427662, 17853498, 20717359, 17246576, 18356166
    18681862, 18440047, 20569094, 20031873, 16875449, 20387265, 19788842
    17296856, 21330264, 14010183, 17648596, 17551063, 17025461, 24719736
    17267114, 22507210, 17912217, 17889583, 18202441, 17040764, 17478145
    16524926, 25655390, 19358317, 22148226, 18747196, 26544823, 18641419
    17036973, 18948177, 17811789, 16542886, 14285317, 18009564, 16618694
    8322815, 16832076, 18247991, 16692232, 22507234, 17570240, 13871092
    24624166, 24348685, 17848897, 17441661, 14034426, 17465741, 16596890
    17437634, 21343897, 20506706, 21453153, 18339044, 17951233, 22321741
    21795111, 18430495, 21787056, 22380919, 19469538, 20506715, 17811429
    19721304, 17903598, 18230522, 19554106, 19458377, 21281607, 17612828
    6599380, 22092979, 22321756, 17040527, 17811438, 18641461, 14657740
    13364795, 21387964, 19490948, 17346671, 17588480, 22351572, 18235390
    26474853, 18849970, 17889549, 19309466, 16472716, 20596234, 18331850
    18641451, 17344412, 21179898, 19461270, 17546761, 24842886, 14521849
    18203835, 18203838, 18964939, 18203837, 17313525, 22195457, 18139690
    16837842, 22296366, 14106803, 17842825, 21352646, 22657942, 16360112
    20657441, 22195441, 17389192, 26198926, 14565184, 17205719, 18440095
    14764829, 22195448, 14354737, 13944971, 16571443, 21868720, 17186905
    17080436, 18673342, 22905130, 17027426, 27374796, 19972569, 19972568
    20144308, 19972566, 17282229, 19972564, 16870214, 21629064, 19615136
    21354456, 17390431, 18762750, 23007241, 16613964, 17957017, 18098207
    18471685, 19730508, 21538485, 18264060, 17323222, 17754782, 17600719
    18317531, 17852463, 17596908, 17655634, 16228604, 27053456, 20074391
    19972570, 18090142, 18996843, 19854503, 16042673, 17835627, 20334344
    17393683, 20861693, 18000422, 17551709, 26575788, 23315889, 20506699
    19006849, 18277454, 18456514, 19174430, 17258090, 17174582, 25654936
    17242746, 16399083, 17824637, 21132297, 22465352, 17762296, 22168163
    17397545, 16450169, 12364061, 20067212, 18856999, 19211724, 19463893
    19463897, 21343775, 17853456, 18673304, 20004021, 26030218, 21668627
    16194160, 17477958, 16538760, 12982566, 24570598, 20828947, 18259031
    20296213, 18293054, 17610798, 19699191, 23065323, 17311728, 18135678
    18774543, 23294548, 16785708, 10136473, 24560906, 22551446, 19777862
    17786518, 18315328, 18334586, 12747740, 18096714, 19032867, 21641760
    17390160, 18899974, 17232014, 20598042, 18673325, 16422541, 18155762
    14015842, 19827973, 22683225, 17726838, 18554871, 23177648, 18051556
    20803583, 21972320, 15990359, 17922254, 18282562, 16855292, 16668584
    21343838, 20299015, 17446237, 18093615, 18043064, 23713236, 17694209
    17288409, 18308268, 20475845, 17274537, 13955826, 16934803, 17634921
    17501491, 16315398, 23725036, 22683212, 17006183, 13829543, 18191164
    17655240, 26746894, 22809871, 18384391, 19393542, 21538567, 16198143
    21847223, 25823754, 17892268, 20142975, 19584068, 17165204, 25165496
    18604493, 21756699, 18508861, 16901385, 18554763, 21532755, 18189036
    17443671, 17385178, 14829250, 17936109, 20925795, 20509482, 17478514
    27441326, 16850630, 13951456, 16595641, 14054676, 15861775, 21142837
    16912439, 17299889, 17297939, 23003979, 18619917, 16833527, 17798953
    17816865, 18607546, 17571306, 21286665, 17341326, 26910644, 17851160
    20558005, 17586955, 19049453, 21051840, 17587063, 16956380, 18328509
    25423453, 14133975, 18061914, 18522509, 21051833, 20294666, 18765602
    20860659, 20324049, 18199537, 17332800, 13609098, 22502493, 18384537
    14338435, 17945983, 16392068, 21067387, 17752995, 21051862, 16863422
    25505382, 17237521, 18244962, 19544839, 24433711, 24717859, 17156148
    18973907, 23026585, 17877323, 17449815, 18180390, 17088068, 17037130
    20004087, 21422580, 19466309, 11733603, 25505371, 21051858, 18084625
    18674024, 21051852, 18091059, 25369547, 16306373, 18306996, 17787259
    18193833, 19915271, 20513399, 20631274, 25879656, 16344544, 14692762
    18614015, 17346091, 18228645, 17721717, 18436307, 21756677, 19888853
    11883252, 17891943, 19475971, 22353199, 16384983, 19121551, 27825893
    12816846, 17982555, 17761775, 22243719, 17265217, 25505394, 17071721
    16721594, 18262334, 21756661, 17891946, 15913355, 17672719, 17602269
    17239687, 17042658, 17238511, 17811456, 17284817, 17752121, 20879889
    21380789, 17394950, 17011832, 16579084, 22195465, 14602788, 18325460
    24476265, 26569225, 24476274, 12611721, 16903536, 17006570, 19689979
    16043574, 18783224, 24662775, 16494615, 21526048, 17392698, 19197175
    16069901, 17811447, 27870645, 17308789, 22195477, 24835538, 17865671
    17343514, 19013183, 17325413, 18316692, 16180763, 17348614, 14368995
    21983325, 17393915, 16285691, 19211433, 20331945, 17883081, 17705023
    24316947, 17614227, 19578350, 22195485, 14084247, 13645875, 16777840
    19727057, 14852021, 18744139, 18674047, 17716305, 19285025, 18482502
    27534509, 17622427, 19289642, 22195492, 25947799, 14458214, 20869721
    21172913, 17767676, 18723434, 25505407, 17786278, 19258504, 17082983
    21351877, 17365043, 13498382, 18331812, 16065166, 25489607, 16685417
    18031668, 22893153, 16943711, 19272701, 21517440, 25897615, 17649265
    13866822, 18094246, 24528741, 17783588, 14245531, 17082359, 18280813
    20448824, 23330119, 16268425, 19487147, 25600421, 18018515, 17302277
    17215560, 24411921, 19271443, 25764020, 17016369, 20777150, 23330124
    16756406, 20441797, 19769489, 28100487, 17545847, 25093656, 18260550
    13853126, 17227277, 23536835, 25957038, 24652769, 19207117, 9756271
    18868646, 17614134, 26667023, 17546973, 18704244, 19680952, 26667015
    17050888, 18828868, 18273830, 17360606, 16992075, 24563422, 17375354
    12905058, 18362222, 21429602, 27086138, 17571039, 17468141, 18436647
    17235750, 21168487, 16220077, 16929165

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

OPatch succeeded.

7、升级失败回滚

opatch rollback -id 29913194

可以这样处理:
1
进入$ORACLE_HOME\NETWORKADMIN 修改listener.ora和tnsnames.ora两个文件,把这两个文件里面内容host名部分,由原来旧HOST更改为新的HOST名
2
进入$ORACLE_HOMEoc4jj2ee 修改文件夹名:
OC4J_DBConsole_$oldhost_orcl531 更改名为 OC4J_DBConsole_$newhost_orcl531

3
修改注册表:
找到HKEY_LOCAL_MACHINE-software-oracle右键后查找host关键字,然后更新为新的主机名;

4,最后重启测试即可。

可以这样解决:
利用oradim重新创建oracle服务:
oradim -delete -SID orcl
oradim -new -SID orcl
如无法new,重新启动服务即可!

查看快照状态
select * from dba_hist_wr_control;

关闭awr

exec DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS(INTERVAL => 0);

启动awr

exec DBMS_WORKLOAD_REPOSITORY.MODIFY_SNAPSHOT_SETTINGS(INTERVAL => 60);

查看快照信息:
select * from dba_hist_snapshot

先停掉EM
emctl stop dbconsole
然后修改时区(TZ)
emctl resetTZ agent
重点是看看这个的输出,是否检测正确了系统时区。不明白Oracle在安装的时候为什么没有检测正确。默认使用了GMT,而我系统应该是东八区的时间。如果它还是检查的不正确的话,修改下系统的时区,然后再改回来。再运行这个命令。成功了会修改emd.properties这个文件里的agentTZRegion项。文件的位置应该是oralce安装目录product10.2.0db_1<hostname_sid>sysmanconfig,如果你没有修改的话。
这里还要提示你要完成更改需要连接到数据库执行一个修改的命令。提示的很清楚,照着做了。
重启EM
emctl start dbconsole
现在应该能够使用了。
重启em之后要等一会查看emctl的状态,因为启动服务需要时间。emctl status agent 的状态。

--查看RMAN备份进度
SELECT inst_id,
sid,
serial#,
opname,
ROUND(SOFAR / TOTALWORK * 100, 2) "%_COMPLETE"
FROM gV$SESSION_LONGOPS
WHERE OPNAME LIKE 'RMAN%'
--AND OPNAME NOT LIKE '%aggregate%'
AND TOTALWORK != 0
AND SOFAR <> TOTALWORK;
查到后,直接KILL掉进程号即可。

发布
问题