unattende setup og Listner and tnsnames [message #66757] |
Tue, 17 December 2002 02:23 |
Kim Carlsen
Messages: 13 Registered: September 2002
|
Junior Member |
|
|
Hi
I need to add an entry in my listner (8i) and tnsnames, by script. I´ve made a .bat script that clones a DB, but I´m missing the listner and tnsnames. How do I do it?
Merry Xmas.
Kim
|
|
|
Re: unattende setup og Listner and tnsnames [message #66758 is a reply to message #66757] |
Tue, 17 December 2002 07:12 |
|
Mahesh Rajendran
Messages: 10708 Registered: March 2002 Location: oracleDocoVille
|
Senior Member Account Moderator |
|
|
still, u can create the tnsnames.ora entries on the fly!
this scrip creates a tnsnames.ora in c:
if u want to open the default one @ORACLE_HOME/network/admin
its beeter to use a stored procedure (using UTL_FILE),
open, the default tnsnames.ora in APPEND mode.
SQL> @cr_tnsnames.sql
Enter the value for connection_string : mystring
Enter the value for host : localhost
Enter the value for port : 1521
Enter the value for Service : local
mystring=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = local)
)
)
SQL> get cr_tnsnames.sql
1 accept string prompt "Enter the value for connection_string : "
2 accept host prompt "Enter the value for host : "
3 accept port prompt "Enter the value for port : "
4 accept serv prompt "Enter the value for Service : "
5 spool c:tnsnames.ora
6 prompt &string=
7 prompt (DESCRIPTION =
8 prompt (ADDRESS_LIST =
9 prompt (ADDRESS = (PROTOCOL = TCP)(HOST = &host)(PORT = &port))
10 prompt )
11 prompt (CONNECT_DATA =
12 prompt (SERVICE_NAME = &serv)
13 prompt )
14 prompt )
15 prompt
16* spool off
|
|
|