SQL - DB LINK AND DBCA



Oracle Database Configuration Assistant (DBCA) is a tool for creating and configuring an Oracle database. In manual method of DB creation we need to specify the path and create directories whereas using DBCA we only need to specify the requirements.

Step 1: Set the DISPLAY environment variable



Step 2: Initiate DBCA


Step 3: select “create a database” and choose next


Step 4: Choose “ advance configuration” and click on next


Step 5: choose “Oracle single instance database” and click next


Step 6: Untick the container database selection and specify the database name that we want to create


Step 7: choose next


Step 8: Enable both options and click on next



Step 9: click on next


Stp 10: click on next


Step 11: choose the below option and click on next


Step 12: untick the “configure enterprise manager” and click on next


Step 13: choose the below option and enter password for the admin user


Step 14: click on next


Step 15: Click on finish


Step 16:


Step 17: Click on finish once progress is complete. We can see hat the new database has been created



Step 18: now to configure TNS and listener
	
Step 19: Configure listener file as follows


Step 20: Configure TNS file as follows


Step 21: Start the listener “lsnrctl start”






Step 22: Try to ping the databases using tnsping
	
Step 23: connect to the database to which DB LINK is to created
	 

Step 24: connect to the user and create a sample table
	 
Step 25: connect to the secondary database as sys user and create a user
	 
Step 26: grant the user permission to create dblink
	
Step 27: conn to the user and create the DBLINK to the primary database
	
Step 28: to find the list of DBLINKS created
	
Step 29:now we can view the contents of a table in the primary databse using the DBLINK “db1”
	
Step 30: to drop a dBLINK
	


(SQL - SQL Loader & External Tables)