connect to oracle databse

1.Check if the Oracle service is running

 Check if  'OracleServiceORCL','OracleoraDB12Home1Mts..' and 'OracleoraDB12Home1NSL..' is   running. If not, right click and start them.(the first one must open,others are optinal).

connect to oracle databse_第1张图片

2.Open a command prompt and type the following 

 You can use this code to login for “sys as sysdba”: 

Orapwd file= .ora password=Password1 force=y

then the password:''Password1"will be stored in system.

3. Loging in to sql plus with the original user name

name:sys as sysdba

key:Password1(e.g:the password wii not show on the screen,don't be nervous) 

connect to oracle databse_第2张图片

4.Create Your Oracle User Account

1.ALTER SESSION SET "_ORACLE_SCRIPT"=TRUE;
2.CREATE USER USERNAME IDENTIFIED BY PASSWORD ACCOUNT UNLOCK
DEFAULT TABLESPACE "USERS" TEMPORARY TABLESPACE "TEMP" PROFILE
"DEFAULT";

5.Grant DBA privilege to the user account you just created

GRANT DBA TO USERNAME;

6.Check that your account has been created successfully

SELECT * FROM ALL_USERS;

 Then,just need to check whether your name is on the list or not

connect to oracle databse_第3张图片

7.Login Oracle Using Your User Account

Close the window and open the sql plus again,this time use your own name and password

connect to oracle databse_第4张图片

 8.Open sql developer and create a new connection

   8.1.How to solve question:"ora-12505"

connect to oracle databse_第5张图片solution:That's a really common problem.The warning appear because the SID name is wrong.So we should find real SID at first.Usually,we use this code:

select INSTANCE_NAME from v$instance;

then we can succesfully find the real SID and write it in Oracle database:

 

你可能感兴趣的:(学习)