直接影响是重建在线重做日志并且设置sequence为1. 因此,修改完dbid以后最好马上做个全备.
如果只修改db_name不需要用resetlogs打开数据库.这种情况下备份和归档还是可用的.只修改db_name没什么严重后果,受影响的就是oracle的password文件.
然后关闭数据库-->修改pfile-->创建密码文件-->启动数据库
[oracle@my2950 ~]$ exit
exit
SQL> shutdown immediate
ORA-03135: connection lost contact
SQL> conn / as sysdba
Connected to an idle instance.
SQL> shutdown abort
ORACLE instance shut down.
SQL> exit
Disconnected
[oracle@my2950 ~]$ ps -eaf|grep oracle
root 16932 16865 0 09:10 pts/0 00:00:00 su - oracle
oracle 16933 16932 0 09:10 pts/0 00:00:00 -bash
root 17726 5313 0 10:03 ? 00:00:00 sshd: oracle [priv]
oracle 17728 17726 0 10:03 ? 00:00:00 sshd: oracle@notty
oracle 17729 17728 0 10:03 ? 00:00:00 /usr/libexec/openssh/sftp-server
root 22713 22691 0 16:00 pts/1 00:00:00 su - oracle
oracle 22714 22713 0 16:00 pts/1 00:00:00 -bash
oracle 23686 22714 0 17:15 pts/1 00:00:00 tail -f /u01/app/oracle/diag/rdbms/momorac/momorac/trace/alert_momorac.log
oracle 23734 16933 0 17:19 pts/0 00:00:00 ps -eaf
oracle 23735 16933 0 17:19 pts/0 00:00:00 grep oracle
[oracle@my2950 ~]$
[oracle@my2950 ~]$ cd /u01/app/oracle/product/11.2.3/db_1/dbs/
[oracle@my2950 dbs]$ pd
-bash: pd: command not found
[oracle@my2950 dbs]$ pwd
/u01/app/oracle/product/11.2.3/db_1/dbs
[oracle@my2950 dbs]$ ls
control02.ctl hc_mydb1.dat initmydb11.ora initmydb1.ora.orig lkMOMORAC
hc_momorac.dat initmomorac.ora@ initmydb1.ora init.ora.orig
[oracle@my2950 dbs]$
[oracle@my2950 dbs]$ ll
total 18476
-rw-r----- 1 oracle dba 18890752 May 15 17:17 control02.ctl
-rw-rw---- 1 oracle dba 1544 May 15 17:17 hc_momorac.dat
-rw-rw---- 1 oracle dba 1544 May 14 14:52 hc_mydb1.dat
lrwxrwxrwx 1 oracle dba 13 May 15 10:43 initmomorac.ora -> initmydb1.ora
-rw-r--r-- 1 oracle dba 14 May 14 11:51 initmydb11.ora
-rw-r--r-- 1 oracle dba 2257 May 14 14:58 initmydb1.ora
-rw-r--r-- 1 oracle dba 1771 May 14 11:59 initmydb1.ora.orig
-rw-r--r-- 1 oracle dba 2851 May 15 2009 init.ora.orig
-rw-r----- 1 oracle dba 24 May 15 09:35 lkMOMORAC
[oracle@my2950 dbs]$
[oracle@my2950 dbs]$
[oracle@my2950 dbs]$
[oracle@my2950 dbs]$ cp initmydb1.ora initmydb1.ora.momorac
[oracle@my2950 dbs]$ rm -f initmomorac.ora
[oracle@my2950 dbs]$ vi initmydb1.ora
[oracle@my2950 dbs]$ logout
[root@my2950 ~]# su - oracle
[oracle@my2950 ~]$ set |grep -i oracle
BASE_PATH=/usr/sbin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/lib/oracle/11.2/client64/bin:/home/oracle/bin
CLASSPATH=/u01/app/oracle/product/11.2.3/db_1/JRE:/u01/app/oracle/product/11.2.3/db_1/jlib:/u01/app/oracle/product/11.2.3/db_1/rdbms/jlib
DB_HOME=/u01/app/oracle/product/11.2.3/db_1
HISTFILE=/home/oracle/.bash_history
HOME=/home/oracle
LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.3/db_1/lib:/lib:/usr/lib
LOGNAME=oracle
MAIL=/var/spool/mail/oracle
ORACLE_BASE=/u01/app/oracle
ORACLE_HOME=/u01/app/oracle/product/11.2.3/db_1
ORACLE_HOSTNAME=my2950.momo.org
ORACLE_SID=mydb1
ORACLE_TERM=xterm
ORACLE_UNQNAME=mydb1
PATH=/u01/app/oracle/product/11.2.3/db_1/bin:/usr/sbin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/lib/oracle/11.2/client64/bin:/home/oracle/bin
PWD=/home/oracle
USER=oracle
[oracle@my2950 ~]$
[oracle@my2950 dbs]$ orapwd -h
Usage: orapwd file= entries= force= ignorecase= nosysdba=
where
file - name of password file (required),
password - password for SYS will be prompted if not specified at command line,
entries - maximum number of distinct DBA (optional),
force - whether to overwrite existing file (optional),
ignorecase - passwords are case-insensitive (optional),
nosysdba - whether to shut out the SYSDBA logon (optional Database Vault only).
There must be no spaces around the equal-to (=) character.
[oracle@my2950 dbs]$
[oracle@my2950 dbs]$ orapwd file=orapwmydb1 entries=10
Enter password for SYS:
[oracle@my2950 dbs]$ ls -l
total 18484
-rw-r----- 1 oracle dba 18890752 May 15 17:17 control02.ctl
-rw-rw---- 1 oracle dba 1544 May 15 17:17 hc_momorac.dat
-rw-rw---- 1 oracle dba 1544 May 14 14:52 hc_mydb1.dat
-rw-r--r-- 1 oracle dba 14 May 14 11:51 initmydb11.ora
-rw-r--r-- 1 oracle dba 2257 May 15 17:21 initmydb1.ora
-rw-r--r-- 1 oracle dba 2257 May 15 17:20 initmydb1.ora.momorac
-rw-r--r-- 1 oracle dba 1771 May 14 11:59 initmydb1.ora.orig
-rw-r--r-- 1 oracle dba 2851 May 15 2009 init.ora.orig
-rw-r----- 1 oracle dba 24 May 15 09:35 lkMOMORAC
-rw-r----- 1 oracle dba 2560 May 15 17:27 orapwmydb1
[oracle@my2950 dbs]$ sqlplus /nolog
SQL*Plus: Release 11.2.0.3.0 Production on Thu May 15 17:27:58 2014
Copyright (c) 1982, 2011, Oracle. All rights reserved.
SQL> conn / as sysdba
Connected to an idle instance.
SQL>
SQL> startup
ORACLE instance started.
Total System Global Area 296456192 bytes
Fixed Size 2227784 bytes
Variable Size 109052344 bytes
Database Buffers 180355072 bytes
Redo Buffers 4820992 bytes
Database mounted.
Database opened.
SQL>
SQL> select dbid,name from v$database;
DBID NAME
---------- ---------
1497461080 MYDB1
SQL>
SQL> host ls -l ~/rman/
total 2063136
-rw-r--r-- 1 oracle dba 0 May 15 10:03 alter
-rw-r----- 1 oracle dba 2084896768 May 14 17:25 data_20140514_1497461080_MOMORAC_1jp89f42_1_1
-rw-r----- 1 oracle dba 8781824 May 14 17:25 data_20140514_1497461080_MOMORAC_1kp89fb5_1_1
-rw-r----- 1 oracle dba 18972672 May 14 17:25 data_20140514_1497461080_MOMORAC_1lp89fb9_1_1
-rw-r--r-- 1 oracle dba 0 May 15 10:03 select
[oracle@my2950 u01]$ find ./ -name momorac -type d -print
./app/oracle/diag/rdbms/mydb1/momorac
./app/oracle/diag/rdbms/momorac
./app/oracle/diag/rdbms/momorac/momorac
[oracle@my2950 u01]$
修改zabbix的配置文件
[oracle@my2950 ~]$ logout
[root@my2950 ~]# cd /etc/zabbix/
[root@my2950 zabbix]# ls -l
total 64
drwxr-xr-x 5 root root 4096 Jun 21 2013 bak
-rw-r--r-- 1 root root 0 Jun 21 2013 test
drwxr-x--- 2 apache apache 4096 Jun 19 2013 web
-rw-r--r-- 1 root root 5831 Jun 18 2013 zabbix_agentd.conf
-rw-r--r-- 1 root root 5814 Jun 9 2013 zabbix_agentd.conf.orig
drwxr-xr-x 2 root root 4096 Jun 9 2013 zabbix_agentd.d
-rw-r----- 1 root zabbix 10692 Jun 24 2013 zabbix_server.conf
-rw-r----- 1 root root 10678 Jun 21 2013 zabbix_server.conf~
-rw-r----- 1 root root 10655 Jun 9 2013 zabbix_server.conf.orig
[root@my2950 zabbix]# cp zabbix_server.conf zabbix_server.conf.momorac
[root@my2950 zabbix]#
[root@my2950 zabbix]# more zabbix_server.conf|grep ^[^#$]
NodeID=0
ListenPort=10051
LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=10
DebugLevel=3
PidFile=/var/run/zabbix/zabbix_server.pid
DBHost=127.0.0.1
DBName=mydb1
DBUser=zabbix
DBPassword=111111
DBSocket=/var/lib/mysql/mysql.sock
DBPort=1521
SNMPTrapperFile=/var/log/snmptt/snmptt.log
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
[root@my2950 zabbix]#
[root@my2950 zabbix]#
还得修改
/usr/share/zabbix/conf/ 下的 zabbix.conf.php
登陆web界面, ok