Oracle ! Ô désespoir !
1. Passer du mode ARCHIVELOG à NOARCHIVELOG
# sqlplus / as sysdba
// VERIFIER LE MODE :
SQL> select log_mode from v$database;
// CHANGER LE MODE :
SQL> shutdown immediate;
SQL> startup mount;
SQL> ALTER DATABASE noarchivelog;
SQL> ALTER DATABASE open;
2. Création d’un User / Schema et son Tablespace
Création avec temporary tablespace, sous SQLPlus par ex. :
SQL> create tablespace d_tbl datafile '/oracle/oradata/INSTANCE/datafile/d_tbl.dbf' size 10M autoextend on next 10M;
SQL> create tablespace i_tbl datafile '/oracle/oradata/INSTANCE/datafile/i_tbl.dbf' size 10M autoextend on next 10M;
SQL> create temporary tablespace t_tbl tempfile '/oracle/oradata/INSTANCE/datafile/t_tbl.dbf' size 10M autoextend on next 10M;
SQL> create user DB_USER identified by DB_USER_PWD default tablespace d_tbl temporary tablespace t_tbl;
SQL> grant connect, resource, create synonym, create view, create materialized view to DB_USER;
// SUPPRESSION COMPLETE :
> drop user DB_USER cascade;
// Modification de mot de passe :
> alter user DB_USER identified by rYFrvfFb;
3. Commandes SQL pratiques
3.1. Liste des users :
SQL> select USERNAME, USER_ID,ACCOUNT_STATUS from DBA_USERS order by USER_ID;
3.2. Vérifier que l’instance Oracle tourne
# sqlplus 'connect / as sysdba';
SQL*Plus: Release 9.2.0.8.0 – Production on Sat Dec 1 19:08:55 2007
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
Enter password:
Connected to an idle instance.
SQL> select status from v$instance;
*
ERROR at line 1:
ORA-01034: ORACLE not available
–> L’instance Oracle ne tourne pas. Sinon vérifier la liste des processus :
# ps -aef |grep pmon
3.3. ERREUR : "Startup : LRM-00109: could not open parameter file '/oracle/product/10.2/rdbms/dbs/initXXX.ora'"
Il faut ajouter le chemin du spfile à la commande startup :
# startup pfile=$ORACLE_HOME/dbs/spfileDBBAS.ora;