Oracle Database Features: High security, rich data types
Oracle is a database product developed by Oracle Corporation of the United States
----------------------------------------------------------------------
Oracle version:
Oracle
Oracle8i--------------------Internet support for network access
Oracle9i
oracle10g-------------------Grid supports network operations
oracle11g
-------------------------------------------------------------------------
Details to be aware of when installing in Oracle:
There must be no Chinese path or space in the installed path
--------------------------------------------------------------------------
SYS: This is the Super user in the Oracle database, it has the highest privileges (System administrator)
System: This is an administrator account, second only to Superuser (System operator)
---------------------------------------------------------------------------
An Oracle database system consists of two components:
First part: Oracle database
Part Two: Oracle instances
Oracle Database system = Oracle Database + Oracle Instance
In an Oracle database, there are three main types of files:
1. Data files: Here is the core data, such as: Data tables, constraints, stored procedures, cursors, triggers, synonyms ....
2, log file: Mainly used for storing operation log operation, after the system problem, through the operation log can be data recovery
3, control files: the physical address of the data file and log file, mainly used for system recovery
-----------------------------------------------------------------------------------------------------
Oracle database, the equivalent of a warehouse, which is stored in the data, but the user is not allowed to directly manipulate the data inside, to access the data inside, You must have a role similar to the warehouse administrator to access---------------------------Oracle instances
Oracle instance, as compared to a warehouse administrator, when a user launches an Oracle instance, the database can be manipulated through an Oracle instance
Oracle instances, which contain a set of background processes, can access the Oracle database's data only if a set of background processes are started:
1. Start the Oracle instance first, and the system will load the necessary set of background processes into memory.
2. Through in-memory, a set of processes that have been loaded can access the data of the Oracle database
--------------------------------------------------------------------------------------
Tablespace: Different users can specify different tablespaces for storing their own data
Table space, in the database, where the database resides
-----------------------------------------------------------------------------------------------
To access Oracle steps:
1, start the service--------------oracleserivcexxxx
----------------------If you do not know the user name and password, you need to create a new user, and specify the password, as well as the authorization------------
2, anonymous login: cmd-> sqlplus/nolog
3, switch to the identity of the administrator: Conn/as sysdba
4. Create tablespace: Syntax: Create tablespace table space name datafile ' d:/myspace.dbf ' size initial size M autoextend on next increase capacity m maxsize max capacity m;
Example: Create Tablespace viectorspace datafile ' f:\data\viectorSpace.dbf ' size 50m autoextend on next 10m maxsiz e 100m;
5. Create a new user, and specify the Tablespace
Syntax: Create user username identified by password default tablespace table space name;
For example: Create user Viector identified by viector default Tablespace viectorspace;
6. Grant permissions to new users
Grant connect to Viector; Granting users permission to connect to a database
Grant resource to Viector; Grant user access to resources (can be changed or deleted)
--------------------------------------------------------------------------------------------------------------- ----------------------------------------------------------
--Steps:
1. Open service Oracleservicexxxx
2, anonymous login Sqlplus/nolog
3, switch to Administrator rights Conn/as SYSDBA
4. See what table spaces are available select Tablespace_name from User_tablespaces;
5, delete the table space (including the contents of the table space) drop tablespace viectorspace including contents;
6. Create table space creating tablespace shirleyspace datafile ' f:\data\shirley.dbf ' size 50m autoextend on next 5m maxsize 100m;
7, see which users select username from all_users;
8, delete user viector; (If the user does not have an associated file, the command can be deleted directly) drop user viector cascade; (If user has file, delete, must add cascade)
9. Create new user Shirley identified by abc123 default Tablespace shirleyspace;
10, modify the user password alter users Shirley identified by Shirley;
11. Grant access to Shirley; --grant permission to connect to the database revoke connect from Shirley; --Revoke the Shirley connection to the database grant resource to shirley;--grant permission to access the resource revoke resource from shirley;--revoke access to the resource
12, switch the new user:
Conn Shirley/shirley
13, there are two ways to log in:
--The first type of sqlplus then enter the user name and password separately
--the second kind of sqlplus Shirley/shirley
-------------------------------------------------------
14, select table_name from User_tables; --See what data tables the current user has
15, if the Oracle database has been added, deleted, changed operation, must commit; Data is stored in the datasheet
-----------------------------------------------------
16. Export Data:
In cmd mode: EXP
17. Import data in cmd mode: Imp
Oracle Learning-The first chapter