Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
securite baseDB
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Xueting
securite baseDB
Commits
7da36107
Commit
7da36107
authored
Dec 6, 2019
by
XueTingSun6
Browse files
Options
Downloads
Patches
Plain Diff
fini
parent
423dbdf3
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Securite/TP5
+134
-0
134 additions, 0 deletions
Securite/TP5
Securite/TP6
+306
-0
306 additions, 0 deletions
Securite/TP6
Securite/connect
+41
-0
41 additions, 0 deletions
Securite/connect
Securite/tnsnames.ora
+13
-0
13 additions, 0 deletions
Securite/tnsnames.ora
with
494 additions
and
0 deletions
Securite/TP5
0 → 100644
+
134
−
0
View file @
7da36107
1.
SQL> spool 'out.spool'
SQL> select name , open_mode from v$pdbs;
NAME
--------------------------------------------------------------------------------
OPEN_MODE
----------
PDB$SEED
MOUNTED
ORCLPDB1
MOUNTED
SQL> spool 'out.spool'append
SQL> show user
USER is "SYS"
SQL> show con_name
CON_NAME
------------------------------
CDB$ROOT
SELECT erreurSemantic FROM v$database;
SELECT erreurSyntaxic DANS v$database;
spool off
/*dans le fiche out.spool sont tout les errors commande que j'ai tapé"
SQL> SELECT name , open_mode FROM v$pdbs;
SELECT name , open_mode FROM v$pdbs
*
ERROR at line 1:
ORA-01034: ORACLE not available
Process ID: 0
Session ID: 0 Serial number: 0
SQL> ls
SP2-0042: unknown command "ls" - rest of line ignored.
SQL> DESCRIBE V$PDBS
ERROR:
ORA-01012: not logged on
Process ID: 0
Session ID: 0 Serial number: 0
SQL> SELECT name , open_mode FROM v$pdbs;
SELECT name , open_mode FROM v$pdbs
*
ERROR at line 1:
ORA-01034: ORACLE not available
*/
2.
1. creer les utilisateur local
SQL> select name, open_mode from v$pdbs;
NAME
--------------------------------------------------------------------------------
OPEN_MODE
----------
ORCLPDB1
MOUNTED
SQL> select name, open_mode from v$database ;
NAME OPEN_MODE
--------- --------------------
ORCLCDB MOUNTED
SQL> alter pluggable database ORCLPDB1 open read write;
Pluggable database altered.
SQL> alter session set container =ORCLPDB1;
Session altered.
SQL> CREATE USER anquetil IDENTIFIED BY xusun3;
User created.
SQL> CREATE USER poulidor IDENTIFIED BY xusun3;
User created.
SQL> create role normaluser;
Role created.
SQL> create role tablecreator;
Role created.
SQL> grant create any table,create procedure to tablecreator;
Grant succeeded.
SQL> grant tablecreator to poulidor;
Grant succeeded.
SQL> grant connect, resource to normaluser;
Grant succeeded.
SQL> grant normaluser to anquetil;
Grant succeeded.
--------------------------------------------------------------------------------
3.)
This diff is collapsed.
Click to expand it.
Securite/TP6
0 → 100644
+
306
−
0
View file @
7da36107
SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
[xusun3@turing Tp5]$
[xusun3@turing Tp5]$
[xusun3@turing Tp5]$ rlwrap sqlplus /nolog
SQL*Plus: Release 19.0.0.0.0 - Production on Fri Nov 29 08:12:14 2019
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
SQL> connect sys@ORCLCDB as sysdba
Enter password:
Connected.
SQL>
SQL> select name, open_mode from v$database ;
NAME OPEN_MODE
--------- --------------------
ORCLCDB READ WRITE
SQL> alter pluggable database ORCLPDB1 open read write;
alter pluggable database ORCLPDB1 open read write
*
ERROR at line 1:
ORA-65019: pluggable database ORCLPDB1 already open
SQL> alter session set container =ORCLPDB1;
Session altered.
SQL> select name, open_mode from v$pdbs;
NAME
--------------------------------------------------------------------------------
OPEN_MODE
----------
PDB$SEED
READ ONLY
ORCLPDB1
READ WRITE
2.
[oracle@tp-xusun3 bin]$ ./lsnrctl
LSNRCTL for Linux: Version 18.0.0.0.0 - Production on 29-NOV-2019 08:22:22
Copyright (c) 1991, 2018, Oracle. All rights reserved.
Welcome to LSNRCTL, type "help" for information.
LSNRCTL> help
The following operations are available
An asterisk (*) denotes a modifier or extended command:
start stop status services
servacls version reload save_config
trace spawn quit exit
set* show*
LSNRCTL>
[oracle@tp-xusun3 bin]$ ./lsnrctl status
LSNRCTL for Linux: Version 18.0.0.0.0 - Production on 29-NOV-2019 08:27:58
Copyright (c) 1991, 2018, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521)))
STATUS of the LISTENER
------------------------
Alias LISTENER
Version TNSLSNR for Linux: Version 18.0.0.0.0 - Production
Start Date 08-NOV-2019 09:06:31
Uptime 20 days 23 hr. 21 min. 27 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File /opt/oracle/product/18c/dbhome_1/network/admin/listener.ora
Listener Log File /opt/oracle/diag/tnslsnr/tp-xusun3/listener/alert/log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=tp-xusun3.local.isima.fr)(PORT=1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(KEY=EXTPROC1521)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcps)(HOST=tp-xusun3.local.isima.fr)(PORT=5500))(Security=(my_wallet_directory=/opt/oracle/admin/ORCLCDB/xdb_wallet))(Presentation=HTTP)(Session=RAW))
Services Summary...
Service "93eb6b3f7bc41e4fe053612010ac817c" has 1 instance(s).
Instance "ORCLCDB", status READY, has 1 handler(s) for this service...
Service "orclpdb1" has 1 instance(s).
Instance "ORCLCDB", status READY, has 1 handler(s) for this service...
The command completed successfully
[oracle@tp-xusun3 bin]$
-----------oui il exsie une instance ORACLEPDB1 -------------
3.)
[oracle@tp-xusun3 xusun3]$ rlwrap sqlplus xusun3 as sysdba
SQL*Plus: Release 18.0.0.0.0 - Production on Fri Nov 29 08:34:28 2019
Version 18.3.0.0.0
Copyright (c) 1982, 2018, Oracle. All rights reserved.
Enter password:
Connected to:
Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0
-----------creer un utilisateur xueting -------------
SQL> alter session set container =ORCLPDB1;
Session altered.
SQL> CREATE USER xueting IDENTIFIED BY xusun3;
User created.
4.)
[xusun3@turing Tp5]$ rlwrap sqlplus /nolog
SQL*Plus: Release 19.0.0.0.0 - Production on Fri Nov 29 08:40:42 2019
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
SQL> connect anquetil@CONTAINER
Enter password:
Connected.
SQL>
-----------set transaction name Q4-------------
SQL> set transaction name 'Q4';
Transaction set.
5).
-----------modification dans anquetil -------------
SQL> update node set label='xue' where id=2;
1 row updated.
-----------vu de transaction-------------
SQL> select name, status from v$transaction;
NAME
--------------------------------------------------------------------------------
STATUS
----------------
Q4
ACTIVE
6).
-------------------------Nous pouvons pas le modifier dans 2eme session ---------------------------
SQL> update node set label='xues' where id=4;
update node set label='xues' where id=4
*
ERROR at line 1:
ORA-01013: user requested cancel of current operation
------------------le commadnde s'est blocqué---------------------------
7.)
SQL> rollback;
Rollback complete.
SQL> exit
Disconnected from Oracle Database 18c Enterprise Edition Release 18.0.0.0.0 - Production
Version 18.3.0.0.0
------------------dans autre session le commande est déblockqué---------------------------
------------------le commadnde s'est blocqué---------------------------
SQL> update node set label='xues' where id=4;
1 row updated.
8).
SQL> select sid,serial# from v$session where username='ANQUETIL';
SID SERIAL#
---------- ----------
271 12477
ALTER SYSTEM KILL SESSION 'sid,serial#';
SQL> ALTER SYSTEM KILL SESSION '271,12477'
2 ;
System altered.
9).
------------------sur le session que j'ai kill(error session has been kill) --------------------------
SQL> update node set label='xues' where id=4;
update node set label='xues' where id=4
*
ERROR at line 1:
ORA-00028: your session has been killed
------------------Vérifiez que vous êtes placés dans la base de données container. --------------------------
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/opt/oracle/oradata/ORCLCDB/ORCLPDB1/system01.dbf
/opt/oracle/oradata/ORCLCDB/ORCLPDB1/sysaux01.dbf
/opt/oracle/oradata/ORCLCDB/ORCLPDB1/undotbs01.dbf
/opt/oracle/oradata/ORCLCDB/ORCLPDB1/users01.dbf
------------------fermer le --------------------------
SQL> alter pluggable database ORCLPDB1 close immediate;
Pluggable database altered.
------------------vérifier si bien fermer --------------------------
SQL> select name from v$datafile;
select name from v$datafile
*
ERROR at line 1:
ORA-03113: end-of-file on communication channel
Process ID: 27437
Session ID: 47 Serial number: 63083
--------------------------------------------------------------------------------
Sauvegarde et récupération
10).
SQL> select name from v$datafile;
NAME
--------------------------------------------------------------------------------
/opt/oracle/oradata/ORCLCDB/ORCLPDB1/system01.dbf
/opt/oracle/oradata/ORCLCDB/ORCLPDB1/sysaux01.dbf
/opt/oracle/oradata/ORCLCDB/ORCLPDB1/undotbs01.dbf
/opt/oracle/oradata/ORCLCDB/ORCLPDB1/users01.dbf
11).
-------------------arreter l'instance--------------------------------
------------------le ORACLEPDB est déja fermer--------------------------
SQL> alter pluggable database ORCLPDB1 close immediate;
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
ERROR:
ORA-12514: TNS:listener does not currently know of service requested in connect
descriptor
Warning: You are no longer connected to ORACLE.
12).
[oracle@tp-xusun3 BACKUP]$ ls
sysaux01.dbf system01.dbf undotbs01.dbf users01.dbf
13).
-------------------Redémarrez l’instance et ouvrez la base de données.--------------------------------
--startup
[oracle@tp-xusun3 xusun3]$ rlwrap sqlplus xusun3 as sysdba
SQL*Plus: Release 18.0.0.0.0 - Production on Fri Nov 29 09:41:26 2019
Version 18.3.0.0.0
Copyright (c) 1982, 2018, Oracle. All rights reserved.
Enter password:
Connected to an idle instance.
SQL> alter session set container =ORCLPDB1;
Session altered.
SQL> connect sys@ORCLCDB as sysdba
Enter password:
Connected.
14.
SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /opt/oracle/product/18c/dbhome_1/dbs/arch
Oldest online log sequence 60
Current log sequence 62
Ilfaut active
This diff is collapsed.
Click to expand it.
Securite/connect
0 → 100644
+
41
−
0
View file @
7da36107
[xusun3@turing ~]$ rlwrap sqlplus /nolog
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Nov 28 10:23:53 2019
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
SQL> connect sys@ORCLCDB as sysdba
Enter password:
ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
SQL> exit
[xusun3@turing ~]$ echo $TNS_ADMIN
[xusun3@turing Tp5]$ echo $PWD
/home/local.isima.fr/xusun3/Bureau/Tp5
[xusun3@turing Tp5]$ export TNS_ADMIN=$PWD
[xusun3@turing Tp5]$ echo $TNS_ADMIN
/home/local.isima.fr/xusun3/Bureau/Tp5
[xusun3@turing Tp5]$ rlwrap sqlplus /nolog
SQL*Plus: Release 19.0.0.0.0 - Production on Thu Nov 28 10:33:47 2019
Version 19.3.0.0.0
Copyright (c) 1982, 2019, Oracle. All rights reserved.
SQL> connect sys@ORCLCDB as sysdba
Enter password:
SQL> connect sys@ORCLCDB as sysdba
Enter password:
Connected.
SQL>
This diff is collapsed.
Click to expand it.
Securite/tnsnames.ora
0 → 100644
+
13
−
0
View file @
7da36107
ORCLCDB =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = tp-xusun3.local.isima.fr)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = ORCLCDB)
)
)
LISTENER_ORCLCDB =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment