1. modify database name 1. view oracle Instance name 2. shutdownimmediate3.lsnrctlstop $ ORACLE_SID # ---------- disable oracle service in windows 4. modify $ ORACLE_SID # ------------ of etcoratab for windows. modify user environment variables. bashprofile # ------------ windows does not have 6. linu
1. modify database name 1. view oracle Instance name 2. shutdown immediate 3. lsnrctl stop $ ORACLE_SID # ---------- disable oracle service in windows 4. modify $ ORACLE_SID # ------------ of/etc/oratab in windows. modify user environment variables. bashprofile # ------------ windows does not have 6. linu
1. Modify the Database Name
1. view the oracle Instance name
2. shutdown immediate
3. lsnrctl stop $ ORACLE_SID # ---------- disable oracle service in windows
4. Modify $ ORACLE_SID # ------------ of/etc/oratab. windows does not have
5. Modify the user environment variable. bashprofile # ------------ windows does not
6. in linux, change the $ ORACLE_HOME/dbs file name for $ ORACLE_SID.
Modify the file name for $ ORACLE_HOME/database in windows
7. regenerate the password file and start the database.
Liunx: orapwd file = $ ORACLE_HOME/dbs/orapw $ ORACLE_SID password = oracle entries = 5 force = y
Windows:
Run oracle % ORACLE_ORCL % in one cmd
Run in another cmd
Set ORACLE_HOME = E: appcswggodproduct11.2.0dbhome _ 1 database
Set ORACLE_ORCL = orcl
Orapwd file = % ORACLE_HOME %/ORACLE_HOME/dbs/orapw % ORACLE_SID % password = oracle entries = 5 force = y
Startup
# ------------------- 1. Select orcl instance
[Oracle @ h1 ~] $ Sqlplus "/as SYSDBA"
SQL * Plus: Release 11.2.0.1.0 Production on Mon Nov 12 03:07:58 2012
Copyright (c) 1982,200 9, Oracle. All rights reserved.
Connected:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0-64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL>
# ------------- 2. view the instance
SQL> select * from v $ thread;
SQL> select instance_name from v $ instance;
INSTANCE_NAME
----------------
Orcl
# --------------- 3. Shutdown
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL>
# ------------- 4. Disable the listener
[Oracle @ h1 ~] $ Lsnrctl stop orcl
LSNRCTL for Linux: Version 11.2.0.1.0-Production on 12-NOV-2012 03:20:11
Copyright (c) 1991,200 9, Oracle. All rights reserved.
Connecting to (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.5.130) (PORT = 1522 )))
The command completed successfully
# -------------- 5. Modify/etc/oratab
[Oracle @ h1 ~] $ Su root
Password:
[Root @ h1 oracle] # vi/etc/oratab
# ------------ Modify orcl to bitc
Bitc:/app/oracle/product/11.2.0/dbhome_2: N
Test:/app/oracle/product/11.2.0/dbhome_2: N
"/Etc/oratab" 24L, 764C written
[Root @ h1 oracle] #
# --------------- 6. Modify. bash_profile and take effect
[Root @ h1 oracle] # su oracle
[Oracle @ h1 ~] $ Pwd
/Home/oracle
[Oracle @ h1 ~] $ Vi. bash_profile
#. Bash_profile
# Get the aliases and functions
If [-f ~ /. Bashrc]; then
.~ /. Bashrc
Fi
# User specific environment and startup programs
PATH = $ PATH: $ HOME/bin
Export PATH
Export ORACLE_BASE =/app/oracle
Export ORACLE_HOME = $ ORACLE_BASE/product/11.2.0/dbhome_2
Export ORACLE_SID = bitc
Export PATH = $ ORACLE_HOME/bin:.: $ PATH
". Bash_profile" 16L, 323C written
[Oracle @ h1 ~] $. Bash_profile
[Oracle @ h1 ~] $ Echo $ ORACLE_SID
Bitc
# --------------------- 7. modify the configuration file name
[Oracle @ h1 ~] $ Cd $ ORACLE_HOME/dbs
[Oracle @ h1 dbs] $ ls-al
Total 56
Drwxr-xr-x. 2 oracle oinstall 4096 Nov 12.
Drwxr-xr-x. 76 oracle oinstall 4096 Nov 10 ..
-Rw ----. 1 oracle oinstall 1544 Nov 10 hc_DBUA0.dat
-Rw ----. 1 oracle oinstall 1544 Nov 12 hc_orcl.dat
-Rw ----. 1 oracle oinstall 1544 Nov 12 hc_test.dat
-Rw-r --. 1 oracle oinstall 2851 May 15 2009 init. ora
-Rw-r -----. 1 oracle oinstall 1906 Nov 9 initorcl. ora
-Rw-r -----. 1 oracle oinstall 24 Nov 3 07:13 lkORCL
-Rw-r -----. 1 oracle oinstall 24 Nov 10 lkTEST
-Rw-r -----. 1 oracle oinstall 1536 Nov 10 orapworcl
-Rw-r -----. 1 oracle oinstall 1536 Nov 10 orapwtest
-Rw-r -----. 1 oracle oinstall 2560 Nov 12 spfileorcl. ora
-Rw-r -----. 1 oracle oinstall 2560 Nov 9 spfileorcl. ora. bak
-Rw-r -----. 1 oracle oinstall 3584 Nov 12 spfiletest. ora
[Oracle @ h1 dbs] $ chmod 777 *
[Oracle @ h1 dbs] $ mv hc_orcl.dat hc_bitc.dat
[Oracle @ h1 dbs] $ mv lkORCL lkBITC
[Oracle @ h1 dbs] $ mv orapworcl orapwbitc
[Oracle @ h1 dbs] $ mv spfileorcl. ora spfilebitc. ora
[Oracle @ h1 dbs] $
[Oracle @ h1 dbs] $ ls
Hc_bitc.dat init. ora lkTEST spfilebitc. ora
Hc_DBUA0.dat initorcl. ora orapwbitc spfileorcl. ora. bak
Hc_test.dat lkBITC orapwtest spfiletest. ora
# --------------- 8. Generate the password file
[Oracle @ h1 dbs] $ orapwd file = $ ORACLE_HOME/dbs/orapw $ ORACLE_SID password = oracle entries = 5 force = y
# --------------- 9. Start the database
[Oracle @ h1 dbs] $ echo $ ORACLE_SID
Bitc
[Oracle @ h1 dbs] $ sqlplus "/as SYSDBA"
SQL * Plus: Release 11.2.0.1.0 Production on Mon Nov 12 03:35:11 2012
Copyright (c) 1982,200 9, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORA-32004: obsolete or deprecated parameter (s) specified for RDBMS instance
ORACLE instance started.
Total System Global Area 501059584 bytes
Fixed Size 2214736 bytes
Variable Size 318768304 bytes
Database Buffers 176160768 bytes
Redo Buffers 3915776 bytes
Database mounted.
Database opened.
SQL> exit
2. Configure static listening after renaming the database
[Oracle @ h1 dbs] $ netmgr
# ------------------- 1. Configure the listener File
Configure remote namespace:
Verification:
# -------------- 2. Modify static listening Parameters