How to create a new database instance for Oracle 10g XE?
For Windows, first ensure that there is no important data in the current XE instance. Then, call oradim-delete-sid xe to delete the current system service (Windows Service ).
Run XE. bat in D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ config \ scripts for batch processing.
For Linux, it is easier to directly run the XE. sh script in the scripts directory.
The above is provided by a master on the Internet. below is the original version.
Can I create an instance whose SID is not "XE? The answer is yes.
Procedure:
Assume that you want to create an instance whose sid is mysid, run oradim-delete-sid xe in cmd, and then modify the following files.
----------------------------------------
D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ config \ scripts \ cloneDBCreation. SQL: Change XE in row (,) to mysid.
D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ config \ scripts \ cloneDBCreation. SQL (4): Create controlfile reuse set database "mysid"
D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ config \ scripts \ cloneDBCreation. SQL (22): Create controlfile reuse set database "mysid"
D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ config \ scripts \ cloneDBCreation. SQL (38): alter database "mysid" open resetlogs;
D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ config \ scripts \ cloneDBCreation. SQL (39): alter database rename global_name to "mysid ";
----------------------------------------
'D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ config \ scripts \ init. ora ': Change XE in row (13) to mysid
D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ config \ scripts \ init. ora (13): db_name = mysid
----------------------------------------
'D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ config \ scripts \ initXETemp. ora ': Change XE in row (13) to mysid
D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ config \ scripts \ initXETemp. ora (13): db_name = mysid
----------------------------------------
Change XE in row (, 16, 18) of 'd: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ config \ scripts \ XE. bat to mysid
D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ config \ scripts \ XE. bat (14): set ORACLE_SID = mysid
D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ config \ scripts \ XE. bat (16): D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ bin \ oradim.exe-new-sid mysid-startmode manual-spfile> D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ config \ log \ XE. bat. log,
D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ config \ scripts \ XE. bat (18): D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ bin \ oradim.exe-edit-sid mysid-startmode auto-srvcstart system> D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ config \ log \ XE. bat. log
If you want to modify the http listening port, modify the file.
D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ config \ scripts \ postDBCreation. dems_xdb.sethttpport (9098) in row (9) of SQL );
Run D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ config \ scripts \ XE. bat.
Run XE. after bat, copy the name PWDXE to D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ database. ora, initXE. ora file. Change the file names to PWDMYSID. ora, initMYSID. ora
Modify listener. ora in D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ NETWORK \ ADMIN
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = PLSExtProc)
(ORACLE_HOME = D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server)
(PROGRAM = extproc)
)
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server)
(PROGRAM = extproc)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC_FOR_mysid ))
(ADDRESS = (PROTOCOL = TCP) (HOST = lp) (PORT = 1521 ))
)
)
DEFAULT_SERVICE_LISTENER = (mysid)
Modify tnsnames. ora in D: \ oracle \ app \ oracle \ product \ 10.2.0 \ server \ NETWORK \ ADMIN
Mysid =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP) (HOST = lp) (PORT = 1521 ))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = mysid)
)
)
EXTPROC_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC_FOR_mysid ))
)
(CONNECT_DATA =
(SID = PLSExtProc)
(PRESENTATION = RO)
)
)
Export lr_connection_data =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC) (KEY = EXTPROC_FOR_mysid ))
)
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
)
)
(I am not sure whether to modify the content in listener. ora and tnsnames. ora. Please try it yourself .)
At this time, the oracle instance whose sid is Mysid has been installed, but there is no listener whose sid is mysid. Run cmd if the connection is successful,
(If you need to stop an oracle instance, run the following command: net stop oracleservicemysid)
Lsnrctl start;
Oradim-startup-sid mysid;
OK. Now open "run SQL command line" connect system/the password you set @ mysid to connect successfully.
Note: If you restart the listenser instance, The listenser instance will not be automatically started and you need to manually run it.
Lsnrctl start;
Oradim-startup-sid mysid;