Skip to content

Commit

Permalink
taskkill
Browse files Browse the repository at this point in the history
  • Loading branch information
rofrol committed Apr 18, 2020
1 parent dbb60ea commit ae244b8
Showing 1 changed file with 74 additions and 72 deletions.
146 changes: 74 additions & 72 deletions src/databases/oracle.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Oracle

- create user http://stackoverflow.com/questions/9447492/how-to-create-a-user-in-oracle-11g-and-grant-permissions

## localhost:8080 already in use
# Oracle

- create user http://stackoverflow.com/questions/9447492/how-to-create-a-user-in-oracle-11g-and-grant-permissions

## localhost:8080 already in use

Let's find out what occupies 8080

Expand All @@ -19,6 +19,8 @@ C:\> tasklist | findstr 2424
TNSLSNR.EXE 2424 Services 0 21 908 K
```

You may kill it with `taskkill /PID typeyourPIDhere /F`.

Change the port on which oracle web listens on

```
Expand All @@ -35,70 +37,70 @@ SQL> Exec DBMS_XDB.SETHTTPPORT(3010); [Assuming you want to have HTTP going to t
PL/SQL procedure successfully completed.
SQL>quit
```

### Restart oracle

Run cmd.exe as admin

```
lsnrctl stop
lsnrctl start
```

http://stackoverflow.com/questions/142868/change-oracle-port-from-port-8080

## SID

SID - The name of your instance.

An Instance, is an Instance of the RDBMS software. An instance MOUNTS a controlfile, (alter database mount) In this controfile are written the location of the datafiles. the collection of datafiles (okay, and the controlfile(s) ) == the database.

A database has a name, the db_name, and (optionally) a domain (db_domain) --> together global_db_name. Now imagine you're replicating (DataGuard) your database. You'd like to keep the DB_name the same, right? (I mean: data-wise, it's the SAME database) But then how to identify the two 'versions' of your database? Enter ' DB_UNIQUE_NAME'.

http://serverfault.com/questions/49509/oracle-difference-between-sid-db-name-db-domain-global-database-name-service/51944#51944

The SID is a site identifier https://asktom.oracle.com/pls/asktom/f?p=100:11:0::NO::P11_QUESTION_ID:318216852435

namespace - me :D

## command line

```
echo -e "drop user paab cascade; \n drop user paabwork cascade;" | sqlplus -s system/${ORACLE_SYSTEM_PASSWORD}@localhost:1521/xe
exit | sqlplus -s system/${ORACLE_SYSTEM_PASSWORD}@localhost:1521/xe @usersPAAB.sql
```

http://stackoverflow.com/questions/1639704/sqlplus-statement-from-command-line/20640697#20640697

## get users and roles

```
select * from dba_roles;
select * from dba_users;
select username from dba_users;
```

- http://stackoverflow.com/questions/20725581/how-to-list-all-the-roles-existing-in-oracle-database
- http://stackoverflow.com/questions/22451252/how-to-find-the-users-list-in-oracle-11g-db

## dual table

It is a dummy table with one element in it. It is useful because Oracle doesn't allow statements like

`SELECT 3+4`

You can work around this restriction by writing

`SELECT 3+4 FROM DUAL`

http://stackoverflow.com/questions/73751/what-is-the-dual-table-in-oracle/73793#73793

## Change password

```
SQL> connect / as sysdba
SQL> alter user <username> identified by <password>;
```

https://community.oracle.com/thread/631553?tstart=0n
```

### Restart oracle

Run cmd.exe as admin

```
lsnrctl stop
lsnrctl start
```

http://stackoverflow.com/questions/142868/change-oracle-port-from-port-8080

## SID

SID - The name of your instance.

An Instance, is an Instance of the RDBMS software. An instance MOUNTS a controlfile, (alter database mount) In this controfile are written the location of the datafiles. the collection of datafiles (okay, and the controlfile(s) ) == the database.

A database has a name, the db_name, and (optionally) a domain (db_domain) --> together global_db_name. Now imagine you're replicating (DataGuard) your database. You'd like to keep the DB_name the same, right? (I mean: data-wise, it's the SAME database) But then how to identify the two 'versions' of your database? Enter ' DB_UNIQUE_NAME'.

http://serverfault.com/questions/49509/oracle-difference-between-sid-db-name-db-domain-global-database-name-service/51944#51944

The SID is a site identifier https://asktom.oracle.com/pls/asktom/f?p=100:11:0::NO::P11_QUESTION_ID:318216852435

namespace - me :D

## command line

```
echo -e "drop user paab cascade; \n drop user paabwork cascade;" | sqlplus -s system/${ORACLE_SYSTEM_PASSWORD}@localhost:1521/xe
exit | sqlplus -s system/${ORACLE_SYSTEM_PASSWORD}@localhost:1521/xe @usersPAAB.sql
```

http://stackoverflow.com/questions/1639704/sqlplus-statement-from-command-line/20640697#20640697

## get users and roles

```
select * from dba_roles;
select * from dba_users;
select username from dba_users;
```

- http://stackoverflow.com/questions/20725581/how-to-list-all-the-roles-existing-in-oracle-database
- http://stackoverflow.com/questions/22451252/how-to-find-the-users-list-in-oracle-11g-db

## dual table

It is a dummy table with one element in it. It is useful because Oracle doesn't allow statements like

`SELECT 3+4`

You can work around this restriction by writing

`SELECT 3+4 FROM DUAL`

http://stackoverflow.com/questions/73751/what-is-the-dual-table-in-oracle/73793#73793

## Change password

```
SQL> connect / as sysdba
SQL> alter user <username> identified by <password>;
```

https://community.oracle.com/thread/631553?tstart=0n

0 comments on commit ae244b8

Please sign in to comment.