- 论坛徽章:
- 0
|
It's so easy that no configuration is needed, at least from server side
1) make sure the database and the listener are all down. create an empty
admin directory
$ env | grep TNS
$ cd $ORACLE_HOME/network
$ mv admin admin.save
$ mkdir admin
2) startup the default listener with no configuration file
$ lsnrctl start
.....
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=suse8.home.net)(PORT=1521)))
.....
3) the listener knows no database services at this time
$ lsnrctl services
.....
Connecting to (ADDRESS=(PROTOCOL=tcp)(PORT=1521))
The listener supports no services
.....
4) startup the database instance
$ sqlplus '/ as sysdba'
SQL>; startup
SQL>; show parameter db_name
SQL>; show parameter db_domain
SQL>; exit
5) the database instance should have registered itself to the listener
note: the service name is "db_name + db_domain"
$ lsnrctl services
.....
Service "db920.home.net" has 1 instance(s).
Instance "db920", status READY, has 1 handler(s) for this service...
.....
6) add an entry in $ORACLE_HOME/network/admin/tnsnames.ora
on all of the clients that want to connect to the database. Note
you will only to modify HOST and SERVICE_NAME returned before
mis = (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = suse8.home.net)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = db920.home.net)))
7) test database connection
$ tnsping mis
you can not startup the database remotely through the listener |
|